From: Garrett Fields Date: Thu, 6 Jun 2019 20:04:35 +0000 (-0400) Subject: If $ZFS_BOOTFS contains guid, replace the guid portion with $pool X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=627f5117a3ec4b435e6ee85026a1da671de44c7b;p=zfs 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 --- 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