From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dS00Q-0005QT-JX for guix-patches@gnu.org; Mon, 03 Jul 2017 07:59:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dS00M-0000Qk-Mg for guix-patches@gnu.org; Mon, 03 Jul 2017 07:59:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:46806) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dS00M-0000QP-Ip for guix-patches@gnu.org; Mon, 03 Jul 2017 07:59:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dS00M-0007Jj-Ax for guix-patches@gnu.org; Mon, 03 Jul 2017 07:59:02 -0400 Subject: [bug#27521] [PATCH] build: Allow specifying volume-uuid with make-iso9660-image. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <878tk6rmvo.fsf@gnu.org> <20170703111043.20712-1-dannym@scratchpost.org> Date: Mon, 03 Jul 2017 13:58:35 +0200 In-Reply-To: <20170703111043.20712-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Mon, 3 Jul 2017 13:10:43 +0200") Message-ID: <87r2xxpw9g.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Danny Milosavljevic Cc: 27521@debbugs.gnu.org Danny Milosavljevic skribis: > * gnu/build/file-systems.scm (iso9660-uuid->string): Export. > * gnu/build/vm.scm (make-iso9660-image): Add volume-uuid. > --- > gnu/build/file-systems.scm | 1 + > gnu/build/vm.scm | 19 ++++++++++++++----- > 2 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm > index 16160a659..b6930497d 100644 > --- a/gnu/build/file-systems.scm > +++ b/gnu/build/file-systems.scm > @@ -48,6 +48,7 @@ > string->ext3-uuid > string->ext4-uuid > string->btrfs-uuid > + iso9660-uuid->string >=20=20 > bind-mount >=20=20 > diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm > index 860c98346..4239bc2fb 100644 > --- a/gnu/build/vm.scm > +++ b/gnu/build/vm.scm > @@ -353,18 +353,27 @@ SYSTEM-DIRECTORY is the name of the directory of th= e 'system' derivation." > (error "failed to create GRUB EFI image")))) >=20=20 > (define* (make-iso9660-image grub config-file os-drv target > - #:key (volume-id "GuixSD")) > + #:key (volume-id "GuixSD") (volume-uuid #f)) > "Given a GRUB package, creates an iso image as TARGET, using CONFIG-FI= LE as > Grub configuration and OS-DRV as the stuff in it." > (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue"))) > (mkdir-p "/tmp/root/var/run") > (mkdir-p "/tmp/root/run") > - (unless (zero? (system* grub-mkrescue "-o" target > - (string-append "boot/grub/grub.cfg=3D" confi= g-file) > - (string-append "gnu/store=3D" os-drv "/..") > + (unless (zero? (apply system* > + `(,grub-mkrescue "-o" ,target > + ,(string-append "boot/grub/grub.cfg=3D" conf= ig-file) > + ,(string-append "gnu/store=3D" os-drv "/..") > "var=3D/tmp/root/var" > "run=3D/tmp/root/run" > - "--" "-volid" (string-upcase volume-id))) > + "--" > + "-volid" ,(string-upcase volume-id) > + ,@(if volume-uuid > + `("-volume_date" "uuid" > + ,(string-filter (lambda (value) > + (not (char=3D? #\-= value))) > + (iso9660-uuid->string > + volume-uuid))) This last part can be written: (string-filter (char-set-complement (char-set #\/)) =E2=80=A6) though that=E2=80=99s not really more concise=E2=80=A6 LGTM! Ludo=E2=80=99.