From 9b347bce8d043e20570b0b48f24a9d7a491a1afb Mon Sep 17 00:00:00 2001 From: lvgenggeng Date: Mon, 17 Oct 2022 16:36:39 +0800 Subject: [PATCH] make_hotpatch: add CUSTOM_BUILD_DIR env Signed-off-by: lvgenggeng --- kpatch.spec | 8 +++++++- make_hotpatch | 15 +++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/kpatch.spec b/kpatch.spec index 5b0cca6..14c835d 100644 --- a/kpatch.spec +++ b/kpatch.spec @@ -1,7 +1,7 @@ Name: kpatch Epoch: 1 Version: 0.9.5 -Release: 15 +Release: 16 Summary: A Linux dynamic kernel patching infrastructure License: GPLv2 @@ -119,6 +119,12 @@ popd %{_mandir}/man1/*.1.gz %changelog +* Mon Oct 17 2022 lvgenggeng - 1:0.9.5-16 +- Type:enhancement +- ID:NA +- SUG:NA +- DESC:make_hotpatch: add CUSTOM_BUILD_DIR env + * Sun Oct 9 2022 Bin Hu -1:0.9.5-15 - Type:bugfix - ID:NA diff --git a/make_hotpatch b/make_hotpatch index 7410154..a95022b 100644 --- a/make_hotpatch +++ b/make_hotpatch @@ -19,10 +19,17 @@ G_HOTPATCH_TAR= G_DIFFEXT= G_JOBS="$(getconf _NPROCESSORS_ONLN)" G_PATCH_SRC= -G_KERNEL_SRC=/opt/patch_workspace/kernel-source -G_KERNEL_CONFIG=/opt/patch_workspace/.config -G_HOTPATCH_DIR=/opt/patch_workspace/hotpatch -G_VMLINUX=/opt/patch_workspace/vmlinux +if [ -z "$CUSTOM_BUILD_DIR" ];then + G_KERNEL_SRC=/opt/patch_workspace/kernel-source + G_KERNEL_CONFIG=/opt/patch_workspace/.config + G_HOTPATCH_DIR=/opt/patch_workspace/hotpatch + G_VMLINUX=/opt/patch_workspace/vmlinux +else + G_KERNEL_SRC="$CUSTOM_BUILD_DIR"/kernel-source + G_KERNEL_CONFIG="$CUSTOM_BUILD_DIR"/.config + G_HOTPATCH_DIR="$CUSTOM_BUILD_DIR"/hotpatch + G_VMLINUX="$CUSTOM_BUILD_DIR"/vmlinux +fi G_PREFIX=klp G_TMP_DIR= G_PATCHFILE=