summaryrefslogtreecommitdiff
path: root/meta-openpower/recipes-phosphor/occ/openpower-occ-control
diff options
context:
space:
mode:
authorBrad Bishop <bradleyb@fuzziesquirrel.com>2018-08-31 13:30:50 +0300
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-09-05 00:28:29 +0300
commitd3f78932cf6b3063caceacdae9ddd6ca30d48786 (patch)
tree765de745d26798d7a37340d2851b86b57cda7eb8 /meta-openpower/recipes-phosphor/occ/openpower-occ-control
parentf1ade61b5994799a4cffca0c124b2ed36e640cbf (diff)
downloadopenbmc-d3f78932cf6b3063caceacdae9ddd6ca30d48786.tar.xz
meta-openpower: Move layer content from common/
Adopt a more conventional directory hierarchy. meta-openpower is still a _long_ way from suitable for hosting on yoctoproject.org but things like this don't help. (From meta-openpower rev: 2c8db5661cecd7e4cc20bcb96df76490e62cfb67) Change-Id: I415caaa28ec728f24e755ddb549012f24874fefe Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openpower/recipes-phosphor/occ/openpower-occ-control')
-rwxr-xr-xmeta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh20
-rw-r--r--meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service12
-rw-r--r--meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service17
-rw-r--r--meta-openpower/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service14
4 files changed, 63 insertions, 0 deletions
diff --git a/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh
new file mode 100755
index 000000000..a6097e527
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/occ-active.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+# set and unset occ active for all occ's in system
+
+if [ "$1" == "disable" ]; then
+ value='false'
+elif [ "$1" == "enable" ]; then
+ value='true'
+else
+ echo "Usage: occ-active.sh [argument]"
+ echo " enable - set occ's to active state"
+ echo " disable - set occ's to inactive state"
+ exit -1
+fi
+
+OCC_CONTROL_SERVICE="org.open_power.OCC.Control"
+
+busctl tree $OCC_CONTROL_SERVICE --list | grep occ | xargs -r -n1 -I{} \
+ busctl set-property $OCC_CONTROL_SERVICE {} org.open_power.OCC.Status \
+ OccActive b $value
+exit 0
diff --git a/meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service
new file mode 100644
index 000000000..0179a5083
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-disable@.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=OpenPOWER OCC Active Disable
+Before=obmc-host-stop-pre@%i.target
+Conflicts=op-occ-enable@%i.service
+
+[Service]
+ExecStart=/usr/bin/env occ-active.sh disable
+SyslogIdentifier=occ-active.sh
+Type=oneshot
+
+[Install]
+WantedBy=obmc-host-stop@%i.target
diff --git a/meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service
new file mode 100644
index 000000000..b97253cf0
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/op-occ-enable@.service
@@ -0,0 +1,17 @@
+[Unit]
+Description=OpenPOWER OCC Active Enable for host %I
+Conflicts=obmc-host-stop@%i.target
+Conflicts=op-occ-disable@%i.service
+Wants=org.open_power.OCC.Control.service
+After=org.open_power.OCC.Control.service
+Wants=fsi-scan@%i.service
+After=fsi-scan@%i.service
+ConditionPathExists=/run/openbmc/host@%i-on
+
+[Service]
+ExecStart=/usr/bin/env occ-active.sh enable
+SyslogIdentifier=occ-active.sh
+Type=oneshot
+
+[Install]
+WantedBy=obmc-host-start@%i.target
diff --git a/meta-openpower/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service
new file mode 100644
index 000000000..a63e18611
--- /dev/null
+++ b/meta-openpower/recipes-phosphor/occ/openpower-occ-control/org.open_power.OCC.Control.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=OpenPOWER OCC controller
+Wants=mapper-wait@-xyz-openbmc_project-inventory.service
+After=mapper-wait@-xyz-openbmc_project-inventory.service
+
+[Service]
+ExecStart=/usr/bin/env openpower-occ-control
+SyslogIdentifier=openpower-occ-control
+Restart=always
+Type=dbus
+BusName={BUSNAME}
+
+[Install]
+WantedBy={SYSTEMD_DEFAULT_TARGET}