fix(ci): derive KVER from the defconfig instead of hardcoding it - #48
Merged
Conversation
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 <pkg>-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 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UFdgJXQKvrucXeKDami499
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes scripts/ci-tests.sh module/vermagic checks by deriving the kernel version (KVER) from the main Buildroot defconfig rather than hardcoding it, preventing CI breakage whenever the kernel version pin is bumped.
Changes:
- Replace hardcoded
KVER=...with extraction fromconfigs/mister_de10nano_defconfig. - Add a clear fatal error path when the defconfig value can’t be read (to avoid misleading downstream failures).
- Document why the value must be derived and why it must be sourced from the main defconfig (not RT/variant pins).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the six
ci-tests.shfailures on #39.Cause
scripts/ci-tests.sh:90was literallyKVER=6.18.38. Every module check scopes tousr/lib/modules/$KVER/, so when the kernel moved to 6.18.39 they all started looking in a directory that no longer exists:The build was fine.
Why derive rather than bump the number
What makes this worth fixing properly is how it failed. The messages point at the wrong subsystem — "kernel-module packages are stamped; a kernel bump needs
make <pkg>-dirclean+ rebuild" — which is a real failure mode this project has actually hit before. So the output reads as a genuine stale-kmod regression rather than a stale constant. A hardcoded version here doesn't fail safe, it fails misleadingly, and bumping it to 6.18.39 would just re-arm the same trap for the next bump.It now derives from
configs/mister_de10nano_defconfig— the same source of truthscripts/export-kernel-tree.shandrenovate-hash-sync.ymlalready read — with a hard failure if it can't be read.Two details preserved deliberately:
mister_rt.fragmentoverrides this symbol for the RT variant (7.2-rc3). Deriving from the main defconfig keeps exactly that scoping.^, last match. The defconfig explains this symbol in a comment that quotes it verbatim, so an unanchored match returns two lines — the exact bug fixed in fix(ci): anchor kernel version grep — unanchored match built a URL with a newline #42. Verified: 2 matches unanchored, 1 anchored.Renovate: nothing needed
A derived value has nothing to pin. #46's coverage (both defconfigs plus the RT fragment) is already on this branch, so all three real pins are managed. I also confirmed no other hardcoded kernel version remains in build logic —
build.yml,release.yml, andmk-sdcard.shall derive theirs;regen-triage.sh's5.15.1is the stock fork kernel and unrelated to this pin.Verification
Ran
ci-tests.shagainst a syntheticrootfs.tarcarryingusr/lib/modules/6.18.39/:All six flipped. (Other checks in that run fail on fixture gaps — I didn't fake btusb modaliases or the xone firmware blob — not related to this change.) shellcheck clean.
Touches only
scripts/ci-tests.sh, so no conflict with #46.Note on branching:
feat/ci-rt-kernelis checked out in your/mnt/source/Buildroot_MiSTer-rt-ciworktree (4 behind origin at the time), so I branched off it and opened this PR rather than pushing into a branch you have live.🤖 Generated with Claude Code
https://claude.ai/code/session_01UFdgJXQKvrucXeKDami499