diff options
author | Richard Yao <ryao@gentoo.org> | 2013-06-09 07:36:43 -0400 |
---|---|---|
committer | Richard Yao <ryao@cs.stonybrook.edu> | 2013-06-09 09:47:39 -0400 |
commit | c2da0c02efadf7d3b70f71ed2acb53ad4e735a75 (patch) | |
tree | a1fb48bccef82e84de6667a2b0025731fec07729 | |
parent | Eliminate warnings about missing ZFS files (diff) | |
download | genkernel-c2da0c02efadf7d3b70f71ed2acb53ad4e735a75.tar.gz genkernel-c2da0c02efadf7d3b70f71ed2acb53ad4e735a75.tar.bz2 genkernel-c2da0c02efadf7d3b70f71ed2acb53ad4e735a75.zip |
Refactor ZFS module load hook
Signed-off-by: Richard Yao <ryao@gentoo.org>
-rw-r--r-- | defaults/linuxrc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/defaults/linuxrc b/defaults/linuxrc index 9ea305b0..37844562 100644 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -298,16 +298,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 splash 'init' |