Skip to content

Commit

Permalink
unfreeze dracut, adapt for NM via systemd in initrd
Browse files Browse the repository at this point in the history
Upstream dracut updated NM to run as a systemd service
(with full dbus support) in the initrd in [1]. Adapt our
systemd units to handle this case.

This should still work fine for RHCOS because we still have
`Before=dracut-initqueue.service`, which can be dropped when
everyone is on dracut 0.54+.

Fixes: coreos/fedora-coreos-tracker#842
  • Loading branch information
dustymabe committed Jul 9, 2021
1 parent c84da09 commit a437c0c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
10 changes: 0 additions & 10 deletions manifest-lock.overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,6 @@
# omit one for FCOS-specific packages (e.g. ignition, afterburn, etc...).

packages:
dracut:
evr: 053-5.fc34
metadata:
reason: https://github.com/coreos/fedora-coreos-tracker/issues/842
type: pin
dracut-network:
evr: 053-5.fc34
metadata:
reason: https://github.com/coreos/fedora-coreos-tracker/issues/842
type: pin
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
# 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 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

0 comments on commit a437c0c

Please sign in to comment.