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 Brian Behlendorf
parent f63e2fe132
commit 936e2d6d3e
1 changed files with 1 additions and 1 deletions

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'