From f1da57f28981ae3b332ac6b3efca264f6dba5884 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 25 Mar 2020 09:55:48 +0200 Subject: [PATCH 01/57] fix crash on fseek/ftell of stdout (27-2) - add 0001-depmod-do-not-output-.bin-to-stdout.patch Resolves: rhbz#1808430 Signed-off-by: Yauheni Kaliuta --- ...-depmod-do-not-output-.bin-to-stdout.patch | 53 +++++++++++++++++++ kmod.spec | 9 +++- 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 0001-depmod-do-not-output-.bin-to-stdout.patch diff --git a/0001-depmod-do-not-output-.bin-to-stdout.patch b/0001-depmod-do-not-output-.bin-to-stdout.patch new file mode 100644 index 0000000..1461006 --- /dev/null +++ b/0001-depmod-do-not-output-.bin-to-stdout.patch @@ -0,0 +1,53 @@ +From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi +Date: Thu, 5 Mar 2020 13:33:10 -0800 +Subject: [PATCH] depmod: do not output .bin to stdout + +index_write() relies on fseek/ftell to manage the position to which we +are write and thus needs the file stream to support it. + +Right now when trying to write the index to stdout we fail with: + + depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed. + Aborted (core dumped) + +We have no interest in outputting our index to stdout, so just skip it +like is done with other indexes. + +While at it, add/remove some newlines to improve readability. + +Reported-by: Yanko Kaneti +Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo") +--- + tools/depmod.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index fbbce10eb0db..875e31480818 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) + struct index_node *idx; + struct kmod_list *l, *builtin = NULL; + +- idx = index_create(); ++ if (out == stdout) ++ return 0; + ++ idx = index_create(); + if (idx == NULL) { + ret = -ENOMEM; + goto fail; +@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) + + if (count) + index_write(idx, out); ++ + index_destroy(idx); ++ + fail: + if (builtin) + kmod_module_unref_list(builtin); +-- +2.25.0 + diff --git a/kmod.spec b/kmod.spec index 652b5d5..0dbfbb4 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -9,6 +9,8 @@ Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.t Source1: weak-modules Exclusiveos: Linux +Patch01: 0001-depmod-do-not-output-.bin-to-stdout.patch + BuildRequires: gcc BuildRequires: chrpath BuildRequires: zlib-devel @@ -44,6 +46,7 @@ applications that wish to load or unload Linux kernel modules. %prep %autosetup -p1 +%patch01 -p %build %configure \ @@ -104,6 +107,10 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Wed Mar 25 2020 Yauheni Kaliuta - 27-2 +- add 0001-depmod-do-not-output-.bin-to-stdout.patch + Resolves: rhbz#1808430 + * Thu Feb 20 2020 Peter Robinson - 27-1 - New upstream v27 From 176e9652239e4ebf6bc6abccaf639ac8059b3e91 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 25 Mar 2020 10:02:12 +0200 Subject: [PATCH 02/57] Revert "fix crash on fseek/ftell of stdout (27-2)" This reverts commit f1da57f28981ae3b332ac6b3efca264f6dba5884. The commit is broken Signed-off-by: Yauheni Kaliuta --- ...-depmod-do-not-output-.bin-to-stdout.patch | 53 ------------------- kmod.spec | 9 +--- 2 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 0001-depmod-do-not-output-.bin-to-stdout.patch diff --git a/0001-depmod-do-not-output-.bin-to-stdout.patch b/0001-depmod-do-not-output-.bin-to-stdout.patch deleted file mode 100644 index 1461006..0000000 --- a/0001-depmod-do-not-output-.bin-to-stdout.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi -Date: Thu, 5 Mar 2020 13:33:10 -0800 -Subject: [PATCH] depmod: do not output .bin to stdout - -index_write() relies on fseek/ftell to manage the position to which we -are write and thus needs the file stream to support it. - -Right now when trying to write the index to stdout we fail with: - - depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed. - Aborted (core dumped) - -We have no interest in outputting our index to stdout, so just skip it -like is done with other indexes. - -While at it, add/remove some newlines to improve readability. - -Reported-by: Yanko Kaneti -Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo") ---- - tools/depmod.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/tools/depmod.c b/tools/depmod.c -index fbbce10eb0db..875e31480818 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) - struct index_node *idx; - struct kmod_list *l, *builtin = NULL; - -- idx = index_create(); -+ if (out == stdout) -+ return 0; - -+ idx = index_create(); - if (idx == NULL) { - ret = -ENOMEM; - goto fail; -@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) - - if (count) - index_write(idx, out); -+ - index_destroy(idx); -+ - fail: - if (builtin) - kmod_module_unref_list(builtin); --- -2.25.0 - diff --git a/kmod.spec b/kmod.spec index 0dbfbb4..652b5d5 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 2%{?dist} +Release: 1%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -9,8 +9,6 @@ Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.t Source1: weak-modules Exclusiveos: Linux -Patch01: 0001-depmod-do-not-output-.bin-to-stdout.patch - BuildRequires: gcc BuildRequires: chrpath BuildRequires: zlib-devel @@ -46,7 +44,6 @@ applications that wish to load or unload Linux kernel modules. %prep %autosetup -p1 -%patch01 -p %build %configure \ @@ -107,10 +104,6 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog -* Wed Mar 25 2020 Yauheni Kaliuta - 27-2 -- add 0001-depmod-do-not-output-.bin-to-stdout.patch - Resolves: rhbz#1808430 - * Thu Feb 20 2020 Peter Robinson - 27-1 - New upstream v27 From 2a32527449aebfcdb4aa33e5575ce7c01598074b Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 25 Mar 2020 09:55:48 +0200 Subject: [PATCH 03/57] fix crash on fseek/ftell of stdout, try 2 (27-2) - add 0001-depmod-do-not-output-.bin-to-stdout.patch Resolves: rhbz#1808430 Signed-off-by: Yauheni Kaliuta --- ...-depmod-do-not-output-.bin-to-stdout.patch | 53 +++++++++++++++++++ kmod.spec | 8 ++- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 0001-depmod-do-not-output-.bin-to-stdout.patch diff --git a/0001-depmod-do-not-output-.bin-to-stdout.patch b/0001-depmod-do-not-output-.bin-to-stdout.patch new file mode 100644 index 0000000..1461006 --- /dev/null +++ b/0001-depmod-do-not-output-.bin-to-stdout.patch @@ -0,0 +1,53 @@ +From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001 +From: Lucas De Marchi +Date: Thu, 5 Mar 2020 13:33:10 -0800 +Subject: [PATCH] depmod: do not output .bin to stdout + +index_write() relies on fseek/ftell to manage the position to which we +are write and thus needs the file stream to support it. + +Right now when trying to write the index to stdout we fail with: + + depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed. + Aborted (core dumped) + +We have no interest in outputting our index to stdout, so just skip it +like is done with other indexes. + +While at it, add/remove some newlines to improve readability. + +Reported-by: Yanko Kaneti +Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo") +--- + tools/depmod.c | 6 +++++- + 1 file changed, 5 insertions(+), 1 deletion(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index fbbce10eb0db..875e31480818 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) + struct index_node *idx; + struct kmod_list *l, *builtin = NULL; + +- idx = index_create(); ++ if (out == stdout) ++ return 0; + ++ idx = index_create(); + if (idx == NULL) { + ret = -ENOMEM; + goto fail; +@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) + + if (count) + index_write(idx, out); ++ + index_destroy(idx); ++ + fail: + if (builtin) + kmod_module_unref_list(builtin); +-- +2.25.0 + diff --git a/kmod.spec b/kmod.spec index 652b5d5..1a5c7af 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -9,6 +9,8 @@ Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.t Source1: weak-modules Exclusiveos: Linux +Patch01: 0001-depmod-do-not-output-.bin-to-stdout.patch + BuildRequires: gcc BuildRequires: chrpath BuildRequires: zlib-devel @@ -104,6 +106,10 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Wed Mar 25 2020 Yauheni Kaliuta - 27-2 +- add 0001-depmod-do-not-output-.bin-to-stdout.patch + Resolves: rhbz#1808430 + * Thu Feb 20 2020 Peter Robinson - 27-1 - New upstream v27 From bddd48bb1f02b70118e3a0b652848567edac13b0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 28 Jul 2020 03:32:01 +0000 Subject: [PATCH 04/57] - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 1a5c7af..a136dd9 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 27 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -106,6 +106,9 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Tue Jul 28 2020 Fedora Release Engineering - 27-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + * Wed Mar 25 2020 Yauheni Kaliuta - 27-2 - add 0001-depmod-do-not-output-.bin-to-stdout.patch Resolves: rhbz#1808430 From b6296f9ad3bf1a11226d6d68932294db915279d4 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Mon, 4 Jan 2021 22:48:43 +0000 Subject: [PATCH 05/57] Add BuildRequires: make https://fedoraproject.org/wiki/Changes/Remove_make_from_BuildRoot --- kmod.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/kmod.spec b/kmod.spec index a136dd9..34f4382 100644 --- a/kmod.spec +++ b/kmod.spec @@ -17,6 +17,7 @@ BuildRequires: zlib-devel BuildRequires: xz-devel BuildRequires: libxslt BuildRequires: openssl-devel +BuildRequires: make Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 From 393f16a127b027b16b5193efadbbe59490fb0ee2 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Thu, 7 Jan 2021 19:31:43 -0500 Subject: [PATCH 06/57] New upstream v28 Enable zstd support Resolves: rhbz#1913949 --- .gitignore | 1 + ...-depmod-do-not-output-.bin-to-stdout.patch | 53 ------------------- kmod.spec | 17 +++--- sources | 2 +- 4 files changed, 13 insertions(+), 60 deletions(-) delete mode 100644 0001-depmod-do-not-output-.bin-to-stdout.patch diff --git a/.gitignore b/.gitignore index f339cc1..9e1f6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /kmod-25.tar.xz /kmod-26.tar.xz /kmod-27.tar.xz +/kmod-28.tar.xz diff --git a/0001-depmod-do-not-output-.bin-to-stdout.patch b/0001-depmod-do-not-output-.bin-to-stdout.patch deleted file mode 100644 index 1461006..0000000 --- a/0001-depmod-do-not-output-.bin-to-stdout.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001 -From: Lucas De Marchi -Date: Thu, 5 Mar 2020 13:33:10 -0800 -Subject: [PATCH] depmod: do not output .bin to stdout - -index_write() relies on fseek/ftell to manage the position to which we -are write and thus needs the file stream to support it. - -Right now when trying to write the index to stdout we fail with: - - depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed. - Aborted (core dumped) - -We have no interest in outputting our index to stdout, so just skip it -like is done with other indexes. - -While at it, add/remove some newlines to improve readability. - -Reported-by: Yanko Kaneti -Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo") ---- - tools/depmod.c | 6 +++++- - 1 file changed, 5 insertions(+), 1 deletion(-) - -diff --git a/tools/depmod.c b/tools/depmod.c -index fbbce10eb0db..875e31480818 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) - struct index_node *idx; - struct kmod_list *l, *builtin = NULL; - -- idx = index_create(); -+ if (out == stdout) -+ return 0; - -+ idx = index_create(); - if (idx == NULL) { - ret = -ENOMEM; - goto fail; -@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out) - - if (count) - index_write(idx, out); -+ - index_destroy(idx); -+ - fail: - if (builtin) - kmod_module_unref_list(builtin); --- -2.25.0 - diff --git a/kmod.spec b/kmod.spec index 34f4382..c320536 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod -Version: 27 -Release: 3%{?dist} +Version: 28 +Release: 1%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -9,15 +9,14 @@ Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.t Source1: weak-modules Exclusiveos: Linux -Patch01: 0001-depmod-do-not-output-.bin-to-stdout.patch - BuildRequires: gcc BuildRequires: chrpath BuildRequires: zlib-devel BuildRequires: xz-devel BuildRequires: libxslt BuildRequires: openssl-devel -BuildRequires: make +BuildRequires: make +BuildRequires: libzstd-devel Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 @@ -52,7 +51,8 @@ applications that wish to load or unload Linux kernel modules. %configure \ --with-openssl \ --with-zlib \ - --with-xz + --with-xz \ + --with-zstd %{make_build} V=1 @@ -107,6 +107,11 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Thu Jan 07 2021 Josh Boyer - 28-1 +- New upstream v28 +- Enable zstd support +- Resolves: rhbz#1913949 + * Tue Jul 28 2020 Fedora Release Engineering - 27-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild diff --git a/sources b/sources index 47c908a..9dc7345 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-27.tar.xz) = e0513094935333fca1fb4c3e3493b232507a579ab00a6457cc9ed3e928363d05aad80634fb65a8287a336bf9895194c7be8ddc41bb088a6c2cca44fc1bfbdb6c +SHA512 (kmod-28.tar.xz) = 50646dc72675a5e17b01e327e3d41b972f18aaeac20c8b00983c4d099c6218f35c32c184a833a2d7f716755d6a86851c90913d2835874cef933bdc4a9722df9a From 406582dd73fb84544bb466d52fa6eecd3c81b6fc Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Tue, 26 Jan 2021 15:58:53 +0000 Subject: [PATCH 07/57] - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index c320536..5630b00 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 28 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -107,6 +107,9 @@ install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Tue Jan 26 2021 Fedora Release Engineering - 28-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + * Thu Jan 07 2021 Josh Boyer - 28-1 - New upstream v28 - Enable zstd support From 93a23f7391f3f9ffc7f2ab72763442f6c64d5b43 Mon Sep 17 00:00:00 2001 From: Robert Scheck Date: Sat, 30 Jan 2021 23:47:20 +0100 Subject: [PATCH 08/57] Spec file cleanup - Updated URL to current (shorter URL and HTTPS) - Removed superfluous slash for %{_mandir} path - Removed superfluous /sbin (only %{_sbindir} is used) - Preserve timestamp when installing weak-modules(1) --- kmod.spec | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kmod.spec b/kmod.spec index 5630b00..40c2674 100644 --- a/kmod.spec +++ b/kmod.spec @@ -4,7 +4,7 @@ Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ -URL: http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary +URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules Exclusiveos: Linux @@ -59,7 +59,7 @@ applications that wish to load or unload Linux kernel modules. %install %{make_install} -pushd $RPM_BUILD_ROOT/%{_mandir}/man5 +pushd $RPM_BUILD_ROOT%{_mandir}/man5 ln -s modprobe.d.5.gz modprobe.conf.5.gz popd @@ -77,8 +77,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d -mkdir -p $RPM_BUILD_ROOT/sbin -install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules +install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %files %dir %{_sysconfdir}/depmod.d From 7c1c60b960c33537f7b3eca00efc58235630b5c3 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Fri, 21 May 2021 08:31:17 -0400 Subject: [PATCH 09/57] New upstream v29 Resolves: rhbz#1962980 --- .gitignore | 2 ++ kmod.spec | 8 ++++++-- sources | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 9e1f6d9..61ee224 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ /kmod-26.tar.xz /kmod-27.tar.xz /kmod-28.tar.xz +/kmod-29.tar.gz +/kmod-29.tar.xz diff --git a/kmod.spec b/kmod.spec index 40c2674..5622515 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod -Version: 28 -Release: 2%{?dist} +Version: 29 +Release: 1%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -106,6 +106,10 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Fri May 14 2021 Josh Boyer - 29-1 +- New upstream v29 +- Resolves: rhbz#1962980 + * Tue Jan 26 2021 Fedora Release Engineering - 28-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild diff --git a/sources b/sources index 9dc7345..d70bf5f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-28.tar.xz) = 50646dc72675a5e17b01e327e3d41b972f18aaeac20c8b00983c4d099c6218f35c32c184a833a2d7f716755d6a86851c90913d2835874cef933bdc4a9722df9a +SHA512 (kmod-29.tar.xz) = 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 From 43ae298bc965ee0089b15519075622f94f08d7ac Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Mon, 24 May 2021 12:46:42 -0500 Subject: [PATCH 10/57] Remove weak-modules from kmod in Fedora Fedora does not support CONFIG_MODVERSIONS, as we have no guarantee of KABI. With this in mind, the weak-modules script adds no benefit to Fedora, but it can cause serious issues with update times on major kernel rebases, and with dkms. This patch removes the script from Fedora, but leaves it in place for ELN/CentOS/RHEL, etc. Signed-off-by: Justin M. Forbes --- kmod.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kmod.spec b/kmod.spec index 5622515..ef2f73a 100644 --- a/kmod.spec +++ b/kmod.spec @@ -44,6 +44,14 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} The kmod-devel package provides header files used for development of applications that wish to load or unload Linux kernel modules. +# Fedora does not support CONFIG_MODVERSIONS. Without kabi support +# weak-modules is useless at best, and can be actively harmful. +%if 0%{?fedora} +%define with_weak_modules 0 +%else +%define with_weak_modules 1 +%endif + %prep %autosetup -p1 @@ -77,7 +85,9 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d +%if %{with_weak_modules} install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules +%endif %files %dir %{_sysconfdir}/depmod.d @@ -90,7 +100,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_sbindir}/rmmod %{_sbindir}/lsmod %{_sbindir}/depmod +%if %{with_weak_modules} %{_sbindir}/weak-modules +%endif %{_datadir}/bash-completion/ %attr(0644,root,root) %{_mandir}/man5/*.5* %attr(0644,root,root) %{_mandir}/man8/*.8* @@ -106,6 +118,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Mon May 24 2021 Justin M. Forbes +- Remove weak-modules for Fedora as it causes problems. + * Fri May 14 2021 Josh Boyer - 29-1 - New upstream v29 - Resolves: rhbz#1962980 From 629ab3ccc2d68cf25e768a32bce9596ac947e7b0 Mon Sep 17 00:00:00 2001 From: "Justin M. Forbes" Date: Tue, 25 May 2021 07:37:32 -0500 Subject: [PATCH 11/57] Rebuild for weak-modules drop in Fedora Signed-off-by: Justin M. Forbes --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index ef2f73a..1d75527 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,6 @@ Name: kmod Version: 29 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -118,6 +118,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Tue May 25 2021 Justin M. Forbes - 29-2 +- Rebuild for weak-modules drop in Fedora + * Mon May 24 2021 Justin M. Forbes - Remove weak-modules for Fedora as it causes problems. From 59975932b83be82e9d1933f5df0e3ad803f8a38c Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Tue, 8 Jun 2021 06:27:02 -0400 Subject: [PATCH 12/57] Move the conditional the top to clarify its scope This conditional impacts the whole spec, and generally these things are at the top of the spec to make it clear and avoid random scoping issues at spec parse time. --- kmod.spec | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/kmod.spec b/kmod.spec index 1d75527..80b1ae0 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,3 +1,12 @@ +# Fedora does not support CONFIG_MODVERSIONS. Without kabi support +# weak-modules is useless at best, and can be actively harmful. +%if 0%{?fedora} +%define with_weak_modules 0 +%else +%define with_weak_modules 1 +%endif + + Name: kmod Version: 29 Release: 2%{?dist} @@ -44,14 +53,6 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} The kmod-devel package provides header files used for development of applications that wish to load or unload Linux kernel modules. -# Fedora does not support CONFIG_MODVERSIONS. Without kabi support -# weak-modules is useless at best, and can be actively harmful. -%if 0%{?fedora} -%define with_weak_modules 0 -%else -%define with_weak_modules 1 -%endif - %prep %autosetup -p1 From a81e15debb46b85a877ea76ce883c3816f2fd229 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Tue, 8 Jun 2021 06:45:19 -0400 Subject: [PATCH 13/57] Fix conditional to only install weak-modules for RHEL Generally speaking, weak-modules is going to be of no use to anyone, since the stabilized kABI is a unique property that only exists with the Red Hat Enterprise Linux distribution kernel. To avoid issues with downstreams, flip the conditional so that it is explicit that this is only useful for RHEL. --- kmod.spec | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/kmod.spec b/kmod.spec index 80b1ae0..7c22d26 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,15 +1,17 @@ # Fedora does not support CONFIG_MODVERSIONS. Without kabi support # weak-modules is useless at best, and can be actively harmful. -%if 0%{?fedora} -%define with_weak_modules 0 +# Since RHEL *does* support this and offers kabi support, +# turn it on there by default. +%if 0%{?rhel} +%bcond_without weak_modules %else -%define with_weak_modules 1 +%bcond_with weak_modules %endif Name: kmod Version: 29 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -86,7 +88,7 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d -%if %{with_weak_modules} +%if %{with weak_modules} install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %endif @@ -101,7 +103,7 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_sbindir}/rmmod %{_sbindir}/lsmod %{_sbindir}/depmod -%if %{with_weak_modules} +%if %{with weak_modules} %{_sbindir}/weak-modules %endif %{_datadir}/bash-completion/ @@ -119,6 +121,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Tue Jun 08 2021 Neal Gompa - 29-3 +- Fix conditional to only install weak-modules for RHEL + * Tue May 25 2021 Justin M. Forbes - 29-2 - Rebuild for weak-modules drop in Fedora From 6aa03ba354d6e0102b978e2ff475bc13901870b5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 22 Jul 2021 10:14:32 +0000 Subject: [PATCH 14/57] - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 7c22d26..3597670 100644 --- a/kmod.spec +++ b/kmod.spec @@ -11,7 +11,7 @@ Name: kmod Version: 29 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -121,6 +121,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_libdir}/libkmod.so %changelog +* Thu Jul 22 2021 Fedora Release Engineering - 29-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + * Tue Jun 08 2021 Neal Gompa - 29-3 - Fix conditional to only install weak-modules for RHEL From 35bc85d1e4cd23183f4377f6f4b1d611f0da95a6 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Tue, 10 Aug 2021 13:04:55 +0300 Subject: [PATCH 15/57] Add default config file, /etc/depmod.d/dist.conf External modules packaging depends on the search order provided by RHEL default config which is missing now from CentOS Stream. Add and install the file. Signed-off-by: Yauheni Kaliuta --- kmod.spec | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kmod.spec b/kmod.spec index 3597670..e335857 100644 --- a/kmod.spec +++ b/kmod.spec @@ -4,8 +4,10 @@ # turn it on there by default. %if 0%{?rhel} %bcond_without weak_modules +%bcond_without dist_conf %else %bcond_with weak_modules +%bcond_with dist_conf %endif @@ -18,6 +20,7 @@ License: GPLv2+ URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules +Source2: depmod.conf.dist Exclusiveos: Linux BuildRequires: gcc @@ -92,6 +95,10 @@ mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %endif +%if %{with dist_conf} +install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf +%endif + %files %dir %{_sysconfdir}/depmod.d %dir %{_sysconfdir}/modprobe.d @@ -107,6 +114,9 @@ install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_sbindir}/weak-modules %{_sbindir}/weak-modules %endif %{_datadir}/bash-completion/ +%if %{with dist_conf} +%{_sysconfdir}/depmod.d/dist.conf +%endif %attr(0644,root,root) %{_mandir}/man5/*.5* %attr(0644,root,root) %{_mandir}/man8/*.8* %doc NEWS README TODO From 50733019f18055586ce6f00ea923e3064380e8ff Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Tue, 8 Jun 2021 11:44:42 +0300 Subject: [PATCH 16/57] weak-modules: split modules into array with read -a Coverity reports warning for splitting mods=($i) `Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a.` Even if it can not cause problems for weak-modules case where the list is coming from modules.dep, use the recommended read -a method. Signed-off-by: Yauheni Kaliuta --- weak-modules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weak-modules b/weak-modules index 65806d0..e328902 100644 --- a/weak-modules +++ b/weak-modules @@ -935,7 +935,7 @@ do_make_groups() declare -a mods while read i; do - mods=($i) + read -a mods <<< "$i" echo "${mods[0]}" |grep -q "extra/" || continue @@ -987,7 +987,7 @@ filter_extra_absoluted() # to speed up handling in general cases echo "$i" |grep -q "extra/" || continue - mods=($i) + read -a mods <<< "$i" for j in "${!mods[@]}"; do mod="${mods[$j]}" From 2679f21c9845e27e988e5f637a899a9dab42d568 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Tue, 8 Jun 2021 11:49:52 +0300 Subject: [PATCH 17/57] weak-modules: compare_initramfs_modules: exit on pushd/popd failures Coverity reports warning `warning[SC2164]: Use 'popd ... || exit' or 'popd ... || return' in case popd fails.` This cannot happen in case of weak-modules, but makes no harm. Signed-off-by: Yauheni Kaliuta --- weak-modules | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weak-modules b/weak-modules index e328902..1a5312b 100644 --- a/weak-modules +++ b/weak-modules @@ -179,24 +179,24 @@ compare_initramfs_modules() { mkdir "$tmpdir/new_initramfs" decompress_initramfs "$old_initramfs" "$tmpdir/old_initramfs.img" - pushd "$tmpdir/old_initramfs" >/dev/null + pushd "$tmpdir/old_initramfs" >/dev/null || exit cpio -i < "$tmpdir/old_initramfs.img" 2>/dev/null rm "$tmpdir/old_initramfs.img" n=0; for i in `list_module_files|sort`; do old_initramfs_modules[n]="$i" n=$((n+1)) done - popd >/dev/null + popd >/dev/null || exit decompress_initramfs "$new_initramfs" "$tmpdir/new_initramfs.img" - pushd "$tmpdir/new_initramfs" >/dev/null + pushd "$tmpdir/new_initramfs" >/dev/null || exit cpio -i < "$tmpdir/new_initramfs.img" 2>/dev/null rm "$tmpdir/new_initramfs.img" n=0; for i in `list_module_files|sort`; do new_initramfs_modules[n]="$i" n=$((n+1)) done - popd >/dev/null + popd >/dev/null || exit # Compare the length and contents of the arrays if [ "${#old_initramfs_modules[@]}" == "${#new_initramfs_modules[@]}" -a \ From 0b10b0482bfb8dc10eda51027748051c9e464ee8 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Tue, 10 Aug 2021 16:09:15 +0300 Subject: [PATCH 18/57] kmod.spec: enable debug The debug messages pretty often are useful to find configuration problems on customers systems. They are seen only with extra verbose command line switches so should not affect performance a lot. Signed-off-by: Yauheni Kaliuta --- kmod.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index e335857..7d173eb 100644 --- a/kmod.spec +++ b/kmod.spec @@ -66,7 +66,8 @@ applications that wish to load or unload Linux kernel modules. --with-openssl \ --with-zlib \ --with-xz \ - --with-zstd + --with-zstd \ + --enable-debug %{make_build} V=1 From f4aad01fe79d9dc193b1cb837ee23797dc271508 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Tue, 10 Aug 2021 16:14:30 +0300 Subject: [PATCH 19/57] packaging: bump up version, 29-5 - kmod.spec: enable debug - weak-modules: compare_initramfs_modules: exit on pushd/popd failures - weak-modules: split modules into array with read -a - Add default config file, /etc/depmod.d/dist.conf Signed-off-by: Yauheni Kaliuta --- kmod.spec | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 7d173eb..dd787b0 100644 --- a/kmod.spec +++ b/kmod.spec @@ -13,7 +13,7 @@ Name: kmod Version: 29 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -132,6 +132,12 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Tue Aug 10 2021 Yauheni Kaliuta - 29-5 +- kmod.spec: enable debug +- weak-modules: compare_initramfs_modules: exit on pushd/popd failures +- weak-modules: split modules into array with read -a +- Add default config file, /etc/depmod.d/dist.conf + * Thu Jul 22 2021 Fedora Release Engineering - 29-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild From 37c97fb6a8367e1db3f06aac8bd72037e8017923 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 11 Aug 2021 09:53:59 +0300 Subject: [PATCH 20/57] fedpkg new-source: commit modified files .gitignore sources Signed-off-by: Yauheni Kaliuta --- .gitignore | 1 + sources | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 61ee224..8243eb3 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ /kmod-28.tar.xz /kmod-29.tar.gz /kmod-29.tar.xz +/depmod.conf.dist diff --git a/sources b/sources index d70bf5f..d766e45 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-29.tar.xz) = 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 +SHA512 (depmod.conf.dist) = b45bc3c6d78ab0a232ad4f6cb70e265cfc21ea7529be9e75fd0223385c8ebf96899884032ff93ba1717b4c746fd6424793d8f14096711b88cf941a91c1a21ac6 From 2e0ab6c0a5d0196c83b9048f81728963b861867e Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 11 Aug 2021 10:07:23 +0300 Subject: [PATCH 21/57] sources: updated kmod-29.tar.xz koji complained, that the file is not found. Signed-off-by: Yauheni Kaliuta --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index d766e45..d70bf5f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (depmod.conf.dist) = b45bc3c6d78ab0a232ad4f6cb70e265cfc21ea7529be9e75fd0223385c8ebf96899884032ff93ba1717b4c746fd6424793d8f14096711b88cf941a91c1a21ac6 +SHA512 (kmod-29.tar.xz) = 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 From be3d947ed195facf36fdb7738b0501df6d7ee1ba Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 11 Aug 2021 10:18:42 +0300 Subject: [PATCH 22/57] sources: updated depmod.conf.dist Signed-off-by: Yauheni Kaliuta --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index d70bf5f..d766e45 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-29.tar.xz) = 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 +SHA512 (depmod.conf.dist) = b45bc3c6d78ab0a232ad4f6cb70e265cfc21ea7529be9e75fd0223385c8ebf96899884032ff93ba1717b4c746fd6424793d8f14096711b88cf941a91c1a21ac6 From d00681e45464923760b0751fbd6a66caffc8d1d7 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 11 Aug 2021 10:25:12 +0300 Subject: [PATCH 23/57] depmod.dist.conf: commit to git koji still complains. Commit it to git like weak-modules. Signed-off-by: Yauheni Kaliuta --- .gitignore | 1 - depmod.conf.dist | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 depmod.conf.dist diff --git a/.gitignore b/.gitignore index 8243eb3..61ee224 100644 --- a/.gitignore +++ b/.gitignore @@ -22,4 +22,3 @@ /kmod-28.tar.xz /kmod-29.tar.gz /kmod-29.tar.xz -/depmod.conf.dist diff --git a/depmod.conf.dist b/depmod.conf.dist new file mode 100644 index 0000000..8513288 --- /dev/null +++ b/depmod.conf.dist @@ -0,0 +1,6 @@ +# +# depmod.conf +# + +# override default search ordering for kmod packaging +search updates extra built-in weak-updates From 43ea30869b5010b25747783605bd64b1d22d7533 Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Wed, 11 Aug 2021 10:29:45 +0300 Subject: [PATCH 24/57] sources: update again Signed-off-by: Yauheni Kaliuta --- sources | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources b/sources index d766e45..d70bf5f 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (depmod.conf.dist) = b45bc3c6d78ab0a232ad4f6cb70e265cfc21ea7529be9e75fd0223385c8ebf96899884032ff93ba1717b4c746fd6424793d8f14096711b88cf941a91c1a21ac6 +SHA512 (kmod-29.tar.xz) = 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 From 7b3a5b1282b7e50be8f2f790484b4c18693b229a Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Tue, 14 Sep 2021 19:05:21 +0200 Subject: [PATCH 25/57] Rebuilt with OpenSSL 3.0.0 --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index dd787b0..ebde4b9 100644 --- a/kmod.spec +++ b/kmod.spec @@ -13,7 +13,7 @@ Name: kmod Version: 29 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -132,6 +132,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Tue Sep 14 2021 Sahana Prasad - 29-6 +- Rebuilt with OpenSSL 3.0.0 + * Tue Aug 10 2021 Yauheni Kaliuta - 29-5 - kmod.spec: enable debug - weak-modules: compare_initramfs_modules: exit on pushd/popd failures From 22122f8f4fe417b5cd5ccb3e1002185c5a31a2ad Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jan 2022 15:00:31 +0000 Subject: [PATCH 26/57] - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index ebde4b9..faa177f 100644 --- a/kmod.spec +++ b/kmod.spec @@ -13,7 +13,7 @@ Name: kmod Version: 29 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -132,6 +132,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jan 20 2022 Fedora Release Engineering - 29-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + * Tue Sep 14 2021 Sahana Prasad - 29-6 - Rebuilt with OpenSSL 3.0.0 From 095680a70dfff8c1aebb51a5c7d0a6e512b8c4fc Mon Sep 17 00:00:00 2001 From: Yauheni Kaliuta Date: Mon, 4 Jul 2022 15:49:29 +0300 Subject: [PATCH 27/57] New upstream release (v30) - README was removed in order to keep only README.md. Update the spec. - Resolves: rhbz#2102796 Signed-off-by: Yauheni Kaliuta --- .gitignore | 2 ++ kmod.spec | 10 +++++++--- sources | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 61ee224..0587760 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ /kmod-28.tar.xz /kmod-29.tar.gz /kmod-29.tar.xz +/kmod-30.tar.gz +/kmod-30.tar.xz diff --git a/kmod.spec b/kmod.spec index faa177f..a9e837b 100644 --- a/kmod.spec +++ b/kmod.spec @@ -12,8 +12,8 @@ Name: kmod -Version: 29 -Release: 7%{?dist} +Version: 30 +Release: 1%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -120,7 +120,7 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %endif %attr(0644,root,root) %{_mandir}/man5/*.5* %attr(0644,root,root) %{_mandir}/man8/*.8* -%doc NEWS README TODO +%doc NEWS README.md TODO %files libs %license COPYING @@ -132,6 +132,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Mon Jul 4 2022 Yauheni Kaliuta - 30-1 +- New upstream v30 +- Resolves: rhbz#2102796 + * Thu Jan 20 2022 Fedora Release Engineering - 29-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild diff --git a/sources b/sources index d70bf5f..0b8dd33 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-29.tar.xz) = 557cdcaec75e5a1ceea2d10862c944e9a65ef54f6ee9da6dc98ce4582418fdc9958aab2e14a84807db61daf36ec4fcdc23a36376c39d5dc31d1823ca7cd47998 +SHA512 (kmod-30.tar.xz) = e2cd34e600a72e44710760dfda9364b790b8352a99eafbd43e683e4a06f37e6b5c0b5d14e7c28070e30fc5fc6ceddedf7b97f3b6c2c5c2d91204fefd630b9a3e From 73532e3bda14da6002d79aa7d76aee81b273a23e Mon Sep 17 00:00:00 2001 From: Stewart Smith Date: Thu, 23 Jun 2022 01:22:32 +0000 Subject: [PATCH 28/57] Move zlib, xz, and zstd to bcond This allows experiments to be run with reducing the size of the initramfs by having fewer bulky shared libraries in it, and also makes it easier for downstream distributions to make different configuration choices. We keep the defaults the same, building *with* all of these in order to not change what is practically being built in Fedora. Signed-off-by: Stewart Smith --- kmod.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/kmod.spec b/kmod.spec index a9e837b..fabb8b8 100644 --- a/kmod.spec +++ b/kmod.spec @@ -10,6 +10,9 @@ %bcond_with dist_conf %endif +%bcond_without zlib +%bcond_without xz +%bcond_without zstd Name: kmod Version: 30 @@ -25,12 +28,18 @@ Exclusiveos: Linux BuildRequires: gcc BuildRequires: chrpath +%if %{with zlib} BuildRequires: zlib-devel +%endif +%if %{with xz} BuildRequires: xz-devel +%endif BuildRequires: libxslt BuildRequires: openssl-devel BuildRequires: make +%if %{with zstd} BuildRequires: libzstd-devel +%endif Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 @@ -64,9 +73,15 @@ applications that wish to load or unload Linux kernel modules. %build %configure \ --with-openssl \ +%if %{with zlib} --with-zlib \ +%endif +%if %{with xz} --with-xz \ +%endif +%if %{with zstd} --with-zstd \ +%endif --enable-debug %{make_build} V=1 From 35cb0afc6a2c2cb25c6ed09abbaaf479138affc5 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 21 Jul 2022 16:27:22 +0000 Subject: [PATCH 29/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index fabb8b8..c1e076e 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 30 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -147,6 +147,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jul 21 2022 Fedora Release Engineering - 30-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + * Mon Jul 4 2022 Yauheni Kaliuta - 30-1 - New upstream v30 - Resolves: rhbz#2102796 From 5a0a5922f1468e533bc3e7cfea0d3148993281fe Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Sat, 17 Dec 2022 18:20:55 +0100 Subject: [PATCH 30/57] Port configure script to C99 Related to: --- kmod-configure-c99.patch | 37 +++++++++++++++++++++++++++++++++++++ kmod.spec | 8 +++++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 kmod-configure-c99.patch diff --git a/kmod-configure-c99.patch b/kmod-configure-c99.patch new file mode 100644 index 0000000..86cda4d --- /dev/null +++ b/kmod-configure-c99.patch @@ -0,0 +1,37 @@ +configure.ac: In _Noreturn check, include for exit + +Otherwise, an implicit functiona declaration is used, causing +a C99 compatibility issue. + +Submitted upstream: + + + +diff --git a/configure b/configure +index d053310a8b4a313a..ec1f12d02428f848 100755 +--- a/configure ++++ b/configure +@@ -14021,7 +14021,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext + printf %s "checking whether _Noreturn is supported... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ +-_Noreturn int foo(void) { exit(0); } ++#include ++ _Noreturn int foo(void) { exit(0); } + _ACEOF + if ac_fn_c_try_compile "$LINENO" + then : +diff --git a/configure.ac b/configure.ac +index 6989e9360da23721..12e0518533201ccf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE( + + AC_MSG_CHECKING([whether _Noreturn is supported]) + AC_COMPILE_IFELSE( +- [AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])], ++ [AC_LANG_SOURCE([[#include ++ _Noreturn int foo(void) { exit(0); }]])], + [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available]) + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) diff --git a/kmod.spec b/kmod.spec index c1e076e..8d4ee3d 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 30 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -24,6 +24,7 @@ URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules Source2: depmod.conf.dist +Patch0: kmod-configure-c99.patch Exclusiveos: Linux BuildRequires: gcc @@ -69,6 +70,8 @@ applications that wish to load or unload Linux kernel modules. %prep %autosetup -p1 +# Avoid rebuilding the autoconf scripts. +touch -r aclocal.m4 configure* %build %configure \ @@ -147,6 +150,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Sat Dec 17 2022 Florian Weimer - 30-3 +- Port configure script to C99 + * Thu Jul 21 2022 Fedora Release Engineering - 30-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild From 351c2750481b439c0ca0fdcb0ad34e92e6b10e22 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 14:58:10 +0000 Subject: [PATCH 31/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 8d4ee3d..5db359e 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 30 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -150,6 +150,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jan 19 2023 Fedora Release Engineering - 30-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + * Sat Dec 17 2022 Florian Weimer - 30-3 - Port configure script to C99 From 2f9252cb9ec647af097ba07cd6b530d12ceba5e9 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Tue, 9 May 2023 09:11:45 +0200 Subject: [PATCH 32/57] weak-modules: add symvers.xz support Check for symvers.xz support in addition to symvers.gz, due to unnanounced unilateral change[1][2] in the kernel packaging. [1] https://gitlab.com/cki-project/kernel-ark/-/commit/26446656572b8d5934f5d714b1fea76f3ed559c0 [2] https://src.fedoraproject.org/rpms/kernel/c/2db77a072a997c00ee63ddf38b79766699094f1c?branch=rawhide * weak-modules (make_kernel_file_names): Interpret all arguments after the second as a list of suffixes, iterate over them (find_kernel_file): Switch print and suffix arguments, interpret all argument after print as suffixes, pass them to make_kernel_file_names. (find_symvers_file): Update the order of arguments in the find_kernel_file call, add .xz suffix in addition to .gz. (find_systemmap_file): Update the order of arguments in the find_kernel_file call. Signed-off-by: Eugene Syromiatnikov References: https://bugzilla.redhat.com/show_bug.cgi?id=2192895 --- weak-modules | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/weak-modules b/weak-modules index 1a5312b..d4ac171 100644 --- a/weak-modules +++ b/weak-modules @@ -520,26 +520,31 @@ finish_sandbox() { # Auxiliary functions to find symvers file make_kernel_file_names() { local krel="$1" - local file="$2" - local suffix="$3" + shift + local file="$1" + shift - echo "${BASEDIR}/boot/${file}-${krel}${suffix}" - echo "${BASEDIR}/lib/modules/${krel}/${file}${suffix}" + for suffix in "$@"; do + echo "${BASEDIR}/boot/${file}-${krel}${suffix}" + echo "${BASEDIR}/lib/modules/${krel}/${file}${suffix}" + done } find_kernel_file() { local krel="$1" - local file="$2" - local suffix="$3" - local print="$4" + shift + local file="$1" + shift + local print="$1" + shift local i if [[ "$print" != "" ]]; then - make_kernel_file_names "$krel" "$file" "$suffix" + make_kernel_file_names "$krel" "$file" "$@" return 0 fi - for i in $(make_kernel_file_names "$krel" "$file" "$suffix"); do + for i in $(make_kernel_file_names "$krel" "$file" "$@"); do if [[ -r "$i" ]]; then echo "$i" return 0 @@ -563,7 +568,7 @@ find_symvers_file() { local krel="$1" local print="$2" - find_kernel_file "$krel" symvers .gz "$print" + find_kernel_file "$krel" symvers "$print" .xz .gz } # find_systemmap_file: @@ -573,7 +578,7 @@ find_systemmap_file() { local print="$2" local no_suffix="" - find_kernel_file "$krel" System.map "$no_suffix" "$print" + find_kernel_file "$krel" System.map "$print" "$no_suffix" } #### Main logic From b215525d804ccc5bba3737dded24bfd4e101e19b Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Tue, 9 May 2023 09:54:35 +0200 Subject: [PATCH 33/57] packaging: bump up version, 30-5 - Add symvers.xz support to weak-modules Signed-off-by: Eugene Syromiatnikov --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 5db359e..a130db6 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 30 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -150,6 +150,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Tue May 09 2023 Eugene Syromiatnikov - 30-5 +- Add symvers.xz support to weak-modules + * Thu Jan 19 2023 Fedora Release Engineering - 30-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild From 389eca78ce46553388cad55ff130214592881a74 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 09:22:57 +0000 Subject: [PATCH 34/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index a130db6..10ac33f 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 30 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -150,6 +150,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jul 20 2023 Fedora Release Engineering - 30-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + * Tue May 09 2023 Eugene Syromiatnikov - 30-5 - Add symvers.xz support to weak-modules From 15b926cdb793effda714ab931e68037ede82dccd Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Thu, 9 Nov 2023 09:01:37 -0500 Subject: [PATCH 35/57] New upstream v31 Resolves: rhbz#2241394 --- kmod-configure-c99.patch | 37 ------------------------------------- kmod.spec | 9 ++++++--- 2 files changed, 6 insertions(+), 40 deletions(-) delete mode 100644 kmod-configure-c99.patch diff --git a/kmod-configure-c99.patch b/kmod-configure-c99.patch deleted file mode 100644 index 86cda4d..0000000 --- a/kmod-configure-c99.patch +++ /dev/null @@ -1,37 +0,0 @@ -configure.ac: In _Noreturn check, include for exit - -Otherwise, an implicit functiona declaration is used, causing -a C99 compatibility issue. - -Submitted upstream: - - - -diff --git a/configure b/configure -index d053310a8b4a313a..ec1f12d02428f848 100755 ---- a/configure -+++ b/configure -@@ -14021,7 +14021,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - printf %s "checking whether _Noreturn is supported... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ --_Noreturn int foo(void) { exit(0); } -+#include -+ _Noreturn int foo(void) { exit(0); } - _ACEOF - if ac_fn_c_try_compile "$LINENO" - then : -diff --git a/configure.ac b/configure.ac -index 6989e9360da23721..12e0518533201ccf 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE( - - AC_MSG_CHECKING([whether _Noreturn is supported]) - AC_COMPILE_IFELSE( -- [AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])], -+ [AC_LANG_SOURCE([[#include -+ _Noreturn int foo(void) { exit(0); }]])], - [AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available]) - AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no])]) diff --git a/kmod.spec b/kmod.spec index 10ac33f..2d7d19d 100644 --- a/kmod.spec +++ b/kmod.spec @@ -15,8 +15,8 @@ %bcond_without zstd Name: kmod -Version: 30 -Release: 6%{?dist} +Version: 31 +Release: 1%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -24,7 +24,6 @@ URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules Source2: depmod.conf.dist -Patch0: kmod-configure-c99.patch Exclusiveos: Linux BuildRequires: gcc @@ -150,6 +149,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Nov 09 2023 Josh Boyer - 31-1 +- New upstream v31 +- Resolves: rhbz#2241394 + * Thu Jul 20 2023 Fedora Release Engineering - 30-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild From 2d51006e981aa880dbe923cd48e178aad0b4b7b2 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Thu, 9 Nov 2023 11:37:47 -0500 Subject: [PATCH 36/57] Add upstream patches to enable SHA3 support New upstream v31 Resolves: rhbz#2241394 --- .gitignore | 1 + kmod-tip.patch | 561 +++++++++++++++++++++++++++++++++++++++++++++++++ kmod.spec | 17 +- sources | 2 +- 4 files changed, 573 insertions(+), 8 deletions(-) create mode 100644 kmod-tip.patch diff --git a/.gitignore b/.gitignore index 0587760..b19ddb5 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,4 @@ /kmod-29.tar.xz /kmod-30.tar.gz /kmod-30.tar.xz +/kmod-31.tar.xz diff --git a/kmod-tip.patch b/kmod-tip.patch new file mode 100644 index 0000000..d57d9f4 --- /dev/null +++ b/kmod-tip.patch @@ -0,0 +1,561 @@ +From 1bb23d7f19d888fbdd96ae0fe929b7086713ef33 Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 18 Jul 2023 14:01:52 +0200 +Subject: [PATCH 1/6] configure: Detect openssl sm3 support + +Older openssl versions do not support sm3. The code has an option to +disable the sm3 hash but the lack of openssl support is not detected +automatically. + +Signed-off-by: Michal Suchanek +Link: https://lore.kernel.org/r/b97e20faa07e9e31c6eaf96683011aa24e80760c.1689681454.git.msuchanek@suse.de +Signed-off-by: Lucas De Marchi +--- + configure.ac | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 82a8532..e5bceea 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -123,6 +123,13 @@ AC_ARG_WITH([openssl], + AS_IF([test "x$with_openssl" != "xno"], [ + PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0], [LIBS="$LIBS $libcrypto_LIBS"]) + AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.]) ++ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include ++ int nid = NID_sm3;]])], [ ++ AC_MSG_NOTICE([openssl supports sm3]) ++ ], [ ++ AC_MSG_NOTICE([openssl sm3 support not detected]) ++ CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3" ++ ]) + ], [ + AC_MSG_NOTICE([openssl support not requested]) + ]) +-- +2.41.0 + + +From 4e7effbdc00307d0d1e83115e0d00cc75aae5cc6 Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 18 Jul 2023 14:01:53 +0200 +Subject: [PATCH 2/6] man/depmod.d: Fix incorrect /usr/lib search path + +depmod searches /lib/depmod.d but the man page says /usr/lib/depmod.d is +searched. Align the documentation with the code. + +Signed-off-by: Michal Suchanek +Link: https://lore.kernel.org/r/9c5a6356b1a111eb6e17ddb110494b7f1d1b44c0.1689681454.git.msuchanek@suse.de +Signed-off-by: Lucas De Marchi +--- + man/depmod.d.xml | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/man/depmod.d.xml b/man/depmod.d.xml +index 76548e9..8d3d821 100644 +--- a/man/depmod.d.xml ++++ b/man/depmod.d.xml +@@ -39,7 +39,7 @@ + + + +- /usr/lib/depmod.d/*.conf ++ /lib/depmod.d/*.conf + /usr/local/lib/depmod.d/*.conf + /run/depmod.d/*.conf + /etc/depmod.d/*.conf +-- +2.41.0 + + +From 8463809f8a29b254b2cab2ce755641bc690f07c9 Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 18 Jul 2023 14:01:54 +0200 +Subject: [PATCH 3/6] libkmod, depmod: Load modprobe.d, depmod.d from + ${prefix}/lib. + +There is an ongoing effort to limit use of files outside of /usr (or +${prefix} on general). Currently all modprobe.d paths are hardcoded to +outside of $prefix. Teach kmod to load modprobe.d from ${prefix}/lib. + +On some distributions /usr/lib and /lib are the same directory because +of a compatibility symlink, and it is possible to craft configuration +files with sideeffects that would behave differently when loaded twice. +However, the override semantic ensures that one 'overrides' the other, +and only one configuration file of the same name is loaded from any of +the search directories. + +Signed-off-by: Michal Suchanek +Link: https://lore.kernel.org/r/a290343ce32e2a3c25b134e4f27c13b26e06c9e0.1689681454.git.msuchanek@suse.de +Signed-off-by: Lucas De Marchi +--- + Makefile.am | 1 + + configure.ac | 5 +++++ + libkmod/libkmod.c | 7 ++++--- + man/Makefile.am | 9 +++++++-- + man/depmod.d.xml | 1 + + man/modprobe.d.xml | 1 + + tools/depmod.c | 1 + + 7 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 5b7abfe..e6630a3 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -19,6 +19,7 @@ AM_CPPFLAGS = \ + -include $(top_builddir)/config.h \ + -I$(top_srcdir) \ + -DSYSCONFDIR=\""$(sysconfdir)"\" \ ++ -DDISTCONFDIR=\""$(distconfdir)"\" \ + ${zlib_CFLAGS} + + AM_CFLAGS = $(OUR_CFLAGS) +diff --git a/configure.ac b/configure.ac +index e5bceea..fd88d1f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -79,6 +79,10 @@ AC_COMPILE_IFELSE( + # --with- + ##################################################################### + ++AC_ARG_WITH([distconfdir], AS_HELP_STRING([--with-distconfdir=DIR], [directory to search for distribution configuration files]), ++ [], [with_distconfdir='${prefix}/lib']) ++AC_SUBST([distconfdir], [$with_distconfdir]) ++ + AC_ARG_WITH([rootlibdir], + AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), + [], [with_rootlibdir=$libdir]) +@@ -313,6 +317,7 @@ AC_MSG_RESULT([ + + prefix: ${prefix} + sysconfdir: ${sysconfdir} ++ distconfdir: ${distconfdir} + libdir: ${libdir} + rootlibdir: ${rootlibdir} + includedir: ${includedir} +diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c +index 1b8773c..57fac1c 100644 +--- a/libkmod/libkmod.c ++++ b/libkmod/libkmod.c +@@ -65,6 +65,7 @@ static const char *const default_config_paths[] = { + SYSCONFDIR "/modprobe.d", + "/run/modprobe.d", + "/usr/local/lib/modprobe.d", ++ DISTCONFDIR "/modprobe.d", + "/lib/modprobe.d", + NULL + }; +@@ -272,9 +273,9 @@ static enum kmod_file_compression_type get_kernel_compression(struct kmod_ctx *c + * to load from user-defined configuration parameters such as + * alias, blacklists, commands (install, remove). If NULL + * defaults to /etc/modprobe.d, /run/modprobe.d, +- * /usr/local/lib/modprobe.d and /lib/modprobe.d. Give an empty +- * vector if configuration should not be read. This array must +- * be null terminated. ++ * /usr/local/lib/modprobe.d, DISTCONFDIR/modprobe.d, and ++ * /lib/modprobe.d. Give an empty vector if configuration should ++ * not be read. This array must be null terminated. + * + * Create kmod library context. This reads the kmod configuration + * and fills in the default values. +diff --git a/man/Makefile.am b/man/Makefile.am +index 11514d5..2fea8e4 100644 +--- a/man/Makefile.am ++++ b/man/Makefile.am +@@ -17,9 +17,14 @@ EXTRA_DIST = $(MAN5:%.5=%.xml) $(MAN8:%.8=%.xml) + CLEANFILES = $(dist_man_MANS) + + %.5 %.8: %.xml +- $(AM_V_XSLT)$(XSLT) \ ++ $(AM_V_XSLT)if [ '$(distconfdir)' != '/lib' ] ; then \ ++ sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' $< ; \ ++ else \ ++ sed -e '/@DISTCONFDIR@/d' $< ; \ ++ fi | \ ++ $(XSLT) \ + -o $@ \ + --nonet \ + --stringparam man.output.quietly 1 \ + --param funcsynopsis.style "'ansi'" \ +- http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< ++ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl - +diff --git a/man/depmod.d.xml b/man/depmod.d.xml +index 8d3d821..f282a39 100644 +--- a/man/depmod.d.xml ++++ b/man/depmod.d.xml +@@ -40,6 +40,7 @@ + + + /lib/depmod.d/*.conf ++ @DISTCONFDIR@/depmod.d/*.conf + /usr/local/lib/depmod.d/*.conf + /run/depmod.d/*.conf + /etc/depmod.d/*.conf +diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml +index 0ab3e91..2bf6537 100644 +--- a/man/modprobe.d.xml ++++ b/man/modprobe.d.xml +@@ -41,6 +41,7 @@ + + + /lib/modprobe.d/*.conf ++ @DISTCONFDIR@/modprobe.d/*.conf + /usr/local/lib/modprobe.d/*.conf + /run/modprobe.d/*.conf + /etc/modprobe.d/*.conf +diff --git a/tools/depmod.c b/tools/depmod.c +index 1d1d41d..630fef9 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -54,6 +54,7 @@ static const char *const default_cfg_paths[] = { + SYSCONFDIR "/depmod.d", + "/run/depmod.d", + "/usr/local/lib/depmod.d", ++ DISTCONFDIR "/depmod.d", + "/lib/depmod.d", + NULL + }; +-- +2.41.0 + + +From ecef7c131618bbd9c559924ecae55764089db0dd Mon Sep 17 00:00:00 2001 +From: Michal Suchanek +Date: Tue, 18 Jul 2023 14:01:55 +0200 +Subject: [PATCH 4/6] kmod: Add pkgconfig file with kmod compile time + configuration + +Show distconfdir (where system configuration files are searched/to be +installed), sysconfdir (where user configuration files are searched), +module compressions, and module signatures supported. + +Signed-off-by: Michal Suchanek +Link: https://lore.kernel.org/r/468b3f572d3b84f25bb53ec8fcb15ed4871914d4.1689681454.git.msuchanek@suse.de +Signed-off-by: Lucas De Marchi +--- + Makefile.am | 2 +- + configure.ac | 11 +++++++++++ + tools/kmod.pc.in | 9 +++++++++ + 3 files changed, 21 insertions(+), 1 deletion(-) + create mode 100644 tools/kmod.pc.in + +diff --git a/Makefile.am b/Makefile.am +index e6630a3..2a54c25 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -96,7 +96,7 @@ libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) + libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) + + pkgconfigdir = $(libdir)/pkgconfig +-pkgconfig_DATA = libkmod/libkmod.pc ++pkgconfig_DATA = libkmod/libkmod.pc tools/kmod.pc + + bashcompletiondir=@bashcompletiondir@ + dist_bashcompletion_DATA = \ +diff --git a/configure.ac b/configure.ac +index fd88d1f..7bf8d78 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -21,6 +21,9 @@ LT_INIT([disable-static pic-only]) + AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])]) + AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by kmod])]) + ++module_compressions="" ++module_signatures="legacy" ++ + ##################################################################### + # Program checks and configurations + ##################################################################### +@@ -94,6 +97,7 @@ AC_ARG_WITH([zstd], + AS_IF([test "x$with_zstd" != "xno"], [ + PKG_CHECK_MODULES([libzstd], [libzstd >= 1.4.4], [LIBS="$LIBS $libzstd_LIBS"]) + AC_DEFINE([ENABLE_ZSTD], [1], [Enable Zstandard for modules.]) ++ module_compressions="zstd $module_compressions" + ], [ + AC_MSG_NOTICE([Zstandard support not requested]) + ]) +@@ -105,6 +109,7 @@ AC_ARG_WITH([xz], + AS_IF([test "x$with_xz" != "xno"], [ + PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99], [LIBS="$LIBS $liblzma_LIBS"]) + AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.]) ++ module_compressions="xz $module_compressions" + ], [ + AC_MSG_NOTICE([Xz support not requested]) + ]) +@@ -116,6 +121,7 @@ AC_ARG_WITH([zlib], + AS_IF([test "x$with_zlib" != "xno"], [ + PKG_CHECK_MODULES([zlib], [zlib], [LIBS="$LIBS $zlib_LIBS"]) + AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.]) ++ module_compressions="gzip $module_compressions" + ], [ + AC_MSG_NOTICE([zlib support not requested]) + ]) +@@ -134,6 +140,7 @@ AS_IF([test "x$with_openssl" != "xno"], [ + AC_MSG_NOTICE([openssl sm3 support not detected]) + CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3" + ]) ++ module_signatures="PKCS7 $module_signatures" + ], [ + AC_MSG_NOTICE([openssl support not requested]) + ]) +@@ -298,6 +305,9 @@ AC_DEFINE_UNQUOTED(KMOD_FEATURES, ["$with_features"], [Features in this build]) + # Generate files from *.in + ##################################################################### + ++AC_SUBST([module_compressions], $module_compressions) ++AC_SUBST([module_signatures], $module_signatures) ++ + AC_CONFIG_FILES([ + Makefile + man/Makefile +@@ -305,6 +315,7 @@ AC_CONFIG_FILES([ + libkmod/docs/version.xml + libkmod/libkmod.pc + libkmod/python/kmod/version.py ++ tools/kmod.pc + ]) + + +diff --git a/tools/kmod.pc.in b/tools/kmod.pc.in +new file mode 100644 +index 0000000..2595980 +--- /dev/null ++++ b/tools/kmod.pc.in +@@ -0,0 +1,9 @@ ++prefix=@prefix@ ++sysconfdir=@sysconfdir@ ++distconfdir=@distconfdir@ ++module_compressions=@module_compressions@ ++module_signatures=@module_signatures@ ++ ++Name: kmod ++Description: Tools to deal with kernel modules ++Version: @VERSION@ +-- +2.41.0 + + +From 3af2f475b0b729f20279f2ce488cc9f727f0b763 Mon Sep 17 00:00:00 2001 +From: Sam James +Date: Sun, 5 Nov 2023 22:02:25 +0000 +Subject: [PATCH 5/6] tools: depmod: fix -Walloc-size +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +GCC 14 introduces a new -Walloc-size included in -Wextra which gives: +``` +tools/depmod.c:192:14: warning: allocation of insufficient size ‘1’ for type ‘struct index_node’ with size ‘1048’ [-Walloc-size] +tools/depmod.c:255:11: warning: allocation of insufficient size ‘1’ for type ‘struct index_value’ with size ‘16’ [-Walloc-size] +tools/depmod.c:286:35: warning: allocation of insufficient size ‘1’ for type ‘struct index_node’ with size ‘1048’ [-Walloc-size] +tools/depmod.c:315:44: warning: allocation of insufficient size ‘1’ for type ‘struct index_node’ with size ‘1048’ [-Walloc-size] +``` + +The calloc prototype is: +``` +void *calloc(size_t nmemb, size_t size); +``` + +So, just swap the number of members and size arguments to match the prototype, as +we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not +doing anything wrong. + +Signed-off-by: Sam James +--- + tools/depmod.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/tools/depmod.c b/tools/depmod.c +index 630fef9..ab8513b 100644 +--- a/tools/depmod.c ++++ b/tools/depmod.c +@@ -190,7 +190,7 @@ static struct index_node *index_create(void) + { + struct index_node *node; + +- node = NOFAIL(calloc(sizeof(struct index_node), 1)); ++ node = NOFAIL(calloc(1, sizeof(struct index_node))); + node->prefix = NOFAIL(strdup("")); + node->first = INDEX_CHILDMAX; + +@@ -253,7 +253,7 @@ static int index_add_value(struct index_value **values, + values = &(*values)->next; + + len = strlen(value); +- v = NOFAIL(calloc(sizeof(struct index_value) + len + 1, 1)); ++ v = NOFAIL(calloc(1, sizeof(struct index_value) + len + 1)); + v->next = *values; + v->priority = priority; + memcpy(v->value, value, len + 1); +@@ -284,7 +284,7 @@ static int index_insert(struct index_node *node, const char *key, + struct index_node *n; + + /* New child is copy of node with prefix[j+1..N] */ +- n = NOFAIL(calloc(sizeof(struct index_node), 1)); ++ n = NOFAIL(calloc(1, sizeof(struct index_node))); + memcpy(n, node, sizeof(struct index_node)); + n->prefix = NOFAIL(strdup(&prefix[j+1])); + +@@ -313,7 +313,7 @@ static int index_insert(struct index_node *node, const char *key, + node->first = ch; + if (ch > node->last) + node->last = ch; +- node->children[ch] = NOFAIL(calloc(sizeof(struct index_node), 1)); ++ node->children[ch] = NOFAIL(calloc(1, sizeof(struct index_node))); + + child = node->children[ch]; + child->prefix = NOFAIL(strdup(&key[i+1])); +-- +2.41.0 + + +From 510c8b7f7455c6613dd1706e5e41ec7b09cf6703 Mon Sep 17 00:00:00 2001 +From: Dimitri John Ledkov +Date: Sun, 29 Oct 2023 03:03:19 +0200 +Subject: [PATCH 6/6] libkmod: remove pkcs7 obj_to_hash_algo() + +Switch to using OBJ_obj2txt() to calculate and print the pkcs7 +signature hash name. This eliminates the need to duplicate libcrypto +NID to name mapping, detect SM3 openssl compile-time support, and +enables using any hashes that openssl and kernel know about. For +example SHA3 are being added for v6.7 and with this patch are +automatically supported. + +Signed-off-by: Dimitri John Ledkov +Link: https://lore.kernel.org/r/20231029010319.157390-1-dimitri.ledkov@canonical.com +--- + configure.ac | 7 ----- + libkmod/libkmod-signature.c | 59 +++++++++++++------------------------ + 2 files changed, 20 insertions(+), 46 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 7bf8d78..a6b8fa0 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -133,13 +133,6 @@ AC_ARG_WITH([openssl], + AS_IF([test "x$with_openssl" != "xno"], [ + PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0], [LIBS="$LIBS $libcrypto_LIBS"]) + AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.]) +- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include +- int nid = NID_sm3;]])], [ +- AC_MSG_NOTICE([openssl supports sm3]) +- ], [ +- AC_MSG_NOTICE([openssl sm3 support not detected]) +- CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3" +- ]) + module_signatures="PKCS7 $module_signatures" + ], [ + AC_MSG_NOTICE([openssl support not requested]) +diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c +index b749a81..80f6447 100644 +--- a/libkmod/libkmod-signature.c ++++ b/libkmod/libkmod-signature.c +@@ -127,6 +127,7 @@ struct pkcs7_private { + PKCS7 *pkcs7; + unsigned char *key_id; + BIGNUM *sno; ++ char *hash_algo; + }; + + static void pkcs7_free(void *s) +@@ -137,42 +138,11 @@ static void pkcs7_free(void *s) + PKCS7_free(pvt->pkcs7); + BN_free(pvt->sno); + free(pvt->key_id); ++ free(pvt->hash_algo); + free(pvt); + si->private = NULL; + } + +-static int obj_to_hash_algo(const ASN1_OBJECT *o) +-{ +- int nid; +- +- nid = OBJ_obj2nid(o); +- switch (nid) { +- case NID_md4: +- return PKEY_HASH_MD4; +- case NID_md5: +- return PKEY_HASH_MD5; +- case NID_sha1: +- return PKEY_HASH_SHA1; +- case NID_ripemd160: +- return PKEY_HASH_RIPE_MD_160; +- case NID_sha256: +- return PKEY_HASH_SHA256; +- case NID_sha384: +- return PKEY_HASH_SHA384; +- case NID_sha512: +- return PKEY_HASH_SHA512; +- case NID_sha224: +- return PKEY_HASH_SHA224; +-# ifndef OPENSSL_NO_SM3 +- case NID_sm3: +- return PKEY_HASH_SM3; +-# endif +- default: +- return -1; +- } +- return -1; +-} +- + static const char *x509_name_to_str(X509_NAME *name) + { + int i; +@@ -219,7 +189,8 @@ static bool fill_pkcs7(const char *mem, off_t size, + unsigned char *key_id_str; + struct pkcs7_private *pvt; + const char *issuer_str; +- int hash_algo; ++ char *hash_algo; ++ int hash_algo_len; + + size -= sig_len; + pkcs7_raw = mem + size; +@@ -278,27 +249,37 @@ static bool fill_pkcs7(const char *mem, off_t size, + + X509_ALGOR_get0(&o, NULL, NULL, dig_alg); + +- hash_algo = obj_to_hash_algo(o); +- if (hash_algo < 0) ++ // Use OBJ_obj2txt to calculate string length ++ hash_algo_len = OBJ_obj2txt(NULL, 0, o, 0); ++ if (hash_algo_len < 0) + goto err3; +- sig_info->hash_algo = pkey_hash_algo[hash_algo]; +- // hash algo has not been recognized +- if (sig_info->hash_algo == NULL) ++ hash_algo = malloc(hash_algo_len + 1); ++ if (hash_algo == NULL) + goto err3; ++ hash_algo_len = OBJ_obj2txt(hash_algo, hash_algo_len + 1, o, 0); ++ if (hash_algo_len < 0) ++ goto err4; ++ ++ // Assign libcrypto hash algo string or number ++ sig_info->hash_algo = hash_algo; ++ + sig_info->id_type = pkey_id_type[modsig->id_type]; + + pvt = malloc(sizeof(*pvt)); + if (pvt == NULL) +- goto err3; ++ goto err4; + + pvt->pkcs7 = pkcs7; + pvt->key_id = key_id_str; + pvt->sno = sno_bn; ++ pvt->hash_algo = hash_algo; + sig_info->private = pvt; + + sig_info->free = pkcs7_free; + + return true; ++err4: ++ free(hash_algo); + err3: + free(key_id_str); + err2: +-- +2.41.0 + diff --git a/kmod.spec b/kmod.spec index 2d7d19d..f32957d 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities License: GPLv2+ @@ -24,6 +24,7 @@ URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules Source2: depmod.conf.dist +Patch1: kmod-tip.patch Exclusiveos: Linux BuildRequires: gcc @@ -34,9 +35,9 @@ BuildRequires: zlib-devel %if %{with xz} BuildRequires: xz-devel %endif -BuildRequires: libxslt +BuildRequires: libxslt docbook-style-xsl BuildRequires: openssl-devel -BuildRequires: make +BuildRequires: make automake %if %{with zstd} BuildRequires: libzstd-devel %endif @@ -69,8 +70,6 @@ applications that wish to load or unload Linux kernel modules. %prep %autosetup -p1 -# Avoid rebuilding the autoconf scripts. -touch -r aclocal.m4 configure* %build %configure \ @@ -135,7 +134,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %if %{with dist_conf} %{_sysconfdir}/depmod.d/dist.conf %endif -%attr(0644,root,root) %{_mandir}/man5/*.5* +%attr(0644,root,root) %{_mandir}/man5/mod*.d*.5* +%attr(0644,root,root) %{_mandir}/man5/depmod.d.5* +%{_mandir}/man5/modprobe.conf.5* %attr(0644,root,root) %{_mandir}/man8/*.8* %doc NEWS README.md TODO @@ -145,11 +146,13 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %files devel %{_includedir}/libkmod.h +%{_libdir}/pkgconfig/kmod.pc %{_libdir}/pkgconfig/libkmod.pc %{_libdir}/libkmod.so %changelog -* Thu Nov 09 2023 Josh Boyer - 31-1 +* Thu Nov 09 2023 Josh Boyer - 31-2 +- Add upstream patches to enable SHA3 support - New upstream v31 - Resolves: rhbz#2241394 diff --git a/sources b/sources index 0b8dd33..d97b132 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-30.tar.xz) = e2cd34e600a72e44710760dfda9364b790b8352a99eafbd43e683e4a06f37e6b5c0b5d14e7c28070e30fc5fc6ceddedf7b97f3b6c2c5c2d91204fefd630b9a3e +SHA512 (kmod-31.tar.xz) = 05ca70381808bec5f262b94db625662c385408988178a35e4aaf4960ee0716dc0cbfc327160ea4b61098d0c2130ab1b5142ea8156bea8e06ded7f4d288b6d085 From c63e20debb21495f7ed079bb136479f093f9fbcf Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Fri, 1 Dec 2023 17:29:14 +0100 Subject: [PATCH 37/57] kmod.spec: update the License in an attempt to comply with the new policy * kmod.spec (Release): Bump to 3. (License): Update to include all licenses mentioned in the sources, add a comment that lists files for each license. (%package libs): Remove the License tag. (%changelog): Add "migrated to SPDX license" mention. Signed-off-by: Eugene Syromiatnikov --- kmod.spec | 51 ++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/kmod.spec b/kmod.spec index f32957d..ea34929 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,10 +16,53 @@ Name: kmod Version: 31 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux kernel module management utilities -License: GPLv2+ +# https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis +# GPL-2.0-or-later: +# build-aux/compile +# build-aux/depcomp +# build-aux/ltmain.sh +# build-aux/ltmain.sh +# build-aux/missing +# build-aux/py-compile +# build-aux/test-driver +# m4/attributes.m4 +# m4/features.m4 +# tools +# GPL-3.0-or-later: +# build-aux/config.guess +# build-aux/config.sub +# build-aux/git-version-gen +# libkmod/docs/gtk-doc.make +# m4/gtk-doc.m4 +# FSFUL: +# configure +# FSFULLRWD: +# aclocal.m4 +# libkmod/docs/Makefile.in +# m4/libtool.m4 +# m4/lt~obsolete.m4 +# m4/ltoptions.m4 +# m4/ltsugar.m4 +# m4/ltversion.m4 +# Makefile.in +# LGPL-2.1-only: +# libkmod/python/kmod/error.py +# libkmod/python/kmod/__init__.py +# libkmod/python/kmod/version.py +# libkmod/python/kmod/version.py.in +# LGPL-2.1-or-later: +# config.h.in (no explicit license, the one in COPYING is assumed) +# libkmod +# man (no explicit license, the one in COPYING is assumed) +# shared +# shell-completion/bash/kmod +# testsuite +# X11: +# build-aux/install-sh +License: GPL-2.0-or-later AND GPL-3.0-or-later AND FSFUL AND FSFULLRWD AND LGPL-2.1-only AND LGPL-2.1-or-later AND X11 URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules @@ -54,7 +97,6 @@ examples of loaded and unloaded modules. %package libs Summary: Libraries to handle kernel module loading and unloading -License: LGPLv2+ %description libs The kmod-libs package provides runtime libraries for any application that @@ -151,6 +193,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Fri Dec 01 2023 Eugene Syromiatnikov - 31-3 +- migrated to SPDX license + * Thu Nov 09 2023 Josh Boyer - 31-2 - Add upstream patches to enable SHA3 support - New upstream v31 From b335496724965971438ed634792e0d24caab1db1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 01:06:54 +0000 Subject: [PATCH 38/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index ea34929..dfed280 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -193,6 +193,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Sun Jan 21 2024 Fedora Release Engineering - 31-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Fri Dec 01 2023 Eugene Syromiatnikov - 31-3 - migrated to SPDX license From bac67d1d7478ffa5fe40e671c24e9f10e7aa29c2 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 00:42:55 +0000 Subject: [PATCH 39/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index dfed280..e3ffcd3 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -193,6 +193,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jan 25 2024 Fedora Release Engineering - 31-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + * Sun Jan 21 2024 Fedora Release Engineering - 31-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 7648e1a704a4aefe5a2926e4825d0b54087be1b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 11 Apr 2024 10:47:32 +0200 Subject: [PATCH 40/57] Prepare for bin-sbin merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin Create symlinks use 'ln --relative' so that we don't get /usr/bin/foo → ../bin/bar, but instead /usr/bin/foo → bar. Create compat provides for the old file locations to satisfy Requires in other packages. --- kmod.spec | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/kmod.spec b/kmod.spec index e3ffcd3..5971c8b 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -89,6 +89,18 @@ Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 Provides: /sbin/modprobe +%if "%{_sbindir}" == "%{_bindir}" +# Compat symlinks for Requires in other packages. +# We rely on filesystem to create the symlinks for us. +Requires: filesystem(unmerged-sbin-symlinks) +Provides: /usr/sbin/modprobe +Provides: /usr/sbin/modinfo +Provides: /usr/sbin/insmod +Provides: /usr/sbin/rmmod +Provides: /usr/sbin/lsmod +Provides: /usr/sbin/depmod +%endif + %description The kmod package provides various programs needed for automatic loading and unloading of modules under 2.6, 3.x, and later kernels, as well @@ -139,12 +151,9 @@ popd find %{buildroot} -type f -name "*.la" -delete mkdir -p $RPM_BUILD_ROOT%{_sbindir} -ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/modprobe -ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/modinfo -ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/insmod -ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/rmmod -ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/depmod -ln -sf ../bin/kmod $RPM_BUILD_ROOT%{_sbindir}/lsmod +for i in modprobe modinfo insmod rmmod depmod lsmod; do + ln -sf --relative $RPM_BUILD_ROOT%{_bindir}/kmod $RPM_BUILD_ROOT%{_sbindir}/$i +done mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d @@ -193,6 +202,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Apr 11 2024 Zbigniew Jedrzejewski-Szmek - 31-6 +- Prepare for %%_bindir==%%_sbindir + * Thu Jan 25 2024 Fedora Release Engineering - 31-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 486394f8b7dc812cb158ffaef8cf39a03ffbb439 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 12:29:07 +0000 Subject: [PATCH 41/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 5971c8b..3b532d0 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 6%{?dist} +Release: 7%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -202,6 +202,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jul 18 2024 Fedora Release Engineering - 31-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + * Thu Apr 11 2024 Zbigniew Jedrzejewski-Szmek - 31-6 - Prepare for %%_bindir==%%_sbindir From 5baad98a23cd1503639538bf649b0ea9d05b2138 Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Mon, 12 Aug 2024 15:59:22 +0200 Subject: [PATCH 42/57] weak-modules: use a proper program for dumping symvers Previously it was assumed that symvers is in gzip format, which is no longer the case, so zcat was used. Dispatch based on the symvers file extension. References: RHEL-39388 Signed-off-by: Eugene Syromiatnikov --- kmod.spec | 5 ++++- weak-modules | 8 +++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index 3b532d0..fed1427 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 31 -Release: 7%{?dist} +Release: 8%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -202,6 +202,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Mon Aug 12 20234 Eugene Syromiatnikov - 31-8 +- weak-modules: use either zcat or xzcat based on symvers file extension + * Thu Jul 18 2024 Fedora Release Engineering - 31-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild diff --git a/weak-modules b/weak-modules index d4ac171..76523a7 100644 --- a/weak-modules +++ b/weak-modules @@ -758,6 +758,7 @@ validate_weak_links() { # to return to caller that original proposal is not valid # here 0 is true, 1 is false, since it will be the return code local is_configuration_valid=0 + local cat_prog tmp=$(mktemp -p $tmpdir) compatible_modules=() @@ -766,7 +767,12 @@ validate_weak_links() { local symvers_path=$(find_symvers_file "$krel") [[ -n "$symvers_path" ]] || return - zcat "$symvers_path" > $tmpdir/symvers-$krel + cat_prog="cat" + case "$symvers" in + *.gz) cat_prog="zcat" ;; + *.xz) cat_prog="xzcat" ;; + esac + "$cat_prog" "$symvers_path" > $tmpdir/symvers-$krel fi while ((is_updates_changed)); do From 73d6e056b5127a939e3ef6c0440056ac6f1dbd3a Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Mon, 12 Aug 2024 16:11:02 +0200 Subject: [PATCH 43/57] kmod.spec: fix a typo in date in changelog entry Signed-off-by: Eugene Syromiatnikov --- kmod.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index fed1427..c01dc48 100644 --- a/kmod.spec +++ b/kmod.spec @@ -202,7 +202,7 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog -* Mon Aug 12 20234 Eugene Syromiatnikov - 31-8 +* Mon Aug 12 2024 Eugene Syromiatnikov - 31-8 - weak-modules: use either zcat or xzcat based on symvers file extension * Thu Jul 18 2024 Fedora Release Engineering - 31-7 From de9195aa3e41469bb6b51f0788fecd9c57d60f6f Mon Sep 17 00:00:00 2001 From: Eugene Syromiatnikov Date: Thu, 15 Aug 2024 20:40:57 +0200 Subject: [PATCH 44/57] New upstream v33 * .gitignore: Add /kmod-33.tar.xz, * kmod-tip.patch: Remove. * kmod.spec (Version): Bump to 33. (Release): Reset to 1. (Patch1): Remove. (BuildRequires): Remove libxslt and docbook-style-xsl, add scdoc; upstream switched to scdoc-based man pages in commt v33~46. (%install): Remove symlinks installed by make install since v32~3. (%files): kmod.pc is moved to %{_datadir} and is moved to be a part of the main package and not kmod-devel, as it should be; TODO file has been removed in v33~2. (%chanelog): Add a record. * sources: Replace the kmod-31.tar.xz with kmod-33.tar.xz. Resolves: rhbz#2268030 Signed-off-by: Eugene Syromiatnikov --- .gitignore | 1 + kmod-tip.patch | 561 ------------------------------------------------- kmod.spec | 17 +- sources | 2 +- 4 files changed, 13 insertions(+), 568 deletions(-) delete mode 100644 kmod-tip.patch diff --git a/.gitignore b/.gitignore index b19ddb5..b486f98 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ /kmod-30.tar.gz /kmod-30.tar.xz /kmod-31.tar.xz +/kmod-33.tar.xz diff --git a/kmod-tip.patch b/kmod-tip.patch deleted file mode 100644 index d57d9f4..0000000 --- a/kmod-tip.patch +++ /dev/null @@ -1,561 +0,0 @@ -From 1bb23d7f19d888fbdd96ae0fe929b7086713ef33 Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Tue, 18 Jul 2023 14:01:52 +0200 -Subject: [PATCH 1/6] configure: Detect openssl sm3 support - -Older openssl versions do not support sm3. The code has an option to -disable the sm3 hash but the lack of openssl support is not detected -automatically. - -Signed-off-by: Michal Suchanek -Link: https://lore.kernel.org/r/b97e20faa07e9e31c6eaf96683011aa24e80760c.1689681454.git.msuchanek@suse.de -Signed-off-by: Lucas De Marchi ---- - configure.ac | 7 +++++++ - 1 file changed, 7 insertions(+) - -diff --git a/configure.ac b/configure.ac -index 82a8532..e5bceea 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -123,6 +123,13 @@ AC_ARG_WITH([openssl], - AS_IF([test "x$with_openssl" != "xno"], [ - PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0], [LIBS="$LIBS $libcrypto_LIBS"]) - AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.]) -+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include -+ int nid = NID_sm3;]])], [ -+ AC_MSG_NOTICE([openssl supports sm3]) -+ ], [ -+ AC_MSG_NOTICE([openssl sm3 support not detected]) -+ CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3" -+ ]) - ], [ - AC_MSG_NOTICE([openssl support not requested]) - ]) --- -2.41.0 - - -From 4e7effbdc00307d0d1e83115e0d00cc75aae5cc6 Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Tue, 18 Jul 2023 14:01:53 +0200 -Subject: [PATCH 2/6] man/depmod.d: Fix incorrect /usr/lib search path - -depmod searches /lib/depmod.d but the man page says /usr/lib/depmod.d is -searched. Align the documentation with the code. - -Signed-off-by: Michal Suchanek -Link: https://lore.kernel.org/r/9c5a6356b1a111eb6e17ddb110494b7f1d1b44c0.1689681454.git.msuchanek@suse.de -Signed-off-by: Lucas De Marchi ---- - man/depmod.d.xml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/man/depmod.d.xml b/man/depmod.d.xml -index 76548e9..8d3d821 100644 ---- a/man/depmod.d.xml -+++ b/man/depmod.d.xml -@@ -39,7 +39,7 @@ - - - -- /usr/lib/depmod.d/*.conf -+ /lib/depmod.d/*.conf - /usr/local/lib/depmod.d/*.conf - /run/depmod.d/*.conf - /etc/depmod.d/*.conf --- -2.41.0 - - -From 8463809f8a29b254b2cab2ce755641bc690f07c9 Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Tue, 18 Jul 2023 14:01:54 +0200 -Subject: [PATCH 3/6] libkmod, depmod: Load modprobe.d, depmod.d from - ${prefix}/lib. - -There is an ongoing effort to limit use of files outside of /usr (or -${prefix} on general). Currently all modprobe.d paths are hardcoded to -outside of $prefix. Teach kmod to load modprobe.d from ${prefix}/lib. - -On some distributions /usr/lib and /lib are the same directory because -of a compatibility symlink, and it is possible to craft configuration -files with sideeffects that would behave differently when loaded twice. -However, the override semantic ensures that one 'overrides' the other, -and only one configuration file of the same name is loaded from any of -the search directories. - -Signed-off-by: Michal Suchanek -Link: https://lore.kernel.org/r/a290343ce32e2a3c25b134e4f27c13b26e06c9e0.1689681454.git.msuchanek@suse.de -Signed-off-by: Lucas De Marchi ---- - Makefile.am | 1 + - configure.ac | 5 +++++ - libkmod/libkmod.c | 7 ++++--- - man/Makefile.am | 9 +++++++-- - man/depmod.d.xml | 1 + - man/modprobe.d.xml | 1 + - tools/depmod.c | 1 + - 7 files changed, 20 insertions(+), 5 deletions(-) - -diff --git a/Makefile.am b/Makefile.am -index 5b7abfe..e6630a3 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -19,6 +19,7 @@ AM_CPPFLAGS = \ - -include $(top_builddir)/config.h \ - -I$(top_srcdir) \ - -DSYSCONFDIR=\""$(sysconfdir)"\" \ -+ -DDISTCONFDIR=\""$(distconfdir)"\" \ - ${zlib_CFLAGS} - - AM_CFLAGS = $(OUR_CFLAGS) -diff --git a/configure.ac b/configure.ac -index e5bceea..fd88d1f 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -79,6 +79,10 @@ AC_COMPILE_IFELSE( - # --with- - ##################################################################### - -+AC_ARG_WITH([distconfdir], AS_HELP_STRING([--with-distconfdir=DIR], [directory to search for distribution configuration files]), -+ [], [with_distconfdir='${prefix}/lib']) -+AC_SUBST([distconfdir], [$with_distconfdir]) -+ - AC_ARG_WITH([rootlibdir], - AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), - [], [with_rootlibdir=$libdir]) -@@ -313,6 +317,7 @@ AC_MSG_RESULT([ - - prefix: ${prefix} - sysconfdir: ${sysconfdir} -+ distconfdir: ${distconfdir} - libdir: ${libdir} - rootlibdir: ${rootlibdir} - includedir: ${includedir} -diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c -index 1b8773c..57fac1c 100644 ---- a/libkmod/libkmod.c -+++ b/libkmod/libkmod.c -@@ -65,6 +65,7 @@ static const char *const default_config_paths[] = { - SYSCONFDIR "/modprobe.d", - "/run/modprobe.d", - "/usr/local/lib/modprobe.d", -+ DISTCONFDIR "/modprobe.d", - "/lib/modprobe.d", - NULL - }; -@@ -272,9 +273,9 @@ static enum kmod_file_compression_type get_kernel_compression(struct kmod_ctx *c - * to load from user-defined configuration parameters such as - * alias, blacklists, commands (install, remove). If NULL - * defaults to /etc/modprobe.d, /run/modprobe.d, -- * /usr/local/lib/modprobe.d and /lib/modprobe.d. Give an empty -- * vector if configuration should not be read. This array must -- * be null terminated. -+ * /usr/local/lib/modprobe.d, DISTCONFDIR/modprobe.d, and -+ * /lib/modprobe.d. Give an empty vector if configuration should -+ * not be read. This array must be null terminated. - * - * Create kmod library context. This reads the kmod configuration - * and fills in the default values. -diff --git a/man/Makefile.am b/man/Makefile.am -index 11514d5..2fea8e4 100644 ---- a/man/Makefile.am -+++ b/man/Makefile.am -@@ -17,9 +17,14 @@ EXTRA_DIST = $(MAN5:%.5=%.xml) $(MAN8:%.8=%.xml) - CLEANFILES = $(dist_man_MANS) - - %.5 %.8: %.xml -- $(AM_V_XSLT)$(XSLT) \ -+ $(AM_V_XSLT)if [ '$(distconfdir)' != '/lib' ] ; then \ -+ sed -e 's|@DISTCONFDIR@|$(distconfdir)|g' $< ; \ -+ else \ -+ sed -e '/@DISTCONFDIR@/d' $< ; \ -+ fi | \ -+ $(XSLT) \ - -o $@ \ - --nonet \ - --stringparam man.output.quietly 1 \ - --param funcsynopsis.style "'ansi'" \ -- http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< -+ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl - -diff --git a/man/depmod.d.xml b/man/depmod.d.xml -index 8d3d821..f282a39 100644 ---- a/man/depmod.d.xml -+++ b/man/depmod.d.xml -@@ -40,6 +40,7 @@ - - - /lib/depmod.d/*.conf -+ @DISTCONFDIR@/depmod.d/*.conf - /usr/local/lib/depmod.d/*.conf - /run/depmod.d/*.conf - /etc/depmod.d/*.conf -diff --git a/man/modprobe.d.xml b/man/modprobe.d.xml -index 0ab3e91..2bf6537 100644 ---- a/man/modprobe.d.xml -+++ b/man/modprobe.d.xml -@@ -41,6 +41,7 @@ - - - /lib/modprobe.d/*.conf -+ @DISTCONFDIR@/modprobe.d/*.conf - /usr/local/lib/modprobe.d/*.conf - /run/modprobe.d/*.conf - /etc/modprobe.d/*.conf -diff --git a/tools/depmod.c b/tools/depmod.c -index 1d1d41d..630fef9 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -54,6 +54,7 @@ static const char *const default_cfg_paths[] = { - SYSCONFDIR "/depmod.d", - "/run/depmod.d", - "/usr/local/lib/depmod.d", -+ DISTCONFDIR "/depmod.d", - "/lib/depmod.d", - NULL - }; --- -2.41.0 - - -From ecef7c131618bbd9c559924ecae55764089db0dd Mon Sep 17 00:00:00 2001 -From: Michal Suchanek -Date: Tue, 18 Jul 2023 14:01:55 +0200 -Subject: [PATCH 4/6] kmod: Add pkgconfig file with kmod compile time - configuration - -Show distconfdir (where system configuration files are searched/to be -installed), sysconfdir (where user configuration files are searched), -module compressions, and module signatures supported. - -Signed-off-by: Michal Suchanek -Link: https://lore.kernel.org/r/468b3f572d3b84f25bb53ec8fcb15ed4871914d4.1689681454.git.msuchanek@suse.de -Signed-off-by: Lucas De Marchi ---- - Makefile.am | 2 +- - configure.ac | 11 +++++++++++ - tools/kmod.pc.in | 9 +++++++++ - 3 files changed, 21 insertions(+), 1 deletion(-) - create mode 100644 tools/kmod.pc.in - -diff --git a/Makefile.am b/Makefile.am -index e6630a3..2a54c25 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -96,7 +96,7 @@ libkmod_libkmod_internal_la_DEPENDENCIES = $(libkmod_libkmod_la_DEPENDENCIES) - libkmod_libkmod_internal_la_LIBADD = $(libkmod_libkmod_la_LIBADD) - - pkgconfigdir = $(libdir)/pkgconfig --pkgconfig_DATA = libkmod/libkmod.pc -+pkgconfig_DATA = libkmod/libkmod.pc tools/kmod.pc - - bashcompletiondir=@bashcompletiondir@ - dist_bashcompletion_DATA = \ -diff --git a/configure.ac b/configure.ac -index fd88d1f..7bf8d78 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -21,6 +21,9 @@ LT_INIT([disable-static pic-only]) - AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not supported by kmod])]) - AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by kmod])]) - -+module_compressions="" -+module_signatures="legacy" -+ - ##################################################################### - # Program checks and configurations - ##################################################################### -@@ -94,6 +97,7 @@ AC_ARG_WITH([zstd], - AS_IF([test "x$with_zstd" != "xno"], [ - PKG_CHECK_MODULES([libzstd], [libzstd >= 1.4.4], [LIBS="$LIBS $libzstd_LIBS"]) - AC_DEFINE([ENABLE_ZSTD], [1], [Enable Zstandard for modules.]) -+ module_compressions="zstd $module_compressions" - ], [ - AC_MSG_NOTICE([Zstandard support not requested]) - ]) -@@ -105,6 +109,7 @@ AC_ARG_WITH([xz], - AS_IF([test "x$with_xz" != "xno"], [ - PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99], [LIBS="$LIBS $liblzma_LIBS"]) - AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.]) -+ module_compressions="xz $module_compressions" - ], [ - AC_MSG_NOTICE([Xz support not requested]) - ]) -@@ -116,6 +121,7 @@ AC_ARG_WITH([zlib], - AS_IF([test "x$with_zlib" != "xno"], [ - PKG_CHECK_MODULES([zlib], [zlib], [LIBS="$LIBS $zlib_LIBS"]) - AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.]) -+ module_compressions="gzip $module_compressions" - ], [ - AC_MSG_NOTICE([zlib support not requested]) - ]) -@@ -134,6 +140,7 @@ AS_IF([test "x$with_openssl" != "xno"], [ - AC_MSG_NOTICE([openssl sm3 support not detected]) - CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3" - ]) -+ module_signatures="PKCS7 $module_signatures" - ], [ - AC_MSG_NOTICE([openssl support not requested]) - ]) -@@ -298,6 +305,9 @@ AC_DEFINE_UNQUOTED(KMOD_FEATURES, ["$with_features"], [Features in this build]) - # Generate files from *.in - ##################################################################### - -+AC_SUBST([module_compressions], $module_compressions) -+AC_SUBST([module_signatures], $module_signatures) -+ - AC_CONFIG_FILES([ - Makefile - man/Makefile -@@ -305,6 +315,7 @@ AC_CONFIG_FILES([ - libkmod/docs/version.xml - libkmod/libkmod.pc - libkmod/python/kmod/version.py -+ tools/kmod.pc - ]) - - -diff --git a/tools/kmod.pc.in b/tools/kmod.pc.in -new file mode 100644 -index 0000000..2595980 ---- /dev/null -+++ b/tools/kmod.pc.in -@@ -0,0 +1,9 @@ -+prefix=@prefix@ -+sysconfdir=@sysconfdir@ -+distconfdir=@distconfdir@ -+module_compressions=@module_compressions@ -+module_signatures=@module_signatures@ -+ -+Name: kmod -+Description: Tools to deal with kernel modules -+Version: @VERSION@ --- -2.41.0 - - -From 3af2f475b0b729f20279f2ce488cc9f727f0b763 Mon Sep 17 00:00:00 2001 -From: Sam James -Date: Sun, 5 Nov 2023 22:02:25 +0000 -Subject: [PATCH 5/6] tools: depmod: fix -Walloc-size -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -GCC 14 introduces a new -Walloc-size included in -Wextra which gives: -``` -tools/depmod.c:192:14: warning: allocation of insufficient size ‘1’ for type ‘struct index_node’ with size ‘1048’ [-Walloc-size] -tools/depmod.c:255:11: warning: allocation of insufficient size ‘1’ for type ‘struct index_value’ with size ‘16’ [-Walloc-size] -tools/depmod.c:286:35: warning: allocation of insufficient size ‘1’ for type ‘struct index_node’ with size ‘1048’ [-Walloc-size] -tools/depmod.c:315:44: warning: allocation of insufficient size ‘1’ for type ‘struct index_node’ with size ‘1048’ [-Walloc-size] -``` - -The calloc prototype is: -``` -void *calloc(size_t nmemb, size_t size); -``` - -So, just swap the number of members and size arguments to match the prototype, as -we're initialising 1 struct of size `sizeof(struct ...)`. GCC then sees we're not -doing anything wrong. - -Signed-off-by: Sam James ---- - tools/depmod.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - -diff --git a/tools/depmod.c b/tools/depmod.c -index 630fef9..ab8513b 100644 ---- a/tools/depmod.c -+++ b/tools/depmod.c -@@ -190,7 +190,7 @@ static struct index_node *index_create(void) - { - struct index_node *node; - -- node = NOFAIL(calloc(sizeof(struct index_node), 1)); -+ node = NOFAIL(calloc(1, sizeof(struct index_node))); - node->prefix = NOFAIL(strdup("")); - node->first = INDEX_CHILDMAX; - -@@ -253,7 +253,7 @@ static int index_add_value(struct index_value **values, - values = &(*values)->next; - - len = strlen(value); -- v = NOFAIL(calloc(sizeof(struct index_value) + len + 1, 1)); -+ v = NOFAIL(calloc(1, sizeof(struct index_value) + len + 1)); - v->next = *values; - v->priority = priority; - memcpy(v->value, value, len + 1); -@@ -284,7 +284,7 @@ static int index_insert(struct index_node *node, const char *key, - struct index_node *n; - - /* New child is copy of node with prefix[j+1..N] */ -- n = NOFAIL(calloc(sizeof(struct index_node), 1)); -+ n = NOFAIL(calloc(1, sizeof(struct index_node))); - memcpy(n, node, sizeof(struct index_node)); - n->prefix = NOFAIL(strdup(&prefix[j+1])); - -@@ -313,7 +313,7 @@ static int index_insert(struct index_node *node, const char *key, - node->first = ch; - if (ch > node->last) - node->last = ch; -- node->children[ch] = NOFAIL(calloc(sizeof(struct index_node), 1)); -+ node->children[ch] = NOFAIL(calloc(1, sizeof(struct index_node))); - - child = node->children[ch]; - child->prefix = NOFAIL(strdup(&key[i+1])); --- -2.41.0 - - -From 510c8b7f7455c6613dd1706e5e41ec7b09cf6703 Mon Sep 17 00:00:00 2001 -From: Dimitri John Ledkov -Date: Sun, 29 Oct 2023 03:03:19 +0200 -Subject: [PATCH 6/6] libkmod: remove pkcs7 obj_to_hash_algo() - -Switch to using OBJ_obj2txt() to calculate and print the pkcs7 -signature hash name. This eliminates the need to duplicate libcrypto -NID to name mapping, detect SM3 openssl compile-time support, and -enables using any hashes that openssl and kernel know about. For -example SHA3 are being added for v6.7 and with this patch are -automatically supported. - -Signed-off-by: Dimitri John Ledkov -Link: https://lore.kernel.org/r/20231029010319.157390-1-dimitri.ledkov@canonical.com ---- - configure.ac | 7 ----- - libkmod/libkmod-signature.c | 59 +++++++++++++------------------------ - 2 files changed, 20 insertions(+), 46 deletions(-) - -diff --git a/configure.ac b/configure.ac -index 7bf8d78..a6b8fa0 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -133,13 +133,6 @@ AC_ARG_WITH([openssl], - AS_IF([test "x$with_openssl" != "xno"], [ - PKG_CHECK_MODULES([libcrypto], [libcrypto >= 1.1.0], [LIBS="$LIBS $libcrypto_LIBS"]) - AC_DEFINE([ENABLE_OPENSSL], [1], [Enable openssl for modinfo.]) -- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include -- int nid = NID_sm3;]])], [ -- AC_MSG_NOTICE([openssl supports sm3]) -- ], [ -- AC_MSG_NOTICE([openssl sm3 support not detected]) -- CPPFLAGS="$CPPFLAGS -DOPENSSL_NO_SM3" -- ]) - module_signatures="PKCS7 $module_signatures" - ], [ - AC_MSG_NOTICE([openssl support not requested]) -diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c -index b749a81..80f6447 100644 ---- a/libkmod/libkmod-signature.c -+++ b/libkmod/libkmod-signature.c -@@ -127,6 +127,7 @@ struct pkcs7_private { - PKCS7 *pkcs7; - unsigned char *key_id; - BIGNUM *sno; -+ char *hash_algo; - }; - - static void pkcs7_free(void *s) -@@ -137,42 +138,11 @@ static void pkcs7_free(void *s) - PKCS7_free(pvt->pkcs7); - BN_free(pvt->sno); - free(pvt->key_id); -+ free(pvt->hash_algo); - free(pvt); - si->private = NULL; - } - --static int obj_to_hash_algo(const ASN1_OBJECT *o) --{ -- int nid; -- -- nid = OBJ_obj2nid(o); -- switch (nid) { -- case NID_md4: -- return PKEY_HASH_MD4; -- case NID_md5: -- return PKEY_HASH_MD5; -- case NID_sha1: -- return PKEY_HASH_SHA1; -- case NID_ripemd160: -- return PKEY_HASH_RIPE_MD_160; -- case NID_sha256: -- return PKEY_HASH_SHA256; -- case NID_sha384: -- return PKEY_HASH_SHA384; -- case NID_sha512: -- return PKEY_HASH_SHA512; -- case NID_sha224: -- return PKEY_HASH_SHA224; --# ifndef OPENSSL_NO_SM3 -- case NID_sm3: -- return PKEY_HASH_SM3; --# endif -- default: -- return -1; -- } -- return -1; --} -- - static const char *x509_name_to_str(X509_NAME *name) - { - int i; -@@ -219,7 +189,8 @@ static bool fill_pkcs7(const char *mem, off_t size, - unsigned char *key_id_str; - struct pkcs7_private *pvt; - const char *issuer_str; -- int hash_algo; -+ char *hash_algo; -+ int hash_algo_len; - - size -= sig_len; - pkcs7_raw = mem + size; -@@ -278,27 +249,37 @@ static bool fill_pkcs7(const char *mem, off_t size, - - X509_ALGOR_get0(&o, NULL, NULL, dig_alg); - -- hash_algo = obj_to_hash_algo(o); -- if (hash_algo < 0) -+ // Use OBJ_obj2txt to calculate string length -+ hash_algo_len = OBJ_obj2txt(NULL, 0, o, 0); -+ if (hash_algo_len < 0) - goto err3; -- sig_info->hash_algo = pkey_hash_algo[hash_algo]; -- // hash algo has not been recognized -- if (sig_info->hash_algo == NULL) -+ hash_algo = malloc(hash_algo_len + 1); -+ if (hash_algo == NULL) - goto err3; -+ hash_algo_len = OBJ_obj2txt(hash_algo, hash_algo_len + 1, o, 0); -+ if (hash_algo_len < 0) -+ goto err4; -+ -+ // Assign libcrypto hash algo string or number -+ sig_info->hash_algo = hash_algo; -+ - sig_info->id_type = pkey_id_type[modsig->id_type]; - - pvt = malloc(sizeof(*pvt)); - if (pvt == NULL) -- goto err3; -+ goto err4; - - pvt->pkcs7 = pkcs7; - pvt->key_id = key_id_str; - pvt->sno = sno_bn; -+ pvt->hash_algo = hash_algo; - sig_info->private = pvt; - - sig_info->free = pkcs7_free; - - return true; -+err4: -+ free(hash_algo); - err3: - free(key_id_str); - err2: --- -2.41.0 - diff --git a/kmod.spec b/kmod.spec index c01dc48..05ddde2 100644 --- a/kmod.spec +++ b/kmod.spec @@ -15,8 +15,8 @@ %bcond_without zstd Name: kmod -Version: 31 -Release: 8%{?dist} +Version: 33 +Release: 1%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -67,7 +67,6 @@ URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz Source1: weak-modules Source2: depmod.conf.dist -Patch1: kmod-tip.patch Exclusiveos: Linux BuildRequires: gcc @@ -78,7 +77,7 @@ BuildRequires: zlib-devel %if %{with xz} BuildRequires: xz-devel %endif -BuildRequires: libxslt docbook-style-xsl +BuildRequires: scdoc BuildRequires: openssl-devel BuildRequires: make automake %if %{with zstd} @@ -152,6 +151,8 @@ find %{buildroot} -type f -name "*.la" -delete mkdir -p $RPM_BUILD_ROOT%{_sbindir} for i in modprobe modinfo insmod rmmod depmod lsmod; do + # kmod now installs the links into bindir by itself + rm $RPM_BUILD_ROOT%{_bindir}/$i ln -sf --relative $RPM_BUILD_ROOT%{_bindir}/kmod $RPM_BUILD_ROOT%{_sbindir}/$i done @@ -185,11 +186,12 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %if %{with dist_conf} %{_sysconfdir}/depmod.d/dist.conf %endif +%{_datadir}/pkgconfig/kmod.pc %attr(0644,root,root) %{_mandir}/man5/mod*.d*.5* %attr(0644,root,root) %{_mandir}/man5/depmod.d.5* %{_mandir}/man5/modprobe.conf.5* %attr(0644,root,root) %{_mandir}/man8/*.8* -%doc NEWS README.md TODO +%doc NEWS README.md %files libs %license COPYING @@ -197,11 +199,14 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %files devel %{_includedir}/libkmod.h -%{_libdir}/pkgconfig/kmod.pc %{_libdir}/pkgconfig/libkmod.pc %{_libdir}/libkmod.so %changelog +* Thu Aug 15 2024 Eugene Syromiatnikov - 33-1 +- New upstream v33 +- Resolves: rhbz#2268030 + * Mon Aug 12 2024 Eugene Syromiatnikov - 31-8 - weak-modules: use either zcat or xzcat based on symvers file extension diff --git a/sources b/sources index d97b132..0c06f7c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-31.tar.xz) = 05ca70381808bec5f262b94db625662c385408988178a35e4aaf4960ee0716dc0cbfc327160ea4b61098d0c2130ab1b5142ea8156bea8e06ded7f4d288b6d085 +SHA512 (kmod-33.tar.xz) = 32d79d0bb7e89012f18458d4e88325f8e19a7dba6e1d5cff01aec3e618d1757b0f7c119735bf38d02e0d056a14273fd7522fca7c61a4d12a3ea5854bb662fff8 From 0a2caa79e2880b25a791b1130827d1dd8c643c60 Mon Sep 17 00:00:00 2001 From: Peter Robinson Date: Mon, 28 Oct 2024 16:09:50 +0000 Subject: [PATCH 45/57] cleanup gitignore --- .gitignore | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index b486f98..4e53c68 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1 @@ -/kmod-7.tar.xz -/kmod-8.tar.xz -/kmod-9.tar.xz -/kmod-10.tar.xz -/kmod-11.tar.xz -/kmod-12.tar.xz -/kmod-13.tar.xz -/kmod-14.tar.xz -/kmod-15.tar.xz -/kmod-16.tar.xz -/kmod-17.tar.xz -/kmod-18.tar.xz -/kmod-19.tar.xz -/kmod-20.tar.xz -/kmod-21.tar.xz -/kmod-22.tar.xz -/kmod-23.tar.xz -/kmod-24.tar.xz -/kmod-25.tar.xz -/kmod-26.tar.xz -/kmod-27.tar.xz -/kmod-28.tar.xz -/kmod-29.tar.gz -/kmod-29.tar.xz -/kmod-30.tar.gz -/kmod-30.tar.xz -/kmod-31.tar.xz -/kmod-33.tar.xz +/kmod-*.tar.xz From 26240b4bb3f9a4199c4aa8213ce585780bd540a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 12 Jan 2025 14:32:51 +0100 Subject: [PATCH 46/57] Rebuilt for the bin-sbin merge (2nd attempt) https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index 05ddde2..e171cbf 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 33 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -203,6 +203,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek - 33-2 +- Rebuilt for the bin-sbin merge (2nd attempt) + * Thu Aug 15 2024 Eugene Syromiatnikov - 33-1 - New upstream v33 - Resolves: rhbz#2268030 From 35b018985525206e6d7a67dcfe3be70aafae8766 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 09:35:58 +0000 Subject: [PATCH 47/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index e171cbf..7a935b4 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 33 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -203,6 +203,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Fri Jan 17 2025 Fedora Release Engineering - 33-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild + * Sun Jan 12 2025 Zbigniew Jędrzejewski-Szmek - 33-2 - Rebuilt for the bin-sbin merge (2nd attempt) From c6eaf81e4cb61123c4ee84a7da4b64e9b8d5036c Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Mon, 24 Feb 2025 12:13:48 -0500 Subject: [PATCH 48/57] New upstream release --- kmod.spec | 10 +++++++--- sources | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kmod.spec b/kmod.spec index 7a935b4..d88670a 100644 --- a/kmod.spec +++ b/kmod.spec @@ -15,8 +15,8 @@ %bcond_without zstd Name: kmod -Version: 33 -Release: 3%{?dist} +Version: 34 +Release: 1%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -79,7 +79,7 @@ BuildRequires: xz-devel %endif BuildRequires: scdoc BuildRequires: openssl-devel -BuildRequires: make automake +BuildRequires: make automake libtool %if %{with zstd} BuildRequires: libzstd-devel %endif @@ -203,6 +203,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Mon Feb 24 2025 Josh Boyer +- New upstream v34 +- Resolves: rhbz#2347049 + * Fri Jan 17 2025 Fedora Release Engineering - 33-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild diff --git a/sources b/sources index 0c06f7c..b9ece1c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-33.tar.xz) = 32d79d0bb7e89012f18458d4e88325f8e19a7dba6e1d5cff01aec3e618d1757b0f7c119735bf38d02e0d056a14273fd7522fca7c61a4d12a3ea5854bb662fff8 +SHA512 (kmod-34.tar.xz) = 214ef8ea78da059a1dd8cce66267690f27ee47e22398e7b0e0b68834c42eb94f2b77cf99ef9c4bdb3f0aee103abda1d9bc9dfc414051e9ad47a72e063802fdbf From 46456317d7f14ae2ef2fd7b5142e800cd61b16b5 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Mon, 24 Feb 2025 12:26:43 -0500 Subject: [PATCH 49/57] Add gtk-doc BR --- kmod.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index d88670a..5497eaf 100644 --- a/kmod.spec +++ b/kmod.spec @@ -77,7 +77,7 @@ BuildRequires: zlib-devel %if %{with xz} BuildRequires: xz-devel %endif -BuildRequires: scdoc +BuildRequires: scdoc gtk-doc BuildRequires: openssl-devel BuildRequires: make automake libtool %if %{with zstd} From 56b12983a2a52fcc2e8291af771b7bddf4f43f61 Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Mon, 24 Feb 2025 13:16:51 -0500 Subject: [PATCH 50/57] Last changes for -34 --- kmod.spec | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/kmod.spec b/kmod.spec index 5497eaf..9f22611 100644 --- a/kmod.spec +++ b/kmod.spec @@ -125,6 +125,7 @@ applications that wish to load or unload Linux kernel modules. %autosetup -p1 %build +autoreconf --install %configure \ --with-openssl \ %if %{with zlib} @@ -149,13 +150,6 @@ popd find %{buildroot} -type f -name "*.la" -delete -mkdir -p $RPM_BUILD_ROOT%{_sbindir} -for i in modprobe modinfo insmod rmmod depmod lsmod; do - # kmod now installs the links into bindir by itself - rm $RPM_BUILD_ROOT%{_bindir}/$i - ln -sf --relative $RPM_BUILD_ROOT%{_bindir}/kmod $RPM_BUILD_ROOT%{_sbindir}/$i -done - mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d mkdir -p $RPM_BUILD_ROOT%{_prefix}/lib/modprobe.d @@ -183,6 +177,8 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_sbindir}/weak-modules %endif %{_datadir}/bash-completion/ +%{_datadir}/fish/vendor_functions.d/* +%{_datadir}/zsh/site-functions/* %if %{with dist_conf} %{_sysconfdir}/depmod.d/dist.conf %endif From bd7db8fb025ec5567a796bd2e1b9c734ee71b1bc Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Sat, 8 Mar 2025 13:05:24 -0500 Subject: [PATCH 51/57] New upstream v34.1 Resolves: rhbz#2350269 --- kmod.spec | 6 +++++- sources | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index 9f22611..19192eb 100644 --- a/kmod.spec +++ b/kmod.spec @@ -15,7 +15,7 @@ %bcond_without zstd Name: kmod -Version: 34 +Version: 34.1 Release: 1%{?dist} Summary: Linux kernel module management utilities @@ -199,6 +199,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Sat Mar 08 2025 Josh Boyer - 34.1-1 +- New upstream v34.1 +- Resolves: rhbz#2350269 + * Mon Feb 24 2025 Josh Boyer - New upstream v34 - Resolves: rhbz#2347049 diff --git a/sources b/sources index b9ece1c..eca3a3b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-34.tar.xz) = 214ef8ea78da059a1dd8cce66267690f27ee47e22398e7b0e0b68834c42eb94f2b77cf99ef9c4bdb3f0aee103abda1d9bc9dfc414051e9ad47a72e063802fdbf +SHA512 (kmod-34.1.tar.xz) = f1f5026f31747270aea8b65df9eca95cc253e48622bfdb87e016e272a79ad1e90c0026cdf83a947fd53d8cbc1be1c546a5116db9617b690ab1b80f9792b6f5b2 From c41da9ae87a643a5fbc77a9b67af2d543371353b Mon Sep 17 00:00:00 2001 From: Josh Boyer Date: Mon, 31 Mar 2025 07:41:52 -0400 Subject: [PATCH 52/57] New upstream v34.2 Resolves: rhbz#2355680 --- kmod.spec | 6 +++++- sources | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index 19192eb..bc28ee9 100644 --- a/kmod.spec +++ b/kmod.spec @@ -15,7 +15,7 @@ %bcond_without zstd Name: kmod -Version: 34.1 +Version: 34.2 Release: 1%{?dist} Summary: Linux kernel module management utilities @@ -199,6 +199,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Mon Mar 31 2025 Josh Boyer - 34.2-1 +- New upstream v34.2 +- Resolves: rhbz#2355680 + * Sat Mar 08 2025 Josh Boyer - 34.1-1 - New upstream v34.1 - Resolves: rhbz#2350269 diff --git a/sources b/sources index eca3a3b..0390a92 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (kmod-34.1.tar.xz) = f1f5026f31747270aea8b65df9eca95cc253e48622bfdb87e016e272a79ad1e90c0026cdf83a947fd53d8cbc1be1c546a5116db9617b690ab1b80f9792b6f5b2 +SHA512 (kmod-34.2.tar.xz) = 0e095c45ad61a6c61ce1ad61b9aa10cf5040e688b749f9a933b0e7d12de493c58027a5068b459cbbce05576fc564a22b83a3dbef1e6511b2a3e27034c88afd33 From d1dc8b58a874162dd3d0e0004d0f6172ac090f4e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 18:50:59 +0000 Subject: [PATCH 53/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild --- kmod.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index bc28ee9..ce3b8be 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 34.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -199,6 +199,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Thu Jul 24 2025 Fedora Release Engineering - 34.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild + * Mon Mar 31 2025 Josh Boyer - 34.2-1 - New upstream v34.2 - Resolves: rhbz#2355680 From b64bf8be07c2fe54ca79009218e72161de636a89 Mon Sep 17 00:00:00 2001 From: "Ziqian SUN (Zamir)" Date: Thu, 20 Mar 2025 16:50:10 +0800 Subject: [PATCH 54/57] Convert gating to restraint and tmt Signed-off-by: Ziqian SUN (Zamir) --- .fmf/version | 1 + tests/libkmod/Makefile | 46 ----------------------- tests/libkmod/libkmod.fmf | 6 +++ tests/libkmod/metadata | 14 +++++++ tests/libkmod/runtest.sh | 1 + tests/plan.fmf | 4 ++ tests/sanity/Makefile | 79 --------------------------------------- tests/sanity/metadata | 12 ++++++ tests/sanity/sanity.fmf | 1 + tests/tests.yml | 2 +- 10 files changed, 40 insertions(+), 126 deletions(-) create mode 100644 .fmf/version delete mode 100644 tests/libkmod/Makefile create mode 100644 tests/libkmod/libkmod.fmf create mode 100644 tests/libkmod/metadata create mode 100644 tests/plan.fmf delete mode 100644 tests/sanity/Makefile create mode 100644 tests/sanity/metadata create mode 100644 tests/sanity/sanity.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/tests/libkmod/Makefile b/tests/libkmod/Makefile deleted file mode 100644 index cc53a81..0000000 --- a/tests/libkmod/Makefile +++ /dev/null @@ -1,46 +0,0 @@ -# SPDX-License-Identifier: LGPL-2.1+ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/libkmod -# Description: Test if libkmod working ok -# Author: Susant Sahani -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -export TEST=/CoreOS/libkmod -export TESTVERSION=1.0 - -OBJS = test-libkmod.c -CFLAG = -Wall -g3 -CC = gcc -LIBS = -lkmod -lcmocka - -test-libkmod:${OBJ} - ${CC} ${CFLAGS} ${INCLUDES} -o $@ ${OBJS} ${LIBS} - -run: test-libkmod - ./runtest.sh -clean: - -rm -f test-libkmod - -.c.o: - ${CC} ${CFLAGS} ${INCLUDES} -c $< - -CC = gcc - -include /usr/share/rhts/lib/rhts-make.include -$(METADATA): Makefile - @echo "Owner: Susant Sahani" > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Test libkmod works ok" >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 5m" >> $(METADATA) - @echo "RunFor: libkmod" >> $(METADATA) - @echo "Requires: libkmod libkmod-devel" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - @echo "Releases: -Fedora 29" >> $(METADATA) - rhts-lint $(METADATA) diff --git a/tests/libkmod/libkmod.fmf b/tests/libkmod/libkmod.fmf new file mode 100644 index 0000000..d796b57 --- /dev/null +++ b/tests/libkmod/libkmod.fmf @@ -0,0 +1,6 @@ +test: bash ./runtest.sh +require: + - libcmocka-devel + - kmod-devel + - make + - gcc diff --git a/tests/libkmod/metadata b/tests/libkmod/metadata new file mode 100644 index 0000000..455987a --- /dev/null +++ b/tests/libkmod/metadata @@ -0,0 +1,14 @@ +[General] +name=libkmod gating test +owner=Susant Sahani +description=libkmod gating test +license=GPLv2 +confidential=no +destructive=no + +[restraint] +entry_point=./runtest.sh +max_time=15m +use_pty=false +dependencies=gcc,make,libcmocka-devel,kmod-devel + diff --git a/tests/libkmod/runtest.sh b/tests/libkmod/runtest.sh index 1ef013c..d86b2e2 100755 --- a/tests/libkmod/runtest.sh +++ b/tests/libkmod/runtest.sh @@ -18,6 +18,7 @@ rlJournalStart rlPhaseStartSetup rlAssertRpm $PACKAGE rlAssertExists "$IPIP" + rlRun "gcc -o test-libkmod test-libkmod.c -lkmod -lcmocka" rlRun "cp test-libkmod /usr/bin/" rlPhaseEnd diff --git a/tests/plan.fmf b/tests/plan.fmf new file mode 100644 index 0000000..e6427de --- /dev/null +++ b/tests/plan.fmf @@ -0,0 +1,4 @@ +discover: + how: fmf +execute: + how: tmt diff --git a/tests/sanity/Makefile b/tests/sanity/Makefile deleted file mode 100644 index e422f7f..0000000 --- a/tests/sanity/Makefile +++ /dev/null @@ -1,79 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of general/kmod/sanity -# Description: kmod test -# -# 2016-07-31 -# Author: Chunyu Hu -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2016 Red Hat, Inc. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -TENV=_env -ifeq ($(PKG_TOP_DIR),) - export PKG_TOP_DIR := $(shell p=$$PWD; while :; do \ - [ -e $$p/env.mk -o -z "$$p" ] && { echo $$p; break; }; p=$${p%/*}; done) - export _TOP_DIR := $(shell p=$$PWD; while :; do \ - [ -d $$p/.git -o -z "$$p" ] && { echo $$p; break; }; p=$${p%/*}; done) - -include $(PKG_TOP_DIR)/env.mk -endif -include $(TENV) -ifeq ($(_TOP_DIR),) - _TOP_DIR=/mnt/tests/$(TOPLEVEL_NAMESPACE) -endif - -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(TENV) $(METADATA) _env runtest.sh Makefile PURPOSE lib.sh - -.PHONY: all install download clean - -run: $(FILES) build - ( set +o posix; . /usr/bin/rhts_environment.sh; \ - . /usr/share/beakerlib/beakerlib.sh; \ - . runtest.sh ) - -build: $(BUILT_FILES) - test -x runtest.sh || chmod a+x runtest.sh - -clean: - rm -fr *~ $(BUILT_FILES) - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Chunyu Hu " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: kmod kernel module check from kernel modules tools">> $(METADATA) - @echo "Type: Regression" >> $(METADATA) - @echo "TestTime: 1h" >> $(METADATA) - @echo "RunFor: kernel" >> $(METADATA) - @echo "Requires: kernel" >> $(METADATA) - @echo "Requires: sysstat perf trace-cmd" >> $(METADATA) - @echo "Requires: $(PACKAGE_NAME) python rpm wget" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - rhts-lint $(METADATA) diff --git a/tests/sanity/metadata b/tests/sanity/metadata new file mode 100644 index 0000000..6c68b4b --- /dev/null +++ b/tests/sanity/metadata @@ -0,0 +1,12 @@ +[General] +name=kmod gating test +owner=Ziqian SUN +description=kmod gating test +license=GPLv2 +confidential=no +destructive=no + +[restraint] +entry_point=./runtest.sh +max_time=15m +use_pty=false diff --git a/tests/sanity/sanity.fmf b/tests/sanity/sanity.fmf new file mode 100644 index 0000000..e9c6959 --- /dev/null +++ b/tests/sanity/sanity.fmf @@ -0,0 +1 @@ +test: bash ./runtest.sh diff --git a/tests/tests.yml b/tests/tests.yml index 828a27a..c8bd0fd 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -2,7 +2,7 @@ tags: - classic roles: - - role: standard-test-beakerlib + - role: standard-test-basic tests: - sanity - libkmod From b4bcf63353f3da600ec5a48b0cf60873f9d313ea Mon Sep 17 00:00:00 2001 From: Zamir SUN Date: Wed, 13 Aug 2025 15:11:26 +0800 Subject: [PATCH 55/57] Tests: Fix fmf files for gating Signed-off-by: Zamir SUN --- tests/libkmod/libkmod.fmf | 7 ++----- tests/plan.fmf | 6 ++++++ tests/sanity/sanity.fmf | 2 ++ 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/libkmod/libkmod.fmf b/tests/libkmod/libkmod.fmf index d796b57..8733518 100644 --- a/tests/libkmod/libkmod.fmf +++ b/tests/libkmod/libkmod.fmf @@ -1,6 +1,3 @@ test: bash ./runtest.sh -require: - - libcmocka-devel - - kmod-devel - - make - - gcc +framework: beakerlib +duration: 15m diff --git a/tests/plan.fmf b/tests/plan.fmf index e6427de..160239c 100644 --- a/tests/plan.fmf +++ b/tests/plan.fmf @@ -1,3 +1,9 @@ +prepare: + how: install + package: + - libcmocka-devel + - make + - gcc discover: how: fmf execute: diff --git a/tests/sanity/sanity.fmf b/tests/sanity/sanity.fmf index e9c6959..8733518 100644 --- a/tests/sanity/sanity.fmf +++ b/tests/sanity/sanity.fmf @@ -1 +1,3 @@ test: bash ./runtest.sh +framework: beakerlib +duration: 15m From 91014e42d6e32377371d118a529f2295357f552c Mon Sep 17 00:00:00 2001 From: Zamir SUN Date: Wed, 13 Aug 2025 15:11:51 +0800 Subject: [PATCH 56/57] Tests: Remove tests.yml STI entrypoint to make tmt work Signed-off-by: Zamir SUN --- tests/tests.yml | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 tests/tests.yml diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index c8bd0fd..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,18 +0,0 @@ -- hosts: localhost - tags: - - classic - roles: - - role: standard-test-basic - tests: - - sanity - - libkmod - required_packages: - - kernel - - perf - - sysstat - - trace-cmd - - kmod - - kmod-devel - - gcc - - libcmocka - - libcmocka-devel From 2ce6b84eca9864e2d1286ffa184c728bd2ecc75f Mon Sep 17 00:00:00 2001 From: Zamir SUN Date: Wed, 13 Aug 2025 15:14:36 +0800 Subject: [PATCH 57/57] Bump to 34.2-3 to build and run new gating Signed-off-by: Zamir SUN --- kmod.spec | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/kmod.spec b/kmod.spec index ce3b8be..8d0b67b 100644 --- a/kmod.spec +++ b/kmod.spec @@ -16,7 +16,7 @@ Name: kmod Version: 34.2 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Linux kernel module management utilities # https://docs.fedoraproject.org/en-US/legal/license-field/#_no_effective_license_analysis @@ -199,6 +199,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/libkmod.so %changelog +* Wed Aug 13 2025 Zamir SUN - 34.2-3 +- Rebuild to switch gating to TMT. +- Resolves: rhbz#2382934 + * Thu Jul 24 2025 Fedora Release Engineering - 34.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild