diff --git a/overlay.d/05core/usr/lib/systemd/system-preset/40-coreos.preset b/overlay.d/05core/usr/lib/systemd/system-preset/40-coreos.preset index 89a4bc8d21..d121675c61 100644 --- a/overlay.d/05core/usr/lib/systemd/system-preset/40-coreos.preset +++ b/overlay.d/05core/usr/lib/systemd/system-preset/40-coreos.preset @@ -13,3 +13,5 @@ enable afterburn-firstboot-checkin.service enable afterburn-sshkeys@.service # Update agent enable zincati.service +# Testing aid +enable coreos-liveiso-success.service diff --git a/overlay.d/05core/usr/lib/systemd/system/coreos-liveiso-success.service b/overlay.d/05core/usr/lib/systemd/system/coreos-liveiso-success.service new file mode 100644 index 0000000000..c3f4a94d54 --- /dev/null +++ b/overlay.d/05core/usr/lib/systemd/system/coreos-liveiso-success.service @@ -0,0 +1,23 @@ +# This is used by our test framework in coreos-assembler +# since we don't have a way to inject testing configuration +# via Ignition to test this scenario. +[Unit] +Description=CoreOS Live ISO virtio success +Documentation=https://github.com/coreos/fedora-coreos-config +# Only run on the Live ISO, and only if there's no Ignition config; +# the second bits here invert the conditionals in coreos-liveiso-network-kargs.service. +ConditionKernelCommandLine=coreos.liveiso +ConditionPathExists=!/config.ign +ConditionVirtualization=|kvm +ConditionVirtualization=|qemu +# Start running late to help ensure that the below conditional works +After=systemd-user-sessions.service +ConditionPathExists=/dev/virtio-ports/coreos.liveiso-success + +[Service] +Type=simple +# See https://cgit.freedesktop.org/systemd/systemd/plain/src/systemd/sd-messages.h +ExecStart=/bin/sh -c 'journalctl -b -f -o cat -u systemd-logind.service MESSAGE_ID=8d45620c1a4348dbb17410da57c60c66 | head -1 >dev/null; echo coreos-liveiso-success > /dev/virtio-ports/coreos.liveiso-success' + +[Install] +WantedBy=multi-user.target