2021-07-31 22:51:52 +05:30
|
|
|
# vim: set ft=sh:
|
|
|
|
# shellcheck shell=sh
|
|
|
|
#
|
|
|
|
# https://shellcheck.net/wiki/SC2154
|
|
|
|
# shellcheck disable=2154
|
|
|
|
|
|
|
|
modprobe zfs 2> /dev/null
|
|
|
|
|
|
|
|
resolve_device "$zfs_root"
|
|
|
|
zpool import -Nd "$device" "${root%%/*}"
|
|
|
|
|
|
|
|
if [ "$zfs_key" ]; then
|
2022-03-21 09:58:02 +05:30
|
|
|
zfs load-key -L prompt -a < "$zfs_key"
|
2021-07-31 22:51:52 +05:30
|
|
|
elif [ "$(zfs get -Ho value encryption "$root")" != off ]; then
|
2022-03-21 09:58:02 +05:30
|
|
|
zfs load-key -L prompt -a
|
2021-07-31 22:51:52 +05:30
|
|
|
fi
|