summaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-05-26 21:42:37 +0200
committerDave Reisner <dreisner@archlinux.org>2012-06-08 23:38:57 +0200
commit5b99f78331f567cc1442460efc054b72c45306a6 (patch)
treebcb81d6d16907d1ce3589b05bbc59a62a25276b1 /functions
parent7965557b65883a6b91de61374764dab1fac778d4 (diff)
downloadmkinitcpio-5b99f78331f567cc1442460efc054b72c45306a6.tar.gz
mkinitcpio-5b99f78331f567cc1442460efc054b72c45306a6.tar.xz
functions: avoid adding nonexistant modules to config
If we didn't actually add a module to the image, avoid adding it to the runtime config for probing. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'functions')
-rw-r--r--functions8
1 files changed, 6 insertions, 2 deletions
diff --git a/functions b/functions
index 262a08a..14c6637 100644
--- a/functions
+++ b/functions
@@ -590,8 +590,12 @@ write_image_config() {
. "$CONFIG"
# sanitize of any extra whitespace
- read -r -a modules <<< "$MODULES"
- (( ${#modules[*]} )) && printf 'MODULES="%s"\n' "${modules[*]%\?}"
+ read -ra modules <<< "$MODULES"
+ for mod in "${modules[@]}"; do
+ in_array "${mod%\?}" "${ADDED_MODULES[@]}" || continue
+ add+=("${mod%\?}")
+ done
+ (( ${#add[*]} )) && printf 'MODULES="%s"\n' "${add[*]}"
printf '%s="%s"\n' \
'EARLYHOOKS' "${RUNHOOKS['early']# }" \