dracut/zfs-load-key.sh: properly remove prefixes

Removes the 'ZFS=' prefix from $BOOTFS instead of $root. This makes sure
that the 'zfs:' prefix remains stripped so that users with
'root=zfs:dataset' cmdline can have key loaded on boot again.

Reviewed-by: Garrett Fields <ghfields@gmail.com>
Reviewed-by: Dacian Reece-Stremtan <dacianstremtan@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Hiếu Lê <leorize+oss@disroot.org>
Closes #9520
This commit is contained in:
alaviss 2019-10-30 21:38:41 +00:00 committed by Tony Hutter
parent 123aa2fc14
commit 5187a14f54

View File

@ -30,7 +30,7 @@ if [ "${root}" = "zfs:AUTO" ] ; then
BOOTFS="$(zpool list -H -o bootfs | awk '$1 != "-" {print; exit}')" BOOTFS="$(zpool list -H -o bootfs | awk '$1 != "-" {print; exit}')"
else else
BOOTFS="${root##zfs:}" BOOTFS="${root##zfs:}"
BOOTFS="${root##ZFS=}" BOOTFS="${BOOTFS##ZFS=}"
fi fi
# if pool encryption is active and the zfs command understands '-o encryption' # if pool encryption is active and the zfs command understands '-o encryption'