diff options
author | Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com> | 2022-12-21 10:37:28 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2023-02-02 22:45:09 +0300 |
commit | db86eb15cee3c88e6cc42fea87c4153bbc791809 (patch) | |
tree | ac14be458fe0202893c5aa1a45cf3084692ea0c9 /meta-phosphor/recipes-phosphor/state | |
parent | ab1722f1966b1eae1d9876a53f1bfb0e16988098 (diff) | |
download | openbmc-db86eb15cee3c88e6cc42fea87c4153bbc791809.tar.xz |
phosphor-state-manager: Separate chassis and host targets
Separate chassis and host targets to generate corresponding instances.
Tested:
chassis/host power control.
Change-Id: I39330deeaf7411dedd3fdb8efaa81986e4fe040c
Signed-off-by: Delphine CC Chiu <Delphine_CC_Chiu@wiwynn.com>
Diffstat (limited to 'meta-phosphor/recipes-phosphor/state')
-rw-r--r-- | meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc | 47 |
1 files changed, 36 insertions, 11 deletions
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc index c9763017c6..3e14646418 100644 --- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc +++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager-systemd-links.inc @@ -1,10 +1,5 @@ -DEFAULT_TARGETS = " \ +HOST_DEFAULT_TARGETS = " \ multi-user.target.requires/obmc-host-reset@{}.target \ - multi-user.target.wants/phosphor-discover-system-state@{}.service \ - obmc-chassis-poweron@{}.target.wants/phosphor-reset-host-recovery@{}.service \ - obmc-chassis-poweron@{}.target.requires/obmc-power-start@{}.service \ - obmc-chassis-poweroff@{}.target.requires/obmc-power-stop@{}.service \ - obmc-chassis-poweroff@{}.target.requires/obmc-powered-off@{}.service \ obmc-host-start@{}.target.requires/obmc-host-startmin@{}.target \ obmc-host-start@{}.target.requires/phosphor-reset-host-reboot-attempts@{}.service \ obmc-host-startmin@{}.target.wants/phosphor-set-host-transition-to-running@{}.service \ @@ -14,13 +9,21 @@ DEFAULT_TARGETS = " \ obmc-host-graceful-quiesce@{}.target.wants/obmc-host-quiesce@{}.target \ obmc-host-graceful-quiesce@{}.target.wants/pldmSoftPowerOff.service \ obmc-host-quiesce@{}.target.wants/phosphor-reset-sensor-states@{}.service \ - obmc-host-shutdown@{}.target.requires/obmc-chassis-poweroff@{}.target \ obmc-host-reboot@{}.target.requires/obmc-host-shutdown@{}.target \ obmc-host-reboot@{}.target.requires/phosphor-reboot-host@{}.service \ obmc-host-warm-reboot@{}.target.requires/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service \ obmc-host-force-warm-reboot@{}.target.requires/obmc-host-stop@{}.target \ obmc-host-force-warm-reboot@{}.target.requires/phosphor-reboot-host@{}.service \ obmc-host-warm-reboot@{}.target.requires/obmc-host-force-warm-reboot@{}.target \ +" + +CHASSIS_DEFAULT_TARGETS = " \ + multi-user.target.wants/phosphor-discover-system-state@{}.service \ + obmc-chassis-poweron@{}.target.wants/phosphor-reset-host-recovery@{}.service \ + obmc-chassis-poweron@{}.target.requires/obmc-power-start@{}.service \ + obmc-host-shutdown@{}.target.requires/obmc-chassis-poweroff@{}.target \ + obmc-chassis-poweroff@{}.target.requires/obmc-power-stop@{}.service \ + obmc-chassis-poweroff@{}.target.requires/obmc-powered-off@{}.service \ obmc-chassis-poweroff@{}.target.wants/phosphor-clear-one-time@{}.service \ obmc-chassis-blackout@{}.target.wants/phosphor-reset-sensor-states@{}.service \ obmc-chassis-powerreset@{}.target.requires/phosphor-reset-chassis-on@{}.service \ @@ -34,7 +37,19 @@ DEFAULT_TARGETS = " \ pkg_postinst:${PN}-obmc-targets:append() { for i in ${OBMC_HOST_INSTANCES}; do - for j in ${DEFAULT_TARGETS}; + for j in ${HOST_DEFAULT_TARGETS}; + do + LINK="$D$systemd_system_unitdir/${j}" + LINK="$(echo ${LINK} | sed s/{}/${i}/g )" + TARGET="../$(basename ${j} | sed s/{}//g )" + mkdir -p "$(dirname ${LINK})" + ln -s "${TARGET}" "${LINK}" + done + done + + for i in ${OBMC_CHASSIS_INSTANCES}; + do + for j in ${CHASSIS_DEFAULT_TARGETS}; do LINK="$D$systemd_system_unitdir/${j}" LINK="$(echo ${LINK} | sed s/{}/${i}/g )" @@ -48,7 +63,17 @@ pkg_postinst:${PN}-obmc-targets:append() { pkg_prerm:${PN}-obmc-targets:append() { for i in ${OBMC_HOST_INSTANCES}; do - for j in ${DEFAULT_TARGETS}; + for j in ${HOST_DEFAULT_TARGETS}; + do + LINK="$D$systemd_system_unitdir/${j}" + LINK="$(echo ${LINK} | sed s/{}/${i}/g )" + rm "${LINK}" + done + done + + for i in ${OBMC_CHASSIS_INSTANCES}; + do + for j in ${CHASSIS_DEFAULT_TARGETS}; do LINK="$D$systemd_system_unitdir/${j}" LINK="$(echo ${LINK} | sed s/{}/${i}/g )" @@ -76,7 +101,7 @@ pkg_prerm:${PN}-chassis:append() { } pkg_postinst:${PN}-chassis-check-power-status:append() { - for i in ${OBMC_HOST_INSTANCES}; + for i in ${OBMC_CHASSIS_INSTANCES}; do mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service" @@ -86,7 +111,7 @@ pkg_postinst:${PN}-chassis-check-power-status:append() { } pkg_prerm:${PN}-chassis-check-power-status:append() { - for i in ${OBMC_HOST_INSTANCES}; + for i in ${OBMC_CHASSIS_INSTANCES}; do LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@${i}.target.requires/phosphor-chassis-check-power-status@${i}.service" rm $LINK |