all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#28445: match-error in 'device-sexp->device' while building system
@ 2017-09-13 14:41 Mark H Weaver
  2017-09-13 15:37 ` Marius Bakke
  2017-09-13 18:32 ` Mark H Weaver
  0 siblings, 2 replies; 12+ messages in thread
From: Mark H Weaver @ 2017-09-13 14:41 UTC (permalink / raw)
  To: 28445

I just started getting this error while trying to build my x86_64 GuixSD
system:

--8<---------------cut here---------------start------------->8---
mhw@jojen ~$ guix system build -K /etc/config-new.scm
Backtrace:
          14 (primitive-load "/home/mhw/guix/scripts/guix")
In guix/ui.scm:
  1331:12 13 (run-guix-command _ . _)
In ice-9/boot-9.scm:
    837:9 12 (catch _ _ #<procedure 7f67b07988c0 at guix/ui.scm:448…> …)
    837:9 11 (catch _ _ #<procedure 7f67b07988d8 at guix/ui.scm:536…> …)
In guix/scripts/system.scm:
   1025:8 10 (_)
    908:6  9 (process-action _ _ _)
In guix/store.scm:
  1443:24  8 (run-with-store _ _ #:guile-for-build _ #:system _ # _)
In guix/scripts/system.scm:
   661:31  7 (_ _)
In srfi/srfi-1.scm:
   705:23  6 (filter-map #<procedure system->boot-parameters (sys…> . #)
In ice-9/boot-9.scm:
    837:9  5 (catch system-error #<procedure 640e660 at guix/script…> …)
In guix/scripts/system.scm:
   385:30  4 (_)
In gnu/system.scm:
   307:17  3 (read-boot-parameters-file "/var/guix/profiles/system-9…")
In ice-9/ports.scm:
   444:17  2 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
In gnu/system.scm:
   282:10  1 (read-boot-parameters _)
    238:4  0 (device-sexp->device _)

gnu/system.scm:238:4: In procedure device-sexp->device:
gnu/system.scm:238:4: Throw to key `match-error' with args `("match" "no matching pattern" #f)'.
--8<---------------cut here---------------end--------------->8---

I'm on commit 01ef804d69b2e57dd7b1d3d13e66e3f67e7c548a plus some local
patches that are likely not relevant to this issue.

Here's my config file /etc/config-new.scm:

--8<---------------cut here---------------start------------->8---
;; This is an operating system configuration template
;; for a "desktop" setup with GNOME and Xfce where the
;; root partition is encrypted with LUKS.

(use-modules (gnu) (gnu system nss) (srfi srfi-1) (guix packages))
(use-service-modules base desktop networking xorg dbus)
(use-package-modules certs gnome cryptsetup linux admin guile firmware xdisorg libusb)

(define keymap
  (plain-file
   "keymap"
   "keymaps 0-255
keycode 42 = Shift
keycode 54 = Shift
keycode 29 = Control
keycode 58 = Control
keycode 56 = Alt
keycode 100 = Alt
alt shift keycode 1 = Meta_Escape
alt shift keycode 2 = Meta_exclam
alt shift keycode 3 = Meta_at
alt shift keycode 4 = Meta_numbersign
alt shift keycode 5 = Meta_dollar
alt shift keycode 6 = Meta_percent
alt shift keycode 7 = Meta_asciicircum
shift control keycode 7 = Control_asciicircum
control alt keycode 7 = Meta_Control_asciicircum
shift control alt keycode 7 = Meta_Control_asciicircum
alt shift keycode 8 = Meta_ampersand
alt shift keycode 9 = Meta_asterisk
alt shift keycode 10 = Meta_parenleft
alt shift keycode 11 = Meta_parenright
alt shift keycode 12 = Meta_underscore
shift control keycode 12 = Control_underscore
control alt keycode 12 = Meta_Control_underscore
shift control alt keycode 12 = Meta_Control_underscore
alt shift keycode 13 = Meta_plus
alt shift keycode 14 = Meta_Delete
alt shift keycode 15 = Meta_Tab
alt shift keycode 16 = Meta_Q
alt shift keycode 17 = Meta_W
alt shift keycode 18 = Meta_E
alt shift keycode 19 = Meta_R
alt shift keycode 20 = Meta_T
alt shift keycode 21 = Meta_Y
alt shift keycode 22 = Meta_U
alt shift keycode 23 = Meta_I
alt shift keycode 24 = Meta_O
alt shift keycode 25 = Meta_P
alt shift keycode 26 = Meta_braceleft
control alt keycode 26 = Meta_Escape
alt shift keycode 27 = Meta_braceright
control alt keycode 27 = Meta_Control_bracketright
alt shift keycode 28 = Meta_Return
alt shift keycode 29 = Meta_Control
alt shift keycode 30 = Meta_A
alt shift keycode 31 = Meta_S
alt shift keycode 32 = Meta_D
alt shift keycode 33 = Meta_F
alt shift keycode 34 = Meta_G
alt shift keycode 35 = Meta_H
alt shift keycode 36 = Meta_J
alt shift keycode 37 = Meta_K
alt shift keycode 38 = Meta_L
alt shift keycode 39 = Meta_colon
alt shift keycode 40 = Meta_quotedbl
alt shift keycode 41 = Meta_asciitilde
alt shift keycode 43 = Meta_bar
control alt keycode 43 = Meta_Control_backslash
alt shift keycode 44 = Meta_Z
alt shift keycode 45 = Meta_X
alt shift keycode 46 = Meta_C
alt shift keycode 47 = Meta_V
alt shift keycode 48 = Meta_B
alt shift keycode 49 = Meta_N
alt shift keycode 50 = Meta_M
alt shift keycode 51 = Meta_less
alt shift keycode 52 = Meta_greater
alt shift keycode 53 = Meta_question
alt shift keycode 57 = Meta_space
"))

(operating-system
  (host-name "jojen")
  (timezone "US/Eastern")
  (locale "en_US.utf8")

  (bootloader (bootloader-configuration
	       (bootloader grub-bootloader)
	       (target "/dev/sda")))

  (kernel linux-libre)

  (firmware (list ath9k-htc-firmware))

  ;; Specify a mapped device for the encrypted root partition.
  ;; The UUID is that returned by 'cryptsetup luksUUID'.
  (mapped-devices
   (list (mapped-device
          (source (uuid "a56c53e7-b345-4e24-a17b-6cf158dbc7d3"))
          (target "jojen-root")
          (type luks-device-mapping))))

  (file-systems (cons* (file-system
                         ;; XXX This doesn't seem to work
                         ;; (device "jojen-root")
                         ;; (title 'label)
                         (device "/dev/mapper/jojen-root")
                         (title 'device)
                         (mount-point "/")
                         (type "btrfs")
                         (dependencies mapped-devices))
                       %base-file-systems))

  (users (cons* (user-account
                 (name "mhw")
                 (uid 1000)
                 (group "mhw")
                 (supplementary-groups '("wheel" "users" "netdev"
                                         "audio" "video" "dialout"))
                 (home-directory "/home/mhw"))
                %base-user-accounts))

  (groups (cons* (user-group
                  (name "mhw")
                  (id 1000))
                 %base-groups))

  (setuid-programs
   (list (file-append shadow "/bin/passwd")
         (file-append inetutils "/bin/ping")))

  ;; This is where we specify system-wide packages.
  (packages (cons* nss-certs         ;for HTTPS access
                   gvfs              ;for user mounts
                   cryptsetup
                   btrfs-progs
                   wpa-supplicant
                   network-manager
                   network-manager-applet
                   (delete sudo %base-packages)))

  (services (cons* (console-keymap-service keymap)
                   ;;(xfce-desktop-service)
                   (gnome-desktop-service)
                   (service network-manager-service-type
                            (network-manager-configuration))
                   (service wpa-supplicant-service-type wpa-supplicant)

                   ;; Desktop services follow
                   (slim-service)
                   ;;(screen-locker-service slock)
                   (screen-locker-service xlockmore "xlock")
                   (simple-service 'mtp udev-service-type (list libmtp))
                   ;;(avahi-service)    ; I don't trust this
                   ;;(wicd-service)     ; using NetworkManager instead
                   (udisks-service)
                   (upower-service)
                   (colord-service)
                   ;;(geoclue-service)  ; I don't want this
                   (polkit-service)
                   (elogind-service)
                   (dbus-service)
                   ;;(ntp-service)      ; I don't trust this

                   (modify-services (remove (lambda (svc)
                                              (eq? (service-kind svc)
                                                   wicd-service-type))
                                            %base-services)
                     ;; This is for debugging
                     #;
                     (nscd-service-type config =>
                                        (nscd-configuration
                                          (inherit config)
                                          (debug-level 3)
                                          (log-file "/var/log/nscd.log")))
                     ;; I don't trust the build farm
                     (guix-service-type config =>
                                        (guix-configuration
                                          (inherit config)
                                          (use-substitutes? #f)
                                          (authorized-keys '())
                                          (substitute-urls '())
                                          (extra-options '("--gc-keep-derivations=yes"
                                                           "--gc-keep-outputs=yes")))))))

  ;; Allow resolution of '.local' host names with mDNS.
  ;;(name-service-switch %mdns-host-lookup-nss)  ; disabled for now
  )
--8<---------------cut here---------------end--------------->8---

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-13 14:41 bug#28445: match-error in 'device-sexp->device' while building system Mark H Weaver
@ 2017-09-13 15:37 ` Marius Bakke
  2017-09-13 21:24   ` Mark H Weaver
  2017-09-13 18:32 ` Mark H Weaver
  1 sibling, 1 reply; 12+ messages in thread
From: Marius Bakke @ 2017-09-13 15:37 UTC (permalink / raw)
  To: Mark H Weaver, 28445


[-- Attachment #1.1: Type: text/plain, Size: 2797 bytes --]

Mark H Weaver <mhw@netris.org> writes:

> I just started getting this error while trying to build my x86_64 GuixSD
> system:
>
> --8<---------------cut here---------------start------------->8---
> mhw@jojen ~$ guix system build -K /etc/config-new.scm
> Backtrace:
>           14 (primitive-load "/home/mhw/guix/scripts/guix")
> In guix/ui.scm:
>   1331:12 13 (run-guix-command _ . _)
> In ice-9/boot-9.scm:
>     837:9 12 (catch _ _ #<procedure 7f67b07988c0 at guix/ui.scm:448…> …)
>     837:9 11 (catch _ _ #<procedure 7f67b07988d8 at guix/ui.scm:536…> …)
> In guix/scripts/system.scm:
>    1025:8 10 (_)
>     908:6  9 (process-action _ _ _)
> In guix/store.scm:
>   1443:24  8 (run-with-store _ _ #:guile-for-build _ #:system _ # _)
> In guix/scripts/system.scm:
>    661:31  7 (_ _)
> In srfi/srfi-1.scm:
>    705:23  6 (filter-map #<procedure system->boot-parameters (sys…> . #)
> In ice-9/boot-9.scm:
>     837:9  5 (catch system-error #<procedure 640e660 at guix/script…> …)
> In guix/scripts/system.scm:
>    385:30  4 (_)
> In gnu/system.scm:
>    307:17  3 (read-boot-parameters-file "/var/guix/profiles/system-9…")
> In ice-9/ports.scm:
>    444:17  2 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
> In gnu/system.scm:
>    282:10  1 (read-boot-parameters _)
>     238:4  0 (device-sexp->device _)
>
> gnu/system.scm:238:4: In procedure device-sexp->device:
> gnu/system.scm:238:4: Throw to key `match-error' with args `("match" "no matching pattern" #f)'.
> --8<---------------cut here---------------end--------------->8---

[...]

>   ;; Specify a mapped device for the encrypted root partition.
>   ;; The UUID is that returned by 'cryptsetup luksUUID'.
>   (mapped-devices
>    (list (mapped-device
>           (source (uuid "a56c53e7-b345-4e24-a17b-6cf158dbc7d3"))
>           (target "jojen-root")
>           (type luks-device-mapping))))
>
>   (file-systems (cons* (file-system
>                          ;; XXX This doesn't seem to work
>                          ;; (device "jojen-root")
>                          ;; (title 'label)
>                          (device "/dev/mapper/jojen-root")
>                          (title 'device)
>                          (mount-point "/")
>                          (type "btrfs")
>                          (dependencies mapped-devices))
>                        %base-file-systems))

I have an identical setup, and the problem is that the parameters file
contains "(store (device #f))".  You can confirm this by `cat
/var/guix/profiles/system-9-link/parameters`.

This patch fixes the parameters generation, but you have to move away
the profile symlinks that contains the broken parameters file before you
can use `guix system` again).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-system-Recognize-device-titles-when-creating-boot-pa.patch --]
[-- Type: text/x-patch, Size: 937 bytes --]

From 5ca849b84c02f5d213b40c654f1449e19adb5471 Mon Sep 17 00:00:00 2001
From: Marius Bakke <mbakke@fastmail.com>
Date: Tue, 12 Sep 2017 21:03:36 +0200
Subject: [PATCH] system: Recognize device titles when creating boot
 parameters.

This solves a problem where the store device would be #f in profile
parameters when not using uuid or labels.

* gnu/system.scm (fs->boot-device): Add case for when FILE-SYSTEM-TITLE is
a "device".
---
 gnu/system.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/system.scm b/gnu/system.scm
index c4404f593..767fc0784 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -902,6 +902,7 @@ device in a <menu-entry>."
   (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)
-- 
2.14.1


[-- Attachment #1.3: Type: text/plain, Size: 185 bytes --]


I wasn't sure if this solution is correct in the general case, as I also
get a warning from GRUB "/dev/mapper/foo-root is not a valid boot
device", but that is probably another issue.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-13 14:41 bug#28445: match-error in 'device-sexp->device' while building system Mark H Weaver
  2017-09-13 15:37 ` Marius Bakke
@ 2017-09-13 18:32 ` Mark H Weaver
  1 sibling, 0 replies; 12+ messages in thread
From: Mark H Weaver @ 2017-09-13 18:32 UTC (permalink / raw)
  To: 28445

Mark H Weaver <mhw@netris.org> writes:

> I just started getting this error while trying to build my x86_64 GuixSD
> system:
>
> mhw@jojen ~$ guix system build -K /etc/config-new.scm
[...]
> gnu/system.scm:238:4: In procedure device-sexp->device:
> gnu/system.scm:238:4: Throw to key `match-error' with args `("match" "no matching pattern" #f)'.

This is ultimately caused by the fact that
/var/guix/profiles/system-*-link/parameters, for every system I have,
includes:

  (store (device #f) (mount-point "/"))

It's worth noting that my root device is unusual: it is a btrfs
filesystem within a LUKS-encrypted partition.  See below for the
relevant excerpts of my OS configuration:

> (operating-system
[...]
>   ;; Specify a mapped device for the encrypted root partition.
>   ;; The UUID is that returned by 'cryptsetup luksUUID'.
>   (mapped-devices
>    (list (mapped-device
>           (source (uuid "a56c53e7-b345-4e24-a17b-6cf158dbc7d3"))
>           (target "jojen-root")
>           (type luks-device-mapping))))
>
>   (file-systems (cons* (file-system
>                          ;; XXX This doesn't seem to work
>                          ;; (device "jojen-root")
>                          ;; (title 'label)
>                          (device "/dev/mapper/jojen-root")
>                          (title 'device)
>                          (mount-point "/")
>                          (type "btrfs")
>                          (dependencies mapped-devices))
>                        %base-file-systems))

       Mark

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-13 15:37 ` Marius Bakke
@ 2017-09-13 21:24   ` Mark H Weaver
  2017-09-13 23:53     ` Mark H Weaver
  2017-09-17 19:51     ` Ludovic Courtès
  0 siblings, 2 replies; 12+ messages in thread
From: Mark H Weaver @ 2017-09-13 21:24 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 28445

Hi Marius,

Marius Bakke <mbakke@fastmail.com> writes:

> I have an identical setup, and the problem is that the parameters file
> contains "(store (device #f))".  You can confirm this by `cat
> /var/guix/profiles/system-9-link/parameters`.

Indeed, I discovered that as well.

> This patch fixes the parameters generation, but you have to move away
> the profile symlinks that contains the broken parameters file before you
> can use `guix system` again).
>
> From 5ca849b84c02f5d213b40c654f1449e19adb5471 Mon Sep 17 00:00:00 2001
> From: Marius Bakke <mbakke@fastmail.com>
> Date: Tue, 12 Sep 2017 21:03:36 +0200
> Subject: [PATCH] system: Recognize device titles when creating boot
>  parameters.

Thanks very much for this, but I think we should find a solution that
doesn't involve discarding all existing system generations.  The problem
is, we would have to take a leap of faith that the newly generated
system will work.  We should not ask users with similar setups to take
that leap of faith and possibly end up with an unbootable system in need
of rescue.  Guix is supposed to prevent this situation from happening.

At least for some transition period, it would be good to find a way to
cope with (store (device #f)) in some older system generations.

What do you think?

      Mark

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-13 21:24   ` Mark H Weaver
@ 2017-09-13 23:53     ` Mark H Weaver
  2017-09-14  6:03       ` Mark H Weaver
  2017-09-17 19:51     ` Ludovic Courtès
  1 sibling, 1 reply; 12+ messages in thread
From: Mark H Weaver @ 2017-09-13 23:53 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 28445

For now, to allow me to apply security updates to my system, I reverted
the following commits:

  96da5d629 system: Add gexp compiler for <operating-system>.
  45bba4751 store: 'run-with-store' has a #:target parameter.
  fc2de6ce1 guix system: Pretty-print device UUIDs.
  7940188eb system: Fix typo in 'read-boot-parameters'.
  5f7fe1c57 vm: Generate a UUID to identify the root file system.
  fd3b4b985 vm: Allow users to specify a UUID for the root partition.
  ce094b466 uuid: 'uuid' macro supports more UUID types.
  075681d35 system: Serialize the UUID type in the "parameters" file.
  9b336338c system: Introduce a disjoint UUID type.
  d1ff5f9db services: file-system: Use 'file-system->spec'.
  47cef4eca file-systems: Introduce (gnu system uuid).
  943e1b975 services: base: Import the closure of (gnu build file-systems).

and this allows me to build a new system.

      Mark

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-13 23:53     ` Mark H Weaver
@ 2017-09-14  6:03       ` Mark H Weaver
  0 siblings, 0 replies; 12+ messages in thread
From: Mark H Weaver @ 2017-09-14  6:03 UTC (permalink / raw)
  To: Marius Bakke; +Cc: 28445

I wrote:
> For now, to allow me to apply security updates to my system, I
> reverted the following commits:

To be clear, I reverted these commits only on a private branch in my
local git repo.

     Mark


>   96da5d629 system: Add gexp compiler for <operating-system>.
>   45bba4751 store: 'run-with-store' has a #:target parameter.
>   fc2de6ce1 guix system: Pretty-print device UUIDs.
>   7940188eb system: Fix typo in 'read-boot-parameters'.
>   5f7fe1c57 vm: Generate a UUID to identify the root file system.
>   fd3b4b985 vm: Allow users to specify a UUID for the root partition.
>   ce094b466 uuid: 'uuid' macro supports more UUID types.
>   075681d35 system: Serialize the UUID type in the "parameters" file.
>   9b336338c system: Introduce a disjoint UUID type.
>   d1ff5f9db services: file-system: Use 'file-system->spec'.
>   47cef4eca file-systems: Introduce (gnu system uuid).
>   943e1b975 services: base: Import the closure of (gnu build file-systems).
>
> and this allows me to build a new system.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-13 21:24   ` Mark H Weaver
  2017-09-13 23:53     ` Mark H Weaver
@ 2017-09-17 19:51     ` Ludovic Courtès
  2017-09-18 17:29       ` Mark H Weaver
  1 sibling, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2017-09-17 19:51 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 28445

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

Hello,

Apologies for not chiming in earlier!

Mark H Weaver <mhw@netris.org> skribis:

> At least for some transition period, it would be good to find a way to
> cope with (store (device #f)) in some older system generations.
>
> What do you think?

I think the patch below, which is Marius’ patch + adjusts
‘read-boot-parameters’ to cope with #f store-device, should solve the
issue.

Could you check if it works for you?

Thanks, and sorry for the delay!

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 720 bytes --]

diff --git a/gnu/system.scm b/gnu/system.scm
index c4404f593..528527ba9 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -278,6 +278,8 @@ directly by the user."
 
       (store-device
        (match (assq 'store rest)
+         (('store ('device #f) _ ...)
+          root-device)
          (('store ('device device) _ ...)
           (device-sexp->device device))
          (_                                       ;the old format
@@ -902,6 +904,7 @@ device in a <menu-entry>."
   (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)

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-17 19:51     ` Ludovic Courtès
@ 2017-09-18 17:29       ` Mark H Weaver
  2017-09-18 21:34         ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Mark H Weaver @ 2017-09-18 17:29 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28445

Hi Ludovic,

ludo@gnu.org (Ludovic Courtès) writes:

> Mark H Weaver <mhw@netris.org> skribis:
>
>> At least for some transition period, it would be good to find a way to
>> cope with (store (device #f)) in some older system generations.
>>
>> What do you think?
>
> I think the patch below, which is Marius’ patch + adjusts
> ‘read-boot-parameters’ to cope with #f store-device, should solve the
> issue.
>
> Could you check if it works for you?

I applied this, and my system boots, but there are errors that occur
within GRUB that didn't happen before this batch of recent commits (the
ones I mentioned reverting earlier).

At two points during boot, GRUB prints an error (paraphrasing): no such
device: /dev/mapper/jojen-root.

* It happens once after entering my disk encryption password for GRUB,
  but before the menu is displayed.

* It happens again after selecting the desired menu item, but before
  loading the kernel.

The origin of these problems can be seen in the diff between my old
grub.cfg and the new one:

--8<---------------cut here---------------start------------->8---
--- /gnu/store/5vw8y4kyl0606wg0sgh8xsm2czshdprl-grub.cfg	1969-12-31 19:00:01.000000000 -0500
+++ /boot/grub/grub.cfg	2017-09-18 05:19:39.240461714 -0400
@@ -21,7 +21,7 @@
 }
 
 # 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
 
 if loadfont /gnu/store/21ngnlx9k0x9x2jj1px7mdlb4j6mzz6x-grub-2.02/share/grub/unicode.pf2; then
   setup_gfxterm
--8<---------------cut here---------------end--------------->8---

Above, it changed from a working method to a non-working method to find
the encrypted partition within GRUB.

--8<---------------cut here---------------start------------->8---
@@ -42,15 +42,20 @@
 set default=0
 set timeout=5
 menuentry "GNU with Linux-Libre 4.13.2 (beta)" {
-  search --file --set /gnu/store/r64778rd9s1hy1yjbvlr17yq16vhwblq-linux-libre-4.13.2/bzImage
-  linux /gnu/store/r64778rd9s1hy1yjbvlr17yq16vhwblq-linux-libre-4.13.2/bzImage --root=/dev/mapper/jojen-root --system=/gnu/store/3lprqk4zdwhz4lvryhalymf2xks8f6yr-system --load=/gnu/store/3lprqk4zdwhz4lvryhalymf2xks8f6yr-system/boot
-  initrd /gnu/store/rqn1zs2pjbk54b1mpsy98qwsbkxj94q5-raw-initrd/initrd
+  search --label --set /dev/mapper/jojen-root
+  linux /gnu/store/r64778rd9s1hy1yjbvlr17yq16vhwblq-linux-libre-4.13.2/bzImage --root=/dev/mapper/jojen-root --system=/gnu/store/7i0f249xi92fjf4r6990s2rmlhjhiq9w-system --load=/gnu/store/7i0f249xi92fjf4r6990s2rmlhjhiq9w-system/boot
+  initrd /gnu/store/0cpz988g0yvq4wimiqw2zd7cc18ak4p4-raw-initrd/initrd
 }
--8<---------------cut here---------------end--------------->8---

and here, the same issue with GRUB's "search" command previously
searching for a file, and now searching for a label that doesn't exist.

Here's what ends up in the 'parameters' file of my new system:
  (store (device "/dev/mapper/jojen-root") (mount-point "/"))

It manages to boot anyway, but it pauses and prompts me to press a key
(to make sure I saw this error) twice during early boot.  It would be
good to handle this root filesystem configuration more gracefully.

Or is my OS configuration to blame?

     Thanks!
       Mark

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-18 17:29       ` Mark H Weaver
@ 2017-09-18 21:34         ` Ludovic Courtès
  2017-09-20 21:27           ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2017-09-18 21:34 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 28445

[-- Attachment #1: Type: text/plain, Size: 570 bytes --]

Hi,

Mark H Weaver <mhw@netris.org> 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 (‘store-device’ must
never be a Linux device name, and that’s what the patch ensures.)

Thoughts?

(I didn’t notice these issues because I identify my root file system by
label or UUID rather than hard-coding its /dev/mapper name.)

Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1705 bytes --]

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 <menu-entry>."
   (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)


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-18 21:34         ` Ludovic Courtès
@ 2017-09-20 21:27           ` Ludovic Courtès
  2017-10-04 17:39             ` Mark H Weaver
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2017-09-20 21:27 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 28445

Hello Mark,

Andy pushed the first half of the fix as
96bc6518002c3b2ad9f15cf36991b20bebcbbe8a.  Could you check whether the
‘ensure-not-/dev’ part below solves the rest?

Thanks,
Ludo’.

ludo@gnu.org (Ludovic Courtès) skribis:

> Mark H Weaver <mhw@netris.org> 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 (‘store-device’ must
> never be a Linux device name, and that’s what the patch ensures.)
>
> Thoughts?
>
> (I didn’t notice these issues because I identify my root file system by
> label or UUID rather than hard-coding its /dev/mapper name.)
>
> Ludo’.
>
> 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 <menu-entry>."
>    (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)

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-09-20 21:27           ` Ludovic Courtès
@ 2017-10-04 17:39             ` Mark H Weaver
  2017-10-06 22:22               ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Mark H Weaver @ 2017-10-04 17:39 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 28445

Hi,

Sorry for the delayed response.

ludo@gnu.org (Ludovic Courtès) writes:
> Andy pushed the first half of the fix as
> 96bc6518002c3b2ad9f15cf36991b20bebcbbe8a.  Could you check whether the
> ‘ensure-not-/dev’ part below solves the rest?

I see that you've pushed the 'ensure-not-/dev' part, and I have that now
in my tree, but FYI it didn't solve the problem for me.  My system
'parameters' file contains:

  (store (device "/dev/mapper/jojen-root") (mount-point "/"))

and my grub.cfg still uses:

  search --label --set /dev/mapper/jojen-root

both in the top section (just before loading the font) and within the
default menu entry.  As before, an error is issued twice, each time this
command is run: just after entering my disk encryption password and
after selecting the default menu item.

Within the "old configurations" menu, all of the menu entries use:

  search --file --set /gnu/store/…-linux-libre-4.13.4/bzImage

I don't remember if this was the case before.

      Mark

^ permalink raw reply	[flat|nested] 12+ messages in thread

* bug#28445: match-error in 'device-sexp->device' while building system
  2017-10-04 17:39             ` Mark H Weaver
@ 2017-10-06 22:22               ` Ludovic Courtès
  0 siblings, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2017-10-06 22:22 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: 28445-done

Hi Mark,

Mark H Weaver <mhw@netris.org> skribis:

> ludo@gnu.org (Ludovic Courtès) writes:
>> Andy pushed the first half of the fix as
>> 96bc6518002c3b2ad9f15cf36991b20bebcbbe8a.  Could you check whether the
>> ‘ensure-not-/dev’ part below solves the rest?
>
> I see that you've pushed the 'ensure-not-/dev' part, and I have that now
> in my tree, but FYI it didn't solve the problem for me.  My system
> 'parameters' file contains:
>
>   (store (device "/dev/mapper/jojen-root") (mount-point "/"))
>
> and my grub.cfg still uses:
>
>   search --label --set /dev/mapper/jojen-root

I tested with the config you had posted, and commit
90d23ed9df33e35e157fecd8ab60f55e716ca42f fixes the problem.

Let me know if anything else pops up in this area!

Thank you,
Ludo’.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-10-06 22:24 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-13 14:41 bug#28445: match-error in 'device-sexp->device' while building system Mark H Weaver
2017-09-13 15:37 ` Marius Bakke
2017-09-13 21:24   ` Mark H Weaver
2017-09-13 23:53     ` Mark H Weaver
2017-09-14  6:03       ` Mark H Weaver
2017-09-17 19:51     ` Ludovic Courtès
2017-09-18 17:29       ` Mark H Weaver
2017-09-18 21:34         ` Ludovic Courtès
2017-09-20 21:27           ` Ludovic Courtès
2017-10-04 17:39             ` Mark H Weaver
2017-10-06 22:22               ` Ludovic Courtès
2017-09-13 18:32 ` Mark H Weaver

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.