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

remove variant sensitivity from 6.1 kernel #3932

Merged
merged 6 commits into from
May 2, 2024

Conversation

bcressey
Copy link
Contributor

@bcressey bcressey commented May 1, 2024

Issue number:
Related: #3883

Description of changes:
Merge all the platform-specific kernel config snippets back together, and remove variant sensitivity from the kernel-6.1 package.

By far the largest (and least interesting) part of this change is the switch to explicit listing of all kernel modules. My goal here is to turn some of the kernel config changes - enabling a new module, making a module built-in, or removing a module - into code changes that can be reviewed in the usual way. My hope is that it can drive some cleanup over time, if not in this kernel then in kernels still to come: adding a modules-aws and modules-vmware package, removing unnecessary variation between x86_64 and aarch64, and so forth. modules-metal is a first step in that direction.

The bootconfig snippets are a potentially contentious addition. They don't reduce the kernel's increased size or surface area, though they do make it a no-op by default. They won't take effect for in-place upgrades, only for newly provisioned nodes. However, I do see value in making explicit which functionality is not needed on which platforms, to assist future refactoring.

As a free bonus change, switch to zstd for firmware compression to remove another use of xz, and to avoid adding it to aws and vmware variants.

Testing done:
No removals, only additions and changes. For the most part, changes are storage drivers (+ dependencies) moving from modules to built-in, and network drivers (+ dependencies) moving from off to modules.

❯ ./tools/diff-kernel-config -b develop -a HEAD -v aws-dev -v vmware-dev -v metal-dev -o configs
...
config-aarch64-aws-dev-diff:      0 removed,  90 added,  29 changed
config-aarch64-metal-dev-diff:    0 removed,  15 added,   3 changed
config-x86_64-aws-dev-diff:       0 removed,  98 added,  31 changed
config-x86_64-metal-dev-diff:     0 removed,   1 added,   4 changed
config-x86_64-vmware-dev-diff:    0 removed,  92 added,  38 changed

diff-report and diff-summary are available here.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

bcressey added 6 commits May 1, 2024 02:39
Support for zstd-compressed firmware was added to the 5.19 kernel.
Now that all `metal-*` variants are on the 6.1 kernel, switch from
xz to zstd as part of the larger effort to eliminate xz usage.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Remove the need for conditional compilation by merging the platform-
specific config snippets together.

Storage drivers that were set to "Y" in any platform config are now
"Y" for all platforms. Network drivers that were set to "M" in any
platform config are likewise now "M" in the merged config.

The simple DRM driver was disabled for `metal` and `vmware` but
enabled for `aws`; it is now enabled for all platforms. The i8042
driver was disabled for `aws` but enabled for `metal` and `vmware`;
it is also now enabled for all platforms.

Switch to a full list of all packaged modules to clarify the full set
of available modules. This also paves the way to move certain modules
into platform-specific subpackages in a subsequent change.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Add support for zstd-compressed firmware now that the linux-firmware
package uses that compression format.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Move the modules that were previously only for "metal" into a new
package that's installed by default for `metal-*` variants. This cuts
down on the installed footprint for `aws-*` and `vmware-*` variants
where the corresponding hardware is not supported.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Block the storage device drivers that were previously only built into
the "metal" kernel from loading on `aws-*` and `vmware-*` variants by
default.

Block the i8042 driver from loading on "aws-*" variants by default,
to approximate the effect of disabling the module at build time.

These blocks are implemented through bootconfig snippets, where the
resulting settings can be changed at runtime if necessary.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Now that the same config is used for all platforms, drop the variant
sensitive marker from the package.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Copy link
Member

@larvacea larvacea left a comment

Choose a reason for hiding this comment

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

Are the storage driver configs y because it would be challenging to boot without a driver for the boot device, and the network drivers are m because it's fine to load them as needed (using those storage drivers) when systemd is bringing up networking?

Copy link
Contributor

@yeazelm yeazelm left a comment

Choose a reason for hiding this comment

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

This is a lot of change but after thinking about it and some offline conversation, I am on board with this change.

@bcressey
Copy link
Contributor Author

bcressey commented May 2, 2024

Are the storage driver configs y because it would be challenging to boot without a driver for the boot device, and the network drivers are m because it's fine to load them as needed (using those storage drivers) when systemd is bringing up networking?

Yes, exactly. Storage drivers need to be "y" because the combination of dm-mod.create and root=/dev/dm-0 to mount the root filesystem requires any necessary storage drivers to be built into the kernel, as there is no initramfs or userspace available to load them from modules. Network drivers aren't necessary until later in the boot so they can be modules.

@bcressey bcressey merged commit 504c0e8 into bottlerocket-os:develop May 2, 2024
33 checks passed
@bcressey bcressey deleted the kernel-6.1-invariant branch May 2, 2024 02:44
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.

3 participants