zfsboottest.sh: correctly check and suggest value of vfs.root.mountfrom

... it was missing "zfs:" prefix.

Reported by:	theraven
MFC after:	10 days
This commit is contained in:
avg 2012-05-07 15:06:07 +00:00
parent 21b948097d
commit 4b75b9fd05

View File

@ -72,11 +72,11 @@ fi
# or vfs.root.mountfrom variable set in /boot/loader.conf.
egrep -q '^'"${bootfs}"'[[:space:]]+/[[:space:]]+zfs[[:space:]]+' "${mountpoint}/etc/fstab" 2>/dev/null
if [ $? -ne 0 ]; then
egrep -q 'vfs.root.mountfrom="?'"${bootfs}"'"?[[:space:]]*$' "${mountpoint}/boot/loader.conf" 2>/dev/null
egrep -q 'vfs.root.mountfrom="?'"zfs:${bootfs}"'"?[[:space:]]*$' "${mountpoint}/boot/loader.conf" 2>/dev/null
if [ $? -ne 0 ]; then
echo "To be able to boot from \"${bootfs}\", you need to declare" >&2
echo "\"${bootfs}\" as being root file system in ${mountpoint}/etc/fstab" >&2
echo "or add \"vfs.root.mountfrom\" variable set to \"${bootfs}\" to" >&2
echo "or add \"vfs.root.mountfrom\" variable set to \"zfs:${bootfs}\" to" >&2
echo "${mountpoint}/boot/loader.conf." >&2
exit 1
fi