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
Conditionalize units which require a boot disk #102
Merged
Merged
Changes from all commits
Commits
Show all changes
3 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 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,16 @@ | ||
# This target contains Ignition units that should only run when we have a | ||
# boot disk, i.e. when we're not running diskless from a live image in RAM. | ||
# Like ignition-complete.target, it only runs on first boot. | ||
[Unit] | ||
Description=Ignition Boot Disk Setup | ||
Before=initrd.target | ||
|
||
# Make sure if any ExecStart= fail, the boot fails. This normally would | ||
# already be guaranteed by `initrd.target` failing, but that doesn't seem to be | ||
# enough: https://bugzilla.redhat.com/show_bug.cgi?id=1696796 | ||
OnFailure=emergency.target | ||
OnFailureJobMode=isolate | ||
|
||
# Make sure we stop all the units before switching root | ||
Conflicts=initrd-switch-root.target umount.target | ||
Conflicts=dracut-emergency.service emergency.service emergency.target |
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 |
---|---|---|
|
@@ -6,12 +6,13 @@ depends() { | |
echo qemu systemd url-lib network | ||
} | ||
|
||
# target is optional, used for instantiated units | ||
install_ignition_unit() { | ||
unit=$1; shift | ||
target="${1:-$unit}" | ||
local unit="$1"; shift | ||
local target="${1:-ignition-complete.target}"; shift | ||
local instantiated="${1:-$unit}"; shift | ||
inst_simple "$moddir/$unit" "$systemdsystemunitdir/$unit" | ||
ln_r "../$unit" "$systemdsystemunitdir/ignition-complete.target.requires/$target" | ||
mkdir -p "$initdir/$systemdsystemunitdir/$target.requires" | ||
ln_r "../$unit" "$systemdsystemunitdir/$target.requires/$instantiated" | ||
} | ||
|
||
install() { | ||
|
@@ -54,16 +55,19 @@ install() { | |
inst_simple "$moddir/ignition-complete.target" \ | ||
"$systemdsystemunitdir/ignition-complete.target" | ||
|
||
mkdir -p "$initdir/$systemdsystemunitdir/ignition-complete.target.requires" | ||
inst_simple "$moddir/ignition-diskful.target" \ | ||
"$systemdsystemunitdir/ignition-diskful.target" | ||
|
||
# path generated by systemd-escape --path /dev/disk/by-label/root | ||
install_ignition_unit [email protected] 'coreos-gpt-setup@dev-disk-by\x2dlabel-root.service' | ||
install_ignition_unit ignition-setup-base.service | ||
install_ignition_unit ignition-setup-user.service | ||
install_ignition_unit ignition-disks.service | ||
install_ignition_unit ignition-mount.service | ||
install_ignition_unit ignition-files.service | ||
install_ignition_unit ignition-remount-sysroot.service | ||
|
||
# units only started when we have a boot disk | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wonder if it'd be cleaner to have the units test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All of these except |
||
# path generated by systemd-escape --path /dev/disk/by-label/root | ||
install_ignition_unit [email protected] ignition-diskful.target 'coreos-gpt-setup@dev-disk-by\x2dlabel-root.service' | ||
install_ignition_unit ignition-setup-user.service ignition-diskful.target | ||
install_ignition_unit ignition-remount-sysroot.service ignition-diskful.target | ||
|
||
# needed for openstack config drive support | ||
inst_rules 60-cdrom_id.rules | ||
|
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks to be copied from
igniton-complete.target
. According to the BZ the bug only affects f29 so maybe we can drop this now? cc @jlebon as this was first added in 549002eThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried dropping the stanza from
ignition-complete.target
, and that causes systemd to loop in the initrd if ignition-files fails. With the stanza, it properly fails the boot. So, still needed.On the other hand, if a dependency of
ignition-diskful.target
fails, systemd doesn't fail the boot with or without this stanza. 🙁There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I recalled this working on f30. I guess systemd might've regressed on git master too? If that's the case, we should be able to file an issue upstream for this where it'll hopefully get more exposure. (The only reason I made it an RHBZ was that upstream only wants bugs that reproduce against N and N-1).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would definitely be nice if we could get this fixed in at least f31