diff --git a/livepatch/kpatch/debian/patches/0004-kpatch-Fix-the-build-failure-when-the-cache-src-dire.patch b/livepatch/kpatch/debian/patches/0004-kpatch-Fix-the-build-failure-when-the-cache-src-dire.patch new file mode 100644 index 000000000..08943e1b3 --- /dev/null +++ b/livepatch/kpatch/debian/patches/0004-kpatch-Fix-the-build-failure-when-the-cache-src-dire.patch @@ -0,0 +1,38 @@ +From 3454f6871ee7a7dd1c04249edf2598f144339440 Mon Sep 17 00:00:00 2001 +From: Zhixiong Chi +Date: Tue, 9 Aug 2022 01:45:28 -0700 +Subject: [PATCH] kpatch: Fix build failure when cache src directory is used + +When the -c option is used (eg: kpatch-prebuilt) for building more +than one livepatch issue, the download linux source step will be +skipped and cache src directory will be used. +We correct the CONFIGFILE variable after the file is copied. + +Signed-off-by: Zhixiong Chi +--- + kpatch-build/kpatch-build | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build +index eb8a1e0..9da45d1 100755 +--- a/kpatch-build/kpatch-build ++++ b/kpatch-build/kpatch-build +@@ -851,10 +851,11 @@ else + fi + fi + +-[[ -z "$CONFIGFILE" ]] && CONFIGFILE="$SRCDIR"/.config +-[[ ! -e "$CONFIGFILE" ]] && die "can't find config file" +-if [[ ! "$CONFIGFILE" -ef "$SRCDIR"/.config ]] ; then +- cp -f "$CONFIGFILE" "$SRCDIR/.config" || die ++[[ -z "${CONFIGFILE}" ]] && CONFIGFILE="${SRCDIR}"/.config ++[[ ! -e "${CONFIGFILE}" ]] && die "Can't find config file ${CONFIGFILE}" ++if [[ ! "${CONFIGFILE}" -ef "${SRCDIR}"/.config ]] ; then ++ cp -f "${CONFIGFILE}" "${SRCDIR}/.config" || die "Copy ${CONFIGFILE} failed" ++ CONFIGFILE="${SRCDIR}/.config" + fi + + # kernel option checking +-- +2.34.1 + diff --git a/livepatch/kpatch/debian/patches/series b/livepatch/kpatch/debian/patches/series index b3833eb72..67b6a42e0 100644 --- a/livepatch/kpatch/debian/patches/series +++ b/livepatch/kpatch/debian/patches/series @@ -1,3 +1,4 @@ 0001-kpatch-Support-for-WRCP.patch 0002-kpatch-Add-the-signature-for-livepatch-kernel-module.patch 0003-kpatch-Adjust-the-kpatch-build-to-support-the-multik.patch +0004-kpatch-Fix-the-build-failure-when-the-cache-src-dire.patch