Skip to content

Conversation

@chewi
Copy link
Contributor

@chewi chewi commented Oct 28, 2025

Decompress the minimal initrd kernel modules

The initrd itself is already compressed with xz, so compressing the modules within with xz as well just makes the image bigger and slower. I observed a 512KB vmlinuz reduction.

Not compressing all the kernel modules in the first place is not such a clear win because it is zlib and zstd compression that is applied elsewhere.

How to use

Just see whether it boots and check the size changes.

Testing done

I've done a local build to check the size difference. I'll run GHA now.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update) -- N/A
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

@chewi chewi self-assigned this Oct 28, 2025
@chewi chewi requested a review from a team as a code owner October 28, 2025 15:04
@chewi
Copy link
Contributor Author

chewi commented Oct 29, 2025

Hmm, doesn't actually work yet. modules.dep needs to be regenerated.

The initrd itself is already compressed with xz, so compressing the
modules within with xz as well just makes the image bigger and slower.

Not compressing all the kernel modules in the first place is not such a
clear win because it is zlib and zstd compression that is applied
elsewhere.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi chewi force-pushed the chewi/initrd-ko-xz branch from e11d750 to 6de9372 Compare October 29, 2025 14:11
@flatcar flatcar deleted a comment from github-actions bot Oct 30, 2025
@chewi
Copy link
Contributor Author

chewi commented Oct 30, 2025

All green now. Also the modules.* files now only cover the modules that are actually in the initrd, so those have shrunk a bit too!

@github-actions
Copy link

Build action triggered: https://github.com/flatcar/scripts/actions/runs/18937364880

@chewi chewi merged commit f104f35 into main Oct 30, 2025
16 of 18 checks passed
@chewi chewi deleted the chewi/initrd-ko-xz branch October 30, 2025 10:34
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.

4 participants