From 284d56bb877be545f59cf10883d28a37f306fc5b Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Wed, 9 Dec 2020 16:03:36 -0600 Subject: 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 Change-Id: Ie6d07011a5ac5f6964435364ff6e332a77e5a3d4 Signed-off-by: Andrew Geissler --- meta-phosphor/recipes-phosphor/pldm/pldm_git.bb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'meta-phosphor/recipes-phosphor/pldm') diff --git a/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb b/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb index 1c07ad59d..e6ac942bd 100644 --- a/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb +++ b/meta-phosphor/recipes-phosphor/pldm/pldm_git.bb @@ -32,6 +32,11 @@ pkg_postinst_${PN} () { 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 @@ pkg_prerm_${PN} () { 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 } -- cgit v1.2.3