From aa25e2c3f2a771666db1cff98633a2b834b422c8 Mon Sep 17 00:00:00 2001 From: Andrew Geissler Date: Mon, 1 Feb 2021 14:14:25 -0600 Subject: mpreboot: utilize new distro feature for checks Previous code was piggy backing the memory preserving reboot function off of the phal machine feature. This had issues in that a witherspoon-tacoma system also supports mpreboot, but does not support phal. Signed-off-by: Andrew Geissler Change-Id: Ib044f5252843e84be3304bc0df8ffb8aa947526c --- .../recipes-phosphor/host/op-proc-control-systemd-links.bb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'meta-openpower/recipes-phosphor/host') diff --git a/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb b/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb index cae79bef0..7ce65f927 100644 --- a/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb +++ b/meta-openpower/recipes-phosphor/host/op-proc-control-systemd-links.bb @@ -57,8 +57,11 @@ pkg_postinst_${PN}() { LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service" TARGET="../proc-pre-poweroff@.service" ln -s $TARGET $LINK + fi - # on phal systems, obmc-host-crash@.target is used for MPIPL + # If the memory preserving reboot feature is enabled, set it up + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then + # on mpreboot systems, obmc-host-crash@.target is used for mpreboot mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.requires LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target" TARGET="../obmc-host-force-warm-reboot@.target" @@ -68,12 +71,12 @@ pkg_postinst_${PN}() { TARGET="../op-enter-mpreboot@.service" ln -s $TARGET $LINK - # ensure diagnostic mode is shown for MPIPL + # ensure diagnostic mode is shown for MPREBOOT LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-diagnostic-mode@0.target" TARGET="../obmc-host-diagnostic-mode@.target" ln -s $TARGET $LINK else - # If not phal, default to quiesce target in crash target to support + # If not a mpreboot system, default to quiesce target in crash target to support # older system designs like witherspoon mkdir -p $D$systemd_system_unitdir/obmc-host-crash@0.target.wants LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.wants/obmc-host-quiesce@0.target" @@ -104,7 +107,10 @@ pkg_prerm_${PN}() { LINK="$D$systemd_system_unitdir/obmc-chassis-poweroff@0.target.requires/proc-pre-poweroff@0.service" rm $LINK + fi + # Remove mpreboot specific units if enabled + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'mpreboot', d)}" = mpreboot ]; then LINK="$D$systemd_system_unitdir/obmc-host-crash@0.target.requires/obmc-host-force-warm-reboot@0.target" rm $LINK -- cgit v1.2.3