aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Yao <ryao@gentoo.org>2014-03-15 15:26:44 -0400
committerRichard Yao <ryao@gentoo.org>2014-03-15 20:23:20 -0400
commit56505d81c2a1354d5cf06c7cce052f88bd97bf69 (patch)
tree68f045875358dc17c1847eb82c6631c7d57fa99d
parentRecord hostid into initramfs (diff)
downloadgenkernel-56505d81c2a1354d5cf06c7cce052f88bd97bf69.tar.gz
genkernel-56505d81c2a1354d5cf06c7cce052f88bd97bf69.tar.bz2
genkernel-56505d81c2a1354d5cf06c7cce052f88bd97bf69.zip
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@gentoo.org>
-rwxr-xr-xgen_funcs.sh11
1 files changed, 11 insertions, 0 deletions
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