summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/state
diff options
context:
space:
mode:
authorAndrew Geissler <andrewg@us.ibm.com>2017-07-26 17:53:04 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-08-03 01:54:52 +0000
commit4ec27746b6bcfa342a7f1e9e465524333d57b9c2 (patch)
tree16f4c95a3ef797b74e4aabd01073c4da8f75ea8e /meta-phosphor/common/recipes-phosphor/state
parent8861a87675343dae4f03eb3708cf8dbbeea3a506 (diff)
downloadtalos-openbmc-4ec27746b6bcfa342a7f1e9e465524333d57b9c2.tar.gz
talos-openbmc-4ec27746b6bcfa342a7f1e9e465524333d57b9c2.zip
Add in new host reboot target
The state management code on the BMC is designed to utilize systemd targets as much as possible. The host reboot was always the odd duck that had some special code written to support it. This special code would basically issue a power off, look for it to complete and then issue a power on. This is very error prone code and has resulted in a few issues. Moving to a single systemd target (the new reboot target) defined here will allow the host reboots to occur solely through a single systemd target now. openbmc/openbmc#2032 is one of those bugs being addressed with this change. Change-Id: If33454aa4f15580e45f888a9b1602dec24a46fca 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-reboot-host@.service11
-rw-r--r--meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb14
2 files changed, 25 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service
new file mode 100644
index 000000000..fdf84c1f3
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/state/files/phosphor-reboot-host@.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Reboot host%i
+Wants=obmc-host-stop@%i.target
+After=obmc-host-stop@%i.target
+
+[Service]
+ExecStart={base_bindir}/systemctl start obmc-host-start@%i.target
+
+
+[Install]
+WantedBy=obmc-host-reboot@%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 0890df78b..91909004e 100644
--- a/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb
+++ b/meta-phosphor/common/recipes-phosphor/state/phosphor-state-manager.bb
@@ -41,6 +41,7 @@ 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"
+DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service"
FILES_${PN}-chassis = "${sbindir}/phosphor-chassis-state-manager"
DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service"
@@ -87,6 +88,19 @@ CHASSIS_STOP_INSTFMT = "obmc-chassis-poweroff@{0}.target"
HOST_STOP_FMT = "../${CHASSIS_STOP_TMPL}:${HOST_STOP_TGTFMT}.requires/${CHASSIS_STOP_INSTFMT}"
SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_STOP_FMT', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+# Force the host reboot target to run the shutdown target
+HOST_SHUTDOWN_TMPL = "obmc-host-shutdown@.target"
+HOST_REBOOT_TGTFMT = "obmc-host-reboot@{0}.target"
+HOST_SHUTDOWN_INSTFMT = "obmc-host-shutdown@{0}.target"
+HOST_REBOOT_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_REBOOT_TGTFMT}.requires/${HOST_SHUTDOWN_INSTFMT}"
+SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_FMT', 'OBMC_HOST_INSTANCES')}"
+
+# And also force the reboot target to call the host start service
+HOST_REBOOT_SVC = "phosphor-reboot-host@.service"
+HOST_REBOOT_SVC_INST = "phosphor-reboot-host@{0}.service"
+HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_TGTFMT}.requires/${HOST_REBOOT_SVC_INST}"
+SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}"
+
SRC_URI += "git://github.com/openbmc/phosphor-state-manager"
SRCREV = "2710e730c698952b6803fea2af6c63bff8ff385c"
OpenPOWER on IntegriCloud