From be9a42675f3ea125c9daa45986a3b58ba8bae226 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Tue, 21 Feb 2012 16:47:56 -0500 Subject: autodetect: resolve guessed filesystem modules Trading out modinfo for modprobe allows us to detect filesystems like ext2 and ext3 which might be aliased to ext4 in the case of Kconfig CONFIG_EXT4_USE_FOR_EXT23 being enabled. Maybe this catches other insane corner cases, too. Since we now treat this as possible aliases, we also need to be mindful of the fact that it could resolve to multiple module names. Assign the output as an array to respect this. Fixes FS#28569. Signed-off-by: Dave Reisner --- install/autodetect | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/install/autodetect b/install/autodetect index 5cc908c..cc12124 100644 --- a/install/autodetect +++ b/install/autodetect @@ -7,8 +7,14 @@ build() { MODULE_FILE=$workdir/autodetect_modules add_if_avail() { - if modinfo -k "$KERNELVERSION" "$1" &>/dev/null; then - printf '%s\n' "$1" >>"$MODULE_FILE" + local resolved + + # treat this as an alias, since ext3 might be aliased to ext4. + IFS=$'\n' read -rd '' -a resolved < \ + <(modprobe -S "$KERNELVERSION" -R "$1" 2>/dev/null) + + if (( ${#resolved[*]} )); then + printf '%s\n' "${resolved[@]}" >>"$MODULE_FILE" fi } -- cgit v1.2.3-24-g4f1b