From b3fb133b4424d3a463fc94848abc1e2241a4c514 Mon Sep 17 00:00:00 2001 From: "Michael C. Ferguson" Date: Sun, 19 Jul 2026 01:01:37 -0500 Subject: [PATCH] fix(ci): derive KVER from the defconfig instead of hardcoding it scripts/ci-tests.sh:90 was literally `KVER=6.18.38`, and it drifted the moment the kernel moved to 6.18.39. Every module check scopes to usr/lib/modules/$KVER/, so all of them started looking in a directory that no longer exists and reported six failures at once: FAIL modules.dep non-empty FAIL modules.alias non-empty FAIL module vermagic (6.18.38, ARMv7) FAIL xone: all 9 .ko.xz modules present FAIL out-of-tree WiFi: 8812au + 8821au .ko.xz present FAIL in-kernel WiFi: rtw88_8814au.ko.xz present The build was fine. What makes this worth fixing properly rather than bumping the number is HOW it failed: the messages point at the wrong subsystem ("kernel-module packages are stamped; a kernel bump needs 'make -dirclean' + rebuild"), which is a real failure mode this project has actually hit, so the output reads as a genuine stale-kmod regression. A hardcoded version here does not fail safe, it fails misleadingly. Now derived from configs/mister_de10nano_defconfig, which is the same source of truth scripts/export-kernel-tree.sh and renovate-hash-sync.yml already read, with a hard failure if it cannot be read. Reads the MAIN image's defconfig specifically, preserving the scoping the existing comment is careful about: mister_rt.fragment overrides this symbol for the RT variant (7.2-rc3) and those trees are deliberately out of scope here. Anchored to ^ and taking the last match, because the defconfig explains the symbol in a comment that quotes it verbatim -- unanchored returns TWO lines, the exact bug fixed in #42. Verified: 2 matches unanchored, 1 anchored. No renovate.json change needed: a derived value has nothing to pin, and #46's coverage (both defconfigs + the RT fragment) is already on this branch. Also confirmed no other hardcoded kernel version remains in build logic -- regen-triage.sh's 5.15.1 is the stock fork kernel, unrelated to this pin. Verified by running ci-tests.sh against a synthetic rootfs.tar carrying usr/lib/modules/6.18.39: all six checks above now pass, and the vermagic check reports 6.18.39. shellcheck clean. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01UFdgJXQKvrucXeKDami499 --- scripts/ci-tests.sh | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/scripts/ci-tests.sh b/scripts/ci-tests.sh index 1e5be0f..17c160e 100755 --- a/scripts/ci-tests.sh +++ b/scripts/ci-tests.sh @@ -87,7 +87,30 @@ LINUX_IMG="$IMAGES/linux.img" # tree), and their presence in CI by build.yml's merged-kver assert. Do not # "fix" these checks to glob across all trees; they would then pass on the # variant tree while the main one regressed. -KVER=6.18.38 +# +# DERIVED, never hardcoded. This was literally `KVER=6.18.38` until 2026-07-19, +# and it drifted the moment the kernel moved to 6.18.39: every module check +# below started looking in usr/lib/modules/6.18.38/, found nothing, and +# reported six failures that all read like the kernel-module packages had gone +# stale ("a kernel bump needs 'make -dirclean'") when in fact the build was +# fine and only this constant was wrong. A hardcoded version here does not fail +# safe -- it fails *misleadingly*, pointing the reader at the wrong subsystem. +# +# Read the MAIN image's defconfig specifically, which is what the scoping note +# above is about: configs/mister_rt.fragment overrides this symbol for the RT +# variant, and configs/mister_kernel_defconfig carries a lockstep copy +# (scripts/check-kernel-defconfig-sync.sh asserts those two agree). +# +# Anchored to ^ and taking the last match on purpose: the defconfig explains +# this symbol in a comment that quotes it verbatim, so an unanchored match +# returns two lines -- the exact bug fixed in the hash-sync workflow (#42). +KVER=$(sed -n 's/^BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="\([^"]*\)".*$/\1/p' \ + "$ROOT/configs/mister_de10nano_defconfig" | tail -1) +if [ -z "$KVER" ]; then + echo "FATAL: could not read BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE from" >&2 + echo " $ROOT/configs/mister_de10nano_defconfig" >&2 + exit 1 +fi # ---------------------------------------------------------------- reporting PASS_COUNT=0