From a300c15748a84df03d8a6d6f4fd306e00955e885 Mon Sep 17 00:00:00 2001 From: Zhixiong Chi Date: Tue, 13 Dec 2022 17:14:51 +0800 Subject: [PATCH] kpatch: Allowing passing in KEYDIR and SRCDIR When the '-k/--keydir' option is used, the variable KEYDIR will still be the fixed value. Allow the customized value for KEYDIR to be passed. It's the same as '-s/--sourcedir' option and the variable SRCDIR. Signed-off-by: Zhixiong Chi --- kpatch-build/kpatch-build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 45a9757..1f66901 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -712,8 +712,8 @@ fi LINUXTYPE="linux${KERNELTYPE}" SIGNTOOLDIR=(/usr/lib/${LINUXTYPE}-kbuild-*/scripts) -SRCDIR="${CACHEDIR}/${LINUXTYPE}-src" -KEYDIR="${LINUXSRCDIR}/kernels/${ARCHVERSION}" +[[ -z "${SRCDIR}" ]] && SRCDIR="${CACHEDIR}/${LINUXTYPE}-src" +[[ -z "${KEYDIR}" ]] && KEYDIR="${LINUXSRCDIR}/kernels/${ARCHVERSION}" [[ "$SKIPCLEANUP" -eq 0 ]] && trap cleanup EXIT INT TERM HUP -- 2.25.1