2020-06-28 09:28:57 +05:30
|
|
|
# vim: set ft=sh:
|
2020-07-03 21:19:09 +05:30
|
|
|
# shellcheck shell=sh
|
|
|
|
#
|
|
|
|
# false positive
|
|
|
|
# shellcheck disable=2154
|
|
|
|
#
|
|
|
|
# word splitting is safe by design
|
2020-09-07 12:24:12 +05:30
|
|
|
# shellcheck disable=2068
|
2020-06-28 09:28:57 +05:30
|
|
|
{
|
|
|
|
[ "$break" = luks ] && { print "break before unlock_luks()"; sh; }
|
|
|
|
|
2020-09-07 12:24:12 +05:30
|
|
|
export DM_DISABLE_UDEV=1
|
2020-06-28 09:28:57 +05:30
|
|
|
mkdir -p /run/cryptsetup
|
|
|
|
|
|
|
|
resolve_device "$luks_root"
|
|
|
|
|
|
|
|
set -- \
|
2020-09-07 12:24:12 +05:30
|
|
|
"${luks_discard:+--allow-discards}" "${luks_header:+--header $luks_header}" \
|
|
|
|
"${luks_key:+-d $luks_key}" "$device" "${luks_name:-crypt-${device##*/}}"
|
2020-06-28 09:28:57 +05:30
|
|
|
|
|
|
|
cryptsetup open $@ || panic "failed to unlock LUKS"
|
|
|
|
}
|