From 0a94b832833d8afe7143b31f863613cfc81c742ec146ed8725c8da9453ffb265 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 28 Jan 2021 12:11:04 +0000 Subject: [PATCH] Accepting request 867442 from home:pevik:branches:Base:System - Backport upstream fix 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch OBS-URL: https://build.opensuse.org/request/show/867442 OBS-URL: https://build.opensuse.org/package/show/Base:System/kmod?expand=0&rev=177 --- ...fo-F-always-shows-name-for-built-ins.patch | 43 +++++++++++++++++++ kmod-testsuite.spec | 1 + kmod.changes | 5 +++ kmod.spec | 1 + 4 files changed, 50 insertions(+) create mode 100644 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch diff --git a/0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch b/0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch new file mode 100644 index 0000000..533d46b --- /dev/null +++ b/0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch @@ -0,0 +1,43 @@ +From 45dd8d3d2859b58c203d9be16ab7ed77d98b7714 Mon Sep 17 00:00:00 2001 +From: Marco d'Itri +Date: Thu, 7 Jan 2021 20:17:48 -0800 +Subject: [PATCH] Fix "modinfo -F always shows name for built-ins" + +Bug reported by Ben Hutchings : +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 +Reviewed-by: Petr Vorel +[ Patch-mainline: fa67110f896cdef67f42cbc2206ae2a8524acee6 ] +--- + tools/modinfo.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +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)"; + } + +-- +2.30.0 + diff --git a/kmod-testsuite.spec b/kmod-testsuite.spec index cf78fc5..d994cf2 100644 --- a/kmod-testsuite.spec +++ b/kmod-testsuite.spec @@ -37,6 +37,7 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch +Patch9: 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets diff --git a/kmod.changes b/kmod.changes index fec44e1..a90de1b 100644 --- a/kmod.changes +++ b/kmod.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jan 28 11:03:09 UTC 2021 - Petr Vorel + +- Backport upstream fix 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch + ------------------------------------------------------------------- Tue Jan 12 16:04:41 UTC 2021 - Michal Suchanek diff --git a/kmod.spec b/kmod.spec index 7f9a203..9a92261 100644 --- a/kmod.spec +++ b/kmod.spec @@ -37,6 +37,7 @@ Patch5: 0011-Do-not-filter-unsupported-modules-when-running-a-van.patch Patch6: 0012-modprobe-print-unsupported-status.patch Patch7: usr-lib-modprobe.patch Patch8: no-stylesheet-download.patch +Patch9: 0001-Fix-modinfo-F-always-shows-name-for-built-ins.patch BuildRequires: autoconf BuildRequires: automake BuildRequires: docbook5-xsl-stylesheets