From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Subject: Re: What is wrong with these few lines of guile code? Date: Tue, 31 Oct 2017 10:02:28 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e9X7j-00067V-VI for guix-devel@gnu.org; Tue, 31 Oct 2017 10:02:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e9X7f-0004CC-UW for guix-devel@gnu.org; Tue, 31 Oct 2017 10:02:36 -0400 Received: from swierczek.io ([45.33.77.97]:40490) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e9X7f-0004Bm-Q6 for guix-devel@gnu.org; Tue, 31 Oct 2017 10:02:31 -0400 Received: from [192.168.1.128] (c-73-233-204-83.hsd1.pa.comcast.net [73.233.204.83]) by swierczek.io (Postfix) with ESMTPSA id 300DB1E66D for ; Tue, 31 Oct 2017 14:02:29 +0000 (UTC) In-Reply-To: Content-Language: en-US List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org On 10/31/2017 09:41 AM, Hartmut Goebel wrote: > 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 :-) I'm a Scheme novice, but is your use of 'target' instead of '#$target'=20 further down the definition body a problem?=C2=A0 Or is that a proper use= of=20 Guile macros? -Mike > [1] > https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/system/install.scm#= n70 > > (define (make-cow-store target) > =C2=A0 "Return a gexp that makes the store copy-on-write, using TARGET= as the > backing store.=C2=A0 This is useful when TARGET is on a hard disk, wher= eas the > current store is on a RAM disk." > > =C2=A0 (define (set-store-permissions directory) > =C2=A0=C2=A0=C2=A0 ;; Set the right perms on DIRECTORY to use it as th= e store. > =C2=A0=C2=A0=C2=A0 #~(begin > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (chown #$directory 0 30000)= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = ;use the fixed > 'guixbuild' GID > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (chmod #$directory #o1775))= ) > > =C2=A0 #~(begin > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; Bind-mount TARGET's /tmp in case we = need space to build things. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((tmpdir (string-append #$target "= /tmp"))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mkdir-p tmpdir) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mount tmpdir "/tmp" "none"= MS_BIND)) > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let* ((rw-dir (string-append target #$= %backing-directory)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ;; FIXME: calculate work-dir from backing-directory: > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= ;; normpath(backing-directory + "../.overlayfs-workdir") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= (work-dir (string-append target "/tmp/.overlayfs-workdir"))) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mkdir-p rw-dir) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mkdir-p work-dir) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mkdir-p "/.rw-store") > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #$(set-store-permissions #~= rw-dir) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 #$(set-store-permissions "/= .rw-store") > > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; Mount the overlay, then = atomically make it the store. > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mount "none" "/.rw-store" = "overlay" > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (string-append "lowerdir=3D" #$(%store-prefix) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 "upperdir=3D" #~rw-dir "," > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 "workdir=3D" #~work-dir)) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (mount "/.rw-store" #$(%sto= re-prefix) "" MS_MOVE) > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (rmdir "/.rw-store")))) >