Wrap dracut scripts to 79 chars
[zfs.git] / dracut / 90zfs / mount-zfs.sh
index a451bf9..49d6846 100755 (executable)
@@ -3,6 +3,7 @@
 . /lib/dracut-lib.sh
 
 ZPOOL_FORCE=""
+
 if getargbool 0 zfs_force -y zfs.force -y zfsforce ; then
        warn "ZFS: Will force-import pools if necessary."
        ZPOOL_FORCE="-f"
@@ -18,12 +19,14 @@ 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'`
-                       if [ "$zfsbootfs" = "" ] ; then
+                       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'`
-                               if [ "$zfsbootfs" = "" ] ; then
+                               if [ "$?" != "0" ] || [ "$zfsbootfs" = "" ] || \
+                                       [ "$zfsbootfs" = "no pools available" ] ; then
                                        rootok=0
                                        pool=""