summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/state
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2017-05-08 15:58:01 -0500
committerAndrew Geissler <andrewg@us.ibm.com>2017-05-09 17:37:14 -0500
commitb1afecc2797d06e1e54094b72c5f2586be73bbdd (patch)
tree85f0703dbbb53144206deff4bc420f6aa2e89c34 /meta-phosphor/common/recipes-phosphor/state
parent293354516d1a6b508ccd403c94a82ad89adf9b66 (diff)
downloadtalos-openbmc-b1afecc2797d06e1e54094b72c5f2586be73bbdd.tar.gz
talos-openbmc-b1afecc2797d06e1e54094b72c5f2586be73bbdd.zip
Add phosphor-host-check and required host services
This application and services will be used by the host reset service to determine if the host is running after a BMC has been rebooted Change-Id: I8299546b0f275ebbb46aa775ab7b0633cc3fd5e0 Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/state')
-rw-r--r--meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-check@.service19
-rw-r--r--meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-running@.service14
-rw-r--r--meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb28
3 files changed, 60 insertions, 1 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-check@.service b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-check@.service
new file mode 100644
index 000000000..ba4f0c098
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-check@.service
@@ -0,0 +1,19 @@
+[Unit]
+Description=Check Host%i status on BMC reset
+Wants=mapper-wait@-xyz-openbmc_project-control-host%i.service
+After=mapper-wait@-xyz-openbmc_project-control-host%i.service
+Wants=obmc-host-reset-running@%i.target
+Before=obmc-host-reset-running@%i.target
+Wants=op-reset-chassis-on@%i.service
+After=op-reset-chassis-on@%i.service
+Conflicts=obmc-host-shutdown@%i.target
+ConditionPathExists=/run/openbmc/chassis@%i-on
+
+[Service]
+RemainAfterExit=yes
+Type=oneshot
+ExecStart=/usr/sbin/phosphor-host-check
+
+
+[Install]
+WantedBy=obmc-host-reset@%i.target
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-running@.service b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-running@.service
new file mode 100644
index 000000000..9a6ffe60b
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reset-host-running@.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Start host%i running after BMC reset
+After=obmc-host-reset-running@%i.target
+Requires=obmc-host-reset-running@%i.target
+ConditionPathExists=/run/openbmc/host@%i-on
+
+[Service]
+RemainAfterExit=no
+# TODO: openbmc/openbmc#1205 - target name refactor
+ExecStart=/bin/systemctl start obmc-host-start@%i.target
+
+
+[Install]
+WantedBy=obmc-host-reset@%i.target
diff --git a/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb b/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb
index ce0fa1ee8..7ba02a0c9 100644
--- a/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb
+++ b/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb
@@ -12,6 +12,7 @@ STATE_MGR_PACKAGES = " \
${PN}-chassis \
${PN}-bmc \
${PN}-discover \
+ ${PN}-host-check \
"
PACKAGES =+ "${STATE_MGR_PACKAGES}"
PACKAGES_remove = "${PN}"
@@ -35,6 +36,7 @@ RDEPENDS_${PN}-host += "libsystemd phosphor-dbus-interfaces"
RDEPENDS_${PN}-chassis += "libsystemd phosphor-dbus-interfaces"
RDEPENDS_${PN}-bmc += "libsystemd phosphor-dbus-interfaces"
RDEPENDS_${PN}-discover += "libsystemd phosphor-dbus-interfaces"
+RDEPENDS_${PN}-host-check += "libsystemd phosphor-dbus-interfaces"
FILES_${PN}-host = "${sbindir}/phosphor-host-state-manager"
DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service"
@@ -48,12 +50,36 @@ DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service"
FILES_${PN}-discover = "${sbindir}/phosphor-discover-system-state"
SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service"
+FILES_${PN}-host-check = "${sbindir}/phosphor-host-check"
+SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service"
+SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service"
+
+RESET_CHECK_TMPL = "phosphor-reset-host-check@.service"
+RESET_CHECK_TGTFMT = "obmc-host-reset@{1}.target"
+RESET_CHECK_INSTFMT = "phosphor-reset-host-check@{0}.service"
+RESET_CHECK_FMT = "../${RESET_CHECK_TMPL}:${RESET_CHECK_TGTFMT}.requires/${RESET_CHECK_INSTFMT}"
+
+RESET_RUNNING_TMPL = "phosphor-reset-host-running@.service"
+RESET_RUNNING_TGTFMT = "obmc-host-reset@{1}.target"
+RESET_RUNNING_INSTFMT = "phosphor-reset-host-running@{0}.service"
+RESET_RUNNING_FMT = "../${RESET_RUNNING_TMPL}:${RESET_RUNNING_TGTFMT}.requires/${RESET_RUNNING_INSTFMT}"
+
+SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_CHECK_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_RUNNING_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+
+# Force the standby target to run the host reset check target
+RESET_TMPL_CTRL = "obmc-host-reset@.target"
+SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}"
+RESET_INSTFMT_CTRL = "obmc-host-reset@{0}.target"
+RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}"
+SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_HOST_INSTANCES')}"
+
TMPL = "phosphor-discover-system-state@.service"
INSTFMT = "phosphor-discover-system-state@{0}.service"
FMT = "../${TMPL}:${SYSTEMD_DEFAULT_TARGET}.wants/${INSTFMT}"
SYSTEMD_LINK_${PN}-discover += "${@compose_list(d, 'FMT', 'OBMC_HOST_INSTANCES')}"
SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
-SRCREV = "cc3fb5d9a720a9a5b2102683da716004cd938e39"
+SRCREV = "d5ac63507a47010f51ce857bd680c2f655380841"
S = "${WORKDIR}/git"
OpenPOWER on IntegriCloud