summarylogtreecommitdiffstats
path: root/encrypt_remote_luks_header.hook
diff options
context:
space:
mode:
Diffstat (limited to 'encrypt_remote_luks_header.hook')
-rw-r--r--encrypt_remote_luks_header.hook8
1 files changed, 7 insertions, 1 deletions
diff --git a/encrypt_remote_luks_header.hook b/encrypt_remote_luks_header.hook
index 819c4cf60fe0..77fc56200d18 100644
--- a/encrypt_remote_luks_header.hook
+++ b/encrypt_remote_luks_header.hook
@@ -49,11 +49,17 @@ EOF
echo "Use 'cryptdevice=${root}:root root=/dev/mapper/root' instead."
}
+ local headerFlag=false
for cryptopt in ${cryptoptions//,/ }; do
case ${cryptopt} in
allow-discards)
cryptargs="${cryptargs} --allow-discards"
;;
+ header=*)
+ cryptargs="${cryptargs} --header ${cryptopt#header=}"
+ headerFlag=true
+ echo "Using detached header ${cryptopt#header=}"
+ ;;
*)
echo "Encryption option '${cryptopt}' not known, ignoring." >&2
;;
@@ -61,7 +67,7 @@ EOF
done
if resolved=$(resolve_device "${cryptdev}" ${rootdelay}); then
- if cryptsetup isLuks ${resolved} >/dev/null 2>&1; then
+ if $headerFlag || cryptsetup isLuks ${resolved} >/dev/null 2>&1; then
[ ${DEPRECATED_CRYPT} -eq 1 ] && warn_deprecated
dopassphrase=1
# If keyfile exists, try to use that