From 87a65e63bac789bca0607e0b4ab09d62517b95e7 Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Wed, 29 May 2019 10:29:58 -0700 Subject: Update to internal Signed-off-by: Ed Tanous --- .../intel-power-forceoff@.service | 15 ++++++++++ .../intel-power-stop@.service | 5 +--- .../intel-chassis-control/intel-wait-host-off.sh | 32 ++++++++++++++++++++++ .../intel-wait-host-off@.service | 21 ++++++++++++++ .../intel-chassis-control/intel-wait-host-on.sh | 32 ++++++++++++++++++++++ .../intel-wait-host-on@.service | 19 +++++++++++++ .../intel-chassis-control/intel-wait-power-off.sh | 32 ++++++++++++++++++++++ .../intel-wait-power-off@.service | 23 ++++++++++++++++ .../intel-chassis-control/intel-wait-power-on.sh | 32 ++++++++++++++++++++++ .../intel-wait-power-on@.service | 21 ++++++++++++++ .../obmc-chassis-hard-poweroff@.target | 1 - .../obmc-chassis-poweron@.target | 1 - .../obmc-host-shutdown@.target | 5 ++++ .../intel-chassis-control/obmc-host-start@.target | 1 - .../intel-chassis-control/obmc-host-stop@.target | 1 - .../obmc-host-warm-reset@.target | 1 - 16 files changed, 233 insertions(+), 9 deletions(-) create mode 100644 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-forceoff@.service create mode 100755 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off.sh create mode 100644 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off@.service create mode 100755 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on.sh create mode 100644 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on@.service create mode 100755 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off.sh create mode 100644 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off@.service create mode 100755 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on.sh create mode 100644 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on@.service create mode 100644 meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-shutdown@.target (limited to 'meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control') diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-forceoff@.service b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-forceoff@.service new file mode 100644 index 000000000..54b9befa4 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-forceoff@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Add force power offf flag for Power%i +Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +Conflicts=obmc-chassis-poweron@%i.target +Conflicts=obmc-host-start@%i.target + +[Service] +Type=oneshot +ExecStart=/bin/sh -c "mkdir -p /run/openbmc && touch /run/openbmc/host@%i-request" +SyslogIdentifier=intel-power-forceoff +StartLimitInterval=0 + +[Install] +WantedBy=obmc-chassis-poweroff@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-stop@.service b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-stop@.service index 5d0e46f82..d0476e9b2 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-stop@.service +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-power-stop@.service @@ -4,6 +4,7 @@ Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service Conflicts=obmc-chassis-poweron@%i.target Conflicts=obmc-host-start@%i.target +ConditionPathExists=/run/openbmc/chassis@%i-on [Service] Type=oneshot @@ -12,9 +13,5 @@ ExecStart=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/Chass SyslogIdentifier=intel-power-stop StartLimitInterval=0 -ExecStart=/bin/rm -f /run/openbmc/chassis@%i-on -ExecStart=/bin/rm -f /run/openbmc/host@%i-on -ExecStart=/bin/rm -f /run/openbmc/host@%i-request - [Install] WantedBy=obmc-chassis-poweroff@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off.sh b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off.sh new file mode 100755 index 000000000..983f1bc8d --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright 2019 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +echo "wait for vrd_good = OFF" +SERVICE=$(mapper get-service /xyz/openbmc_project/Chassis/Control/Power0) +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power vrd_good \ + | sed 's/i\s*[0]/off/' | grep off | wc -l) + +while [ $PGOOD == 0 ]; do + echo "!OFF" +sleep 1 +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power vrd_good \ + | sed 's/i\s*[0]/off/' | grep off | wc -l) +done +echo "vrd_good = OFF" \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off@.service b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off@.service new file mode 100644 index 000000000..eedfcc78a --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-off@.service @@ -0,0 +1,21 @@ +[Unit] +Description=Wait for Host%i to turn off +Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +#After=obmc-chassis-poweroff@%i.target +Before=intel-wait-power-off@%i.service +After=intel-power-stop@%i.service +Conflicts=obmc-chassis-poweron@%i.target +ConditionPathExists=/run/openbmc/host@%i-on + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/intel-wait-host-off.sh +ExecStartPost=/bin/sh -c "rm -rf /run/openbmc/host@%i-on" + +SyslogIdentifier=intel-wait-host-off +TimeoutSec=30 + +[Install] +RequiredBy=obmc-host-stop@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on.sh b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on.sh new file mode 100755 index 000000000..74f6bd47b --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright 2019 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +echo "wait for vrd_good = ON" +SERVICE=$(mapper get-service /xyz/openbmc_project/Chassis/Control/Power0) +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power vrd_good \ + | sed 's/i\s*[1]/on/' | grep on | wc -l) + +while [ $PGOOD == 0 ]; do + echo "!ON" +sleep 1 +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power vrd_good \ + | sed 's/i\s*[1]/on/' | grep on | wc -l) +done +echo "vrd_good = ON" \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on@.service b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on@.service new file mode 100644 index 000000000..a1fc316c2 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-host-on@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Wait for Host%i to turn on +Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=intel-wait-power-on@%i.service +Conflicts=obmc-chassis-poweroff@%i.target +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/intel-wait-host-on.sh +ExecStartPost=/bin/sh -c "mkdir -p /run/openbmc/ && touch /run/openbmc/host@%i-on" + +SyslogIdentifier=intel-wait-host-on +TimeoutSec=30 + +[Install] +RequiredBy=obmc-host-startmin@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off.sh b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off.sh new file mode 100755 index 000000000..be58682cc --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright 2019 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +echo "wait for pgood = OFF" +SERVICE=$(mapper get-service /xyz/openbmc_project/Chassis/Control/Power0) +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power pgood \ + | sed 's/i\s*[0]/off/' | grep off | wc -l) + +while [ $PGOOD == 0 ]; do + echo "!OFF" +sleep 1 +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power pgood \ + | sed 's/i\s*[0]/off/' | grep off | wc -l) +done +echo "pgood = OFF" \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off@.service b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off@.service new file mode 100644 index 000000000..0dcc897ce --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-off@.service @@ -0,0 +1,23 @@ +[Unit] +Description=Wait for Power%i to turn off +Before=obmc-power-off@%i.target +Wants=obmc-power-stop@%i.target +Before=obmc-power-stop@%i.target +Wants=obmc-power-stop-pre@%i.target +After=obmc-power-stop-pre@%i.target +Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=intel-wait-host-off@%i.service +Conflicts=obmc-chassis-poweron@%i.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/intel-wait-power-off.sh +ExecStartPost=/bin/rm -f /run/openbmc/chassis@%i-on +ExecStartPost=/bin/rm -f /run/openbmc/host@%i-request +SyslogIdentifier=intel-wait-power-off +TimeoutSec=15 + +[Install] +WantedBy=obmc-host-stop@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on.sh b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on.sh new file mode 100755 index 000000000..970e5a420 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# Copyright 2019 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +echo "wait for pgood = ON" +SERVICE=$(mapper get-service /xyz/openbmc_project/Chassis/Control/Power0) +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power pgood \ + | sed 's/i\s*[1]/on/' | grep on | wc -l) + +while [ $PGOOD == 0 ]; do + echo "!ON" +sleep 1 +PGOOD=$(busctl get-property $SERVICE \ + /xyz/openbmc_project/Chassis/Control/Power0 xyz.openbmc_project.Chassis.Control.Power pgood \ + | sed 's/i\s*[1]/on/' | grep on | wc -l) +done +echo "pgood = ON" \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on@.service b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on@.service new file mode 100644 index 000000000..140ee5b8d --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/intel-wait-power-on@.service @@ -0,0 +1,21 @@ +[Unit] +Description=Wait for Power%i to turn on +Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Power%i.service +After=intel-power-start@%i.service +Before=intel-wait-host-on@%i.service +Conflicts=obmc-chassis-poweroff@%i.target +ConditionPathExists=!/run/openbmc/chassis@%i-on + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/intel-wait-power-on.sh + +ExecStartPost=/bin/sh -c "mkdir -p /run/openbmc/ && touch /run/openbmc/chassis@%i-on" + +SyslogIdentifier=intel-wait-power-on +TimeoutSec=15 + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-hard-poweroff@.target b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-hard-poweroff@.target index 9a9902f7c..265a48982 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-hard-poweroff@.target +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-hard-poweroff@.target @@ -7,6 +7,5 @@ After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service Conflicts=obmc-chassis-poweron@%i.target Conflicts=obmc-chassis-reset@%i.target Conflicts=obmc-host-shutdown@%i.target -Conflicts=xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service RefuseManualStop=yes diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-poweron@.target b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-poweron@.target index f8fecf2a6..e95e46353 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-poweron@.target +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-chassis-poweron@.target @@ -6,5 +6,4 @@ Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service Conflicts=obmc-chassis-poweroff@%i.target RefuseManualStop=yes -OnFailure=obmc-chassis-poweroff@%i.target OnFailureJobMode=flush diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-shutdown@.target b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-shutdown@.target new file mode 100644 index 000000000..585886b26 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-shutdown@.target @@ -0,0 +1,5 @@ +[Unit] +Description=Power%i Host Off +Wants=multi-user.target +RefuseManualStop=yes +OnFailureJobMode=flush diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-start@.target b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-start@.target index 425953d4d..2f8c24929 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-start@.target +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-start@.target @@ -6,5 +6,4 @@ Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service Conflicts=obmc-host-stop@%i.target RefuseManualStop=yes -OnFailure=obmc-host-quiesce@%i.target OnFailureJobMode=flush \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-stop@.target b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-stop@.target index 0693db6e5..625eda8ee 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-stop@.target +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-stop@.target @@ -6,5 +6,4 @@ Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service Conflicts=obmc-host-startmin@%i.target RefuseManualStop=yes -OnFailure=obmc-chassis-poweroff@%i.target OnFailureJobMode=flush \ No newline at end of file diff --git a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-warm-reset@.target b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-warm-reset@.target index 8aed937e7..8fc9358e2 100644 --- a/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-warm-reset@.target +++ b/meta-openbmc-mods/meta-common/recipes-intel/chassis/intel-chassis-control/obmc-host-warm-reset@.target @@ -6,5 +6,4 @@ Wants=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service After=mapper-wait@-xyz-openbmc_project-Chassis-Control-Chassis%i.service Conflicts=obmc-host-stop@%i.target RefuseManualStop=yes -OnFailure=obmc-host-quiesce@%i.target OnFailureJobMode=flush -- cgit v1.2.3