Add openpower-debug-collector as part of host-crash target
When the host crashes, we need some kind of debug data before
it is taken to quiesce state.
Fixes openbmc/openbmc#1647
Change-Id: I853e9a6aa840e0811a5610f486b530b0f6dfe0a8
Signed-off-by: Vishwanatha Subbanna <vishwa@linux.vnet.ibm.com>
diff --git a/common/recipes-phosphor/debug/openpower-debug-collector.bb b/common/recipes-phosphor/debug/openpower-debug-collector.bb
index e31058f..757ca31 100644
--- a/common/recipes-phosphor/debug/openpower-debug-collector.bb
+++ b/common/recipes-phosphor/debug/openpower-debug-collector.bb
@@ -21,9 +21,11 @@
S = "${WORKDIR}/git"
-TMPL = "openpower-debug-collector@.service"
-INSTFMT = "openpower-debug-collector@{0}.service"
-LINK_FMT = "${TMPL}:${INSTFMT}"
+# This needs to be executed as part of host crash
+DEBUG_TMPL = "openpower-debug-collector@.service"
+CRASH_TGTFMT = "obmc-host-crash@{0}.target"
+DEBUG_INSTFMT = "openpower-debug-collector@{0}.service"
+CRASH_DEBUG_FMT = "../${DEBUG_TMPL}:${CRASH_TGTFMT}.wants/${DEBUG_INSTFMT}"
-SYSTEMD_SERVICE_${PN} += "${TMPL}"
-SYSTEMD_LINK_${PN} += "${@compose_list(d, 'LINK_FMT', 'OBMC_CHECKSTOP_INSTANCES')}"
+SYSTEMD_SERVICE_${PN} += "${DEBUG_TMPL}"
+SYSTEMD_LINK_${PN} += "${@compose_list(d, 'CRASH_DEBUG_FMT', 'OBMC_HOST_INSTANCES')}"
diff --git a/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector@.service b/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector@.service
index 8f6f2bd..9ed37e3 100644
--- a/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector@.service
+++ b/common/recipes-phosphor/debug/openpower-debug-collector/openpower-debug-collector@.service
@@ -1,6 +1,6 @@
[Unit]
Description=OpenPOWER debug data collector
-Conflicts=obmc-host-quiesce@%i.target
+Before=obmc-host-quiesce@%i.target
[Service]
ExecStart={sbindir}/checkstop_app