Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dracut-install: add weak dependencies support #2658

Closed
wants to merge 1 commit into from

Commits on Jun 28, 2024

  1. dracut-install: add weak dependencies support

    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.
    
    So, a new type of dependency has been created, 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.
    
    The 'weak' dependency support has been already included in kmod:
    kmod-project/kmod@05828b4
    And in kernel:
    https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux.git/commit/?h=modules-next&id=1f3dacc0dcef6681c2acf5890e018012f6b53085
    After these, 'weak' dependencies for modules will start to appear.
    Read the possible weak dependencies from dracut in order to take them into
    account.
    
    Signed-off-by: Jose Ignacio Tornos Martinez <[email protected]>
    jtornosm committed Jun 28, 2024
    Configuration menu
    Copy the full SHA
    4a59f9f View commit details
    Browse the repository at this point in the history