From 09af3c9bf3e549edc650c41393ed6bdbb56a8248 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sun, 1 Jan 2012 14:53:20 -0500 Subject: autodetect: check for rootfs module existance 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 --- install/autodetect | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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}/* | -- cgit v1.2.3-24-g4f1b