Skip to content

Commit 50a01dd

Browse files
committed
fix: install all depmod relevant configuration files
This is important for running `depmod` in the initrd.
1 parent 87c4c17 commit 50a01dd

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

dracut.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,17 @@ if ! [[ -d $dracutsysrootdir$tmpfilesdir ]]; then
17601760
[[ -d $dracutsysrootdir/usr/lib/tmpfiles.d ]] && tmpfilesdir=/usr/lib/tmpfiles.d
17611761
fi
17621762
1763+
[[ -d $dracutsysrootdir$depmodd ]] \
1764+
|| sysctld=$(pkg-config libkmod --variable=depmodd 2> /dev/null)
1765+
1766+
[[ -d $dracutsysrootdir$depmodd ]] || depmodd=/usr/lib/depmod.d
1767+
1768+
[[ -d $dracutsysrootdir$depmodconfdir ]] \
1769+
|| sysctlconfdir=$(pkg-config libkmod --variable=depmodconfdir 2> /dev/null)
1770+
1771+
[[ -d $dracutsysrootdir$depmodconfdir ]] || depmodconfdir=/etc/depmod.d
1772+
1773+
17631774
export initdir dracutbasedir \
17641775
dracutmodules force_add_dracutmodules add_dracutmodules omit_dracutmodules \
17651776
mods_to_load \
@@ -1776,7 +1787,7 @@ export initdir dracutbasedir \
17761787
modulesloadconfdir sysctl sysctlconfdir sysusers sysusersconfdir \
17771788
systemdutildir systemdutilconfdir systemdcatalog systemdntpunits \
17781789
systemdntpunitsconfdir systemdsystemunitdir systemdsystemconfdir \
1779-
hostonly_cmdline loginstall tmpfilesdir
1790+
hostonly_cmdline loginstall tmpfilesdir depmodd depmodconfdir
17801791
17811792
mods_to_load=""
17821793
# check all our modules to see if they should be sourced.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@ installkernel() {
128128
hostonly='' instmods "=crypto"
129129
instmods "=arch/$arch/crypto" "=drivers/crypto"
130130
fi
131+
132+
inst_multiple -o "$depmodd/*.conf"
133+
if [[ $hostonly ]]; then
134+
inst_multiple -H -o "$depmodconfdir/*.conf"
135+
fi
131136
:
132137
}
133138

0 commit comments

Comments
 (0)