[arch-projects] [mkinitcpio][PATCH 12/19] init: correct trimming of earlymodules and MODULES
Dave Reisner
dreisner at archlinux.org
Sun May 13 13:57:15 EDT 2012
This never worked properly and only "fixed" the stupid bug that found
an edge case when either of these vars contains nothing more than a
single space.
Signed-off-by: Dave Reisner <dreisner at archlinux.org>
---
init | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/init b/init
index 8e9ad90..7cd812f 100644
--- a/init
+++ b/init
@@ -26,14 +26,11 @@ for d in ${disablehooks//,/ }; do
eval "hook_${d}=disabled"
done
-earlymodules=${earlymodules//,/ }
-if [ -n "${earlymodules## }" ]; then
- modprobe -qab ${earlymodules}
-fi
+[ -n "${earlymodules//[[:space:]]}" ] && modprobe -qab ${earlymodules//,/ }
. /config
-[ -n "${MODULES## }" ] && modprobe -qab $MODULES
+[ -n "${MODULES//[[:space:]]}" ] && modprobe -qab $MODULES
# If rootdelay is empty or not a non-negative integer, set it to 10
if [ -z "${rootdelay}" ] || ! [ "${rootdelay}" -ge 0 ]; then
--
1.7.10.2
More information about the arch-projects
mailing list