From e2e7d2cd2177d74fd14408568007b4493928d727 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 12 Apr 2018 18:26:07 +0200 Subject: [PATCH] kpatch-build: fix Ubuntu kernel detection on successive retries If a patch failed a first time, kpatch-build is using the previous cache directory on subsequent builds. The UBUNTU_KERNEL=1 variable is not set in this case. Therefore, utsrelease.h is not updated correctly and the appropriate structures are not used. Just check if distro is Ubuntu and we didn't request our own specific directory. Signed-off-by: Vincent Bernat --- kpatch-build/kpatch-build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kpatch-build/kpatch-build b/kpatch-build/kpatch-build index 8e2c18e..24b7368 100755 --- a/kpatch-build/kpatch-build +++ b/kpatch-build/kpatch-build @@ -602,7 +602,6 @@ else # url may be changed for a different mirror url="http://archive.ubuntu.com/ubuntu/pool/main/l" sublevel="SUBLEVEL = 0" - UBUNTU_KERNEL=1 elif [[ "$DISTRO" = debian ]]; then @@ -820,7 +819,7 @@ fi echo "Building patch module: $MODNAME.ko" -if [[ ! -z "$UBUNTU_KERNEL" ]]; then +if [[ -z "$USERSRCDIR" ]] && [[ "$DISTRO" = ubuntu ]]; then # UBUNTU: add UTS_UBUNTU_RELEASE_ABI to utsrelease.h after regenerating it UBUNTU_ABI="${ARCHVERSION#*-}" UBUNTU_ABI="${UBUNTU_ABI%-*}"