diff mbox series

[bug#72457,v3,07/15] gnu: system: Fix bootloader crypto device recognition.

Message ID 0a87dfd7b7f40c55ba99df7952dd3eb2c2e5f183.1722803521.git.lilah@lunabee.space
State New
Headers show
Series Rewrite bootloader subsystem. | expand

Commit Message

Lilah Tascheter Aug. 4, 2024, 8:31 p.m. UTC
* gnu/system.scm (operating-system-bootloader-crypto-devices): Check for
  luks-device-mapping-with-options in addition to luks-device-mapping.

Change-Id: Iafc9afe608640b97083c4d559c9240846330472a
---
 gnu/system.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/gnu/system.scm b/gnu/system.scm
index 66c1a80733..093c8fa350 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -400,10 +400,12 @@  (define operating-system-bootloader-crypto-devices
   (mlambdaq (os)                        ;to avoid duplicated output
     "Return the sources of the LUKS mapped devices specified by UUID."
     ;; XXX: Device ordering is important, we trust the returned one.
-    (let* ((luks-devices (filter (lambda (m)
-                                   (eq? luks-device-mapping
-                                        (mapped-device-type m)))
-                                 (operating-system-boot-mapped-devices os)))
+    ;; Check against the close-luks-device procedure to get both maptypes
+    (let* ((close (mapped-device-kind-close luks-device-mapping))
+           (luks? (lambda (m) (let ((t (mapped-device-type m)))
+                                (eq? (mapped-device-kind-close t) close))))
+           (luks-devices (filter luks?
+                           (operating-system-boot-mapped-devices os)))
            (uuid-crypto-devices non-uuid-crypto-devices
                                 (partition (compose uuid? mapped-device-source)
                                            luks-devices)))