This repository was archived by the owner on Aug 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Add new ignition-fetch-offline.service #164
Merged
+76
−18
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,27 @@ | ||
| #!/bin/bash | ||
| set -euo pipefail | ||
|
|
||
| set +euo pipefail | ||
| . /usr/lib/dracut-lib.sh | ||
| set -euo pipefail | ||
|
|
||
| dracut_func() { | ||
| # dracut is not friendly to set -eu | ||
| set +euo pipefail | ||
| "$@"; local rc=$? | ||
| set -euo pipefail | ||
| return $rc | ||
| } | ||
|
|
||
| # If we need networking and it hasn't been requested yet, request it. | ||
| if [ -f /run/ignition/neednet ] && ! dracut_func getargbool 0 'rd.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/hooks/cmdline/99-nm-config.sh | ||
| set -euo pipefail | ||
| fi | ||
This file contains hidden or 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 hidden or 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) | ||
jlebon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| 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 in ignition-check-neednet, 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.