Add service to enter and continue mpreboot
This commit add services for invoking the memory preserving
reboot commands. The memory preserving reboot is executed to
preserve host memory contents across a reboot. This is needed
when the hypervisor encountered an error and cannot continue
with normal operations. The memory is preserved during such
reboots and a memory dump will be craeted to analyze the failure.
The enter mpreboot service initialize the powering off the host
and continue mp reboot will start the initialization host with
preserving memory contents. The system power will not be removed
in these kind of reboots.
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
Change-Id: I9ffc3d3d70d68e700959cbbf1687e16fb08f4ce4
diff --git a/Makefile.am b/Makefile.am
index f9bb234..3257f33 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,9 @@
pcie-poweroff@.service \
xyz.openbmc_project.Control.Host.NMI.service \
op-stop-instructions@.service \
- op-cfam-reset.service
+ op-cfam-reset.service \
+ op-continue-mpreboot@.service \
+ op-enter-mpreboot@.service
if ENABLE_PHAL
systemdsystemunit_DATA += set-spi-mux.service
diff --git a/configure.ac b/configure.ac
index 887cc54..fecae53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -111,4 +111,6 @@
AC_CONFIG_FILES([xyz.openbmc_project.Control.Host.NMI.service])
AC_CONFIG_FILES([op-stop-instructions@.service])
AC_CONFIG_FILES([op-cfam-reset.service])
+AC_CONFIG_FILES([op-continue-mpreboot@.service])
+AC_CONFIG_FILES([op-enter-mpreboot@.service])
AC_OUTPUT
diff --git a/op-continue-mpreboot@.service.in b/op-continue-mpreboot@.service.in
new file mode 100644
index 0000000..c4262c5
--- /dev/null
+++ b/op-continue-mpreboot@.service.in
@@ -0,0 +1,18 @@
+[Unit]
+Description=Continue mp reboot on host%i
+After=obmc-host-start-pre@%i.target
+Wants=obmc-host-starting@%i.target
+Before=obmc-host-starting@%i.target
+Before=obmc-host-started@%i.target
+Wants=obmc-power-on@%i.target
+After=obmc-power-on@%i.target
+Conflicts=obmc-host-stop@%i.target
+ConditionPathExists=/run/openbmc/mpreboot@%i
+
+[Service]
+ExecStart=/usr/bin/openpower-proc-control startHostMpReboot
+Type=oneshot
+RemainAfterExit=yes
+
+[Install]
+WantedBy=obmc-host-startmin@%i.target
diff --git a/op-enter-mpreboot@.service.in b/op-enter-mpreboot@.service.in
new file mode 100644
index 0000000..8d4af5b
--- /dev/null
+++ b/op-enter-mpreboot@.service.in
@@ -0,0 +1,14 @@
+[Unit]
+Description=Start memory preserving reboot host%i
+Wants=obmc-host-stop-pre@%i.target
+Before=obmc-host-stop-pre@%i.target
+After=op-stop-instructions@%i.service
+Conflicts=obmc-host-startmin@%i.target
+
+[Service]
+RemainAfterExit=yes
+Type=oneshot
+ExecStart=/usr/bin/openpower-proc-control enterMpReboot
+
+[Install]
+WantedBy=obmc-host-diagnostic-mode@%i.target