From 403884623a072d2298d686e4e9e519d5ff61539a Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Tue, 16 Jul 2024 14:19:12 +0800 Subject: [PATCH 1/3] update to kmod-25-20.src.rpm Signed-off-by: Zhao Hang --- 1000-libkmod-Support-SM3-hash-algorithm.patch | 47 ------------------- dist | 1 + kmod.spec | 38 ++------------- weak-modules | 27 ++++++----- 4 files changed, 22 insertions(+), 91 deletions(-) delete mode 100644 1000-libkmod-Support-SM3-hash-algorithm.patch create mode 100644 dist diff --git a/1000-libkmod-Support-SM3-hash-algorithm.patch b/1000-libkmod-Support-SM3-hash-algorithm.patch deleted file mode 100644 index c419904..0000000 --- a/1000-libkmod-Support-SM3-hash-algorithm.patch +++ /dev/null @@ -1,47 +0,0 @@ -From f609cb5185acb0955d66795cb297e9fe9d83405a Mon Sep 17 00:00:00 2001 -From: HuaxinLu -Date: Thu, 30 Jun 2022 14:36:05 +0800 -Subject: [PATCH] libkmod: Support SM3 hash algorithm - -SM3 has been supported in kernel and cryptographic libraries like openssl. -This patch adds support for the SM3 algorithm of kmod. - -Signed-off-by: HuaxinLu ---- - libkmod/libkmod-signature.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c -index 4e8748c26c1c..4ae5af63ac22 100644 ---- a/libkmod/libkmod-signature.c -+++ b/libkmod/libkmod-signature.c -@@ -56,6 +56,7 @@ enum pkey_hash_algo { - PKEY_HASH_SHA384, - PKEY_HASH_SHA512, - PKEY_HASH_SHA224, -+ PKEY_HASH_SM3, - PKEY_HASH__LAST - }; - -@@ -68,6 +69,7 @@ const char *const pkey_hash_algo[PKEY_HASH__LAST] = { - [PKEY_HASH_SHA384] = "sha384", - [PKEY_HASH_SHA512] = "sha512", - [PKEY_HASH_SHA224] = "sha224", -+ [PKEY_HASH_SM3] = "sm3", - }; - - enum pkey_id_type { -@@ -161,6 +163,10 @@ static int obj_to_hash_algo(const ASN1_OBJECT *o) - 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; - } --- -2.24.3 (Apple Git-128) - diff --git a/dist b/dist new file mode 100644 index 0000000..9c0e36e --- /dev/null +++ b/dist @@ -0,0 +1 @@ +an8 diff --git a/kmod.spec b/kmod.spec index c07450c..67587a3 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,8 +1,6 @@ -%define anolis_release .0.2 - Name: kmod Version: 25 -Release: 19%{anolis_release}%{?dist} +Release: 20%{?dist} Summary: Linux kernel module management utilities Group: System Environment/Kernel @@ -19,8 +17,6 @@ Patch03: kmod-modprobe-ignore-builtin-module-on-recursive-removing.patch Patch04: 0001-depmod-prevent-module-dependency-files-missing-durin.patch Patch05: 0002-depmod-prevent-module-dependency-files-corruption-du.patch -Patch1000: 1000-libkmod-Support-SM3-hash-algorithm.patch - BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: chrpath BuildRequires: zlib-devel @@ -30,19 +26,9 @@ BuildRequires: openssl-devel # Remove it as soon as no need for Patch02 anymore (Makefile.am updated) BuildRequires: automake autoconf libtool -Requires: glibc - Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 Provides: /sbin/modprobe -Provides: /usr/bin/%{name} -Provides: /usr/sbin/depmod -Provides: /usr/sbin/insmod -Provides: /usr/sbin/lsmod -Provides: /usr/sbin/modinfo -Provides: /usr/sbin/modprobe -Provides: /usr/sbin/rmmod -Provides: /usr/sbin/weak-modules %description The kmod package provides various programs needed for automatic @@ -68,14 +54,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. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -Doc pages for %{name}. - %prep %setup -q %patch01 -p1 @@ -84,8 +62,6 @@ Doc pages for %{name}. %patch04 -p1 %patch05 -p1 -%patch1000 -p1 - %build export V=1 aclocal @@ -140,6 +116,7 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_sysconfdir}/depmod.d/dist.conf %attr(0644,root,root) %{_mandir}/man5/*.5* %attr(0644,root,root) %{_mandir}/man8/*.8* +%doc NEWS README TODO %files libs %{!?_licensedir:%global license %%doc} @@ -151,15 +128,10 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/pkgconfig/libkmod.pc %{_libdir}/libkmod.so -%files doc -%doc NEWS README TODO - %changelog -* Thu May 25 2023 Tianjia Zhang - 25-19.0.2 -- Support SM3 hash algorithm - -* Mon Jul 18 2022 Zhao Hang - 25-19.0.1 -- Add doc sub package +* Wed Oct 11 2023 Eugene Syromiatnikov - 25-20 +- Add symvers.xz support to weak-modules +- Resolves: RHEL-8903 * Mon Nov 29 2021 Yauheni Kaliuta - 25-19 - depmod: fix parallel execution issues diff --git a/weak-modules b/weak-modules index 2b16275..2aeb9d4 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 -- Gitee From 12db35a8de43bbe0df4c0173549580e16b1d02be Mon Sep 17 00:00:00 2001 From: Zhao Hang Date: Mon, 18 Jul 2022 11:07:04 +0800 Subject: [PATCH 2/3] spec: add doc sub package Signed-off-by: Zhao Hang --- kmod.spec | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/kmod.spec b/kmod.spec index 67587a3..6df4232 100644 --- a/kmod.spec +++ b/kmod.spec @@ -1,6 +1,8 @@ +%define anolis_release .0.1 + Name: kmod Version: 25 -Release: 20%{?dist} +Release: 20%{anolis_release}%{?dist} Summary: Linux kernel module management utilities Group: System Environment/Kernel @@ -26,9 +28,19 @@ BuildRequires: openssl-devel # Remove it as soon as no need for Patch02 anymore (Makefile.am updated) BuildRequires: automake autoconf libtool +Requires: glibc + Provides: module-init-tools = 4.0-1 Obsoletes: module-init-tools < 4.0-1 Provides: /sbin/modprobe +Provides: /usr/bin/%{name} +Provides: /usr/sbin/depmod +Provides: /usr/sbin/insmod +Provides: /usr/sbin/lsmod +Provides: /usr/sbin/modinfo +Provides: /usr/sbin/modprobe +Provides: /usr/sbin/rmmod +Provides: /usr/sbin/weak-modules %description The kmod package provides various programs needed for automatic @@ -54,6 +66,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. +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Doc pages for %{name}. + %prep %setup -q %patch01 -p1 @@ -116,7 +136,6 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_sysconfdir}/depmod.d/dist.conf %attr(0644,root,root) %{_mandir}/man5/*.5* %attr(0644,root,root) %{_mandir}/man8/*.8* -%doc NEWS README TODO %files libs %{!?_licensedir:%global license %%doc} @@ -128,7 +147,13 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %{_libdir}/pkgconfig/libkmod.pc %{_libdir}/libkmod.so +%files doc +%doc NEWS README TODO + %changelog +* Tue Jul 16 2024 Zhao Hang - 25-20.0.1 +- Add doc sub package + * Wed Oct 11 2023 Eugene Syromiatnikov - 25-20 - Add symvers.xz support to weak-modules - Resolves: RHEL-8903 -- Gitee From 65c666d86fc9102191ddd258fb6f13e8b3a18f80 Mon Sep 17 00:00:00 2001 From: Tianjia Zhang Date: Thu, 25 May 2023 11:33:26 +0800 Subject: [PATCH 3/3] Support SM3 hash algorithm Signed-off-by: Tianjia Zhang --- 1000-libkmod-Support-SM3-hash-algorithm.patch | 47 +++++++++++++++++++ kmod.spec | 5 ++ 2 files changed, 52 insertions(+) create mode 100644 1000-libkmod-Support-SM3-hash-algorithm.patch diff --git a/1000-libkmod-Support-SM3-hash-algorithm.patch b/1000-libkmod-Support-SM3-hash-algorithm.patch new file mode 100644 index 0000000..c419904 --- /dev/null +++ b/1000-libkmod-Support-SM3-hash-algorithm.patch @@ -0,0 +1,47 @@ +From f609cb5185acb0955d66795cb297e9fe9d83405a Mon Sep 17 00:00:00 2001 +From: HuaxinLu +Date: Thu, 30 Jun 2022 14:36:05 +0800 +Subject: [PATCH] libkmod: Support SM3 hash algorithm + +SM3 has been supported in kernel and cryptographic libraries like openssl. +This patch adds support for the SM3 algorithm of kmod. + +Signed-off-by: HuaxinLu +--- + libkmod/libkmod-signature.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/libkmod/libkmod-signature.c b/libkmod/libkmod-signature.c +index 4e8748c26c1c..4ae5af63ac22 100644 +--- a/libkmod/libkmod-signature.c ++++ b/libkmod/libkmod-signature.c +@@ -56,6 +56,7 @@ enum pkey_hash_algo { + PKEY_HASH_SHA384, + PKEY_HASH_SHA512, + PKEY_HASH_SHA224, ++ PKEY_HASH_SM3, + PKEY_HASH__LAST + }; + +@@ -68,6 +69,7 @@ const char *const pkey_hash_algo[PKEY_HASH__LAST] = { + [PKEY_HASH_SHA384] = "sha384", + [PKEY_HASH_SHA512] = "sha512", + [PKEY_HASH_SHA224] = "sha224", ++ [PKEY_HASH_SM3] = "sm3", + }; + + enum pkey_id_type { +@@ -161,6 +163,10 @@ static int obj_to_hash_algo(const ASN1_OBJECT *o) + 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; + } +-- +2.24.3 (Apple Git-128) + diff --git a/kmod.spec b/kmod.spec index 6df4232..a4609a6 100644 --- a/kmod.spec +++ b/kmod.spec @@ -19,6 +19,8 @@ Patch03: kmod-modprobe-ignore-builtin-module-on-recursive-removing.patch Patch04: 0001-depmod-prevent-module-dependency-files-missing-durin.patch Patch05: 0002-depmod-prevent-module-dependency-files-corruption-du.patch +Patch1000: 1000-libkmod-Support-SM3-hash-algorithm.patch + BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) BuildRequires: chrpath BuildRequires: zlib-devel @@ -82,6 +84,8 @@ Doc pages for %{name}. %patch04 -p1 %patch05 -p1 +%patch1000 -p1 + %build export V=1 aclocal @@ -153,6 +157,7 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf %changelog * Tue Jul 16 2024 Zhao Hang - 25-20.0.1 - Add doc sub package +- Support SM3 hash algorithm (tianjia.zhang@linux.alibaba.com) * Wed Oct 11 2023 Eugene Syromiatnikov - 25-20 - Add symvers.xz support to weak-modules -- Gitee