Fix boot failure in Dracut scripts.

mount-zfs.sh script incorrectly parsed results from zpool list.  Correct
bootfs attribute was only found on systems with a single pool or where
the bootable pool's name alphabetized to before all other pool names.
Boot failed when the bootable pool's name came after other pools
(IE 'rpool' and 'mypool' would fail to find bootfs on rpool.)

Patch correctly discards pools whose bootfs attribute is blank ('-').

Signed-off-by: Zachary Bedell <zac@thebedells.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #402
This commit is contained in:
Zachary Bedell 2011-09-17 23:42:43 -04:00 committed by Brian Behlendorf
parent f021fe194f
commit c39b2786ac
1 changed files with 2 additions and 2 deletions

View File

@ -18,13 +18,13 @@ case "$root" in
# Might be imported by the kernel module, so try searching before # Might be imported by the kernel module, so try searching before
# we import anything. # we import anything.
zfsbootfs=`zpool list -H -o bootfs | sed 'q'` zfsbootfs=`zpool list -H -o bootfs | sed -n '/-/ !p' | sed 'q'`
if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \ if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
[ "$zfsbootfs" = "no pools available" ] ; then [ "$zfsbootfs" = "no pools available" ] ; then
# Not there, so we need to import everything. # Not there, so we need to import everything.
info "ZFS: Attempting to import additional pools." info "ZFS: Attempting to import additional pools."
zpool import -N -a ${ZPOOL_FORCE} zpool import -N -a ${ZPOOL_FORCE}
zfsbootfs=`zpool list -H -o bootfs | sed 'q'` zfsbootfs=`zpool list -H -o bootfs | sed -n '/-/ !p' | sed 'q'`
if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \ if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
[ "$zfsbootfs" = "no pools available" ] ; then [ "$zfsbootfs" = "no pools available" ] ; then
rootok=0 rootok=0