tinyramfs/hooks/luks/luks.init

22 lines
515 B
Plaintext
Raw Normal View History

# 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
# shellcheck disable=2068
2020-09-11 01:23:39 +05:30
[ "$break" = luks ] && { print "break before luks.init"; sh; }
2020-09-11 01:23:39 +05:30
export DM_DISABLE_UDEV=1
mkdir -p /run/cryptsetup
2020-09-11 01:23:39 +05:30
resolve_device "$luks_root"
2020-09-11 01:23:39 +05:30
set -- \
"${luks_discard:+--allow-discards}" "${luks_header:+--header $luks_header}" \
"${luks_key:+-d $luks_key}" "$device" "${luks_name:-crypt-${device##*/}}"
cryptsetup open $@ || panic "failed to unlock LUKS"