From bd4a671d9ccdc30fe68cbb646bce126fa1135ab4 Mon Sep 17 00:00:00 2001 From: hubin Date: Tue, 10 May 2022 16:16:19 +0800 Subject: [PATCH] kpatch-build: do not copy linux scripts when building OOT module hotpatch Signed-off-by: hubin --- ...build-do-not-copy-linux-scripts-when.patch | 27 +++++++++++++++++++ kpatch.spec | 9 ++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 0038-kpatch-build-do-not-copy-linux-scripts-when.patch diff --git a/0038-kpatch-build-do-not-copy-linux-scripts-when.patch b/0038-kpatch-build-do-not-copy-linux-scripts-when.patch new file mode 100644 index 0000000..da787ef --- /dev/null +++ b/0038-kpatch-build-do-not-copy-linux-scripts-when.patch @@ -0,0 +1,27 @@ +From 72d80c02e16d7558bea6512116bac2b9461bf879 Mon Sep 17 00:00:00 2001 +From: hubin +Date: Tue, 10 May 2022 16:12:29 +0800 +Subject: [PATCH] kpatch-build: do not copy linux scripts when building OOT + module hotpatch + +Signed-off-by: hubin +--- + kpatch-build/kpatch-build | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index ce163e5..dc5f5a5 100644 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -955,7 +955,7 @@ grep -q "CONFIG_GCC_PLUGIN_RANDSTRUCT=y" "$CONFIGFILE" && die "kernel option 'CO + # support extended ELF sections. Disable the BTF typeinfo generation in + # link-vmlinux.sh and Makefile.modfinal since kpatch doesn't care about + # that anyway. +-if grep -q "CONFIG_DEBUG_INFO_BTF=y" "$CONFIGFILE" ; then ++if grep -q "CONFIG_DEBUG_INFO_BTF=y" "$CONFIGFILE" && [[ -z "$OOT_MODULE" ]] ; then + cp -f "$SRCDIR/scripts/link-vmlinux.sh" "$TEMPDIR/link-vmlinux.sh" || die + sed -i 's/CONFIG_DEBUG_INFO_BTF/DISABLED_FOR_KPATCH_BUILD/g' "$SRCDIR"/scripts/link-vmlinux.sh || die + +-- +2.31.0.windows.1 + diff --git a/kpatch.spec b/kpatch.spec index 1735f86..4c78e53 100644 --- a/kpatch.spec +++ b/kpatch.spec @@ -1,7 +1,7 @@ Name: kpatch Epoch: 1 Version: 0.9.5 -Release: 6 +Release: 7 Summary: A Linux dynamic kernel patching infrastructure License: GPLv2 @@ -50,6 +50,7 @@ Patch0034:0034-create-diff-object-ignore-changed-of-section-__patch.patch Patch0035:0035-create-diff-object-fix-null-pointer-dereference-in-k.patch Patch0036:0036-create-diff-object-ignore-.note.gnu.property-section.patch Patch0037:0037-create-diff-object-skip-creating-.kpatch.arch-sectio.patch +Patch0038:0038-kpatch-build-do-not-copy-linux-scripts-when.patch BuildRequires: gcc elfutils-libelf-devel kernel-devel git Requires: bc make gcc patch bison flex openssl-devel @@ -110,6 +111,12 @@ popd %{_mandir}/man1/*.1.gz %changelog +* Tue May 10 2022 Bin Hu -1:0.9.5-7 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:kpatch-build: do not copy linux scripts when building OOT module hotpatch + * Tue May 10 2022 Bin Hu -1:0.9.5-6 - Type:bugfix - ID:NA