kpatch-build: Remove duplicate functions

Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
This commit is contained in:
tangbin 2022-09-06 12:47:29 -04:00
parent 1a9fa8d9b7
commit 32c1d0685e
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,43 @@
From 81a48ca6a060cf006cf9eec309e726c4333a9d46 Mon Sep 17 00:00:00 2001
From: tangbin <tangbin_yewu@cmss.chinamobile.com>
Date: Tue, 6 Sep 2022 11:46:41 -0400
Subject: [PATCH] kpatch-build: Remove duplicate functions
We find that there are duplicate functions of "use_klp_arch()" &
"rhel_kernel_version_gte", and one of them are useless, so remove
them.
Signed-off-by: tangbin <tangbin_yewu@cmss.chinamobile.com>
---
kpatch-build/kpatch-build | 15 ---------------
1 file changed, 15 deletions(-)
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
index dc5f5a5..6a0645a 100755
--- a/kpatch-build/kpatch-build
+++ b/kpatch-build/kpatch-build
@@ -198,21 +198,6 @@ rhel_kernel_version_gte() {
[ "${ARCHVERSION}" = "$(echo -e "${ARCHVERSION}\\n$1" | sort -rV | head -n1)" ]
}
-# klp.arch relocations were supported prior to v5.8
-# and prior to 4.18.0-240.el8
-use_klp_arch()
-{
- if kernel_is_rhel; then
- ! rhel_kernel_version_gte 4.18.0-240.el8
- else
- ! kernel_version_gte 5.8.0
- fi
-}
-
-rhel_kernel_version_gte() {
- [ "${ARCHVERSION}" = "$(echo -e "${ARCHVERSION}\\n$1" | sort -rV | head -n1)" ]
-}
-
# klp.arch relocations were supported prior to v5.8
# and prior to 4.18.0-284.el8
use_klp_arch()
--
2.18.4

View File

@ -1,7 +1,7 @@
Name: kpatch
Epoch: 1
Version: 0.9.5
Release: 12
Release: 13
Summary: A Linux dynamic kernel patching infrastructure
License: GPLv2
@ -55,6 +55,7 @@ Patch0039:0039-create-diff-object-ignore-change-of-certain.patch
Patch0040:0040-create-diff-object-allow-__jump_table-section.patch
Patch0041:0041-livepatch-patch-hook-fix-kpatch-build-error-which-do.patch
Patch0042:0042-kpatch-build-fix-loading-error-in-aarch64.patch
Patch0043:0043-kpatch-build-Remove-duplicate-functions.patch
BuildRequires: gcc elfutils-libelf-devel kernel-devel git
Requires: bc make gcc patch bison flex openssl-devel
@ -115,6 +116,12 @@ popd
%{_mandir}/man1/*.1.gz
%changelog
* Tue Sep 6 2022 Tang Bin <tangbin_yewu@cmss.chinamobile.com> -1:0.9.5-13
- Type:clean code
- ID:NA
- SUG:NA
- DESC:kpatch-build: Remove duplicate functions
* Tue Sep 6 2022 Tang Bin <tangbin_yewu@cmss.chinamobile.com> -1:0.9.5-12
- Type:bugfix
- ID:NA