Skip to content

flatcar-network: Use upstream network and resolved Dracut modules - #129

Open
chewi wants to merge 8 commits into
flatcar-masterfrom
chewi/upstream-network
Open

flatcar-network: Use upstream network and resolved Dracut modules#129
chewi wants to merge 8 commits into
flatcar-masterfrom
chewi/upstream-network

Conversation

@chewi

@chewi chewi commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Our IP parser has some shortcomings and systemd-network-generator can simply do this for us. Afterburn is being modified (coreos/afterburn#1299) to emit an environment file with SYSTEMD_PROC_CMDLINE because the generator won't read the existing /etc/cmdline.d file that was consumed by Dracut.

This also deduplicates .network files in common with coreos-init. The bootengine copies had gone out of sync, and we can just install coreos-init's copies. We need to adjust KeepConfiguration for the initrd environment though.

This partially addresses #117 by allowing afterburn-network-kargs.service to work with ProxmoxVE. We cannot allow KubeVirt yet because a new Afterburn release is needed first.

The rest is just small cleanups.

How to use

This is most effectively tested with ProxmoxVE. /run/systemd/networkd should include 20-eth0.network and 71-default.network generated from the two different mechanisms. They should be roughly similar.

Testing done

The most recent Jenkins build was successful. Earlier builds tested all the platforms successfully. I have also done a lot of manual testing with QEMU and ProxmoxVE.

chewi added 8 commits August 13, 2026 14:48
We mount it in the minimal initrd and it never gets unmounted, so it's
simpler to assume it's there.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
It was only used by Equinix Metal (Packet), which has now gone.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
The bootengine copies had gone out of sync, and we can just install
coreos-init's copies. We need to adjust KeepConfiguration for the initrd
environment though.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This was accidentally omitted.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
I added these when Dracut stopped simply installing all of them, but on
reflection, Calico and veth are irrelevant in the initrd.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Our IP parser has some shortcomings and systemd-network-generator can
simply do this for us. Afterburn is being modified to emit an
environment file with SYSTEMD_PROC_CMDLINE because the generator won't
read the existing /etc/cmdline.d file that was consumed by Dracut.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Upstream have also added KubeVirt support here, but that hasn't been
released yet.

Bug: #117
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi chewi self-assigned this Aug 26, 2026
@chewi
chewi requested a review from a team as a code owner August 26, 2026 10:11
Copilot AI lite review requested due to automatic review settings August 26, 2026 10:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Flatcar’s initrd networking flow to rely on upstream Dracut + systemd components (notably systemd-network-generator with an Afterburn-provided SYSTEMD_PROC_CMDLINE), while removing the bespoke ip= parsing and deduplicating network unit files that had drifted from upstream/coreos-init behavior.

Changes:

  • Switch initrd networking from a custom ip= parser + static .network set to upstream systemd-network-generator, with Afterburn providing SYSTEMD_PROC_CMDLINE via an environment file.
  • Remove various initrd units/config that assumed a sysusr-usr.mount systemd unit, aligning with /sysusr being mounted by minimal-init.
  • Clean up/realign Dracut module inclusion and installed network unit sources (drop local copies; install upstream copies; tweak KeepConfiguration behavior for initrd).

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
update-bootengine Adjust Dracut module set: drop network from omit list and add flatcar-network.
dracut/53ignition/sysusr-usr-revdeps.conf Remove sysusr cryptsetup revdeps drop-in.
dracut/53ignition/module-setup.sh Stop installing flatcar-static-network.service and sysusr-usr cryptsetup drop-in.
dracut/53ignition/ignition-mount.service Remove RequiresMountsFor=/sysusr/usr/ dependency.
dracut/53ignition/ignition-kargs.service Remove RequiresMountsFor=/sysusr/usr/ (keep /oem/).
dracut/53ignition/ignition-fetch.service Remove RequiresMountsFor=/sysusr/usr/ (keep /oem/).
dracut/53ignition/ignition-fetch-offline.service Remove RequiresMountsFor=/sysusr/usr/ (keep /oem/).
dracut/53ignition/ignition-disks.service Remove RequiresMountsFor=/sysusr/usr/.
dracut/53ignition/flatcar-static-network.service Remove the legacy unit that generated .network files via coreos-metadata --network-units=....
dracut/53ignition/flatcar-openstack-hostname.service Drop sysusr-usr.mount ordering/requirement.
dracut/53ignition/flatcar-metadata-hostname.service Drop sysusr-usr.mount ordering/requirement.
dracut/53ignition/flatcar-afterburn-network.service Drop sysusr-usr.mount ordering/requirement.
dracut/50flatcar-network/zz-default.network Remove local copy (intended to use upstream-installed copy).
dracut/50flatcar-network/yy-pxe.network Remove local copy (intended to use upstream-installed copy).
dracut/50flatcar-network/yy-netroot.network Tighten matching to exclude virtual NICs and loopback.
dracut/50flatcar-network/yy-azure-sriov.network Remove local copy (intended to use upstream-installed copy).
dracut/50flatcar-network/yy-azure-sriov-coreos.network Remove local copy (intended to use upstream-installed copy).
dracut/50flatcar-network/systemd-network-generator-afterburn.conf Add drop-in to run Afterburn first and load /run/afterburn/network-generator.env for SYSTEMD_PROC_CMDLINE.
dracut/50flatcar-network/parse-ip-for-networkd.sh Remove custom ip= parsing script.
dracut/50flatcar-network/parse-ip-for-networkd.service Remove unit that ran the custom ip= parsing script.
dracut/50flatcar-network/module-setup.sh Switch to upstream unit installation; adjust KeepConfiguration; wire Afterburn into systemd-network-generator; manage enable/disable of networkd/resolved/generator.
dracut/50flatcar-network/afterburn-network-kargs.service Re-scope conditions and ordering (notably ProxmoxVE; order before dracut-cmdline.service); remove old install/PartOf wiring.
dracut/50flatcar-network/10-nodeps.conf Remove the systemd-resolved drop-in.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

"$systemdnetwork"/{20-calico-tunl0,50-veth,98-{gce-coreos-virtio,gce-virtio,virtio}}.link
"$systemdnetwork"/{20-calico-tunl0,50-veth,98-{gce-coreos-virtio,gce-virtio,virtio}}.link \
"$systemdnetwork"/yy-{azure-sriov{,-coreos},pxe}.network \
"$systemdnetwork"/zz-default.network

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If those are provided by coreos-init - should we add it as a post dependency to the bootengine ebuild?

@tormath1 tormath1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One question - but it looks good to me. It simplifies a lot this area. Thanks for the deep dive!

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