diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2016-02-29 12:34:09 -0800 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2016-02-29 12:34:16 -0800 |
commit | c37d0daba2f264c72a945dcebd08e9a42d8649f7 (patch) | |
tree | 19db5a14f546ad295adf6c1c1df7ec2d55ac11a9 | |
parent | kconfig: disable CONFIG_FB_NVIDIA per bug #574358; obsolete with Nouveau (diff) | |
download | genkernel-c37d0daba2f264c72a945dcebd08e9a42d8649f7.tar.gz genkernel-c37d0daba2f264c72a945dcebd08e9a42d8649f7.tar.bz2 genkernel-c37d0daba2f264c72a945dcebd08e9a42d8649f7.zip |
fix rootfs detection per bug #552052
ZFS and btrfs tools if not explictly configured (either way), default to
detecting the fstype of the rootfs.
The old rootfs detection method was NOT reliable in all cases; so
replace it with a different way. Future improvements should check for
rootfs AND the local existence of the required binaries (and bail out
early if the the rootrfs was detected but the binaries are not present).
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | gen_cmdline.sh | 4 | ||||
-rwxr-xr-x | gen_funcs.sh | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/gen_cmdline.sh b/gen_cmdline.sh index 01adfdd..e9e7401 100755 --- a/gen_cmdline.sh +++ b/gen_cmdline.sh @@ -100,9 +100,9 @@ longusage() { echo " --no-dmraid Exclude DMRAID support" echo " --e2fsprogs Include e2fsprogs" echo " --no-e2fsprogs Exclude e2fsprogs" - echo " --zfs Include ZFS support" + echo " --zfs Include ZFS support (enabled by default if rootfs is zfs)" echo " --no-zfs Exclude ZFS support" - echo " --btrfs Include Btrfs support" + echo " --btrfs Include Btrfs support (enabled by default if rootfs is btrfs)" echo " --no-btrfs Exclude Btrfs support" echo " --multipath Include Multipath support" echo " --no-multipath Exclude Multipath support" diff --git a/gen_funcs.sh b/gen_funcs.sh index 37942ad..eb807ad 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -498,7 +498,9 @@ set_config_with_override() { rootfs_type_is() { local fstype=$1 - if $(df -t ${fstype} / 2>/dev/null 1>/dev/null) + # It is possible that the awk will return MULTIPLE lines, depending on your + # initramfs setup (one of the entries will be 'rootfs'). + if awk '($2=="/"){print $3}' /proc/mounts | grep -sq --line-regexp "$fstype" ; then echo yes else |