]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: install all depmod relevant configuration files
authorHarald Hoyer <harald@redhat.com>
Tue, 4 May 2021 09:42:46 +0000 (11:42 +0200)
committerHarald Hoyer <harald@hoyer.xyz>
Tue, 4 May 2021 11:15:49 +0000 (13:15 +0200)
This is important for running `depmod` in the initrd.

dracut.sh
modules.d/90kernel-modules/module-setup.sh

index 36af5d86ab7490d8ada961e25e109ff5ac223abf..cb1388914a2c3db54ddb7629759453a3bdf4f8e6 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1760,6 +1760,17 @@ if ! [[ -d $dracutsysrootdir$tmpfilesdir ]]; then
     [[ -d $dracutsysrootdir/usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
 fi
 
+[[ -d $dracutsysrootdir$depmodd ]] \
+    || sysctld=$(pkg-config libkmod --variable=depmodd 2> /dev/null)
+
+[[ -d $dracutsysrootdir$depmodd ]] || depmodd=/usr/lib/depmod.d
+
+[[ -d $dracutsysrootdir$depmodconfdir ]] \
+    || sysctlconfdir=$(pkg-config libkmod --variable=depmodconfdir 2> /dev/null)
+
+[[ -d $dracutsysrootdir$depmodconfdir ]] || depmodconfdir=/etc/depmod.d
+
+
 export initdir dracutbasedir \
     dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
     mods_to_load \
@@ -1776,7 +1787,7 @@ export initdir dracutbasedir \
     modulesloadconfdir sysctl sysctlconfdir sysusers sysusersconfdir \
     systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \
     systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \
-    hostonly_cmdline loginstall tmpfilesdir
+    hostonly_cmdline loginstall tmpfilesdir depmodd depmodconfdir
 
 mods_to_load=""
 # check all our modules to see if they should be sourced.
index b3c91f21bc97a27173356659ba2dd61dad79df57..499fc066ad812bfcd0a7e7ee05950a0a8183da35 100755 (executable)
@@ -128,6 +128,11 @@ installkernel() {
         hostonly='' instmods "=crypto"
         instmods "=arch/$arch/crypto" "=drivers/crypto"
     fi
+
+    inst_multiple -o "$depmodd/*.conf"
+    if [[ $hostonly ]]; then
+        inst_multiple -H -o "$depmodconfdir/*.conf"
+    fi
     :
 }