kpatch/9011-kpatch-build-use-.klp.rela-in-euleros-7.5-kernel.patch
Zhipeng Xie 428b311440 sync code to openeuler
sync latest code to openeuler

Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
2019-12-30 15:59:18 +08:00

49 lines
1.6 KiB
Diff

From 868a6e4462bebcffa4bf6beea02262823e7dc3a3 Mon Sep 17 00:00:00 2001
From: Zhipeng Xie <xiezhipeng1@huawei.com>
Date: Fri, 2 Nov 2018 17:25:33 +0000
Subject: [PATCH] kpatch-build: use .klp.rela in euleros 7.5 kernel
use .klp.rela in euleros 7.5 kernel
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
---
kpatch-build/kpatch-build | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
index fb14850..5a70a44 100755
--- a/kpatch-build/kpatch-build
+++ b/kpatch-build/kpatch-build
@@ -157,6 +157,15 @@ is_rhel() {
[[ $1 =~ \.el[78]\. ]]
}
+is_euleros_klp() {
+ if [[ "$1" =~ ^3.10.0-862 ]] ;then
+ if [ $ID == "euleros" ];then
+ return 0;
+ fi
+ fi
+ return 1;
+}
+
find_dirs() {
if [[ -e "$SCRIPTDIR/create-diff-object" ]]; then
# git repo
@@ -708,10 +717,10 @@ KPATCH_MODULE=true
grep -q "CONFIG_DEBUG_INFO=y" "$CONFIGFILE" || die "kernel doesn't have 'CONFIG_DEBUG_INFO' enabled"
if grep -q "CONFIG_LIVEPATCH=y" "$CONFIGFILE"; then
# The kernel supports livepatch.
- if version_gte "${ARCHVERSION//-*/}" 4.7.0 || is_rhel "$ARCHVERSION"; then
+ if version_gte "${ARCHVERSION//-*/}" 4.7.0 || is_rhel "$ARCHVERSION" || is_euleros_klp "$ARCHVERSION"; then
# Use new .klp.rela. sections
KPATCH_MODULE=false
- if version_gte "${ARCHVERSION//-*/}" 4.9.0 || is_rhel "$ARCHVERSION"; then
+ if version_gte "${ARCHVERSION//-*/}" 4.9.0 || is_rhel "$ARCHVERSION" || is_euleros_klp "$ARCHVERSION"; then
KPATCH_LDFLAGS="--unique=.parainstructions --unique=.altinstructions"
fi
fi
--
1.7.5.4