Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Commit

Permalink
units: add ConditionPathExists=/etc/initrd-release everywhere
Browse files Browse the repository at this point in the history
This is standard practice for units that are only meant to run in the
initrd. It matches what e.g. `systemd` does for its initrd units. See
also: #140.

I also snuck in `Documentation=` lines in there.
  • Loading branch information
jlebon committed Dec 6, 2019
1 parent 8168e4c commit 736459e
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions dracut/30ignition/[email protected]
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Generate new UUID for disk GPT %I
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=no
Before=local-fs-pre.target systemd-fsck-root.service
Before=ignition-diskful.target
Expand Down
3 changes: 2 additions & 1 deletion dracut/30ignition/ignition-complete.target
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# initrd.
[Unit]
Description=Ignition Complete
Before=initrd.target
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
Before=initrd.target

# initrd.target has OnFailureJobMode=replace-irreversibly, which seems to
# cause unit restart loops in the initramfs if one of our units fails. Thus
Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-diskful.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# Like ignition-complete.target, it only runs on first boot.
[Unit]
Description=Ignition Boot Disk Setup
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
Before=ignition-complete.target

# Make sure we stop all the units before switching root
Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-disks.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Ignition (disks)
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
After=ignition-fetch.service
Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-fetch.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Ignition (fetch)
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target
After=basic.target
Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-files.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Ignition (files)
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target

Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-mount.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Ignition (mount)
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target

Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-remount-sysroot.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Remount /sysroot read-write for Ignition
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
# Some Linux Distributions don't pass a rw option on the kernel
# commandline and thus mount the root filesystem ro by default. In
# this case, remount /sysroot to rw (issue #37)
Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-setup-base.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Ignition (setup base config)
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target

Expand Down
2 changes: 2 additions & 0 deletions dracut/30ignition/ignition-setup-user.service
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[Unit]
Description=Ignition (setup user config)
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
DefaultDependencies=false
Before=ignition-complete.target

Expand Down
3 changes: 2 additions & 1 deletion dracut/30ignition/ignition-subsequent.target
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# different order on the Ignition boot versus "subsequent" boots.
[Unit]
Description=Subsequent (Not Ignition) boot complete
Before=initrd.target
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
Before=initrd.target

# See comments in ignition-complete.target
OnFailure=emergency.target
Expand Down

0 comments on commit 736459e

Please sign in to comment.