From 131672d6ce6512d7dbdfcda33d17883222724b35 Mon Sep 17 00:00:00 2001 From: lgcosta Date: Thu, 12 Nov 2026 20:11:02 -0300 Subject: [PATCH] fix(build): resolve the kernel tree in one place kernel-config.sh looked for the tree two levels up and build-kernel.sh did not pass on the tree it had resolved, so a plain ./scripts/build-kernel.sh could configure one tree and build another. Both resolve /../linux-7.3.4. --- scripts/build-kernel.sh | 3 ++- scripts/kernel-config.sh | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/build-kernel.sh b/scripts/build-kernel.sh index c33a25b..49ff8b7 100755 --- a/scripts/build-kernel.sh +++ b/scripts/build-kernel.sh @@ -4,7 +4,8 @@ set -euo pipefail REPO="$(cd "$(dirname "$0")/.." && pwd)" K="${KERNELDIR:-$(cd "$REPO/../linux-7.3.4" && pwd)}" cd "$K" -"$REPO/scripts/kernel-config.sh" "${1:-}" +# kernel-config.sh must configure the *same* tree we are about to build. +KERNELDIR="$K" "$REPO/scripts/kernel-config.sh" "${1:-}" JOBS="${JOBS:-$(($(nproc)-2))}" make -j"$JOBS" -s bzImage modules_prepare # External module builds need Module.symvers (kbuild only writes diff --git a/scripts/kernel-config.sh b/scripts/kernel-config.sh index 7f62884..b799ade 100755 --- a/scripts/kernel-config.sh +++ b/scripts/kernel-config.sh @@ -3,7 +3,10 @@ # defconfig baseline + direct-kernel-boot deps. Idempotent. # `kernel-config.sh test` additionally enables DEBUG_KMEMLEAK (soak builds). set -euo pipefail -K="${KERNELDIR:-$(cd "$(dirname "$0")/../../linux_kernel/linux-7.3.4" && pwd)}" +REPO="$(cd "$(dirname "$0")/.." && pwd)" +# Default: the kernel tree next to the repository (pf_port/../linux-7.3.4), +# same rule as build-kernel.sh / build-module.sh. +K="${KERNELDIR:-$REPO/../linux-7.3.4}" cd "$K" [ -f .config ] || make defconfig scripts/config --file .config \