Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

Merge pull request #96153 from xaverdh/kmod-name-field-patch-for-staging

kmod: add patch to correct behaviour with --field

authored by Linus Heckemann and committed by GitHub 4f4d0ca1 b3faa9f7

Changed files
+25 -1
pkgs
os-specific
+1 -1
pkgs/os-specific/linux/kmod/default.nix
··· 24 24 "--with-modulesdirs=${modulesDirs}" 25 25 ] ++ lib.optional withStatic "--enable-static"; 26 26 27 - patches = [ ./module-dir.patch ] 27 + patches = [ ./module-dir.patch ./no-name-field.patch ] 28 28 ++ lib.optional stdenv.isDarwin ./darwin.patch 29 29 ++ lib.optional withStatic ./enable-static.patch; 30 30
+24
pkgs/os-specific/linux/kmod/no-name-field.patch
··· 1 + 2 + --- 3 + tools/modinfo.c | 5 ++++- 4 + 1 file changed, 4 insertions(+), 1 deletion(-) 5 + 6 + diff --git a/tools/modinfo.c b/tools/modinfo.c 7 + index 0231bb0..7b2259e 100644 8 + --- a/tools/modinfo.c 9 + +++ b/tools/modinfo.c 10 + @@ -178,7 +178,10 @@ static int modinfo_do(struct kmod_module *mod) 11 + is_builtin = (filename == NULL); 12 + 13 + if (is_builtin) { 14 + - printf("%-16s%s%c", "name:", kmod_module_get_name(mod), separator); 15 + + if (field == NULL || field != NULL && streq(field, "name")){ 16 + + printf("%-16s%s%c", "name:", 17 + + kmod_module_get_name(mod), separator); 18 + + } 19 + filename = "(builtin)"; 20 + } 21 + 22 + -- 23 + 2.28.0 24 +