mirror of
https://github.com/nix-community/disko.git
synced 2026-12-02 14:03:28 +01:00
luks: don't depend on autogenerated password
This commit is contained in:
1 parent
d60b2b5e00
commit
0d15976fce
1 file changed
+6
-2
+6
-2
@@ -227,13 +227,17 @@ in
|
|||||||
export SLOT_ZERO_TO_DELETE=true
|
export SLOT_ZERO_TO_DELETE=true
|
||||||
''}
|
''}
|
||||||
cryptsetup -q luksFormat "${config.device}" ${toString config.extraFormatArgs} ${formatKeyFileArgs}
|
cryptsetup -q luksFormat "${config.device}" ${toString config.extraFormatArgs} ${formatKeyFileArgs}
|
||||||
fi
|
|
||||||
|
|
||||||
if ! cryptsetup status "${config.name}" >/dev/null; then
|
|
||||||
${formatCryptsetupOpen} \
|
${formatCryptsetupOpen} \
|
||||||
--persistent
|
--persistent
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Unlock without relying on the autogenerated password when someone
|
||||||
|
# calls this script after unmounting or rebooting
|
||||||
|
if ! cryptsetup status "${config.name}" >/dev/null; then
|
||||||
|
${cryptsetupOpen}
|
||||||
|
fi
|
||||||
|
|
||||||
${toString (
|
${toString (
|
||||||
lib.forEach config.additionalKeyFiles (keyFile: ''
|
lib.forEach config.additionalKeyFiles (keyFile: ''
|
||||||
if ! cryptsetup open --test-passphrase --key-file=${keyFile} "${config.device}" 2>/dev/null; then
|
if ! cryptsetup open --test-passphrase --key-file=${keyFile} "${config.device}" 2>/dev/null; then
|
||||||
|
|||||||
Reference in new issue
Block a user