summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-09-24 16:22:19 +0200
committerDave Reisner <dreisner@archlinux.org>2012-09-30 00:06:09 +0200
commit4136ec05327471a986b8d4dfada5733c6927d79e (patch)
tree4e88509c73bdc392cf334630ceb398b1b7b44d00
parentcf4188d69685161a8a676bba25db5d6a92e9f3ab (diff)
downloadmkinitcpio-4136ec05327471a986b8d4dfada5733c6927d79e.tar.gz
mkinitcpio-4136ec05327471a986b8d4dfada5733c6927d79e.tar.xz
mkinitcpio: munge modules.order before calling depmod
The initramfs installs all modules to kernel/ which devalues the modules.order file. To avoid any edge cases with the wrong module being loaded (because all matching modules for a given alias will be added), make sure that the modules.order file is actually valid. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
-rwxr-xr-xmkinitcpio8
1 files changed, 7 insertions, 1 deletions
diff --git a/mkinitcpio b/mkinitcpio
index 7c9a48a..f92cc44 100755
--- a/mkinitcpio
+++ b/mkinitcpio
@@ -371,7 +371,13 @@ if (( ${#MODPATHS[*]} )); then
msg "Generating module dependencies"
install -m644 -t "$BUILDROOT/usr/lib/modules/$KERNELVERSION" \
- "$MODULEDIR"/modules.{builtin,order}
+ "$MODULEDIR"/modules.builtin
+
+ # we install all modules into kernel/, making the .order file incorrect
+ # for the module tree. munge it, so that we have an accurate index.
+ awk -F'/' '{ print "kernel/" $NF }' \
+ "$MODULEDIR"/modules.order >"$BUILDROOT/lib/modules/$KERNELVERSION/modules.order"
+
depmod -b "$BUILDROOT" "$KERNELVERSION"
# remove all non-binary module.* files (except devname for on-demand module loading)