]> granicus.if.org Git - zfs/commitdiff
If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
authorGarrett Fields <ghfields@gmail.com>
Thu, 6 Jun 2019 20:04:35 +0000 (16:04 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 6 Jun 2019 20:04:35 +0000 (13:04 -0700)
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Garrett Fields <ghfields@gmail.com>
Closes #8356

contrib/initramfs/scripts/zfs.in

index 36b7f436c1f1cef8578f81b349ce29b0dcf2fffe..ad604a82ce526750d2f44aad56594ad5e3d4c9ca 100644 (file)
@@ -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