From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 2AF5D1391DB for ; Sun, 16 Mar 2014 00:26:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 91CECE0AD0; Sun, 16 Mar 2014 00:26:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EFEB7E0AD3 for ; Sun, 16 Mar 2014 00:26:24 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1C70533F922 for ; Sun, 16 Mar 2014 00:26:24 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 17961188EB for ; Sun, 16 Mar 2014 00:26:22 +0000 (UTC) From: "Richard Yao" 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" Message-ID: <1394929400.56505d81c2a1354d5cf06c7cce052f88bd97bf69.ryao@gentoo> Subject: [gentoo-commits] proj/genkernel:master commit in: / X-VCS-Repository: proj/genkernel X-VCS-Files: gen_funcs.sh X-VCS-Directories: / X-VCS-Committer: ryao X-VCS-Committer-Name: Richard Yao X-VCS-Revision: 56505d81c2a1354d5cf06c7cce052f88bd97bf69 X-VCS-Branch: master Date: Sun, 16 Mar 2014 00:26:22 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 8a27d110-43d8-46f4-bdee-f24a52561352 X-Archives-Hash: 662c7f85651ae66720f0b1fe66f5774e commit: 56505d81c2a1354d5cf06c7cce052f88bd97bf69 Author: Richard Yao gentoo org> AuthorDate: Sat Mar 15 19:26:44 2014 +0000 Commit: Richard Yao gentoo org> CommitDate: Sun Mar 16 00:23:20 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/genkernel.git;a=commit;h=56505d81 Create rootfs_type_is() helper function This is meant to facilite automatic detection of root filesystems that require additional support. The main one being ZFS, but btrfs will also qualify once support has been added. Signed-off-by: Richard Yao gentoo.org> --- gen_funcs.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gen_funcs.sh b/gen_funcs.sh index 4f0a0fc..37942ad 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -495,6 +495,17 @@ set_config_with_override() { eval ${CfgVar}=\"${Result}\" } +rootfs_type_is() { + local fstype=$1 + + if $(df -t ${fstype} / 2>/dev/null 1>/dev/null) + then + echo yes + else + echo no + fi +} + check_distfiles() { for i in $BUSYBOX_SRCTAR $MULTIPATH_SRCTAR $LVM_SRCTAR $DMRAID_SRCTAR $ISCSI_SRCTAR $GPG_SRCTAR do