kpatch-build: restore source code from patched

The purpose of using `--skip-cleanup` is to save
the intermediate build products. Leaving the patch
in the source code does not make much sense and
may even increase the workload for debugging.

Let's restore the source code from the patch.

Signed-off-by: Wardenjohn <zhangwarden@gmail.com>
This commit is contained in:
Wardenjohn 2025-04-21 15:18:02 +08:00
parent e3904157d2
commit 94bb6e90ef

View File

@ -900,7 +900,11 @@ else
BUILDDIR="$KERNEL_SRCDIR"
fi
[[ "$SKIPCLEANUP" -eq 0 ]] && trap cleanup EXIT INT TERM HUP
if [[ "$SKIPCLEANUP" -eq 0 ]]; then
trap cleanup EXIT INT TERM HUP
else
trap remove_patches EXIT INT TERM HUP
fi
# Don't check external file.
# shellcheck disable=SC1090