Skip to content

separate kernel series hashing#4194

Merged
deitch merged 4 commits intolinuxkit:masterfrom
ChrisIgel:kernel-hash-fix
Dec 11, 2025
Merged

separate kernel series hashing#4194
deitch merged 4 commits intolinuxkit:masterfrom
ChrisIgel:kernel-hash-fix

Conversation

@ChrisIgel
Copy link
Contributor

@deitch What do you think about this solution?

- What I did
Added per-series kernel hashing and switched builds/tags/pushes to use the series-specific hash

- How I did it

  • Compute SHARED_HASH from common build files
  • Define series_hash(...) = hash(SHARED_HASH + series folder) + DIRTY function
  • Use series_hash() in linuxkit build/show-tag/cache/push and tool targets

- How to verify it

  • make list shows "Shared hash: "
  • make show-tag-6.12.x prints baseimage-
  • Committing a change to one of the shared files changes all series hashes
  • Committing a change to only one of the series-specific files only changes this series' hash

- Description for the changelog
Use per-series kernel hashes by combining a shared-files hash with the series folder

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

I rather Iike this idea. I have an idea to take it one step further, what do you think?

Move all of the common files into common/ (or build/ if you prefer, or anything else sane) directory. Then the logic in the Makefile can include just two things: the common dir and the series-specific dir. And any updates will get picked up automatically, as long as it is in common or series-specific.

Two other things:

  1. DCO needs signed commits
  2. Check the make update-kernel-yamls (and the script it calls) does the right thing with this?

@ChrisIgel
Copy link
Contributor Author

I signed the commits, moved alls shared files to a common directory and also fixed some issues we run over previously in the update-component-sha.sh script.

I also tested various commands including updating the kernel hashes and to me it looked good.

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

This is nice. I expect CI will fail on the hashes, but let's let it run and see what it says.

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

Yup, it is the kernel dependencies. I will have to tag them just right

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

OK, I copied those two tags. Take a look at the failed test, you need to update the hashes per the report.

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
- add bsd/gnu cross compatibility for sed
- also replace in */test.sh files
- replace potentially problematic xargs
- remove potentially problematic word boundary \b

Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
Signed-off-by: Chris Irrgang <chris.irrgang@gmx.de>
@ChrisIgel
Copy link
Contributor Author

Okay just running make update-kernel-yaml should fix this now, if I'm not mistaken. Let's see...

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

Why is it trying to build kernels? Makes no sense, as they already are out there. I will cancel that job and see what we missed.

@ChrisIgel
Copy link
Contributor Author

Well the hashes changed, that should be the reason right?

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

Well the hashes changed, that should be the reason right?

yeah, but I added tags for the new ones, so let's check. If we wait for builds here, it will be forever

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

I think that the make build is still using the old hash version, see these lines:

linuxkit pkg build .  --platforms linux/amd64 --build-yml ./common/build-kernel.yml --hash 0ef72d722190ecfe0b3b37711f9a871a696e301a --tag "6.12.59-{{.Hash}}" --build-arg-file 6.12.x/build-args 
Building "linuxkit/kernel:6.12.59-0ef72d722190ecfe0b3b37711f9a871a696e301a"

Actually, that looks right, but I can pull down the manifest for it, so something is strange.

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

Oh! I didn't tag the other images (debug, etc.). I can fix that.

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

Pushed out. Let's see.

@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

This time it was happy.

@deitch deitch merged commit 50025b8 into linuxkit:master Dec 11, 2025
31 of 38 checks passed
@deitch
Copy link
Collaborator

deitch commented Dec 11, 2025

Thanks!!

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