[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
What is wrong with these few lines of guile code?
From: |
Hartmut Goebel |
Subject: |
What is wrong with these few lines of guile code? |
Date: |
Tue, 31 Oct 2017 14:41:46 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
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 | address@hidden |
| www.crazy-compilers.com | compilers which you thought are impossible |
- What is wrong with these few lines of guile code?,
Hartmut Goebel <=