summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--functions3
-rwxr-xr-xmkinitcpio5
2 files changed, 6 insertions, 2 deletions
diff --git a/functions b/functions
index 314748f..ac7da7e 100644
--- a/functions
+++ b/functions
@@ -167,7 +167,8 @@ add_module() {
return 1
fi
- _add_file "${path#$BASEDIR}" "$path" 644
+ # aggregate modules and add them all at once to save some forks
+ MODPATHS+=("$path")
ADDED_MODULES+=("${module//-/_}")
# explicit module depends
diff --git a/mkinitcpio b/mkinitcpio
index fb705e1..dec139b 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -25,7 +25,7 @@ COMPRESSION=gzip
declare TMPDIR BASEDIR MODULE_FILE GENIMG PRESET COMPRESSION_OPTIONS BUILDROOT
declare NC= BOLD= BLUE= GREEN= RED= YELLOW=
declare -i QUIET=1 SHOW_AUTOMODS=0 SAVELIST=0 COLOR=1
-declare -a SKIPHOOKS ADDED_MODULES
+declare -a SKIPHOOKS ADDED_MODULES MODPATHS
# Add /{,usr}/sbin to path
# works around undetected problems like in #8448
@@ -323,6 +323,9 @@ set +E
trap ERR
if (( ${#ADDED_MODULES[*]} )); then
+ mkdir -p "${MODPATHS[@]%/*}"
+ cp --parents "${MODPATHS[@]}" "$BUILDROOT"
+
msg "Generating module dependencies"
/sbin/depmod -b "${TMPDIR}/root" "${KERNELVERSION}"
rm "$BUILDROOT/lib/modules/$KERNELVERSION"/modules.!(dep.bin|alias.bin|symbols.bin)