kernel config hash: ignore modifications the source config already declares - #10367
Open
iav wants to merge 1 commit into
Open
kernel config hash: ignore modifications the source config already declares#10367iav wants to merge 1 commit into
iav wants to merge 1 commit into
Conversation
…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.
Contributor
📝 WalkthroughWalkthroughKernel configuration modification hashing now canonicalizes assignments, removes entries matching the source configuration, and then reduces the remaining modifications before calculating the hash. ChangesKernel configuration hash normalization
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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.
Description
A hook that sets a kernel config option to the value the source config already carries
produces a byte-identical
.config, yet still movesartifact_version— cutting the boardoff from the published kernel debs. Compare each announced
OPTION=valueagainst theconfig text before hashing and drop the ones that match.
Announcements are canonicalized to the
CONFIG_prefix first:scripts/configaccepts anoption 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 runswithout.
How Has This Been Tested?
./compile.sh artifact-config-dump-json WHAT=kernel BOARD=odroidn2 BRANCH=edge, with andwithout an extension setting
IP_PNP=y,TUN=y,NFS_FS=m— the exact values already inlinux-meson64-edge.config. Before:.config hook hash1c3a9337c4583b24without theextension,
029b15474d885e57with it. After:76b3aeb8f7fb12d7in both.Checklist:
Summary by CodeRabbit