run soft off in quiesce
When the obmc-host-quiesce@.target was initially created the idea was to
leave the system in the state it was in. In most cases the host had
crashed.
As OpenBMC has grown, the use cases for the quiesce target have grown.
For example the Quiesce On Hardware Error design:
https://github.com/openbmc/docs/blob/master/designs/fail-boot-on-hw-error.md
When the QuiesceOnHwError setting is enabled, the host will be put in a
Quiesce state to indicate that an error has occurred. In a lot of cases
though the host actually can (and does) continue to boot. This causes a
lot of confusion for the user (host state shows Quiesce but host is
still booting).
This commit adds the pldmSoftPowerOff.service to the quiesce target to
ensure the host is given a chance (if it's running) to gracefully shut
itself down. If the host does not respond then the soft off service will
follow it's timeout flow and exit without error.
Tested:
- Verified when quiesce error is injected that the PLDM soft off service
was called
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Iee273e90a978e629e7f1827dcd420f867de3a741
diff --git a/recipes-phosphor/pldm/pldm_git.bb b/recipes-phosphor/pldm/pldm_git.bb
index 1c07ad5..e6ac942 100644
--- a/recipes-phosphor/pldm/pldm_git.bb
+++ b/recipes-phosphor/pldm/pldm_git.bb
@@ -32,6 +32,11 @@
TARGET="../pldmSoftPowerOff.service"
ln -s $TARGET $LINK
+ mkdir -p $D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants
+ LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/pldmSoftPowerOff.service"
+ TARGET="../pldmSoftPowerOff.service"
+ ln -s $TARGET $LINK
+
mkdir -p $D$systemd_system_unitdir/obmc-host-warm-reboot@0.target.requires
LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@0.target.requires/pldmSoftPowerOff.service"
TARGET="../pldmSoftPowerOff.service"
@@ -43,6 +48,9 @@
LINK="$D$systemd_system_unitdir/obmc-host-shutdown@0.target.requires/pldmSoftPowerOff.service"
rm $LINK
+ LINK="$D$systemd_system_unitdir/obmc-host-quiesce@0.target.wants/pldmSoftPowerOff.service"
+ rm $LINK
+
LINK="$D$systemd_system_unitdir/obmc-host-warm-reboot@0.target.requires/pldmSoftPowerOff.service"
rm $LINK
}