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
(From meta-phosphor rev: dfa2d6beb496b2265402950caf524c7f79850c46)
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: Ie6d07011a5ac5f6964435364ff6e332a77e5a3d4
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb b/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb
index 1c07ad5..e6ac942 100644
--- a/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb
+++ b/meta-phosphor/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
}