parent
a468c11a30
commit
ed509c72a6
18
hook/zfs/zfs
Normal file
18
hook/zfs/zfs
Normal file
@ -0,0 +1,18 @@
|
||||
# vim: set ft=sh:
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# https://shellcheck.net/wiki/SC2154
|
||||
# shellcheck disable=2154
|
||||
|
||||
[ "$zfs_key" ] && {
|
||||
copy_file "${zfs_key#*=}" /root/zfs_key 0400
|
||||
|
||||
sed "s|${zfs_key#*=}|/root/zfs_key|" \
|
||||
"${tmpdir}/etc/tinyramfs/config" > "${tmpdir}/_"
|
||||
|
||||
mv "${tmpdir}/_" "${tmpdir}/etc/tinyramfs/config"
|
||||
}
|
||||
|
||||
copy_kmod zfs
|
||||
copy_exec zfs
|
||||
copy_exec zpool
|
16
hook/zfs/zfs.init
Normal file
16
hook/zfs/zfs.init
Normal file
@ -0,0 +1,16 @@
|
||||
# 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
|
||||
zfs load-key -L "file://${zfs_key}" "$root"
|
||||
elif [ "$(zfs get -Ho value encryption "$root")" != off ]; then
|
||||
zfs load-key -L prompt "$root"
|
||||
fi
|
Loading…
Reference in New Issue
Block a user