Skip to content

initrd: Mount cgroup2 filesystem for Podman 6+ compatibility - #5

Merged
achilleas-k merged 2 commits into
osbuild:mainfrom
joelcapitao:mount-cgroup2
Aug 19, 2026
Merged

initrd: Mount cgroup2 filesystem for Podman 6+ compatibility#5
achilleas-k merged 2 commits into
osbuild:mainfrom
joelcapitao:mount-cgroup2

Conversation

@joelcapitao

@joelcapitao joelcapitao commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Podman 6 removed cgroups v1 support (podman-container-tools/podman#27271).
Specifically, commit e860773c0d added a mandatory check at startup
that verifies /sys/fs/cgroup is mounted as cgroup2. If the check
fails, Podman exits with: "Cgroups v1 not supported".

Prior to Podman 6, this worked because there was no such verification -
Podman would simply run without cgroups if none were mounted.

Note: osbuild does not actually need cgroup functionality - this is
only to satisfy Podman 6+'s mandatory startup check.

Partially closes: osbuild/osbuild#2502

Assisted-by: OpenCode (Claude Opus 4)

Assisted-by: OpenCode (Claude Opus 4)

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you. This LGTM but the new test is failing.

@joelcapitao

Copy link
Copy Markdown
Contributor Author

hmm the target path /sys/fs/cgroup does not exist in fedora-bootc rootfs, so the moveMount operation fails.

@joelcapitao
joelcapitao force-pushed the mount-cgroup2 branch 2 times, most recently from 5b33c14 to f2b9542 Compare July 9, 2026 15:42
@joelcapitao

Copy link
Copy Markdown
Contributor Author

@achilleas-k it's working fine now with last changes. I didn't hit the CI issue because I did my test locally with osbuild/osbuild#2503 which ensures /sys/fs/cgroup is available.

@brlane-rht

Copy link
Copy Markdown

I think the readme should also have info about this added to it.

Also, will this work correctly on systems that still use cgroups1 and older podman versions? Or is that something we don't care about at this point?

@joelcapitao

Copy link
Copy Markdown
Contributor Author

I think the readme should also have info about this added to it.

Good point, I added the section to the README

Also, will this work correctly on systems that still use cgroups1 and older podman versions? Or is that something we don't care about at this point?

As we are basically following the Podman lifecycle here, I'd say we should not care about old systems (kernel < 4.5 and/or podman < 2.x)

alexlarsson
alexlarsson previously approved these changes Aug 19, 2026

@alexlarsson alexlarsson left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

@alexlarsson

Copy link
Copy Markdown
Collaborator

The failure seems to be a flake. Can someone rerun it?

@alexlarsson

Copy link
Copy Markdown
Collaborator

The rerun failed, but that seems to be a real failure:
=== Cgroup2 mount test ===
FAIL: /sys/fs/cgroup is not mounted

Podman 6+ removed support for cgroups v1 and now requires cgroups v2.
Mount cgroup2 at `/sys/fs/cgroup` during early boot and ensure the
mount point directory is created before mounting. The mount is then
moved to the sysroot during switchRoot.

Assisted-by: OpenCode (Claude Opus 4)
@alexlarsson

Copy link
Copy Markdown
Collaborator

There were some issues in the handling of the mount, i pushed a fix. Also I changed things to mount /proc earlier so we can get proper debug output in mountAPIs()

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@achilleas-k
achilleas-k merged commit 4b143b2 into osbuild:main Aug 19, 2026
2 checks passed
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.

--in-vm builds fail with Podman 6+ due to missing cgroup2 mount

4 participants