[arch-projects] [mkinitcpio][PATCH 5/8] autodetect: check for rootfs module existance
Dave Reisner
d at falconindy.com
Thu Jan 5 14:26:11 EST 2012
Avoiding adding a filesystem module to the whitelist when it doesn't
actually exist as a module (in case its compiled in staticly).
Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
install/autodetect | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/install/autodetect b/install/autodetect
index c787fcb..abc0fa0 100644
--- a/install/autodetect
+++ b/install/autodetect
@@ -10,11 +10,16 @@ build() {
auto_modules | grep -xEv '(ata|ide)_generic' >"$MODULE_FILE"
- if ! rootfstype=$(findmnt -uno fstype "${BASEDIR:-/}" | tee -a "$MODULE_FILE"); then
+ if ! rootfstype=$(findmnt -uno fstype "${BASEDIR:-/}"); then
error "failed to detect root filesystem"
fs_autodetect_failed=1
fi
+ # filesystem module might be a builtin
+ if modinfo -k "$KERNELVERSION" "$rootfstype" &>/dev/null; then
+ printf '%s\n' "$rootfstype" >>"$MODULE_FILE"
+ fi
+
if (( UID == 0 )) || in_array 'disk' $(groups); then
if [[ -x $(type -P mdadm) ]]; then
mdadm -Esv /dev/[hrsv]d* /dev/{ida,cciss,ataraid,mapper}/* |
--
1.7.8.1
More information about the arch-projects
mailing list