~registry/kmod/master

  • Committer: Lucas De Marchi
  • Author(s): Jose Ignacio Tornos Martinez
  • Date: 2024-05-09 04:37:38 UTC
  • Revision ID: git-v1:05828b4a6e9327a63ef94df544a042b5e9ce4fe7
libkmod: add weak dependecies

It has been seen that for some network mac drivers (i.e. lan78xx) the
related module for the phy is loaded dynamically depending on the current
hardware. In this case, the associated phy is read using mdio bus and then
the associated phy module is loaded during runtime (kernel function
phy_request_driver_module). However, no software dependency is defined, so
the user tools will no be able to get this dependency. For example, if
dracut is used and the hardware is present, lan78xx will be included but no
phy module will be added, and in the next restart the device will not work
from boot because no related phy will be found during initramfs stage.

In order to solve this, we could define a normal 'pre' software dependency
in lan78xx module with all the possible phy modules (there may be some),
but proceeding in that way, all the possible phy modules would be loaded
while only one is necessary.

The idea is to create a new type of dependency, that we are going to call
'weak' to be used only by the user tools that need to detect this situation.
In that way, for example, dracut could check the 'weak' dependency of the
modules involved in order to install these dependencies in initramfs too.
That is, for the commented lan78xx module, defining the 'weak' dependency
with the possible phy modules list, only the necessary phy would be loaded
on demand keeping the same behavior, but all the possible phy modules would
be available from initramfs.

A new function 'kmod_module_get_weakdeps' in libkmod will be added for
this to avoid breaking the API and maintain backward compatibility. This
general procedure could be useful for other similar cases (not only for
dynamic phy loading).

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Link: https://lore.kernel.org/r/20240327141116.97587-1-jtornosm@redhat.com
Filename Latest Rev Last Changed Committer Comment Size
..
libkmod 2 12 years ago Lucas De Marchi Rename libabc to libkmod Diff
m4 1 12 years ago Lucas De Marchi Import skeleton from libabc Diff
man 439 12 years ago Lucas De Marchi rename doc dir to man Diff
shared 919 10 years ago Lucas De Marchi Move macro.h to shared directory It's not really Diff
shell-completion 815 11 years ago Lucas De Marchi shell-completion: Add initial completion for kmod Diff
testsuite 495 12 years ago Lucas De Marchi testsuite: add skeleton Diff
tools 163 12 years ago Lucas De Marchi Merge branch 'use-mmap' Conflicts: libkmod/libkm Diff
.gitignore 1328 5 months ago Lucas De Marchi build: Ignore directories commonly used for out-of 324 bytes Diff Download File
File autogen.sh 1316 8 months ago Lucas De Marchi Drop python bindings Python bindings are not well 1.7 KB Diff Download File
CODING-STYLE 971 9 years ago Lucas De Marchi CODING-STYLE: add include order 2.3 KB Diff Download File
configure.ac 1326 7 months ago Lucas De Marchi Install kmod.pc in ${datadir}/pkgconfig The data 11.3 KB Diff Download File
COPYING 928 10 years ago Lucas De Marchi Clarify what licences apply where This doesn't ch 25.8 KB Diff Download File
Makefile.am 1326 7 months ago Lucas De Marchi Install kmod.pc in ${datadir}/pkgconfig The data 13.5 KB Diff Download File
NEWS 1324 7 months ago Lucas De Marchi kmod 32 31.4 KB Diff Download File
README.md 1316 8 months ago Lucas De Marchi Drop python bindings Python bindings are not well 3.6 KB Diff Download File
TODO 1142 6 years ago Lucas De Marchi libkmod-module: check for NULL before accessing po 2.1 KB Diff Download File