The default kernel tree can be parked on an old branch, and then every tool reports the wrong kernel version perfectly truthfully
scope: generic · severity: trap · confidence: proven · subsystem: build
The trap — a kernel tree is a working copy, not a statement about the
port. PORTHOLE_KERNEL_TREE defaults to <workdir>/linux, and nothing keeps
that checkout on the product branch. Leave it on a topic branch from two kernel
versions ago – which is the normal end state of any bisect or feature branch –
and every tool downstream reports that version, accurately, forever.
The failure is not that a tool lies. It is that “the tree is 6.18” and “the port is 6.18” are different statements that look identical in output, and a reader has no way to tell them apart from the line alone.
What it looks like
>> NOTE: profile says the product branch is taimen-v7.2>> this tree is on wifi-disablekey-test -- one of the two is stale>> WARNING: this tree is Linux 6.18, the device runs 7.2.2That NOTE is the tell, and it only appears once you try to build. Anyone who
read doctor or brief first never saw it.
How to not fall in
- The device is the authority on the device:
cat /proc/version. The aport name is the authority on what ships (PORTHOLE_KERNEL_PKG). A tree is neither. - Check a branch’s version without checking it out:
git show <branch>:Makefile | head -3. KBUILD_BUILD_VERSION = pkgrel + 1, so#60is aport r59. Reading the#NNas the pkgrel is off by one every time.
Fixed, in three places, because one was not enough
PORTHOLE_KERNEL_TREEpinned to a worktree that stays on the product branch (git worktree add ../linux-<series> <product-branch>), inconfig.envandsystemctl --user set-environment– the user manager holds a second, invisible copy of the config.doctor’s kernel-tree row now compares the tree’sMakefileversion against the series inPORTHOLE_KERNEL_PKGand warns before it says anything else, naming both and how to fix it.- The stale checkout was left exactly as found. It was carrying 19
uncommitted files that were not mine to discard, and adding a worktree costs
a checkout while
git checkoutover someone’s WIP costs their day.
