unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Marius Bakke <mbakke@fastmail.com>
To: Mark H Weaver <mhw@netris.org>, 28445@debbugs.gnu.org
Subject: bug#28445: match-error in 'device-sexp->device' while building system
Date: Wed, 13 Sep 2017 17:37:50 +0200	[thread overview]
Message-ID: <871snafw35.fsf@fastmail.com> (raw)
In-Reply-To: <87y3pid5jw.fsf@netris.org>


[-- 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 --]

  reply	other threads:[~2017-09-13 15:38 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871snafw35.fsf@fastmail.com \
    --to=mbakke@fastmail.com \
    --cc=28445@debbugs.gnu.org \
    --cc=mhw@netris.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).