From 627f5117a3ec4b435e6ee85026a1da671de44c7b Mon Sep 17 00:00:00 2001 From: Garrett Fields Date: Thu, 6 Jun 2019 16:04:35 -0400 Subject: [PATCH] If $ZFS_BOOTFS contains guid, replace the guid portion with $pool Reviewed-by: George Melikov Reviewed-by: Richard Laager Signed-off-by: Garrett Fields Closes #8356 --- contrib/initramfs/scripts/zfs.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/initramfs/scripts/zfs.in b/contrib/initramfs/scripts/zfs.in index 36b7f436c1..ad604a82ce 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