Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Free up /boot space with some GRUB module changes #2456

Merged
merged 3 commits into from
Nov 19, 2024
Merged

Conversation

chewi
Copy link
Contributor

@chewi chewi commented Nov 18, 2024

Free up /boot space with some GRUB module changes

Secure Boot prevents you from loading additional GRUB modules so remove them from supported targets to save space. These modules could be useful for debugging with Secure Boot disabled, but manually copying the modules with debug symbols is even more useful and not that difficult.

Compress the GRUB modules with xz instead of gzip to save space. Giving the --best or -9 option results in a heavier decompression cost with no gain on such small files. Note that this required a Kola test to be dropped.

Prevent the developer test GRUB modules from being built. These are normally always installed, even by grub-install, but they have no use outside of testing and take up valuable space in /boot. Apologies for the use of awk here, but sed didn't cut it. Kudos to Copilot for the assistance. 😄

/boot usage has changed from 62MB to 60MB on amd64. arm64 remains at 62MB, despite the modules previously taking up 940KB. I suspect all these usage figures are actually quite close to 61MB. The unrounded figures would give a better picture.

We still need to be cautious about the kernel size for the time being because older systems being upgraded will not benefit from these savings. It would probably be easy to backport the changes into the updater though, so I'll look into that.

How to use

Just test that the images boot as usual.

Testing done

A Jenkins run passed except for the cl.update.grubnop test, which has since been dropped as mentioned above.

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

Secure Boot prevents you from loading additional modules so remove them
to save space. These modules could be useful for debugging with Secure
Boot disabled, but manually copying the modules with debug symbols is
even more useful and not that difficult.

Signed-off-by: James Le Cuirot <[email protected]>
Giving the --best or -9 option results in a heavier decompression cost
with no gain on such small files.

Signed-off-by: James Le Cuirot <[email protected]>
These are normally always installed, even by grub-install, but they have
no use outside of testing and take up valuable space in /boot.

Signed-off-by: James Le Cuirot <[email protected]>
@chewi chewi requested a review from a team November 18, 2024 14:57
@chewi chewi self-assigned this Nov 18, 2024
@chewi chewi merged commit ee02718 into main Nov 19, 2024
1 check failed
@chewi chewi deleted the chewi/grub-mod branch November 19, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

3 participants