Skip to content

Commit

Permalink
If $ZFS_BOOTFS contains guid, replace the guid portion with $pool
Browse files Browse the repository at this point in the history
Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Richard Laager <rlaager@wiktel.com>
Signed-off-by: Garrett Fields <ghfields@gmail.com>
Closes #8356
  • Loading branch information
ghfields authored and behlendorf committed Jun 7, 2019
1 parent 35050ef commit 9fd95a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion contrib/initramfs/scripts/zfs.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 9fd95a2

Please sign in to comment.