commit:     56505d81c2a1354d5cf06c7cce052f88bd97bf69
Author:     Richard Yao <ryao <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 15 19:26:44 2014 +0000
Commit:     Richard Yao <ryao <AT> gentoo <DOT> 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 <ryao <AT> 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

Reply via email to