. /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"
# 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=""