Skip to content

linux-qcom: make the kernel release independent of the git checkout - #3381

Merged
Ricardo Salveti (ricardosalveti) merged 2 commits into
qualcomm-linux:masterfrom
ricardosalveti:kernel-localversion
Oct 20, 2026
Merged

Ricardo Salveti (ricardosalveti) merged 2 commits into
qualcomm-linux:masterfrom
ricardosalveti:kernel-localversion

Conversation

@ricardosalveti

Copy link
Copy Markdown
Contributor

With CONFIG_LOCALVERSION_AUTO enabled, setlocalversion derives the kernel
release from the git checkout: the git describe distance and a -dirty
suffix. Neither is part of the task signature. The distance changes
depending on whether the fetcher unpacked a full clone or the shallow
tarball (7.2.0-01462-gd49c33864d06-dirty vs 7.2.0-gd49c33864d06-dirty).

The kernel's do_compile is not restored from sstate. When a module recipe
has to be rebuilt, the kernel is compiled again from a fresh checkout and
can produce a release that the kernel packages from sstate do not have.
do_rootfs then fails, as on every qcom-next row of #3361:

nothing provides kernel-7.2.0-gd49c33864d06-dirty needed by
kernel-module-msm-kgsl-7.2.0-gd49c33864d06-dirty-1.0.17-r0
  • linux-qcom: disable CONFIG_LOCALVERSION_AUTO: the release becomes
    the kernel version plus the exported LOCALVERSION. The linux-yocto
    kernels already do this through the yocto-kernel-cache base fragment.
  • linux-qcom: append the source revision to the kernel release: keeps
    uname -r traceable by setting KERNEL_LOCALVERSION from the resolved
    SRCREV and the SRC_URI patch count, e.g. 6.18.44-gb5a6060def87-p1
    and 7.3.0-rc4-g1a0586064ee1.

The kernel task signatures change once, so the first build after this
rebuilds the kernels.

With CONFIG_LOCALVERSION_AUTO enabled, setlocalversion builds the kernel
release from the git checkout: the git describe distance from the last
tag, and -dirty when the tree has local changes. Neither is part of the
task signature, and the distance depends on whether the fetcher unpacked
a full clone or the shallow tarball, which has no tags:

  7.2.0-01462-gd49c33864d06-dirty    (full clone)
  7.2.0-gd49c33864d06-dirty          (shallow tarball)

The kernel's do_compile is not restored from sstate, so a module recipe
that has to be rebuilt compiles the kernel again from a fresh checkout,
and can get a release that the kernel packages from sstate do not
provide:

  nothing provides kernel-7.2.0-gd49c33864d06-dirty needed by
  kernel-module-msm-kgsl-7.2.0-gd49c33864d06-dirty-1.0.17-r0

Disable it, as the linux-yocto kernels already do through the
yocto-kernel-cache base fragment (ktypes/base/base.cfg), so the release
is the kernel version plus the exported LOCALVERSION, whatever the
checkout looks like; the rt flavors inherit the fragment. uname -r
loses its git-describe suffix, including the -dirty that the
quilt-applied patch gives linux-qcom 6.18.

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
With LOCALVERSION_AUTO disabled, uname -r no longer tells which kernel
revision a board runs. Set KERNEL_LOCALVERSION to -g<sha> of the
revision the fetcher resolved for SRC_URI (the fetched head for AUTOREV
builds), plus -p<count> for the SRC_URI patches applied on top of it,
similar to the +g<sha>+p<count> suffix meta-freescale uses. linux-qcom
6.18 reports 6.18.44-gb5a6060def87-p1 and linux-qcom-next
7.3.0-rc4-g1a0586064ee1, the same for every build of those inputs.

Assisted-by: Claude Code:claude-fable-5
Signed-off-by: Ricardo Salveti <ricardo.salveti@oss.qualcomm.com>
@github-actions

This comment has been minimized.

@test-reporting-app

test-reporting-app Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Test Results

  118 files  ± 0    718 suites  ±0   8h 16m 42s ⏱️ - 49m 57s
  194 tests  -  5    186 ✅ +32   0 💤 ±0  8 ❌  - 37 
4 622 runs  +14  4 576 ✅ +61  38 💤 +1  8 ❌  - 48 

For more details on these failures, see this check.

Results for commit 7e53bb5. ± Comparison against base commit e02726e.

This pull request removes 5 tests.
lava ‑ auto-login-action
lava ‑ lava-test-retry
lava ‑ lava-test-shell
lava ‑ minimal-boot
lava ‑ ramdump

♻️ This comment has been updated with latest results.

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 7e53bb5

  • qcomdistro: multimedia image-prop
    Pass: 50 | Fail: 0 | Total: 50
  • qcomdistro: multimedia image
    Pass: 2 | Fail: 0 | Total: 2

@qcomlnxci

Copy link
Copy Markdown

Test Coral run workflow

Test jobs for commit 7e53bb5

  • qcomdistro: multimedia image-prop
    Pass: 50 | Fail: 0 | Total: 50
  • qcomdistro: multimedia image
    Pass: 2 | Fail: 0 | Total: 2

@github-actions

Copy link
Copy Markdown

Test run workflow

Test jobs for commit 7e53bb5

qcom-distro_linux-qcom-6.18
Pass: 235 | Fail: 1 | Total: 253
nodistro
Pass: 10 | Fail: 0 | Total: 10
qcom-distro
Pass: 340 | Fail: 7 | Total: 368

@ricardosalveti

Copy link
Copy Markdown
Contributor Author

Known issues.

@ricardosalveti
Ricardo Salveti (ricardosalveti) merged commit 74a7ed8 into qualcomm-linux:master Oct 20, 2026
216 of 217 checks passed
@quic-yocto-ci

Copy link
Copy Markdown
Contributor

Backport failed for wrynose, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin wrynose
git worktree add -d .worktree/backport/3381-to-wrynose origin/wrynose
cd .worktree/backport/3381-to-wrynose
git switch --create backport/3381-to-wrynose
git cherry-pick -x 1769f29d54b9e16ba064b075b366879fa9ffbcda 7e53bb5655fb870650a051bbe41f4deeef0cf4d3

@ricardosalveti

Copy link
Copy Markdown
Contributor Author

Will backport once #3384 is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants