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 Jun 24, 2021
1 parent d498325 commit 8fa89fb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 21 deletions.
12 changes: 1 addition & 11 deletions manifest-lock.overrides.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,4 @@
# *should* include a URL in the `metadata.reason` key, though it's acceptable to
# 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
packages: {}
4 changes: 2 additions & 2 deletions manifest-lock.x86_64.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@
"evra": "4.2-1.fc34.x86_64"
},
"dracut": {
"evra": "053-5.fc34.x86_64"
"evra": "055-2.fc34.x86_64"
},
"dracut-network": {
"evra": "053-5.fc34.x86_64"
"evra": "055-2.fc34.x86_64"
},
"e2fsprogs": {
"evra": "1.45.6-5.fc34.x86_64"
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 8fa89fb

Please sign in to comment.