diff options
author | Dominik Xaver Hörl <hoe.dom@gmx.de> | 2020-08-24 00:00:37 +0200 |
---|---|---|
committer | Dominik Xaver Hörl <hoe.dom@gmx.de> | 2020-08-24 10:59:16 +0200 |
commit | 40d33887db7cd72bbb9daeae2a4e382ad16ee96f (patch) | |
tree | 14dd9715566bc01cdbb14c48d90a04339c64b7b3 /pkgs/os-specific/linux/kmod | |
parent | 58377555eddb98ade867c80f166e3c01a81a2dc9 (diff) | |
download | nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.tar nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.tar.gz nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.tar.bz2 nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.tar.lz nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.tar.xz nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.tar.zst nixpkgs-40d33887db7cd72bbb9daeae2a4e382ad16ee96f.zip |
kmod: add patch to correct behaviour with --field
This came up in https://github.com/NixOS/nixpkgs/pull/96008. Without this patch modinfo always prints the module name for builtin modules, even if an explicit --field is passed.
Diffstat (limited to 'pkgs/os-specific/linux/kmod')
-rw-r--r-- | pkgs/os-specific/linux/kmod/default.nix | 2 | ||||
-rw-r--r-- | pkgs/os-specific/linux/kmod/no-name-field.patch | 24 |
2 files changed, 25 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix index f1cc4558b05..805b8a32aed 100644 --- a/pkgs/os-specific/linux/kmod/default.nix +++ b/pkgs/os-specific/linux/kmod/default.nix @@ -24,7 +24,7 @@ in stdenv.mkDerivation rec { "--with-modulesdirs=${modulesDirs}" ] ++ lib.optional withStatic "--enable-static"; - patches = [ ./module-dir.patch ] + patches = [ ./module-dir.patch ./no-name-field.patch ] ++ lib.optional stdenv.isDarwin ./darwin.patch ++ lib.optional withStatic ./enable-static.patch; diff --git a/pkgs/os-specific/linux/kmod/no-name-field.patch b/pkgs/os-specific/linux/kmod/no-name-field.patch new file mode 100644 index 00000000000..282f59e55e5 --- /dev/null +++ b/pkgs/os-specific/linux/kmod/no-name-field.patch @@ -0,0 +1,24 @@ + +--- + tools/modinfo.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/tools/modinfo.c b/tools/modinfo.c +index 0231bb0..7b2259e 100644 +--- a/tools/modinfo.c ++++ b/tools/modinfo.c +@@ -178,7 +178,10 @@ 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 || field != NULL && streq(field, "name")){ ++ printf("%-16s%s%c", "name:", ++ kmod_module_get_name(mod), separator); ++ } + filename = "(builtin)"; + } + +-- +2.28.0 + |