Skip to content

kernel config hash: ignore modifications the source config already declares - #10367

Open
iav wants to merge 1 commit into
armbian:mainfrom
iav:fix/kernel-config-hash-noop-modifications
Open

kernel config hash: ignore modifications the source config already declares#10367
iav wants to merge 1 commit into
armbian:mainfrom
iav:fix/kernel-config-hash-noop-modifications

Conversation

@iav

@iav iav commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Description

A hook that sets a kernel config option to the value the source config already carries
produces a byte-identical .config, yet still moves artifact_version — cutting the board
off from the published kernel debs. Compare each announced OPTION=value against the
config text before hashing and drop the ones that match.

Announcements are canonicalized to the CONFIG_ prefix first: scripts/config accepts an
option name either way, so both spellings have to collapse to one key before the
last-assignment-wins reduction.

Every kernel family changes version once: even with no extension in play, the core hooks
re-announce options the config file already carries — 237 of 334 announcements dropped on
odroidn2/edge. One rebuild, then versions settle.

Not covered: an option that ends up enabled through a Kconfig dependency rather than a
literal line. Detecting that needs make, which version calculation deliberately runs
without.

How Has This Been Tested?

  • ./compile.sh artifact-config-dump-json WHAT=kernel BOARD=odroidn2 BRANCH=edge, with and
    without an extension setting IP_PNP=y, TUN=y, NFS_FS=m — the exact values already in
    linux-meson64-edge.config. Before: .config hook hash 1c3a9337c4583b24 without the
    extension, 029b15474d885e57 with it. After: 76b3aeb8f7fb12d7 in both.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

Summary by CodeRabbit

  • Bug Fixes
    • Improved kernel configuration change handling by standardizing option updates.
    • Prevented redundant configuration changes from being included when they already match the existing system configuration.
    • Preserved meaningful differences while removing duplicate or unnecessary modifications.

…clares

The kernel artifact version mixes in a hash of every config modification the
hooks announce, so a build with different modifications lands on a different
version. Nothing compares those announcements against the config file they are
applied to: a hook that sets an option to the value the source config already
carries produces a byte-identical .config, yet still moves the version and thus
cuts the build off from the published kernel debs.

Compare each announced `OPTION=value` against the source config text before
hashing and drop the ones that match, so identical explicit settings hash
identically whether they come from the config file or from a hook.

Announcements are canonicalized to the CONFIG_ prefix first. scripts/config
accepts an option name either way, so both spellings have to collapse to one key
before the last-assignment-wins reduction; otherwise `FOO=y` overridden by a
later `CONFIG_FOO=n` keeps both entries in the hash.

This covers only options stated literally in one of those two places. An option
that ends up enabled through a Kconfig dependency rather than a literal line
still splits the version; detecting that needs `make`, which version
calculation deliberately runs without.

Every kernel family changes version once. Even with no extension in play, the
core Armbian hooks re-announce options the config file already carries -- 237 of
334 announcements are dropped on odroidn2/edge -- so the `.config hook hash`
moves everywhere. One rebuild, then versions settle.

Measured on odroidn2/edge (meson64, 7.1.7) with a hook setting IP_PNP=y, TUN=y
and NFS_FS=m -- the exact values already in linux-meson64-edge.config. Before:
.config hook hash 1c3a9337c4583b24 without the hook, 029b15474d885e57 with it.
After: 76b3aeb8f7fb12d7 in both cases.
@github-actions github-actions Bot added the 08 Milestone: Third quarter release label Aug 8, 2026
@coderabbitai

coderabbitai Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Kernel configuration modification hashing now canonicalizes assignments, removes entries matching the source configuration, and then reduces the remaining modifications before calculating the hash.

Changes

Kernel configuration hash normalization

Layer / File(s) Summary
Modification normalization and filtering
lib/functions/compilation/kernel-config.sh
Adds helpers that prefix assignments with CONFIG_, preserve non-assignment markers, parse source values, and remove matching announcements.
Hash input preparation
lib/functions/artifacts/artifact-kernel.sh
Prepares a copied modification list by canonicalizing and filtering entries before last-assignment reduction and hashing.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: rpardini

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: excluding source-config modifications from the kernel configuration hash.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size/medium PR with more then 50 and less then 250 lines Needs review Seeking for review Framework Framework components labels Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Framework Framework components Needs review Seeking for review size/medium PR with more then 50 and less then 250 lines

Development

Successfully merging this pull request may close these issues.

1 participant