diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2025-07-06 16:54:28 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-07-18 00:57:31 +0200 |
| commit | 14c8728f0d812ea2c396b3c0564fa8da1202f430 (patch) | |
| tree | 43918dec589454dd2e3062e96ac53859bddf4388 /gnu | |
| parent | 62bf9a7cc79d24e7edc2b56d6dde6e77eebc537e (diff) | |
mapped-devices: luks: Adjust to support extra arguments.
Fixes <https://issues.guix.gnu.org/70826>.
When using ‘luks-device-mapping-with-options’, procedures such as
‘operating-system-boot-mapped-devices’ would fail to identify LUKS
mapped devices because they would check whether the mapped device type
is ‘eq?’ to ‘luks-device-mapping’.
This addresses that by ensuring mapped devices are always of the
‘luks-device-mapping’ type, even when different options are used.
* gnu/system/mapped-devices.scm (close-luks-device): Add #:rest.
(luks-device-mapping-with-options): Deprecate.
* gnu/tests/install.scm (%encrypted-home-os-key-file): Update
accordingly.
* doc/guix.texi (Mapped Devices): Document use of the ‘arguments’ field
of ‘luks-device-mapping’. Remove ‘luks-device-mapping-with-options’
documentation.
(Bootloader Configuration): Update example with key file in extra
initrd.
Change-Id: I5442908cb8ef4e3891dbb053cccf5e42b895486f
Reported-by: Tadhg McDonald-Jensen <tadhgmister@gmail.com>
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/system/mapped-devices.scm | 6 | ||||
| -rw-r--r-- | gnu/tests/install.scm | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index c09a0f1ef17..b0a6beef280 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -256,7 +256,7 @@ requests is allowed for the underlying device." (zero? (apply system*/tty cryptsetup cryptsetup-flags)))))))))) -(define (close-luks-device source targets) +(define* (close-luks-device source targets #:rest _) "Return a gexp that closes TARGET, a LUKS device." (match targets ((target) @@ -296,7 +296,9 @@ requests is allowed for the underlying device." ((gnu build file-systems) #:select (find-partition-by-luks-uuid system*/tty)))))) -(define* (luks-device-mapping-with-options #:key key-file allow-discards?) +(define-deprecated (luks-device-mapping-with-options #:key + key-file allow-discards?) + mapped-device-arguments "Return a luks-device-mapping object with open modified to pass the arguments into the open-luks-device procedure." (mapped-device-kind diff --git a/gnu/tests/install.scm b/gnu/tests/install.scm index 7ef0cae73bd..97c3505fb09 100644 --- a/gnu/tests/install.scm +++ b/gnu/tests/install.scm @@ -1078,8 +1078,8 @@ launched as a shepherd service." (mapped-devices (list (mapped-device (source (uuid "12345678-1234-1234-1234-123456789abc")) (target "the-home-device") - (type (luks-device-mapping-with-options - #:key-file "/key-file.bin"))))) + (type luks-device-mapping) + (arguments '(#:key-file "/key-file.bin"))))) (file-systems (cons* (file-system (device (file-system-label "root-fs")) (mount-point "/") |
