diff options
Diffstat (limited to 'meta-phosphor/recipes-phosphor/chassis')
25 files changed, 467 insertions, 0 deletions
diff --git a/meta-phosphor/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.py b/meta-phosphor/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.py new file mode 100644 index 0000000000..a68f2e511c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.py @@ -0,0 +1,29 @@ +#!/usr/bin/env python + +# Contributors Listed Below - COPYRIGHT 2015 +# [+] International Business Machines Corp. +# +# +# 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. + +import time +import sys +import dbus +import dbus.service +import dbus.mainloop.glib + +if __name__ == '__main__': + print "obmc-phosphor-chassisd starting..." + + while 1: + time.sleep(5) diff --git a/meta-phosphor/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service b/meta-phosphor/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service new file mode 100644 index 0000000000..e981dc06d1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/files/obmc-phosphor-chassisd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Chassis Controller + +[Service] +Restart=always +ExecStart=/usr/bin/env obmc-phosphor-chassisd +SyslogIdentifier=obmc-phosphor-chassisd + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-button-power.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-button-power.bb new file mode 100644 index 0000000000..144d4e1e7d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-button-power.bb @@ -0,0 +1,12 @@ +SUMMARY = "OpenBMC org.openbmc.Button example implementation" +DESCRIPTION = "A sample implementation for a button controlling a power domain." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +SKELETON_DIR = "pwrbutton" + +FMT = "org.openbmc.buttons.Power@{0}.service" +DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_POWER_BUTTON_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service new file mode 100644 index 0000000000..443ecbbabd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-button-power/org.openbmc.buttons.Power@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Phosphor Power Button%i +Wants=mapper-wait@-org-openbmc-managers-System.service +After=mapper-wait@-org-openbmc-managers-System.service + +[Service] +Restart=always +ExecStart=/usr/bin/env button_power.exe +SyslogIdentifier=button_power.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-button-reset.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-button-reset.bb new file mode 100644 index 0000000000..9435d31413 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-button-reset.bb @@ -0,0 +1,12 @@ +SUMMARY = "OpenBMC org.openbmc.Button example implementation" +DESCRIPTION = "A sample implementation for a reset button." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +SKELETON_DIR = "rstbutton" + +FMT = "org.openbmc.buttons.reset@{0}.service" +DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_RESET_BUTTON_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service new file mode 100644 index 0000000000..e535e650c4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-button-reset/org.openbmc.buttons.reset@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Phosphor Reset Button%i +Wants=mapper-wait@-org-openbmc-managers-System.service +After=mapper-wait@-org-openbmc-managers-System.service + +[Service] +Restart=always +ExecStart=/usr/bin/env button_reset.exe +SyslogIdentifier=button_reset.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-control-chassis.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-control-chassis.bb new file mode 100644 index 0000000000..157d4169bd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-control-chassis.bb @@ -0,0 +1,18 @@ +SUMMARY = "OpenBMC org.openbmc.control.Chassis example implementation" +DESCRIPTION = "An example implementation of the org.openbmc.control.Chassis DBUS API." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +RDEPENDS_${PN} += "\ + python-dbus \ + python-pygobject \ + python-netclient \ + pyphosphor-dbus \ + " + +SKELETON_DIR = "pychassisctl" + +FMT = "org.openbmc.control.Chassis@{0}.service" +DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service new file mode 100644 index 0000000000..76acd19a15 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-control-chassis/org.openbmc.control.Chassis@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Phosphor Chassis%i Control + +[Service] +Restart=always +ExecStart=/usr/bin/env chassis_control.py +SyslogIdentifier=chassis_control.py +Type=dbus +BusName={BUSNAME} +Environment="PYTHONUNBUFFERED=1" +TimeoutStartSec=180s + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-host-failure-reboots.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-host-failure-reboots.bb new file mode 100644 index 0000000000..645f40cbfd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-host-failure-reboots.bb @@ -0,0 +1,14 @@ +SUMMARY = "Enables reboots on host failures" +DESCRIPTION = "Manages the settings entry that controls reboots \ +on host failures" +PR = "r1" + +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license + +TMPL = "host-failure-reboots@.service" +INSTFMT = "host-failure-reboots@{0}.service" +LINK_FMT = "${TMPL}:${INSTFMT}" + +SYSTEMD_SERVICE_${PN} += "${TMPL}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'LINK_FMT', 'OBMC_HOST_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service new file mode 100644 index 0000000000..88769c77ae --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-host-failure-reboots/host-failure-reboots@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Enable reboot on host failures +Wants=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service +After=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service + +[Service] +ExecStart = /bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/control/host0/auto_reboot` /xyz/openbmc_project/control/host0/auto_reboot xyz.openbmc_project.Control.Boot.RebootPolicy AutoReboot b true" +ExecStop = /bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/control/host0/auto_reboot` /xyz/openbmc_project/control/host0/auto_reboot xyz.openbmc_project.Control.Boot.RebootPolicy AutoReboot b false" +Type=oneshot +RemainAfterExit=yes + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-mgr-inventory.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-mgr-inventory.bb new file mode 100644 index 0000000000..a04aab29a9 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-mgr-inventory.bb @@ -0,0 +1,24 @@ +SUMMARY = "OpenBMC inventory manager" +DESCRIPTION = "OpenBMC inventory manager." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +RRECOMMENDS_${PN} += "virtual-obmc-inventory-data" + +VIRTUAL-RUNTIME_skeleton_workbook ?= "" + +RDEPENDS_${PN} += "\ + python-argparse \ + python-dbus \ + python-json \ + python-pickle \ + python-pygobject \ + python-subprocess \ + pyphosphor-dbus \ + ${VIRTUAL-RUNTIME_skeleton_workbook} \ + " + +SKELETON_DIR = "pyinventorymgr" +SYSTEMD_SERVICE_${PN} += "obmc-sync-inventory-item@.service" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service new file mode 100644 index 0000000000..0e294a1896 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-mgr-inventory/obmc-sync-inventory-item@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Sync %I + +[Service] +Restart=no +Type=oneshot +EnvironmentFile={envfiledir}/obmc/sync_inventory_item/%I +ExecStart=/usr/bin/env sync_inventory_items.py -p ${{PROPERTY}} -s $SYNC_TYPE +SyslogIdentifier=sync_inventory_items.py + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power.bb new file mode 100644 index 0000000000..c3a1b9dacf --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power.bb @@ -0,0 +1,95 @@ +SUMMARY = "org.openbmc.control.Power implementation for OpenPOWER" +DESCRIPTION = "A power control implementation suitable for OpenPOWER systems." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +DEPENDS += "phosphor-mapper systemd" + +SKELETON_DIR = "op-pwrctl" + +FMT = "org.openbmc.control.Power@{0}.service" +DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_POWER_INSTANCES')}" + +SYSTEMD_SERVICE_${PN} += " \ + op-power-start@.service \ + op-wait-power-on@.service \ + op-power-stop@.service \ + op-wait-power-off@.service \ + op-reset-chassis-running@.service \ + op-reset-chassis-on@.service \ + op-powered-off@.service \ + " + +SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/power_control" + +START_TMPL = "op-power-start@.service" +START_TGTFMT = "obmc-chassis-poweron@{1}.target" +START_INSTFMT = "op-power-start@{0}.service" +START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}" + +STOP_TMPL = "op-power-stop@.service" +STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target" +STOP_INSTFMT = "op-power-stop@{0}.service" +STOP_FMT = "../${STOP_TMPL}:${STOP_TGTFMT}.requires/${STOP_INSTFMT}" + +POWERED_OFF_TMPL = "op-powered-off@.service" +POWERED_OFF_INSTFMT = "op-powered-off@{0}.service" +POWERED_OFF_FMT = "../${POWERED_OFF_TMPL}:${STOP_TGTFMT}.requires/${POWERED_OFF_INSTFMT}" + +ON_TMPL = "op-wait-power-on@.service" +ON_INSTFMT = "op-wait-power-on@{0}.service" +ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}" + +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_TGTFMT = "obmc-chassis-powerreset@{1}.target" + +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" +RESET_ON_CHASSIS_INSTFMT = "op-reset-chassis-on@{0}.service" +RESET_ON_CHASSIS_FMT = "../${RESET_ON_CHASSIS_TMPL}:${RESET_TGTFMT}.requires/${RESET_ON_CHASSIS_INSTFMT}" + +# Build up requires relationship for START_TGTFMT and STOP_TGTFMT +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'POWERED_OFF_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_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')}" + +# Now show that the main control target requires these power targets +START_TMPL_CTRL = "obmc-chassis-poweron@.target" +START_TGTFMT_CTRL = "obmc-host-startmin@{1}.target" +START_INSTFMT_CTRL = "obmc-chassis-poweron@{0}.target" +START_FMT_CTRL = "../${START_TMPL_CTRL}:${START_TGTFMT_CTRL}.requires/${START_INSTFMT_CTRL}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT_CTRL', 'OBMC_POWER_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" + +# Chassis off requires host off +STOP_TMPL_CTRL = "obmc-host-stop@.target" +STOP_TGTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" +STOP_INSTFMT_CTRL = "obmc-host-stop@{1}.target" +STOP_FMT_CTRL = "../${STOP_TMPL_CTRL}:${STOP_TGTFMT_CTRL}.requires/${STOP_INSTFMT_CTRL}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'STOP_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}" + +# Hard power off requires chassis off +HARD_OFF_TMPL_CTRL = "obmc-chassis-poweroff@.target" +HARD_OFF_TGTFMT_CTRL = "obmc-chassis-hard-poweroff@{0}.target" +HARD_OFF_INSTFMT_CTRL = "obmc-chassis-poweroff@{0}.target" +HARD_OFF_FMT_CTRL = "../${HARD_OFF_TMPL_CTRL}:${HARD_OFF_TGTFMT_CTRL}.requires/${HARD_OFF_INSTFMT_CTRL}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'HARD_OFF_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" + +# Force the standby target to run the chassis reset check target +RESET_TMPL_CTRL = "obmc-chassis-powerreset@.target" +SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}" +RESET_INSTFMT_CTRL = "obmc-chassis-powerreset@{0}.target" +RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/obmc/power_control b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/obmc/power_control new file mode 100644 index 0000000000..8db8890347 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/obmc/power_control @@ -0,0 +1,2 @@ +POLL_INTERVAL="3000" +PGOOD_TIMEOUT="10" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service new file mode 100644 index 0000000000..c1de92f3b2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-start@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Start Power%i +Wants=obmc-power-start@%i.target +Before=obmc-power-start@%i.target +After=obmc-power-start-pre@%i.target +After=obmc-fan-control.target +Wants=mapper-wait@-org-openbmc-control-power%i.service +After=mapper-wait@-org-openbmc-control-power%i.service +Conflicts=obmc-chassis-poweroff@%i.target +ConditionPathExists=!/run/openbmc/chassis@%i-on + +[Service] +RemainAfterExit=yes +Type=oneshot +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 1" +SyslogIdentifier=op-power-start + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service new file mode 100644 index 0000000000..40dbf36377 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-power-stop@.service @@ -0,0 +1,17 @@ +[Unit] +Description=Stop Power%i +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@-org-openbmc-control-power%i.service +After=mapper-wait@-org-openbmc-control-power%i.service +Conflicts=obmc-chassis-poweron@%i.target + +[Service] +RemainAfterExit=yes +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/power%i` /org/openbmc/control/power%i org.openbmc.control.Power setPowerState i 0" +SyslogIdentifier=op-power-stop + +[Install] +WantedBy=obmc-host-stop@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service new file mode 100644 index 0000000000..b76db7bf41 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-powered-off@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Power is off to chassis%i +After=op-wait-power-off@%i.service +Requires=op-wait-power-off@%i.service + +[Service] +RemainAfterExit=no +# systemd starts all wanted targets in parallel and a Conflict +# statement will resolve itself when the target starts, not when +# completes. Some services have a requirement to stop +# once power is off. The solution is to create a new target, +# obmc-chassis-powered-off@.target, that is started after it is +# verified that power has been removed from the chassis. Then +# services may conflict with this target to ensure they +# are stopped at the appropriate time. +ExecStart=/bin/systemctl start obmc-chassis-powered-off@%i.target + + +[Install] +WantedBy=obmc-chassis-poweroff@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service new file mode 100644 index 0000000000..f2a7103254 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-on@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Start chassis%i on after BMC reset +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 +ExecStart=/bin/systemctl start obmc-chassis-poweron@%i.target + + +[Install] +WantedBy=obmc-chassis-powerreset@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-reset-chassis-running@.service new file mode 100644 index 0000000000..381f89dfca --- /dev/null +++ b/meta-phosphor/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/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service new file mode 100644 index 0000000000..11373618b5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-off@.service @@ -0,0 +1,22 @@ +[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@-org-openbmc-control-power%i.service +After=mapper-wait@-org-openbmc-control-power%i.service +Conflicts=obmc-chassis-poweron@%i.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env pgood_wait /org/openbmc/control/power%i off +SyslogIdentifier=pgood_wait +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-host-stop@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service new file mode 100644 index 0000000000..1e65d08879 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/op-wait-power-on@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Wait for Power%i to turn on +Before=obmc-power-on@%i.target +Wants=obmc-power-start@%i.target +Before=obmc-power-start@%i.target +Wants=mapper-wait@-org-openbmc-control-power%i.service +After=mapper-wait@-org-openbmc-control-power%i.service +Conflicts=obmc-chassis-poweroff@%i.target +ConditionPathExists=!/run/openbmc/chassis@%i-on + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env pgood_wait /org/openbmc/control/power%i on +SyslogIdentifier=pgood_wait +TimeoutSec=30 + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service new file mode 100644 index 0000000000..95ef0b88d4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-op-control-power/org.openbmc.control.Power@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Phosphor Power%i Control +Wants=mapper-wait@-org-openbmc-managers-System.service +After=mapper-wait@-org-openbmc-managers-System.service + +[Service] +EnvironmentFile={envfiledir}/obmc/power_control +Restart=always +ExecStart=/usr/bin/env power_control.exe $POLL_INTERVAL $PGOOD_TIMEOUT +SyslogIdentifier=power_control.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-pcie-detect.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-pcie-detect.bb new file mode 100644 index 0000000000..6e0ad97192 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-pcie-detect.bb @@ -0,0 +1,17 @@ +SUMMARY = "OpenBMC PCIE slot detection utility" +DESCRIPTION = "OpenBMC PCIE slot detection utility." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-systemd +inherit pkgconfig + +SKELETON_DIR = "pciedetect" + +TMPL = "pcie-slot-detect@.service" +TGTFMT = "obmc-host-startmin@{0}.target" +INSTFMT = "pcie-slot-detect@{0}.service" +FMT = "../${TMPL}:${TGTFMT}.wants/${INSTFMT}" + +SYSTEMD_SERVICE_${PN} += "pcie-slot-detect@.service" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service b/meta-phosphor/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service new file mode 100644 index 0000000000..4545524d3c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-pcie-detect/pcie-slot-detect@.service @@ -0,0 +1,14 @@ +[Unit] +Description=PCIE Slot Presence Detection For Chassis%i +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-host-stop@%i.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env pcie_slot_present.exe +SyslogIdentifier=pcie_slot_present.exe + +[Install] +WantedBy=obmc-host-startmin@%i.target diff --git a/meta-phosphor/recipes-phosphor/chassis/obmc-phosphor-chassisd.bb b/meta-phosphor/recipes-phosphor/chassis/obmc-phosphor-chassisd.bb new file mode 100644 index 0000000000..b02787e54b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/chassis/obmc-phosphor-chassisd.bb @@ -0,0 +1,11 @@ +SUMMARY = "Phosphor OpenBMC Chassis Management" +DESCRIPTION = "Phosphor OpenBMC chassis management reference implementation." +PR = "r1" + +inherit obmc-phosphor-pydbus-service + +PROVIDES += "virtual/obmc-chassis-mgmt" +RPROVIDES_${PN} += "virtual-obmc-chassis-mgmt" + +S = "${WORKDIR}" +SRC_URI += "file://${PN}.py" |