summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMarco d'Itri <md@linux.it>2021-01-07 20:17:48 -0800
committerLucas De Marchi <lucas.demarchi@intel.com>2021-01-07 20:17:48 -0800
commitfa67110f896cdef67f42cbc2206ae2a8524acee6 (patch)
tree522ef4814c219687ed14a4c5ca91d2b443897f9e /tools
parentc3771eddcb6385e94055d00050db4340b6e86530 (diff)
downloadkmod-fa67110f896cdef67f42cbc2206ae2a8524acee6.tar.gz
kmod-fa67110f896cdef67f42cbc2206ae2a8524acee6.tar.bz2
kmod-fa67110f896cdef67f42cbc2206ae2a8524acee6.zip
Fix "modinfo -F always shows name for built-ins"
Bug reported by Ben Hutchings <ben@decadent.org.uk>: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=970871 Now that the kernel provides module information for potentially modular code that's actually built-in, it's possible to query these built-ins with "modinfo -F". However, this doesn't work quite right: $ modinfo -Flicense e1000e GPL v2 $ modinfo -Flicense bitrev name: bitrev GPL
Diffstat (limited to 'tools')
-rw-r--r--tools/modinfo.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/modinfo.c b/tools/modinfo.c
index 0231bb0..f6a971f 100644
--- a/tools/modinfo.c
+++ b/tools/modinfo.c
@@ -178,7 +178,11 @@ static int modinfo_do(struct kmod_module *mod)
is_builtin = (filename == NULL);
if (is_builtin) {
- printf("%-16s%s%c", "name:", kmod_module_get_name(mod), separator);
+ if (field == NULL)
+ printf("%-16s%s%c", "name:",
+ kmod_module_get_name(mod), separator);
+ else if (field != NULL && streq(field, "name"))
+ printf("%s%c", kmod_module_get_name(mod), separator);
filename = "(builtin)";
}