aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/initramfs
diff options
context:
space:
mode:
authorGarrett Fields <[email protected]>2019-06-06 16:04:35 -0400
committerBrian Behlendorf <[email protected]>2019-06-06 13:04:35 -0700
commit627f5117a3ec4b435e6ee85026a1da671de44c7b (patch)
tree21d82cf9db8a0741c0dadd6243e10889003f6bd1 /contrib/initramfs
parent3ce85b5e604e92c421a7975f9f64607cc98131fc (diff)
If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
Reviewed-by: George Melikov <[email protected]> Reviewed-by: Richard Laager <[email protected]> Signed-off-by: Garrett Fields <[email protected]> Closes #8356
Diffstat (limited to 'contrib/initramfs')
-rw-r--r--contrib/initramfs/scripts/zfs.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/contrib/initramfs/scripts/zfs.in b/contrib/initramfs/scripts/zfs.in
index 36b7f436c..ad604a82c 100644
--- a/contrib/initramfs/scripts/zfs.in
+++ b/contrib/initramfs/scripts/zfs.in
@@ -878,7 +878,9 @@ mountroot()
pool="$("${ZPOOL}" get name,guid -o name,value -H | \
awk -v pool="${ZFS_RPOOL}" '$2 == pool { print $1 }')"
if [ -n "$pool" ]; then
- ZFS_BOOTFS="${pool}/${ZFS_BOOTFS#*/}"
+ # If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
+ ZFS_BOOTFS=$(echo "$ZFS_BOOTFS" | \
+ sed -e "s/$("${ZPOOL}" get guid -o value "$pool" -H)/$pool/g")
ZFS_RPOOL="${pool}"
fi