From 56505d81c2a1354d5cf06c7cce052f88bd97bf69 Mon Sep 17 00:00:00 2001 From: Richard Yao Date: Sat, 15 Mar 2014 15:26:44 -0400 Subject: 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 --- gen_funcs.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gen_funcs.sh b/gen_funcs.sh index 4f0a0fc2..37942ad9 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 -- cgit v1.2.3-65-gdbad