From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-598147-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 BBDFD1381F3
	for <garchives@archives.gentoo.org>; Sun,  9 Jun 2013 13:48:30 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1F7DFE0825;
	Sun,  9 Jun 2013 13:48:30 +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 92B2DE0822
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 Jun 2013 13:48:29 +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 AE7A433E1C6
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 Jun 2013 13:48:28 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by hornbill.gentoo.org (Postfix) with ESMTP id 56B47E468F
	for <gentoo-commits@lists.gentoo.org>; Sun,  9 Jun 2013 13:48:27 +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: <1370785659.3851e0653f342668e7911d58c0214dcea6d61b3c.ryao@gentoo>
Subject: [gentoo-commits] proj/genkernel:master commit in: /
X-VCS-Repository: proj/genkernel
X-VCS-Files: gen_initramfs.sh
X-VCS-Directories: /
X-VCS-Committer: ryao
X-VCS-Committer-Name: Richard Yao
X-VCS-Revision: 3851e0653f342668e7911d58c0214dcea6d61b3c
X-VCS-Branch: master
Date: Sun,  9 Jun 2013 13:48:27 +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: dd90514c-458e-4724-aa49-c6d4ceba281d
X-Archives-Hash: cb63c7134062cd7d9798e96a6892ff4a
Message-ID: <20130609134827.1nEcT3xyZj0X0a_iQE5o9PO3EiYtk8Mzkl59r5niaRI@z>

commit:     3851e0653f342668e7911d58c0214dcea6d61b3c
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sun Jun  9 07:56:57 2013 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> org>
CommitDate: Sun Jun  9 13:47:39 2013 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=3851e065

Eliminate warnings about missing ZFS files

zpool.cache and zdev.conf are optional files, so instead of warning when
they are missing, we print a message when they are copied.

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

---
 gen_initramfs.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/gen_initramfs.sh b/gen_initramfs.sh
index 745e15a..9b354a4 100755
--- a/gen_initramfs.sh
+++ b/gen_initramfs.sh
@@ -424,13 +424,17 @@ append_zfs(){
 		rm -r "${TEMP}/initramfs-zfs-temp"
 	fi
 
-	mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs/"
+	mkdir -p "${TEMP}/initramfs-zfs-temp/etc/zfs"
 
 	# Copy files to /etc/zfs
-	for i in /etc/zfs/{zdev.conf,zpool.cache}
+	for i in zdev.conf zpool.cache
 	do
-		cp -a "${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \
-			|| print_warning 1 "Could not copy file ${i} for ZFS"
+		if [ -f /etc/zfs/${i} ]
+		then
+			print_info 1 "        >> Including ${i}"
+			cp -a "/etc/zfs/${i}" "${TEMP}/initramfs-zfs-temp/etc/zfs" 2> /dev/null \
+				|| gen_die "Could not copy file ${i} for ZFS"
+		fi
 	done
 
 	# Copy binaries