summaryrefslogtreecommitdiffstats
path: root/meta-phosphor/common/recipes-phosphor/chassis
diff options
context:
space:
mode:
authorJosh D. King <jdking@us.ibm.com>2017-05-18 09:33:36 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-05-24 12:23:12 +0000
commitf7de6310d5cf4d3e4c70cba4e13d53965e8a07f9 (patch)
tree552ddec04d2a10917f8da89c67a505dd91079fcd /meta-phosphor/common/recipes-phosphor/chassis
parent60189dc5cf260236d51abc35ade478bfc64a52e2 (diff)
downloadtalos-openbmc-f7de6310d5cf4d3e4c70cba4e13d53965e8a07f9.tar.gz
talos-openbmc-f7de6310d5cf4d3e4c70cba4e13d53965e8a07f9.zip
Combined services to create chassis-running service
Took the contents of op-reset-pgood-check and op-reset-set-power-on and combined them to create the new service op-reset-chassis-running. Resolves openbmc/openbmc#1337 Change-Id: I6cdb93fcf9f7e701703482ef3dcb8b23ef75cf93 Signed-off-by: Josh D. King <jdking@us.ibm.com> Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/chassis')
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb11
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service5
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service15
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service16
-rw-r--r--meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service16
5 files changed, 21 insertions, 42 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb
index 19efac655..f85859ccb 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power.bb
@@ -17,8 +17,7 @@ SYSTEMD_SERVICE_${PN} += " \
op-wait-power-on@.service \
op-power-stop@.service \
op-wait-power-off@.service \
- op-reset-pgood-check@.service \
- op-reset-set-power-on@.service \
+ op-reset-chassis-running@.service \
op-reset-chassis-on@.service \
"
@@ -42,13 +41,10 @@ OFF_TMPL = "op-wait-power-off@.service"
OFF_INSTFMT = "op-wait-power-off@{0}.service"
OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}"
-RESET_TMPL = "op-reset-pgood-check@.service"
RESET_TGTFMT = "obmc-chassis-powerreset@{1}.target"
-RESET_INSTFMT = "op-reset-pgood-check@{0}.service"
-RESET_FMT = "../${RESET_TMPL}:${RESET_TGTFMT}.requires/${RESET_INSTFMT}"
-RESET_ON_TMPL = "op-reset-set-power-on@.service"
-RESET_ON_INSTFMT = "op-reset-set-power-on@{0}.service"
+RESET_ON_TMPL = "op-reset-chassis-running@.service"
+RESET_ON_INSTFMT = "op-reset-chassis-running@{0}.service"
RESET_ON_FMT = "../${RESET_ON_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_INSTFMT}"
RESET_ON_CHASSIS_TMPL = "op-reset-chassis-on@.service"
@@ -60,7 +56,6 @@ SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'OFF_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
-SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_ON_CHASSIS_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}"
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service
index 7c55e1110..f2a710325 100644
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service
@@ -1,9 +1,10 @@
[Unit]
Description=Start chassis%i on after BMC reset
-Requires=op-reset-set-power-on@%i.service
-After=op-reset-set-power-on@%i.service
+Requires=op-reset-chassis-running@%i.service
+After=op-reset-chassis-running@%i.service
After=obmc-power-reset-on@%i.target
Requires=obmc-power-reset-on@%i.target
+ConditionPathExists=/run/openbmc/chassis@%i-on
[Service]
RemainAfterExit=no
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service
new file mode 100644
index 000000000..381f89dfc
--- /dev/null
+++ b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Check Chassis%i pgood and create a file to indicate it
+Wants=mapper-wait@-org-openbmc-control-power%i.service
+After=mapper-wait@-org-openbmc-control-power%i.service
+Wants=obmc-power-reset-on@%i.target
+Before=obmc-power-reset-on@%i.target
+Conflicts=obmc-chassis-poweroff@%i.target
+
+[Service]
+RemainAfterExit=no
+Type=oneshot
+ExecStart=/bin/sh -c "if [ $(busctl get-property `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power pgood | sed 's/i\s*[1]/on/' | grep on | wc -l) != 0 ]; then mkdir -p /run/openbmc/ && touch /run/openbmc/chassis@%i-on; fi"
+
+[Install]
+WantedBy=obmc-chassis-powerreset@%i.target
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service
deleted file mode 100644
index ea975ea21..000000000
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-pgood-check@.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Check Chassis%i pgood on reset
-Wants=mapper-wait@-org-openbmc-control-power%i.service
-After=mapper-wait@-org-openbmc-control-power%i.service
-Wants=obmc-power-reset-on@%i.target
-Before=obmc-power-reset-on@%i.target
-Conflicts=obmc-chassis-poweroff@%i.target
-
-[Service]
-RemainAfterExit=no
-Type=oneshot
-ExecStart=/bin/sh -c "busctl get-property `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power pgood | sed 's/i\s*[1]/on/' | grep on"
-
-
-[Install]
-WantedBy=obmc-chassis-powerreset@%i.target
diff --git a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service b/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service
deleted file mode 100644
index cfc1eed96..000000000
--- a/meta-phosphor/common/recipes-phosphor/chassis/obmc-op-control-power/op-reset-set-power-on@.service
+++ /dev/null
@@ -1,16 +0,0 @@
-[Unit]
-Description=Create file to indicate chassis%i pgood is on
-After=obmc-power-reset-on@%i.target
-Requires=obmc-power-reset-on@%i.target
-After=op-reset-pgood-check@%i.service
-Requires=op-reset-pgood-check@%i.service
-Conflicts=obmc-chassis-poweroff@%i.target
-
-[Service]
-RemainAfterExit=no
-Type=oneshot
-ExecStart=/bin/sh -c "mkdir -p /run/openbmc/ && touch /run/openbmc/chassis@%i-on"
-
-
-[Install]
-WantedBy=obmc-chassis-powerreset@%i.target
OpenPOWER on IntegriCloud