aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-07-23 11:11:24 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-07-23 16:13:30 -0700
commit0f547668a92025fe0741a9dfcf5abfc84e6ba9f9 (patch)
tree23edd94700ccceb45034158085a7a54fe30d461d
parent6e86cd9a0a12662265a749bf116dc259deb683d2 (diff)
downloadconsfigurator-0f547668a92025fe0741a9dfcf5abfc84e6ba9f9.tar.gz
add support for passing arbitrary options to cryptsetup luksFormat
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--src/property/disk.lisp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/property/disk.lisp b/src/property/disk.lisp
index 6806bab..ab9b6f3 100644
--- a/src/property/disk.lisp
+++ b/src/property/disk.lisp
@@ -611,6 +611,11 @@ possible. Ignored if VOLUME-SIZE is also bound."))
"The value of the --type parameter to cryptsetup luksFormat.
Note that GRUB2 older than 2.06 cannot open the default LUKS2 format, so
specify \"luks1\" if this is needed.")
+ (cryptsetup-options
+ :type list :initform nil :initarg :cryptsetup-options
+ :documentation
+ "Extra arguments to pass to cryptsetup(8) when creating the volume, such as
+'--cipher'. Use the LUKS-TYPE slot for '--type'.")
(crypttab-options
:type list :initform '("luks" "discard" "initramfs")
:initarg :crypttab-options :accessor crypttab-options)
@@ -632,12 +637,15 @@ specify \"luks1\" if this is needed.")
(merge-pathnames volume-label #P"/dev/mapper/"))))
(defmethod create-volume ((volume luks-container) (file pathname))
- (with-slots (luks-passphrase-iden1 volume-label luks-type) volume
+ (with-slots
+ (luks-passphrase-iden1 volume-label luks-type cryptsetup-options)
+ volume
(mrun :inform
:input (get-data-string luks-passphrase-iden1 (volume-label volume))
"cryptsetup" "--type" luks-type
(and (member luks-type '("luks" "luks2") :test #'string=)
`("--label" ,volume-label))
+ cryptsetup-options
"luksFormat" file "-")))
(defmethod close-volume ((volume opened-luks-container))