add package-level support for erofs as root filesystem #159
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number:
Related: bottlerocket-os/twoliter#379
Description of changes:
This implements the core kit side of erofs support.
Require a 6.1 kernel for using erofs, and add the necessary kernel config and SELinux policy statements to make it work.
The ugly parts come from my goal of avoiding multiple forms of compression; since erofs includes its own compression, we can avoid compressing license and attribution data, kernel modules, and kernel development files.
Kernel module decompression is handled by
twoliter
: if we're building an erofs root filesystem, it decompresses any kernel modules. Uncompressed license and attribution data is mostly handled bytwoliter
, which skips generating the squashfs when using the erofs feature. However, we need to tell the OS not to try to mount the missing squashfs.Handling the kernel development files is more complicated, because there's a lot of logic in the
release
package to handle setting up/usr/src/kernels
as a writable mount. I couldn't see a great way to prevent thekernel-6.1
package from depending on some of the specific units inrelease
, but I tried to minimize it. We now create twokernel-devel
packages, one compressed with squashfs and the other left unpacked, and we use a drop-in to replace the squashfs mount inrelease
with a regular bind mount.Testing done:
Built
aws-k8s-1.30
with and without the image feature enabled.Without:
With:
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.