From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-598143-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 90EE3138202
	for <garchives@archives.gentoo.org>; Sun,  9 Jun 2013 13:40:43 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 649ABE0825;
	Sun,  9 Jun 2013 13:40:41 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id D01CCE0822
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 Jun 2013 13:40:40 +0000 (UTC)
Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163])
	(using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id E755D33E35A
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 Jun 2013 13:40:39 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 965E4E545F
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 Jun 2013 13:40:38 +0000 (UTC)
From: "Richard Yao" <ryao@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Richard Yao" <ryao@gentoo.org>
Message-ID: <1370785197.a33f93c174b67cb766c2b4af39b02ecb6584a76e.ryao@gentoo>
Subject: [gentoo-commits] proj/genkernel:ryao commit in: defaults/
X-VCS-Repository: proj/genkernel
X-VCS-Files: defaults/linuxrc
X-VCS-Directories: defaults/
X-VCS-Committer: ryao
X-VCS-Committer-Name: Richard Yao
X-VCS-Revision: a33f93c174b67cb766c2b4af39b02ecb6584a76e
X-VCS-Branch: ryao
Date: Sun,  9 Jun 2013 13:40:38 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: 66a2ba0b-1e90-43ff-9088-01626286cb08
X-Archives-Hash: 4bee6f0695ec1d0bdf98a9f674219483

commit:     a33f93c174b67cb766c2b4af39b02ecb6584a76e
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  9 11:36:43 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Sun Jun  9 13:39:57 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=a33f93c1

Refactor ZFS module load hook

Signed-off-by: Richard Yao <ryao <AT> gentoo.org>

---
 defaults/linuxrc | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/defaults/linuxrc b/defaults/linuxrc
index 9ea305b..3784456 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'