Skip to content

Commit

Permalink
linux-mod-r1.eclass: disable depmod.d files
Browse files Browse the repository at this point in the history
These cause no issues with depmod itself, but dracut has the
funny idea to parse /lib/depmod.d files manually in its
90kernel-modules-extra/module-setup.sh and decides to include
modules that are overriden even though they are not needed in
early boot (increasing size, perhaps by as much as 90MB if
nvidia got included).

By disabling we're back to potentially loading stale
UNINSTALL_IGNORE'ed modules, but would rather keep the status
quo than introduce different issues (or at least for now),
especially considering dracut has become widely used on Gentoo.

Note there's no real need to revbump all modules to omit
these files given:
1) has not existed for that long, and is mostly in ~arch
2) will be cleaned on kernel upgrade + modules rebuild
3) initramfs will not include extra modules unless it
   is ran *after* the modules were rebuilt which is
   atypical except for zfs-kmod (in case of zfs-kmod
   we want to include modules either way)
4) users that rebuild their initramfs after out-of-tree modules
   likely rebuild everytime as-is (avoids stale modules)
5) "most" modules are harmless to include unless large or being
   API sensitive and the user does not upgrade their kernel

Primary issue can be with nvidia-drivers in a scenario such as:
1. build kernel
2. build nvidia
3. build initramfs *after* nvidia (gets included, while
   wouldn't without the depmod.d)
4. build new nvidia-drivers version
5. don't rebuild initramfs
6. get API mismatch if nvidia.ko got loaded during initramfs
  (typically happens even if not using the display yet)
Non-issue if the initramfs was built in step 1, unless nvidia
modules were already installed for that kernel version like
a gentoo-kernel revbump that did not trigger dist-kernel rebuilds.

As a precaution, will still revbump nvidia-drivers given these
are already using this in stable.

Signed-off-by: Ionen Wolkens <[email protected]>
  • Loading branch information
ionenwks committed Jun 5, 2023
1 parent 10c878e commit cd28886
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion eclass/linux-mod-r1.eclass
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,11 @@ modules_post_process() {
(( ${#mods[@]} )) ||
die "${FUNCNAME[0]} was called with no installed modules under ${path}"

_modules_process_depmod.d "${mods[@]#"${path}/"}"
# TODO?: find way for sane use with dracut (its 90kernel-modules-extra
# parses depmod.d files directly and assumes should include its modules
# which can lead to unnecessarily increased size or stale modules)
# _modules_process_depmod.d "${mods[@]#"${path}/"}"

_modules_process_strip "${mods[@]}"
_modules_process_sign "${mods[@]}"
_modules_sanity_modversion "${mods[@]}" # after strip/sign in case broke it
Expand Down

0 comments on commit cd28886

Please sign in to comment.