all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Tadhg McDonald-Jensen <tadhgmister@gmail.com>
Cc: 70826@debbugs.gnu.org
Subject: bug#70826: luks-device-mapping-with-options breaks bootloader
Date: Sat, 25 May 2024 11:47:03 +0200	[thread overview]
Message-ID: <87ikz22pgo.fsf@gnu.org> (raw)
In-Reply-To: <CAP5DvDj1Xgkr5Mzy2XEzj6O86Nm=Z=hczhKQpCYKhV8Z7mg=BA@mail.gmail.com> (Tadhg McDonald-Jensen's message of "Tue, 7 May 2024 14:54:12 -0400")

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

Hi,

Tadhg McDonald-Jensen <tadhgmister@gmail.com> skribis:

> using the `luks-device-mapping-with-options` mapped device type defined in
> (gnu system mapped-devices) causes grub or other bootloaders to not
> properly attempt to mount the encrypted drive. This is caused by the
> commit 39a9404 which identifies luks mapped devices by checking if the type
> is equal to `luks-device-mapping`, so by using a different routine that is
> a proxy to that one it doesn't forward it to grub in the
> store-crypto-devices list.

Ouch, indeed.  The immediate fix is:


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

diff --git a/gnu/system.scm b/gnu/system.scm
index c76f4d7c502..bb851b1b75f 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -667,10 +667,13 @@ (define (operating-system-boot-mapped-devices os)
 (define operating-system-bootloader-crypto-devices
   (mlambdaq (os)                        ;to avoid duplicated output
     "Return the sources of the LUKS mapped devices specified by UUID."
+    (define (luks-device? m)
+      (memq (mapped-device-type m)
+            (list luks-device-mapping-with-options
+                  luks-device-mapping)))
+
     ;; XXX: Device ordering is important, we trust the returned one.
-    (let* ((luks-devices (filter (lambda (m)
-                                   (eq? luks-device-mapping
-                                        (mapped-device-type m)))
+    (let* ((luks-devices (filter luks-device?
                                  (operating-system-boot-mapped-devices os)))
            (uuid-crypto-devices non-uuid-crypto-devices
                                 (partition (compose uuid? mapped-device-source)

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]


Not ideal, but it fixes the problem.

I’ll go ahead with this patch if there are no objections.

Thanks!

Ludo’.

  reply	other threads:[~2024-05-25  9:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-07 18:54 bug#70826: luks-device-mapping-with-options breaks bootloader Tadhg McDonald-Jensen
2024-05-25  9:47 ` Ludovic Courtès [this message]
2024-05-25 14:30   ` Tadhg McDonald-Jensen
2024-07-23 18:19     ` Tomas Volf
2024-08-11 22:33       ` Tadhg McDonald-Jensen
2024-08-11 23:19         ` Tadhg McDonald-Jensen

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

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

  git send-email \
    --in-reply-to=87ikz22pgo.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=70826@debbugs.gnu.org \
    --cc=tadhgmister@gmail.com \
    /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 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.