libkmod: honor install commands on modules with softdeps - #461
Open
prabhakarpujeri wants to merge 1 commit into
Open
prabhakarpujeri wants to merge 1 commit into
prabhakarpujeri wants to merge 1 commit into
Conversation
__kmod_module_fill_softdep() marks any module that has softdep entries with ignorecmd, and kmod_module_probe_insert_module() then skips the module's install command and falls back to a plain insmod. An explicit 'install <mod> <cmd>' stanza is silently dropped as soon as the module ships any softdep: blacklisting such a module with the documented
blacklist ksmbd
install ksmbd /bin/false
combination has no effect, and a dry run shows an insmod of the real
module file.
An 'install' directive is user configuration and must win over softdep
metadata. Only ignore the command when no install command is
configured, so the softdep path keeps its current behavior for modules
without one.
Add a test-modprobe fixture covering it: a module with a softdep and an
install command must run the install command in a dry run (the pre
softdep is still inserted first) instead of insmod-ing the module
itself.
Link: kmod-project#446
Signed-off-by: Prabhakar Pujeri <prabhakar.pujeri@dell.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #446.
Since 89e9248 ("modprobe: obey blacklist and softdep pre"),
__kmod_module_fill_softdep()marks every module that has any softdep entry withignorecmd, andkmod_module_probe_insert_module()then silently skips the module's configuredinstallcommand and falls back toinsmod.Consequence: the documented block formula
has no effect for a module that ships a softdep (Gentoo confirmed
blacklist+installis silently ignored) – a dry run inserts the real module file, and as the reporter notes, "even something as simple as a softdep kills any install command".Changes
libkmod: only setignorecmdwhen no install command is configured (kmod_module_get_install_commands(mod) == NULL). An explicitinstalldirective is user configuration and must win over softdep metadata; modules without one keep the existing behavior, and--ignore-installis unaffected.testsuite: new fixturetest-modprobe/install-cmd-softdep– module with apresoftdep plusinstall mod-foo /bin/true. The dry run must printinsmod …/mod-foo-a.kofollowed byinstall /bin/true; without the fix it printsinsmod …/mod-foo.koinstead. Verified red on master, green with this change; full testsuite passes.Reproduction (on master)
after this change, the second line is
install /bin/false.