Skip to content

fix(ci): derive KVER from the defconfig instead of hardcoding it - #48

Merged
mcfbytes merged 1 commit into
feat/ci-rt-kernelfrom
fix/rt-ci-kernel-version
Jul 20, 2026
Merged

fix(ci): derive KVER from the defconfig instead of hardcoding it#48
mcfbytes merged 1 commit into
feat/ci-rt-kernelfrom
fix/rt-ci-kernel-version

Conversation

@mcfbytes

Copy link
Copy Markdown
Owner

Fixes the six ci-tests.sh failures on #39.

Cause

scripts/ci-tests.sh:90 was literally KVER=6.18.38. Every module check scopes to usr/lib/modules/$KVER/, so when the kernel moved to 6.18.39 they all started looking in a directory that no longer exists:

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.

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 truth scripts/export-kernel-tree.sh and renovate-hash-sync.yml already read — with a hard failure if it can't be read.

Two details preserved deliberately:

  • Reads the MAIN image's defconfig specifically. The existing comment is careful that these checks must not glob across variant trees, since mister_rt.fragment overrides this symbol for the RT variant (7.2-rc3). Deriving from the main defconfig keeps exactly that scoping.
  • Anchored to ^, 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 logicbuild.yml, release.yml, and mk-sdcard.sh all derive theirs; regen-triage.sh's 5.15.1 is the stock fork kernel and unrelated to this pin.

Verification

Ran ci-tests.sh against a synthetic rootfs.tar carrying usr/lib/modules/6.18.39/:

PASS  modules.dep non-empty
PASS  modules.alias non-empty
PASS  module vermagic (6.18.39, ARMv7): consistent across all 12 modules
PASS  xone: all 9 .ko.xz modules present
PASS  out-of-tree WiFi: 8812au + 8821au .ko.xz present
PASS  in-kernel WiFi: rtw88_8814au.ko.xz present

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-kernel is checked out in your /mnt/source/Buildroot_MiSTer-rt-ci worktree (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

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
Copilot AI review requested due to automatic review settings July 19, 2026 06:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 from configs/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.

@mcfbytes
mcfbytes merged commit 764b971 into feat/ci-rt-kernel Jul 20, 2026
5 checks passed
@mcfbytes
mcfbytes deleted the fix/rt-ci-kernel-version branch July 20, 2026 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants