summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2017-10-06 14:15:43 +0200
committerDave Reisner <dreisner@archlinux.org>2017-10-06 21:18:06 +0200
commit5bba09cb1c661627fde76b977cfe9f937b1264a3 (patch)
tree2653ce5f7603f4389e32d95e33398d4a5aa2dda2
parentc99e8f6cc1e6f2aa08c667045c86608f86374a54 (diff)
downloadmkinitcpio-5bba09cb1c661627fde76b977cfe9f937b1264a3.tar.gz
mkinitcpio-5bba09cb1c661627fde76b977cfe9f937b1264a3.tar.xz
Restore addition of modules from config file
Broken by c5ad00c2. ref: https://bugs.archlinux.org/task/55870
-rw-r--r--functions11
1 files changed, 10 insertions, 1 deletions
diff --git a/functions b/functions
index 1486f2f..ba95e80 100644
--- a/functions
+++ b/functions
@@ -627,9 +627,18 @@ parse_config() {
map add_file "${FILES[@]}"
tee "$BUILDROOT/buildconfig" < "$1" | {
+ # When MODULES is not an array (but instead implicitly converted at
+ # startup), sourcing the config causes the string value of MODULES
+ # to be assigned as MODULES[0]. Avoid this by explicitly unsetting
+ # MODULES before re-sourcing the config.
+ unset MODULES
+
. /dev/stdin
- for mod in "${modules[@]%\?}"; do
+ # arrayize MODULES if necessary.
+ [[ ${MODULES@a} != *a* ]] && read -ra MODULES <<<"${MODULES//-/_}"
+
+ for mod in "${MODULES[@]%\?}"; do
mod=${mod//-/_}
# only add real modules (2 == builtin)
(( _addedmodules["$mod"] == 1 )) && add+=("$mod")