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

Commit

Permalink
Add ignition-diskful-subsequent.target
Browse files Browse the repository at this point in the history
This target is a combination of `ignition-subsequent.target` and
`ignition-diskful.target` - units here should only run when we have a
boot disk and *aren't* doing the first boot.

This came out of discussion in
coreos/fedora-coreos-config#271

Will be used by FCOS.

Suggested-by: @jlebon
  • Loading branch information
cgwalters authored and jlebon committed Jan 30, 2020
1 parent ef08dd5 commit 14808e2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
12 changes: 12 additions & 0 deletions dracut/30ignition/ignition-diskful-subsequent.target
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This target is a combination of ignition-subsequent.target and
# ignition-diskful.target - units here should only run when we have a
# boot disk and *aren't* doing the first boot.
[Unit]
Description=Ignition Subsequent Boot Disk Setup
Documentation=https://github.com/coreos/ignition
ConditionPathExists=/etc/initrd-release
Before=ignition-subsequent.target

# 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
3 changes: 3 additions & 0 deletions dracut/30ignition/ignition-generator
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ else
# like `ignition-ostree-mount-sysroot.service`
# can cleanly distinguish between the two.
add_requires ignition-subsequent.target initrd.target
if ! command -v is-live-image >/dev/null || ! is-live-image; then
add_requires ignition-diskful-subsequent.target ignition-subsequent.target
fi
fi

echo "PLATFORM_ID=$(cmdline_arg ignition.platform.id)" > /run/ignition.env
11 changes: 4 additions & 7 deletions dracut/30ignition/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,10 @@ install() {
inst_simple "$moddir/ignition-generator" \
"$systemdutildir/system-generators/ignition-generator"

inst_simple "$moddir/ignition-complete.target" \
"$systemdsystemunitdir/ignition-complete.target"
inst_simple "$moddir/ignition-subsequent.target" \
"$systemdsystemunitdir/ignition-subsequent.target"

inst_simple "$moddir/ignition-diskful.target" \
"$systemdsystemunitdir/ignition-diskful.target"
for x in "complete" "subsequent" "diskful" "diskful-subsequent"; do
inst_simple "$moddir/ignition-$x.target" \
"$systemdsystemunitdir/ignition-$x.target"
done

install_ignition_unit ignition-setup-base.service
install_ignition_unit ignition-setup-user.service
Expand Down

0 comments on commit 14808e2

Please sign in to comment.