diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-05-26 21:42:37 +0200 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-06-08 23:38:57 +0200 |
commit | 5b99f78331f567cc1442460efc054b72c45306a6 (patch) | |
tree | bcb81d6d16907d1ce3589b05bbc59a62a25276b1 | |
parent | 7965557b65883a6b91de61374764dab1fac778d4 (diff) | |
download | mkinitcpio-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>
-rw-r--r-- | functions | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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']# }" \ |