Repository navigation
feat(kernel): enable EROFS in every kernel - #38
Conversation
Flintlock's overlay volume mode presents the root filesystem as a read-only EROFS image. No published kernel can mount one. Add an EROFS fragment to each kernel component. The Cloud Hypervisor base config has MISC_FILESYSTEMS off, so the fragment turns that on too. lz4 support is enabled although flintlock does not compress the image yet, so that it can later without a kernel rebuild. kernel-ch and kernel-fc did not check that fragment options survive dependency resolution. Give them the check that the two k8s components already have. additional-61.config in kernel-fc had no newline at its end. A fragment appended after it would be fused with its last option into one line, and the check loop skipped a last line without a newline. Terminate the file, concatenate with awk, and make the loop in all four components read an unterminated last line. Signed-off-by: Richard Case <richard.case@outlook.com>
The fragment is copied into each kernel directory, because each one is its own docker build context. Nothing stopped the copies from drifting, which would publish kernels that differ in a way nobody chose. Add a check to the kernel config lint. Update the documents, which said that microVMs always boot with no initrd; flintlock's overlay volume mode boots with one. Signed-off-by: Richard Case <richard.case@outlook.com>
| ./hack/check-no-modules.sh $configs | ||
| - name: Check that the copies of the EROFS fragment match | ||
| run: | | ||
| copies=$(find . -name erofs.config -not -path '*/out/*' | sort) |
There was a problem hiding this comment.
This finds only copies that still exist. If one kernel’s erofs.config is deleted, the remaining three identical files pass check-fragments-match.sh, so this lint does not enforce the documented one-copy-per-kernel requirement. Could the check assert the four expected paths exist before comparing their contents? I confirmed that passing three copies exits 0.
There was a problem hiding this comment.
Fixed in 5a598a5. The workflow now names the four copies instead of using find, and check-fragments-match.sh fails on any argument that is not a file, before it compares anything.
With kernel-ch/configs/erofs.config deleted, the step prints ERROR: kernel-ch/configs/erofs.config is missing and exits 1. A differing copy still fails with the diff.
A new kernel component has to be added to the list by hand. AGENTS.md says so.
| @@ -0,0 +1,6 @@ | |||
| CONFIG_MISC_FILESYSTEMS=y | |||
There was a problem hiding this comment.
This fragment is at the component root, while AGENTS.md and the top-level README.md say repo-specific fragments live in each component’s configs/ directory. kernel-k8s-ch/k8s_additions.config is already at the root too, so the simplest fix may be to document the Cloud Hypervisor k8s layout as an exception.
There was a problem hiding this comment.
Fixed in d3a5ea3 by documenting the exception. AGENTS.md and the top-level README.md now say that kernel-k8s-ch/ has no configs/ directory and keeps its fragments at the component root.
I left the files where they are. Moving them would also move k8s_additions.config, which this pull request does not otherwise touch.
| - `kernel-fc/` merges its single fragment with a plain `cat`. | ||
| - `kernel-k8s-fc/`, `kernel-k8s-ch/` and `kernel-ch/` merge fragments with the kernel's own `scripts/kconfig/merge_config.sh` and then validate that every requested symbol actually survived Kconfig dependency resolution (the Dockerfile fails the build otherwise — `merge_config.sh` only warns). | ||
| - `erofs.config` exists once per kernel directory and every copy must be identical. Change all four together; `hack/check-fragments-match.sh` checks it in CI. | ||
| - `kernel-fc/` concatenates its fragments onto the base config with `cat` in the `Makefile`, and its `Dockerfile` then checks that every fragment option survived. |
There was a problem hiding this comment.
kernel-fc/Makefile now uses awk 1 for each variant, while this new guidance says it uses cat. Could this line name awk 1 so the repository instructions match the build?
There was a problem hiding this comment.
Fixed in d3a5ea3. The line now names awk 1 and gives the reason: it ends every line with a newline, so a fragment with no final newline cannot fuse with the one after it.
The lint compared the copies of erofs.config that find returned. When one kernel's copy was deleted, the three that remained still matched and the lint passed. Name the four copies in the workflow, and make the script fail on an argument that is not a file. A new kernel component has to be added to the list by hand, and AGENTS.md says so. Signed-off-by: Richard Case <richard.case@outlook.com>
The documents said that every component keeps its fragments in configs/. kernel-k8s-ch keeps them at the component root. Say so. AGENTS.md said that kernel-fc concatenates with cat. The Makefile uses awk 1, so that a fragment with no final newline cannot fuse with the one after it. Signed-off-by: Richard Case <richard.case@outlook.com>
fda0740 to
d3a5ea3
Compare
Summary
Adds an
erofs.configfragment to each of the four kernel components, so that every kernel can mount an EROFS filesystem. Flintlock's overlay volume mode (designed in liquidmetal-dev/flintlock#1274) presents the root filesystem as a read-only EROFS image, assembled into an overlay root by an initrd.Also in this change:
kernel-chandkernel-fcget the check that fragment options survive dependency resolution, which the two k8s components already have.kernel-fc/configs/additional-61.confighad no newline at its end. Appending a fragment after it fused two options into one line, and the check loop skipped a last line without a newline. The file is terminated, the Makefile concatenates withawk 1, and the loop in all four Dockerfiles reads an unterminated last line.Evidence
=y, keeps overlayfs, ext4, virtio-blk, devtmpfs and initrd support, and has no=mline.CONFIG_MISC_FILESYSTEMS=yfrom the Cloud Hypervisor fragment fails the build withDROPPED: wanted [CONFIG_EROFS_FS=y].kernel-fchasCONFIG_PCI=yandCONFIG_MISC_FILESYSTEMS=yas two lines, and the check now examines both.firecracker-kernel:5.10and:6.1booted an overlay root under Firecracker v1.16.1, with an EROFS base and an ext4 upper, to a login prompt. The Cloud Hypervisor kernels were not booted.Before publishing
kernel-fctakes its base config from themainbranch of Firecracker at build time. The published images are from October 2025. Republishing under the same tags picks up a year of changes to that base, not only EROFS:firecracker-kernel:5.10PCI,VIRTIO_PCI,NF_TABLES,FUSE_FSDEVMEMfirecracker-kernel:5.10-no-acpifirecracker-kernel:6.1SECURITY_LANDLOCK,CRYPTO_FIPS,TUN,VXLANDEVMEMThe three k8s and Cloud Hypervisor k8s kernels have a pinned base and change by EROFS only.
This pull request does not change where
kernel-fcgets its base. Pinning it, and failing on a failed download as the layer below this one does for Cloud Hypervisor, is a separate change that should land before thekernel-fcworkflow is run.After merge
The images are published by running the four kernel build workflows by hand. Tags do not change.