phosphor-state-manager: fix chassis poweroff calling wrong host stop
In multihost system, the OBMC_CHASSIS_INSTANCES contains "0" instance
id, which is not exist in OBMC_HOST_INSTANCES. It cause
obmc-chassis-poweroff calling wrong instance of obmc-host-stop in
multihost system.
Example of yosemite4:
- OBMC_CHASSIS_INSTANCES: 0,1,2,3,4,5,6,7,8
- OBMC_HOST_INSTANCES: 1,2,3,4,5,6,7,8
Change to use OBMC_HOST_INSTANCES for both obmc-chassis-poweroff and
obmc-host-stop.
Tested on yosemite4:
- before change, obmc-chassis-poweroff & obmc-host-stop mapping to the
different instance id.
```
root@bmc:/usr/lib/systemd/system# ls obmc-chassis-poweroff*.requires
obmc-chassis-poweroff@0.target.requires:
obmc-host-stop@1.target obmc-poweroff.service phosphor-set-chassis-transition-to-off@0.service
obmc-chassis-poweroff@1.target.requires:
obmc-host-stop@2.target phosphor-set-chassis-transition-to-off@1.service
obmc-chassis-poweroff@2.target.requires:
obmc-host-stop@3.target phosphor-set-chassis-transition-to-off@2.service
obmc-chassis-poweroff@3.target.requires:
obmc-host-stop@4.target phosphor-set-chassis-transition-to-off@3.service
obmc-chassis-poweroff@4.target.requires:
obmc-host-stop@5.target phosphor-set-chassis-transition-to-off@4.service
obmc-chassis-poweroff@5.target.requires:
obmc-host-stop@6.target phosphor-set-chassis-transition-to-off@5.service
obmc-chassis-poweroff@6.target.requires:
obmc-host-stop@7.target phosphor-set-chassis-transition-to-off@6.service
obmc-chassis-poweroff@7.target.requires:
obmc-host-stop@8.target phosphor-set-chassis-transition-to-off@7.service
obmc-chassis-poweroff@8.target.requires:
phosphor-set-chassis-transition-to-off@8.service
```
- after change, obmc-chassis-poweroff & obmc-host-stop mapping to the
same instance id.
```
root@bmc:/usr/lib/systemd/system# ls obmc-chassis-poweroff*.requires
obmc-chassis-poweroff@0.target.requires:
obmc-poweroff.service phosphor-set-chassis-transition-to-off@0.service
obmc-chassis-poweroff@1.target.requires:
obmc-host-stop@1.target phosphor-set-chassis-transition-to-off@1.service
obmc-chassis-poweroff@2.target.requires:
obmc-host-stop@2.target phosphor-set-chassis-transition-to-off@2.service
obmc-chassis-poweroff@3.target.requires:
obmc-host-stop@3.target phosphor-set-chassis-transition-to-off@3.service
obmc-chassis-poweroff@4.target.requires:
obmc-host-stop@4.target phosphor-set-chassis-transition-to-off@4.service
obmc-chassis-poweroff@5.target.requires:
obmc-host-stop@5.target phosphor-set-chassis-transition-to-off@5.service
obmc-chassis-poweroff@6.target.requires:
obmc-host-stop@6.target phosphor-set-chassis-transition-to-off@6.service
obmc-chassis-poweroff@7.target.requires:
obmc-host-stop@7.target phosphor-set-chassis-transition-to-off@7.service
obmc-chassis-poweroff@8.target.requires:
obmc-host-stop@8.target phosphor-set-chassis-transition-to-off@8.service
```
Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Change-Id: I8aa4083f628bae84f59639966ec4c77304d36931
diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb
index a5ac8b5..8407da0 100644
--- a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb
+++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager_git.bb
@@ -244,7 +244,7 @@
STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target"
STOP_INSTFMT_CTRL = "obmc-host-stop@{1}.target"
STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}"
-SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK:${PN}-obmc-targets += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
# Hard power off requires chassis off
HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target"