properly handle user specified modules

This commit is contained in:
illiliti
2020-04-17 20:41:54 +03:00
parent 55fe9abfdc
commit 9f9ed09508
2 changed files with 16 additions and 9 deletions

View File

@@ -70,6 +70,8 @@ prepare_environment()
ln -s /proc/self/fd/2 /dev/stderr
trap 'panic "something went wrong"' EXIT
[ "$modules" ] && modprobe -a "$modules"
}
parse_cmdline()
@@ -147,10 +149,8 @@ unlock_luks()
set -- \
"--disable-locks" \
"$luks_key" \
"$luks_header" \
"$luks_discard" \
"$device" \
"$luks_key" "$luks_header" \
"$luks_discard" "$device" \
"${luks_name:-luks-${device##*/}}"
cryptsetup open $@ || panic "failed to unlock LUKS"