linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug#970871: "modinfo -F" always shows name for built-ins
@ 2021-01-08  1:44 Marco d'Itri
  2021-01-08  3:34 ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Marco d'Itri @ 2021-01-08  1:44 UTC (permalink / raw)
  To: linux-modules

[-- Attachment #1: Type: text/plain, Size: 1409 bytes --]

The attached patch fixes this.

----- Forwarded message from Ben Hutchings <ben@decadent.org.uk> -----

From: Ben Hutchings <ben@decadent.org.uk>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: Bug#970871: "modinfo -F" always shows name for built-ins

Package: kmod
Version: 27+20200310-2
Severity: normal

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

Ben.

-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable-debug
  APT policy: (500, 'unstable-debug'), (500, 'stable-updates'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.0-1-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages kmod depends on:
ii  libc6      2.31-3
ii  libkmod2   27+20200310-2
ii  liblzma5   5.2.4-1+b1
ii  libssl1.1  1.1.1g-1
ii  lsb-base   11.1.0

kmod recommends no packages.

kmod suggests no packages.

-- no debconf information

----- End forwarded message -----

-- 
ciao,
Marco

[-- Attachment #2: fix_modinfo_F --]
[-- Type: text/plain, Size: 481 bytes --]

--- a/tools/modinfo.c
+++ b/tools/modinfo.c
@@ -178,7 +178,11 @@ static int modinfo_do(struct kmod_module
 	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)";
 	}
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug#970871: "modinfo -F" always shows name for built-ins
  2021-01-08  1:44 Bug#970871: "modinfo -F" always shows name for built-ins Marco d'Itri
@ 2021-01-08  3:34 ` Lucas De Marchi
  2021-01-08  4:13   ` Marco d'Itri
  0 siblings, 1 reply; 4+ messages in thread
From: Lucas De Marchi @ 2021-01-08  3:34 UTC (permalink / raw)
  To: linux-modules

On Thu, Jan 7, 2021 at 5:55 PM Marco d'Itri <md@linux.it> wrote:
>
> The attached patch fixes this.

who is the author?

Lucas De Marchi

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug#970871: "modinfo -F" always shows name for built-ins
  2021-01-08  3:34 ` Lucas De Marchi
@ 2021-01-08  4:13   ` Marco d'Itri
  2021-01-11 13:05     ` Lucas De Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Marco d'Itri @ 2021-01-08  4:13 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-modules

[-- Attachment #1: Type: text/plain, Size: 228 bytes --]

On Jan 08, Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:

> On Thu, Jan 7, 2021 at 5:55 PM Marco d'Itri <md@linux.it> wrote:
> >
> > The attached patch fixes this.
> 
> who is the author?
I am.

-- 
ciao,
Marco

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bug#970871: "modinfo -F" always shows name for built-ins
  2021-01-08  4:13   ` Marco d'Itri
@ 2021-01-11 13:05     ` Lucas De Marchi
  0 siblings, 0 replies; 4+ messages in thread
From: Lucas De Marchi @ 2021-01-11 13:05 UTC (permalink / raw)
  To: Lucas De Marchi, linux-modules

On Thu, Jan 7, 2021 at 8:14 PM Marco d'Itri <md@linux.it> wrote:
>
> On Jan 08, Lucas De Marchi <lucas.de.marchi@gmail.com> wrote:
>
> > On Thu, Jan 7, 2021 at 5:55 PM Marco d'Itri <md@linux.it> wrote:
> > >
> > > The attached patch fixes this.
> >
> > who is the author?
> I am.

applied, thanks.

Lucas De Marchi

>
> --
> ciao,
> Marco

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-11 14:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08  1:44 Bug#970871: "modinfo -F" always shows name for built-ins Marco d'Itri
2021-01-08  3:34 ` Lucas De Marchi
2021-01-08  4:13   ` Marco d'Itri
2021-01-11 13:05     ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).