Fix boot failure in Dracut scripts.
[zfs.git] / dracut / 90zfs / mount-zfs.sh.in
index 49d6846..2d2afd8 100755 (executable)
@@ -18,13 +18,13 @@ case "$root" in
 
                        # Might be imported by the kernel module, so try searching before
                        # 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" = "" ] || \
                                [ "$zfsbootfs" = "no pools available" ] ; then
                                # Not there, so we need to import everything.
                                info "ZFS: Attempting to import additional pools."
                                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" = "" ] || \
                                        [ "$zfsbootfs" = "no pools available" ] ; then
                                        rootok=0