fsi-scan: ensure run on all boots
This service needs to be run in both the obmc-chassis-poweron target and
obmc-host-startmin target. This is so support is there for FSI
operations with just a "obmcutil chassison" as well as supporting the
warm reboot path where a chassison is not executed. The service will
only run once during a normal boot due to the way the service is
configured.
Similar to the CFAM reset, the FSI scan service should also not be run
on memory preserving reboots.
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I31b6ba79dede3ff724e729906001e09709ecbfd8
diff --git a/recipes-phosphor/fsi/op-fsi.bb b/recipes-phosphor/fsi/op-fsi.bb
index 86cf5c1..bedf650 100644
--- a/recipes-phosphor/fsi/op-fsi.bb
+++ b/recipes-phosphor/fsi/op-fsi.bb
@@ -8,12 +8,15 @@
RDEPENDS_${PN} += "op-proc-control"
-TGTFMT = "obmc-chassis-poweron@{0}.target"
+TGTFMT_CHASSIS = "obmc-chassis-poweron@{0}.target"
+TGTFMT_HOST = "obmc-host-startmin@{0}.target"
TMPL_SCAN = "fsi-scan@.service"
INSTFMT_SCAN = "fsi-scan@{0}.service"
-FMT_SCAN = "../${TMPL_SCAN}:${TGTFMT}.wants/${INSTFMT_SCAN}"
+FMT_SCAN_CHASSIS = "../${TMPL_SCAN}:${TGTFMT_CHASSIS}.wants/${INSTFMT_SCAN}"
+FMT_SCAN_HOST = "../${TMPL_SCAN}:${TGTFMT_HOST}.wants/${INSTFMT_SCAN}"
SYSTEMD_SERVICE_${PN} += "${TMPL_SCAN} fsi-enable.service fsi-disable.service"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_SCAN', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_SCAN_CHASSIS', 'OBMC_CHASSIS_INSTANCES')}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT_SCAN_HOST', 'OBMC_HOST_INSTANCES')}"
diff --git a/recipes-phosphor/fsi/op-fsi/fsi-scan@.service b/recipes-phosphor/fsi/op-fsi/fsi-scan@.service
index dd837ef..c37863e 100644
--- a/recipes-phosphor/fsi/op-fsi/fsi-scan@.service
+++ b/recipes-phosphor/fsi/op-fsi/fsi-scan@.service
@@ -4,7 +4,10 @@
After=obmc-power-on@%i.target
Wants=obmc-host-start-pre@%i.target
Before=obmc-host-start-pre@%i.target
+After=op-cfam-reset.service
Conflicts=obmc-chassis-poweroff@%i.target
+Conflicts=obmc-host-stop@%i.target
+ConditionPathExists=!/run/openbmc/mpreboot@%i
[Service]
ExecStart=/usr/bin/env openpower-proc-control scanFSI
@@ -15,3 +18,4 @@
[Install]
WantedBy=obmc-chassis-poweron@%i.target
+WantedBy=obmc-host-startmin@%i.target