unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What is wrong with these few lines of guile code?
@ 2017-10-31 13:41 Hartmut Goebel
  2017-10-31 14:02 ` Mike
  2017-10-31 17:50 ` Christopher Baines
  0 siblings, 2 replies; 6+ messages in thread
From: Hartmut Goebel @ 2017-10-31 13:41 UTC (permalink / raw)
  To: guix-devel

Hallo,

i replaced the code of gnu/system/install.scm(make-cow-store target) [1]
with the code below. Now when running this code (which is triggered by
"herd start cow-store /mnt" in the installation-os)|I get this error:
|

herd: exception caught while executing 'start' on service 'cow-store':
ERROR: Unbound variable: gexp

What is wrong with this code? (Parentheses are matching, of course :-)

[1]
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/install.scm#n70

(define (make-cow-store target)
  "Return a gexp that makes the store copy-on-write, using TARGET as the
backing store.  This is useful when TARGET is on a hard disk, whereas the
current store is on a RAM disk."

  (define (set-store-permissions directory)
    ;; Set the right perms on DIRECTORY to use it as the store.
    #~(begin
        (chown #$directory 0 30000)             ;use the fixed
'guixbuild' GID
        (chmod #$directory #o1775)))

  #~(begin
      ;; Bind-mount TARGET's /tmp in case we need space to build things.
      (let ((tmpdir (string-append #$target "/tmp")))
        (mkdir-p tmpdir)
        (mount tmpdir "/tmp" "none" MS_BIND))

      (let* ((rw-dir (string-append target #$%backing-directory))
             ;; FIXME: calculate work-dir from backing-directory:
             ;; normpath(backing-directory + "../.overlayfs-workdir")
             (work-dir (string-append target "/tmp/.overlayfs-workdir")))
        (mkdir-p rw-dir)
        (mkdir-p work-dir)
        (mkdir-p "/.rw-store")
        #$(set-store-permissions #~rw-dir)
        #$(set-store-permissions "/.rw-store")

        ;; Mount the overlay, then atomically make it the store.
        (mount "none" "/.rw-store" "overlay"
               (string-append "lowerdir=" #$(%store-prefix)
                              "upperdir=" #~rw-dir ","
                              "workdir=" #~work-dir))
        (mount "/.rw-store" #$(%store-prefix) "" MS_MOVE)
        (rmdir "/.rw-store"))))

-- 
Regards
Hartmut Goebel

| Hartmut Goebel          | h.goebel@crazy-compilers.com               |
| www.crazy-compilers.com | compilers which you thought are impossible |

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-11-04 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-31 13:41 What is wrong with these few lines of guile code? Hartmut Goebel
2017-10-31 14:02 ` Mike
2017-10-31 17:50 ` Christopher Baines
2017-11-03 14:34   ` Hartmut Goebel
2017-11-03 16:09     ` Ricardo Wurmus
2017-11-04 11:46     ` Pjotr Prins

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).