Bug 118661
Summary: | kmod : why does modinfo not report built-in modules - please can it be made to do so ? | ||
---|---|---|---|
Product: | Tools | Reporter: | Jason Vas Dias (jason.vas.dias) |
Component: | Other | Assignee: | Tools.Other (tools_other) |
Status: | NEW --- | ||
Severity: | normal | CC: | pkozlov.vrn |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | all | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
patch against kmod v22 tools/modinfo.c
patch against kmod v22 tools/modinfo.c patch against kmod v22 tools/modinfo.c patch against kmod v22 tools/modinfo.c |
Description
Jason Vas Dias
2016-05-21 17:37:10 UTC
Something like this perhaps at the end of kmod/tools/modinfo.c @ line 459: ... kmod_unref(ctx); // added lines: if( 0 > err ) if( 0 < snprintf(dir_name_buf,PATH_MAX,"/sys/modules/%s", name)) err = (access( dir_name_buf, F_OK ) == 0) ? 0 : 1; // end addition return err >= 0 ? EXIT_SUCCESS : EXIT_FAILURE; } Oops, "/sys/modules/%s" should be "/sys/module/%s" in previous comment. Created attachment 217041 [details]
patch against kmod v22 tools/modinfo.c
This patch fixes the problem . If there was a name given, and the first
lookup fails, then if the file :
/sys/module/$name
exists, return OK .
Created attachment 217051 [details]
patch against kmod v22 tools/modinfo.c
Patch that fixes problem .
Example output without patch:
$ modinfo -p snd
modinfo: ERROR: Module snd not found
$ echo $?
1
Example output with patch:
$ modinfo -p snd
modinfo: ERROR: Module snd not found.
built-in: snd
$ echo $?
0
Created attachment 217061 [details]
patch against kmod v22 tools/modinfo.c
better patch - output now like:
$ modinfo -p snd
modinfo: ERROR: Module snd not found.
built-in: snd major=116 cards_limit=1 cards_limit=1
$ echo $?
0
Created attachment 217071 [details]
patch against kmod v22 tools/modinfo.c
Final version of patch to make modinfo show built-in modules.
Output now like:
$ modinfo -d snd
modinfo: ERROR: Module snd not found.
built-in: snd author=TheLinuxDevelopers description=snd license=GPL filename=/sys/module/snd major=116 cards_limit=1
Agree that it is needed to modinfo to work for built-in modules. I have i915 built-in and what to see information about it. $ modinfo i915 modinfo: ERROR: Module i915 not found. |