Move ZFS binary check outside of commandline loop
authorRichard Yao <ryao@cs.stonybrook.edu>
Sat, 7 Apr 2012 21:17:50 +0000 (17:17 -0400)
committerSebastian Pipping <sebastian@pipping.org>
Thu, 12 Apr 2012 04:08:44 +0000 (06:08 +0200)
defaults/linuxrc

index 9ac2c7cca96a62f0339fcc0efde773893cd05738..4a16462994e404245815d0955d45a2c99b8e9705 100755 (executable)
@@ -97,16 +97,11 @@ do
                        USE_DMRAID_NORMAL=1
                ;;
                dozfs*)
-                       if [ ! -x /sbin/zfs ]; then
-                               USE_ZFS=0
-                               bad_msg 'zfs binary not found: aborting use of zfs!'
-                       else
-                               USE_ZFS=1
-                               MY_HWOPTS="${MY_HWOPTS} zfs"
-                               if [ "${x#*=}" = 'force' ]
-                               then
-                                       ZPOOL_FORCE=-f
-                               fi
+                       USE_ZFS=1
+                       MY_HWOPTS="${MY_HWOPTS} zfs"
+                       if [ "${x#*=}" = 'force' ]
+                       then
+                               ZPOOL_FORCE=-f
                        fi
                ;;
                # Debug Options
@@ -253,6 +248,14 @@ then
        REAL_ROOT="${FAKE_ROOT}"
 fi
 
+# Disable ZFS when support is missing
+if [ "USE_ZFS" = "1" -a ! -x /sbin/zfs ]
+then
+       USE_ZFS=0
+       MY_HWOPTS=$(echo ${MY_HWOPTS} | sed -e 's/ zfs//g')
+       bad_msg 'zfs binary not found: aborting use of zfs!'
+fi
+
 splash 'init'
 
 cmdline_hwopts