This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new ignition-fetch-offline.service
Make use of the new `fetch-offline` stage: coreos/ignition#979 We run this between the `setup` and `fetch` stages (the latter possibly being skipped if networking is not required). We hit the same issue here that `coreos-copy-firstboot-network.service` hit, which is that we can't run before the `cmdline` hook because that runs *before* udev, but we want the `by-*` symlinks for `ignition-setup-user.service`. The hack we do here is to rerun the NM cmdline hook in case ignition dropped a snippet in `/etc/cmdline.d`. As mentioned in coreos/fedora-coreos-config#346, we'll be able to do this more cleanly once we run NM as a systemd service directly.
- Loading branch information
Showing
9 changed files
with
63 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
if [ -f /run/ignition/neednet ]; then | ||
echo "rd.neednet=1" > /etc/cmdline.d/40-ignition-neednet.conf | ||
|
||
# Hack: we need to rerun the NM cmdline hook because we run after | ||
# dracut-cmdline.service because we need udev. We should be able to move | ||
# away from this once we run NM as a systemd unit. See also: | ||
# https://github.com/coreos/fedora-coreos-config/pull/346#discussion_r409843428 | ||
set +euo pipefail | ||
. /usr/lib/dracut-lib.sh | ||
. /usr/lib/dracut/hooks/cmdline/99-nm-config.sh | ||
set -euo pipefail | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[Unit] | ||
Description=Ignition (fetch-offline) | ||
Documentation=https://github.com/coreos/ignition | ||
ConditionPathExists=/etc/initrd-release | ||
DefaultDependencies=false | ||
Before=ignition-complete.target | ||
After=basic.target | ||
|
||
# Stage order: setup -> fetch-offline [-> fetch] -> disks -> mount -> files. | ||
# We run after the setup stage has run because it may copy in new/different | ||
# ignition configs for us to consume. | ||
After=ignition-setup-base.service | ||
After=ignition-setup-user.service | ||
Before=ignition-fetch.service | ||
|
||
OnFailure=emergency.target | ||
OnFailureJobMode=isolate | ||
|
||
# See hack below, as well as coreos-copy-firstboot-network.service. | ||
After=dracut-cmdline.service | ||
Before=dracut-initqueue.service | ||
|
||
[Service] | ||
Type=oneshot | ||
RemainAfterExit=yes | ||
EnvironmentFile=/run/ignition.env | ||
ExecStart=/usr/bin/ignition --root=/sysroot --platform=${PLATFORM_ID} --stage=fetch-offline | ||
ExecStart=/usr/sbin/ignition-check-neednet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters