From 391a9b996934f1590fb663674ddbb1bff1cb60aa Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sat, 7 Apr 2012 17:17:50 -0400 Subject: [PATCH] Move ZFS binary check outside of commandline loop --- defaults/linuxrc | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index 9ac2c7c..4a16462 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -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