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: Mon, 18 Sep 2017 23:34:26 +0200 Message-ID: <87shfjelnh.fsf@gnu.org> References: <87y3pid5jw.fsf@netris.org> <871snafw35.fsf@fastmail.com> <87ingmcmwm.fsf@netris.org> <874ls1gl3d.fsf@gnu.org> <877ewvj4ph.fsf@netris.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1du3h1-0006MX-GU for bug-guix@gnu.org; Mon, 18 Sep 2017 17:35:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1du3h0-00054S-IW for bug-guix@gnu.org; Mon, 18 Sep 2017 17:35:03 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:38253) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1du3h0-000542-En for bug-guix@gnu.org; Mon, 18 Sep 2017 17:35:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1du3h0-0005fU-6C for bug-guix@gnu.org; Mon, 18 Sep 2017 17:35:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <877ewvj4ph.fsf@netris.org> (Mark H. Weaver's message of "Mon, 18 Sep 2017 13:29:14 -0400") 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, Mark H Weaver skribis: > # Set 'root' to the partition that contains /gnu/store. > -search --file --set /gnu/store/21ngnlx9k0x9x2jj1px7mdlb4j6mzz6x-grub-2.0= 2/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 syste= m by label or UUID rather than hard-coding its /dev/mapper name.) Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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))) + (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))) (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)))) (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))) (define (operating-system-boot-parameters os system.drv root-device) --=-=-=--