summaryrefslogtreecommitdiff
path: root/gnu/system/mapped-devices.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-12-05 19:17:41 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-12-05 19:17:41 +0100
commit9bc0f45df5d6aed217020b1183dca54989844fb0 (patch)
treed927e89949ff7f65b5059bc94273c53fd43d0763 /gnu/system/mapped-devices.scm
parent6db3c536e89deb8a204e756f427614925a7d2582 (diff)
parent10554e0a57feeea470127a1d0441957d1776b0bd (diff)
downloadguix-patches-9bc0f45df5d6aed217020b1183dca54989844fb0.tar
guix-patches-9bc0f45df5d6aed217020b1183dca54989844fb0.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates-frozen
Diffstat (limited to 'gnu/system/mapped-devices.scm')
-rw-r--r--gnu/system/mapped-devices.scm10
1 files changed, 8 insertions, 2 deletions
diff --git a/gnu/system/mapped-devices.scm b/gnu/system/mapped-devices.scm
index 518dbc4fe8..96a381d5fe 100644
--- a/gnu/system/mapped-devices.scm
+++ b/gnu/system/mapped-devices.scm
@@ -192,7 +192,8 @@ option of @command{guix system}.\n")
"Return a gexp that maps SOURCE to TARGET as a LUKS device, using
'cryptsetup'."
(with-imported-modules (source-module-closure
- '((gnu build file-systems)))
+ '((gnu build file-systems)
+ (guix build utils))) ;; For mkdir-p
(match targets
((target)
#~(let ((source #$(if (uuid? source)
@@ -201,7 +202,12 @@ option of @command{guix system}.\n")
;; XXX: 'use-modules' should be at the top level.
(use-modules (rnrs bytevectors) ;bytevector?
((gnu build file-systems)
- #:select (find-partition-by-luks-uuid)))
+ #:select (find-partition-by-luks-uuid))
+ ((guix build utils) #:select (mkdir-p)))
+
+ ;; Create '/run/cryptsetup/' if it does not exist, as device locking
+ ;; is mandatory for LUKS2.
+ (mkdir-p "/run/cryptsetup/")
;; Use 'cryptsetup-static', not 'cryptsetup', to avoid pulling the
;; whole world inside the initrd (for when we're in an initrd).