Skip to content

Modprobe from any for --show-{modversions,exports} #353

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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

evelikov
Copy link
Collaborator

In the odd case of using --show/dump-modversions or --show-exports, I regularly get irked that they take only the full module path.

This PR fixes that, admittedly with zero testing, man/shell-completion updates... Looking at which, it seems like we never added --show-exports into the man page - I'm guessing that was not intentional?

If people are on board with the idea I will polish and resubmit. As always - name suggestions (see the helper functions within) are greatly appreciated.

evelikov added 3 commits May 19, 2025 21:13
Split the functionality into a helper function, which will be used with
later commits.

Signed-off-by: Emil Velikov <[email protected]>
@evelikov evelikov marked this pull request as draft May 19, 2025 20:21
@@ -203,6 +203,26 @@ static int show_config(struct kmod_ctx *ctx)
return 0;
}

static int module_new_from_any(struct kmod_ctx *ctx, const char *module, struct kmod_module **mod, struct kmod_list **list)
{
if (strncmp(module, "/", 1) == 0 || strncmp(module, "./", 2) == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another opportunity for strstartswith?

kmod_module_unref_list(list);
}
return err;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something wrong here...

@lucasdemarchi
Copy link
Contributor

I like the idea and functions names look fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants