Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unfreeze dracut, adapt for NM via systemd in initrd #1068

Merged
merged 4 commits into from
Jul 9, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions manifest-lock.overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@

packages:
dracut:
evr: 053-5.fc34
evr: 055-3.fc34
metadata:
reason: https://github.com/coreos/fedora-coreos-tracker/issues/842
type: pin
reason: https://github.com/coreos/fedora-coreos-tracker/issues/842#issuecomment-867900969
type: fast-track
bodhi: https://bodhi.fedoraproject.org/updates/FEDORA-2021-9d1b72b267
dracut-network:
evr: 053-5.fc34
evr: 055-3.fc34
metadata:
reason: https://github.com/coreos/fedora-coreos-tracker/issues/842
type: pin
reason: https://github.com/coreos/fedora-coreos-tracker/issues/842#issuecomment-867900969
type: fast-track
bodhi: https://bodhi.fedoraproject.org/updates/FEDORA-2021-9d1b72b267
fedora-coreos-pinger:
evr: 0.0.4-11.fc34
metadata:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@
# - i.e. after /dev/disk/by-label/boot is available
# - and after the ignition-dracut GPT generator (see below)
# - Need to run before networking is brought up.
# - This is done in nm-run.service [1]
# - i.e. Before=nm-run.service
# - This is done in nm-initrd.service [1]
# - i.e. Before=nm-initrd.service
# - Need to make sure karg networking configuration isn't applied
# - There are two ways to do this.
# - One is to run *before* the nm-config.sh [2] that runs as part of
# dracut-cmdline [3] and `ln -sf /bin/true /usr/libexec/nm-initrd-generator`.
# - i.e. Before=dracut-cmdline.service
# - Another is to run *after* nm-config.sh [2] in dracut-cmdline [3]
# and just delete all the files created by nm-initrd-generator.
# - i.e. After=dracut-cmdline.service, but Before=nm-run.service
# - i.e. After=dracut-cmdline.service, but Before=nm-initrd.service
# - We'll go with the second option here because the need for the /boot
# device (mentioned above) means we can't start before dracut-cmdline.service
#
# [1] https://github.com/dracutdevs/dracut/blob/master/modules.d/35network-manager/nm-run.service
# [1] https://github.com/dracutdevs/dracut/blob/master/modules.d/35network-manager/nm-initrd.service
# [2] https://github.com/dracutdevs/dracut/blob/master/modules.d/35network-manager/nm-config.sh
# [3] https://github.com/dracutdevs/dracut/blob/master/modules.d/35network-manager/module-setup.sh#L34
#
Expand All @@ -30,8 +30,8 @@ Description=Copy CoreOS Firstboot Networking Config
ConditionPathExists=/usr/lib/initrd-release
DefaultDependencies=false
Before=ignition-diskful.target
Before=nm-run.service
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, should we keep nm-run.service and just add nm-initrd.service? That way if nm-run.service is backported to RHEL, but not nm-initrd.service, this will still work for RHCOS.

Copy link
Member Author

Choose a reason for hiding this comment

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

I highly doubt that will happen as nm-run.service was only in there for one release of dracut (053) and was replaced by the full systemd+dbus implementation because the NM team actively wants it for the next version of RHEL.

IMHO I'd rather it fail so we could consider and fix our wrong assumption.

# compat: remove when everyone is on dracut 053+
Before=nm-initrd.service
# compat: remove when everyone is on dracut 054+
Before=dracut-initqueue.service
After=dracut-cmdline.service
# Any services looking at mounts need to order after this
Expand All @@ -47,6 +47,10 @@ After=coreos-multipath-wait.target
# hook which will generate NM configs from the network kargs, but we want to
# have precedence.
After=coreos-enable-network.service
# We've seen races with ignition-kargs.service, which accesses /boot rw.
# Let's introduce some ordering here. Need to use `Before` because otherwise
# we get a systemd ordering cycle. https://github.com/coreos/fedora-coreos-tracker/issues/883
Before=ignition-kargs.service
Copy link
Member

Choose a reason for hiding this comment

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

Hmm OK yeah that makes sense now looking at the cycle in coreos/fedora-coreos-tracker#883 (comment).

We need networking to fetch the config to apply the kargs. And this service obviously has to run before networking comes up since the whole point is network configuration.


[Service]
Type=oneshot
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Before=ignition-fetch.service

# See hack in coreos-enable-network, as well as coreos-copy-firstboot-network.service.
After=dracut-cmdline.service
Before=nm-run.service
# compat: remove when everyone is on dracut 053+
Before=nm-initrd.service
# compat: remove when everyone is on dracut 054+
Before=dracut-initqueue.service

[Service]
Expand Down