Skip to content

feat(kernel): enable EROFS in every kernel - #38

Merged
richardcase merged 4 commits into
kernel-ch-config-pinfrom
kernel-erofs
Sep 29, 2026
Merged

richardcase merged 4 commits into
kernel-ch-config-pinfrom
kernel-erofs

Conversation

@richardcase

@richardcase richardcase commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds an erofs.config fragment 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-ch and kernel-fc get the check that fragment options survive dependency resolution, which the two k8s components already have.
  • kernel-fc/configs/additional-61.config had 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 with awk 1, and the loop in all four Dockerfiles reads an unterminated last line.
  • A lint step fails when the copies of the fragment differ. Each component is its own docker build context, so the fragment is copied into each.
  • The documents said that microVMs always boot with no initrd. They now say that no module can be loaded at runtime.

Evidence

  • Seven kernels built locally. Each has the six fragment options as =y, keeps overlayfs, ext4, virtio-blk, devtmpfs and initrd support, and has no =m line.
  • Removing CONFIG_MISC_FILESYSTEMS=y from the Cloud Hypervisor fragment fails the build with DROPPED: wanted [CONFIG_EROFS_FS=y].
  • The 6.1 build input of kernel-fc has CONFIG_PCI=y and CONFIG_MISC_FILESYSTEMS=y as two lines, and the check now examines both.
  • The locally built firecracker-kernel:5.10 and :6.1 booted 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-fc takes its base config from the main branch 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:

Tag Options added Among them Removed
firecracker-kernel:5.10 79 PCI, VIRTIO_PCI, NF_TABLES, FUSE_FS DEVMEM
firecracker-kernel:5.10-no-acpi 74 the same
firecracker-kernel:6.1 62 SECURITY_LANDLOCK, CRYPTO_FIPS, TUN, VXLAN DEVMEM

The three k8s and Cloud Hypervisor k8s kernels have a pinned base and change by EROFS only.

This pull request does not change where kernel-fc gets 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 the kernel-fc workflow is run.

After merge

The images are published by running the four kernel build workflows by hand. Tags do not change.

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>
@richardcase
richardcase added this pull request to stack #39 September 29, 2026 10:01
@richardcase richardcase changed the title kernel erofs feat(kernel): enable EROFS in every kernel Sep 29, 2026
@richardcase richardcase added the enhancement New feature or request label Sep 29, 2026
@richardcase
richardcase marked this pull request as ready for review September 29, 2026 10:44
./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)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@richardcase richardcase Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

@richardcase richardcase Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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.

Comment thread AGENTS.md Outdated
- `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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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?

@richardcase richardcase Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant