1 Star 0 Fork 44

xujialing/kpatch

forked from src-openEuler/kpatch 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
0024-optimize-for-out-of-tree-module.patch 1.55 KB
Copy Edit Raw Blame History
谢志鹏 authored 2020-11-13 04:00 . optimization for out-of-tree modules
From aef88b0908ee9d36131c63493c02359a04d1304c Mon Sep 17 00:00:00 2001
From: Zhipeng Xie <xiezhipeng1@huawei.com>
Date: Fri, 13 Nov 2020 03:05:22 -0500
Subject: [PATCH] optimize for out of tree module
some out-of-tree modules's Module.symvers not in SRCDIR
some out-of-tree modules's obj has relative path like /xxx/./xxx.o
Signed-off-by: Zhipeng Xie <xiezhipeng1@huawei.com>
---
kpatch-build/kpatch-build | 1 +
kpatch-build/kpatch-gcc | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build
index 523d5df..6238bc8 100755
--- a/kpatch-build/kpatch-build
+++ b/kpatch-build/kpatch-build
@@ -1035,6 +1035,7 @@ for i in $FILES; do
BUILDDIR="/lib/modules/$ARCHVERSION/build/"
SYMVERS_FILE="$TEMPDIR/Module.symvers"
[[ -e $SRCDIR/Module.symvers ]] && cp "$SRCDIR/Module.symvers" "$SYMVERS_FILE"
+ [[ -e $USERMODBUILDDIR/Module.symvers ]] && cp "$USERMODBUILDDIR/Module.symvers" $SYMVERS_FILE
awk '{ print $1 "\t" $2 "\t" $3 "\t" $4}' "${BUILDDIR}/Module.symvers" >> "$SYMVERS_FILE"
fi
fi
diff --git a/kpatch-build/kpatch-gcc b/kpatch-build/kpatch-gcc
index 6ad6ebc..2b2490e 100755
--- a/kpatch-build/kpatch-gcc
+++ b/kpatch-build/kpatch-gcc
@@ -25,7 +25,9 @@ if [[ "$TOOLCHAINCMD" =~ "${ARCH_COMPILE}gcc" ||
[[ "$obj" = */.tmp_*.o ]] && obj="${obj/.tmp_/}"
relobj=${obj//$KPATCH_GCC_SRCDIR\//}
- case "$relobj" in
+ tmpobj=$(readlink -f $obj)
+ relobj2=${tmpobj//$KPATCH_GCC_SRCDIR\//}
+ case "$relobj2" in
*.mod.o|\
*built-in.o|\
*built-in.a|\
--
2.18.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sticky-rice-wine/kpatch.git
git@gitee.com:sticky-rice-wine/kpatch.git
sticky-rice-wine
kpatch
kpatch
master

Search