Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

arm64 kernel shrink #2239

Merged
merged 3 commits into from
Oct 24, 2022
Merged

arm64 kernel shrink #2239

merged 3 commits into from
Oct 24, 2022

Conversation

jepio
Copy link
Contributor

@jepio jepio commented Oct 18, 2022

arm64 kernel shrink

Disable some unneeded kconfig options and turn wireguard into a module. This shrinks the arm64 kernel by ~3MB based on my testing.

How to use

Check image changes to see size decrease. Check kola to see that wireguard continues to work without manually loading module.

Testing done

Build tested.

  • 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.

Disable ARCH_QCOM, ARCH_ZYNQMP, ARCH_MEDIATEK which enable other options that
are only relevant on the respective boards, none of which are supported targets
for Flatcar. Since the arm64 kernel does not support compression, these
settings have a significant impact on kernel size. The boot partition size is
only 128MB and needs to fit 2 kernels, so we have set ourselves a target of
60MB per kernel. This commit brings down the arm64 kernel size by 3MB.

At the same time, enable the settings that are actually relevant: ARCH_BCM,
because that one is relevant for Raspberry Pi 4 that runs Linux.
The wireguard module has some crypto dependencies, we benefit from making them
all modules so that they don't increase the arm64 kernel size.
@jepio
Copy link
Contributor Author

jepio commented Oct 18, 2022

@pothos
Copy link
Contributor

pothos commented Oct 19, 2022

Makes sense for now, thanks! In the future it would be nice to support more boards, though - I'm looking forward to Linux 6.1 to enable generic EFI compression.

@jepio jepio requested a review from a team October 19, 2022 11:13
@pothos
Copy link
Contributor

pothos commented Oct 19, 2022

A changelog entry would be good

Copy link
Contributor

@dongsupark dongsupark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, we need to merge this PR before #2235, not to exceed the 60MB limit of arm64 Kernel, right?
Please add a proper changelog as Kai said, and feel free to merge.

@jepio
Copy link
Contributor Author

jepio commented Oct 24, 2022

If I understand correctly, we need to merge this PR before #2235, not to exceed the 60MB limit of arm64 Kernel, right?

We're at 59 MB with that PR (and some recent ones) merged, so yeah, it's necessary to merge this one.

Added changelog entries and merging.

@jepio jepio merged commit de6e014 into main Oct 24, 2022
@jepio jepio deleted the jepio/arm64-kernel-shrink branch October 24, 2022 07:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants