diff options
author | Christopher Baines <mail@cbaines.net> | 2024-04-09 16:44:22 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2024-04-09 16:46:34 +0100 |
commit | 6cae1db889f62051580d5a365f62585412a53a8c (patch) | |
tree | 4d3db074d50ca3e2109cced17bec77f207a0c1fd /gnu/system/mapped-devices.scm | |
parent | 410e699e0933653e69d03a4cdadf11854c6723f4 (diff) | |
parent | 35e1d9247e39f3c91512cf3d9ef1467962389e35 (diff) | |
download | guix-6cae1db889f62051580d5a365f62585412a53a8c.tar.gz guix-6cae1db889f62051580d5a365f62585412a53a8c.zip |
Merge remote-tracking branch 'savannah/master' into mesa-updates
Change-Id: Iad185e2ced97067b3dff8fd722435a6c5e2c00e5
Diffstat (limited to 'gnu/system/mapped-devices.scm')
-rw-r--r-- | gnu/system/mapped-devices.scm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm index c19a818453..e56ead9e5e 100644 --- a/gnu/system/mapped-devices.scm +++ b/gnu/system/mapped-devices.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014-2022 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2014-2022, 2024 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2016 Andreas Enge <andreas@enge.fr> ;;; Copyright © 2017, 2018 Mark H Weaver <mhw@netris.org> ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> @@ -57,6 +57,7 @@ mapped-device-kind? mapped-device-kind-open mapped-device-kind-close + mapped-device-kind-modules mapped-device-kind-check device-mapping-service-type @@ -112,6 +113,8 @@ specifications to 'targets'." (open mapped-device-kind-open) ;source target -> gexp (close mapped-device-kind-close ;source target -> gexp (default (const #~(const #f)))) + (modules mapped-device-kind-modules ;list of module names + (default '())) (check mapped-device-kind-check ;source -> Boolean (default (const #t)))) @@ -125,13 +128,14 @@ specifications to 'targets'." 'device-mapping (match-lambda (($ <mapped-device> source targets - ($ <mapped-device-type> open close)) + ($ <mapped-device-type> open close modules)) (shepherd-service (provision (list (symbol-append 'device-mapping- (string->symbol (string-join targets "-"))))) (requirement '(udev)) (documentation "Map a device node using Linux's device mapper.") (start #~(lambda () #$(open source targets))) (stop #~(lambda _ (not #$(close source targets)))) + (modules (append %default-modules modules)) (respawn? #f)))) (description "Map a device node using Linux's device mapper."))) @@ -202,12 +206,6 @@ option of @command{guix system}.\n") (uuid-bytevector source) source)) (keyfile #$key-file)) - ;; XXX: 'use-modules' should be at the top level. - (use-modules (rnrs bytevectors) ;bytevector? - ((gnu build file-systems) - #:select (find-partition-by-luks-uuid - system*/tty)) - ((guix build utils) #:select (mkdir-p))) ;; Create '/run/cryptsetup/' if it does not exist, as device locking ;; is mandatory for LUKS2. @@ -283,7 +281,10 @@ option of @command{guix system}.\n") (mapped-device-kind (open open-luks-device) (close close-luks-device) - (check check-luks-device))) + (check check-luks-device) + (modules '((rnrs bytevectors) ;bytevector? + ((gnu build file-systems) + #:select (find-partition-by-luks-uuid system*/tty)))))) (define* (luks-device-mapping-with-options #:key key-file) "Return a luks-device-mapping object with open modified to pass the arguments |