2020-06-28 06:58:57 +03:00
|
|
|
# vim: set ft=sh:
|
2020-07-03 18:49:09 +03:00
|
|
|
# shellcheck shell=sh
|
|
|
|
#
|
2021-07-31 20:20:16 +03:00
|
|
|
# https://shellcheck.net/wiki/SC2154
|
2020-07-03 18:49:09 +03:00
|
|
|
# shellcheck disable=2154
|
2020-06-28 06:58:57 +03:00
|
|
|
|
2020-09-10 22:53:39 +03:00
|
|
|
mkdir -p /run/cryptsetup
|
2020-06-28 06:58:57 +03:00
|
|
|
|
2020-09-10 22:53:39 +03:00
|
|
|
resolve_device "$luks_root"
|
2020-06-28 06:58:57 +03:00
|
|
|
|
2021-05-10 14:23:34 +03:00
|
|
|
DM_DISABLE_UDEV=1 cryptsetup open \
|
2021-06-24 04:16:27 +03:00
|
|
|
${luks_discard:+--allow-discards} \
|
2021-07-04 15:53:47 +03:00
|
|
|
${luks_header:+--header="$luks_header"} \
|
|
|
|
${luks_key:+--key-file="$luks_key"} -- "$device" \
|
2021-05-10 14:23:34 +03:00
|
|
|
"${luks_name:-crypt-${device##*/}}" || panic "failed to unlock LUKS"
|