From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) Subject: bug#28445: match-error in 'device-sexp->device' while building system Date: Wed, 20 Sep 2017 23:27:17 +0200 Message-ID: <87mv5pqcwa.fsf@gnu.org> References: <87y3pid5jw.fsf@netris.org> <871snafw35.fsf@fastmail.com> <87ingmcmwm.fsf@netris.org> <874ls1gl3d.fsf@gnu.org> <877ewvj4ph.fsf@netris.org> <87shfjelnh.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dumXL-0000aq-0Q for bug-guix@gnu.org; Wed, 20 Sep 2017 17:28:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dumXK-0005C4-4T for bug-guix@gnu.org; Wed, 20 Sep 2017 17:28:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:41951) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dumXK-0005Bw-1d for bug-guix@gnu.org; Wed, 20 Sep 2017 17:28:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dumXJ-0004xt-Sw for bug-guix@gnu.org; Wed, 20 Sep 2017 17:28:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <87shfjelnh.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 18 Sep 2017 23:34:26 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Mark H Weaver Cc: 28445@debbugs.gnu.org Hello Mark, Andy pushed the first half of the fix as 96bc6518002c3b2ad9f15cf36991b20bebcbbe8a. Could you check whether the =E2=80=98ensure-not-/dev=E2=80=99 part below solves the rest? Thanks, Ludo=E2=80=99. ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > Mark H Weaver skribis: > >> # Set 'root' to the partition that contains /gnu/store. >> -search --file --set /gnu/store/21ngnlx9k0x9x2jj1px7mdlb4j6mzz6x-grub-2.= 02/share/grub/unicode.pf2 >> +search --label --set /dev/mapper/jojen-root > > Oops. I believe the patch below does the trick (=E2=80=98store-device=E2= =80=99 must > never be a Linux device name, and that=E2=80=99s what the patch ensures.) > > Thoughts? > > (I didn=E2=80=99t notice these issues because I identify my root file sys= tem by > label or UUID rather than hard-coding its /dev/mapper name.) > > Ludo=E2=80=99. > > diff --git a/gnu/system.scm b/gnu/system.scm > index d337e5259..d71b9c15b 100644 > --- a/gnu/system.scm > +++ b/gnu/system.scm > @@ -243,6 +243,11 @@ directly by the user." > ((? string? device) > device))) >=20=20 > + (define (ensure-not-/dev device) > + (if (and (string? device) (string-prefix? "/" device)) > + #f > + device)) > + > (match (read port) > (('boot-parameters ('version 0) > ('label label) ('root-device root) > @@ -277,15 +282,16 @@ directly by the user." > file))) >=20=20 > (store-device > - (match (assq 'store rest) > - (('store ('device device) _ ...) > - (device-sexp->device device)) > - (_ ;the old format > - ;; Root might be a device path like "/dev/sda1", which is not a > - ;; suitable GRUB device identifier. > - (if (string-prefix? "/" root) > - #f > - root)))) > + ;; ROOT might be a device path like "/dev/sda1", which is not a > + ;; suitable GRUB device identifier. > + (ensure-not-/dev > + (match (assq 'store rest) > + (('store ('device #f) _ ...) > + root-device) > + (('store ('device device) _ ...) > + (device-sexp->device device)) > + (_ ;the old format > + root-device)))) >=20=20 > (store-mount-point > (match (assq 'store rest) > @@ -906,6 +912,7 @@ device in a ." > (case (file-system-title fs) > ((uuid) (file-system-device fs)) > ((label) (file-system-device fs)) > + ((device) (file-system-device fs)) > (else #f))) >=20=20 > (define (operating-system-boot-parameters os system.drv root-device)