From 6c0e6f6ee6c2fccd26ce1a2448ec7999c5f1eb22 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sun, 9 Jun 2013 07:36:43 -0400 Subject: [PATCH] Refactor ZFS module load hook Signed-off-by: Richard Yao --- defaults/linuxrc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/defaults/linuxrc b/defaults/linuxrc index 4fb241b..5bc70a3 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -290,16 +290,17 @@ esac # Verify that it is safe to use ZFS if [ "USE_ZFS" = "1" ] then - if [ -x /sbin/zfs -a -x /sbin/zpool ] - then - MY_HWOPTS="${MY_HWOPTS} zfs" - else - USE_ZFS=0 + for i in /sbin/zfs /sbin/zpool + do + if [ ! -x ${i} ] + then + USE_ZFS=0 + bad_msg 'Aborting use of zfs because ${i} not found!' + break + fi + done - [ -x /sbin/zfs ] || bad_msg '/sbin/zfs not found!' - [ -x /sbin/zpool ] || bad_msg '/sbin/zpool not found!' - bad_msg 'Aborting use of zfs!' - fi + [ "USE_ZFS" = "1" ] && MY_HWOPTS="${MY_HWOPTS} zfs" fi cmdline_hwopts