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