diff options
Diffstat (limited to 'meta-phosphor/recipes-phosphor')
310 files changed, 10237 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" diff --git a/meta-phosphor/recipes-phosphor/clear-once/clear-once.bb b/meta-phosphor/recipes-phosphor/clear-once/clear-once.bb new file mode 100644 index 0000000000..79a7ecd771 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/clear-once/clear-once.bb @@ -0,0 +1,7 @@ +SUMMARY = "Clear boot-once variables" +DESCRIPTION = "Clear u-boot variables used for one-time boot flow" + +RDEPENDS_${PN} = "${@d.getVar('PREFERRED_PROVIDER_u-boot-fw-utils', True) or 'u-boot-fw-utils'}" + +inherit obmc-phosphor-systemd +inherit obmc-phosphor-license diff --git a/meta-phosphor/recipes-phosphor/clear-once/clear-once/clear-once.service b/meta-phosphor/recipes-phosphor/clear-once/clear-once/clear-once.service new file mode 100644 index 0000000000..132d11d697 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/clear-once/clear-once/clear-once.service @@ -0,0 +1,16 @@ +[Unit] +Description=Clear one time boot overrides + +ConditionFileNotEmpty=/etc/fw_env.config +RequiresMountsFor=/run /sbin /etc + +[Service] +Type=oneshot +RemainAfterExit=yes + +# It took 7 seconds to erase and write flash, be conservative +TimeoutStartSec=60 +Restart=no + +ExecStart=/sbin/fw_setenv openbmconce +ExecStart=/sbin/fw_setenv openbmconce diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console-ssh.socket b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console-ssh.socket new file mode 100644 index 0000000000..3174489efe --- /dev/null +++ b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console-ssh.socket @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Host Console SSH Per-Connection socket +Wants=obmc-console@{OBMC_CONSOLE_HOST_TTY}.service + +[Socket] +ListenStream=2200 +Accept=yes + +[Install] +WantedBy=sockets.target diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service new file mode 100644 index 0000000000..82ffe7919a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console-ssh@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor Host Console SSH Per-Connection +Wants=obmc-console@{OBMC_CONSOLE_HOST_TTY}.service + +[Service] +Environment="DROPBEAR_RSAKEY_DIR=/etc/dropbear" +EnvironmentFile={envfiledir}/dropbear +ExecStart=-/usr/bin/env dropbear -i -r ${{DROPBEAR_RSAKEY_DIR}}/dropbear_rsa_host_key -c "/usr/bin/env obmc-console-client" $DROPBEAR_EXTRA_ARGS +SyslogIdentifier=dropbear +ExecReload={base_bindir}/kill -HUP $MAINPID +StandardInput=socket +KillMode=process diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console.conf b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console.conf new file mode 100644 index 0000000000..d42caa9355 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console.conf @@ -0,0 +1,2 @@ +lpc-address = 0x3f8 +sirq = 4 diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console@.service b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console@.service new file mode 100644 index 0000000000..26e452c3cb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/console/obmc-console/obmc-console@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor Console Muxer listening on device /dev/%I +BindsTo=dev-%i.device +After=dev-%i.device + +[Service] +ExecStart=/usr/bin/env obmc-console-server --config {sysconfdir}/obmc-console.conf %i +SyslogIdentifier=obmc-console-server +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb b/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb new file mode 100644 index 0000000000..d4d6e616c7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/console/obmc-console_git.bb @@ -0,0 +1,37 @@ +SUMMARY = "OpenBMC console daemon" +DESCRIPTION = "Daemon to handle UART console connections" +HOMEPAGE = "http://github.com/openbmc/obmc-console" +PR = "r1" + +inherit obmc-phosphor-license +inherit obmc-phosphor-systemd +inherit autotools +inherit obmc-phosphor-discovery-service + +TARGET_CFLAGS += "-fpic -O2" + +DEPENDS += "autoconf-archive-native" + +SRC_URI += "git://github.com/openbmc/obmc-console" +SRC_URI += "file://${PN}.conf" + +SRCREV = "3c89b263484128071343bdaf0b5f3a8dace32799" +PV = "1.0+git${SRCPV}" + +REGISTERED_SERVICES_${PN} += "obmc_console:tcp:2200" +OBMC_CONSOLE_HOST_TTY ?= "ttyVUART0" +SYSTEMD_SUBSTITUTIONS += "OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh@.service" +SYSTEMD_SUBSTITUTIONS += "OBMC_CONSOLE_HOST_TTY:${OBMC_CONSOLE_HOST_TTY}:${PN}-ssh.socket" + +SYSTEMD_SERVICE_${PN} = " \ + ${PN}@.service \ + ${PN}@${OBMC_CONSOLE_HOST_TTY}.service \ + ${PN}-ssh.socket \ + ${PN}-ssh@.service \ + " +do_install_append() { + install -m 0755 -d ${D}${sysconfdir} + install -m 0644 ${WORKDIR}/${PN}.conf ${D}${sysconfdir}/${PN}.conf +} + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager/xyz.openbmc_project.Time.Manager.service b/meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager/xyz.openbmc_project.Time.Manager.service new file mode 100644 index 0000000000..e819e35ac4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager/xyz.openbmc_project.Time.Manager.service @@ -0,0 +1,18 @@ +[Unit] +Description=Phosphor Time Manager daemon +Wants=mapper-wait@-xyz-openbmc_project-time-owner.service +After=mapper-wait@-xyz-openbmc_project-time-owner.service +Wants=mapper-wait@-xyz-openbmc_project-time-sync_method.service +After=mapper-wait@-xyz-openbmc_project-time-sync_method.service +Wants=mapper-wait@-xyz-openbmc_project-state-host0.service +After=mapper-wait@-xyz-openbmc_project-state-host0.service + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-timemanager +SyslogIdentifier=phosphor-timemanager +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager_git.bb b/meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager_git.bb new file mode 100644 index 0000000000..59fa7b5184 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/datetime/phosphor-time-manager_git.bb @@ -0,0 +1,30 @@ +SUMMARY = "Phosphor Time Manager daemon" +DESCRIPTION = "Daemon to cater to BMC and HOST time management" +HOMEPAGE = "http://github.com/openbmc/phosphor-time-manager" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig pythonnative +inherit obmc-phosphor-dbus-service + +DEPENDS += "autoconf-archive-native" +DEPENDS += "phosphor-mapper" +DEPENDS += "systemd" +DEPENDS += "sdbusplus" +DEPENDS += "sdbusplus-native" +DEPENDS += "phosphor-logging" +DEPENDS += "phosphor-dbus-interfaces" +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}" +RDEPENDS_${PN} += "network" +RDEPENDS_${PN} += "libmapper" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "sdbusplus" +RDEPENDS_${PN} += "phosphor-dbus-interfaces" + +SRC_URI += "git://github.com/openbmc/phosphor-time-manager" +SRCREV = "33752c75e8bdadf13d983e94667de72f64ba3537" +PV = "1.0+git${SRCPV}" +S = "${WORKDIR}/git" + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.Time.Manager.service" diff --git a/meta-phosphor/recipes-phosphor/dbus/dbus-perms.bb b/meta-phosphor/recipes-phosphor/dbus/dbus-perms.bb new file mode 100644 index 0000000000..8290ecce20 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/dbus-perms.bb @@ -0,0 +1,16 @@ +SUMMARY = "Phosphor OpenBMC DBUS Permissions" +DESCRIPTION = "Phosphor OpenBMC DBUS Permissions." +HOMEPAGE = "http://github.com/openbmc/" +PR = "r1" + +inherit allarch +inherit obmc-phosphor-license +inherit dbus-dir + +SRC_URI += "file://org.openbmc.conf" + +do_install_append() { + install -d ${D}${dbus_system_confdir} + install -m 0644 ${WORKDIR}/org.openbmc.conf \ + ${D}${dbus_system_confdir} +} diff --git a/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf b/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf new file mode 100644 index 0000000000..b51293b19e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/dbus-perms/org.openbmc.conf @@ -0,0 +1,8 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy context="default"> + <allow own="*"/> + <allow send_destination="*"/> + </policy> +</busconfig> diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces-mapper-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces-mapper-config-native.bb new file mode 100644 index 0000000000..c39e0a34f4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces-mapper-config-native.bb @@ -0,0 +1,11 @@ +SUMMARY="Add /xyz/openbmc_project namespace to phosphor-mapper" +DESCRIPTION="Add the /xyz/openbmc_project path namespace and \ +xyz.openbmc_project interface prefix to the mapper \ +watch list." + +inherit phosphor-mapper +inherit native +inherit obmc-phosphor-license + +PHOSPHOR_MAPPER_NAMESPACE_append = " /xyz/openbmc_project" +PHOSPHOR_MAPPER_INTERFACE_append = " xyz.openbmc_project" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces.bb new file mode 100644 index 0000000000..790898cd15 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-interfaces.bb @@ -0,0 +1,32 @@ +SUMMARY = "Phosphor DBus Interfaces" +DESCRIPTION = "Generated bindings, using sdbus++, for the phosphor YAML" +PR = "r1" + +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit obmc-phosphor-license +inherit pythonnative +inherit phosphor-dbus-yaml + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbus++-native" + +SRC_URI += "git://github.com/openbmc/phosphor-dbus-interfaces" +SRCREV = "e0e9aed2be16f2189759c36e63dbdef8819f12c9" + +DEPENDS_remove_class-native = "sdbus++-native" +DEPENDS_remove_class-nativesdk = "sdbus++-native" + +PACKAGECONFIG ??= "libphosphor_dbus" +PACKAGECONFIG[libphosphor_dbus] = " \ + --enable-libphosphor_dbus, \ + --disable-libphosphor_dbus, \ + systemd sdbusplus, \ + libsystemd sdbusplus \ + " + +PACKAGECONFIG_remove_class-native = "libphosphor_dbus" +PACKAGECONFIG_remove_class-nativesdk = "libphosphor_dbus" + +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb new file mode 100644 index 0000000000..228ae5a634 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor-config-native.bb @@ -0,0 +1,20 @@ +SUMMARY = "Phosphor DBus Monitor Configuration" +DESCRIPTION = "Meta-recipe, pulling in native recipes that wish to add \ +configuration files to the /usr/share/phosphor-dbus-monitor filesystem." +HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor" +PR = "r1" + +inherit obmc-phosphor-license +inherit native +inherit phosphor-dbus-monitor + +PHOSPHOR_DBUS_MONITOR_CONFIGS ??= "" + +# To add additional config files, create a recipe in your layer, +# and add it to PHOSPHOR_DBUS_MONITOR_CONFIGS with a bbappend to this recipe. + +DEPENDS += "${PHOSPHOR_DBUS_MONITOR_CONFIGS}" + +do_install() { + mkdir -p ${D}${config_dir} +} diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor.bb new file mode 100644 index 0000000000..cfa684aa0b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor.bb @@ -0,0 +1,46 @@ +SUMMARY = "Phosphor DBus Monitor" +DESCRIPTION = "Phosphor DBus Monitor is a general purpose DBus application \ +that watches DBus traffic for events and takes actions based on those events." +PR = "r1" + +HOMEPAGE = "http://github.com/openbmc/phosphor-dbus-monitor" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI = "git://github.com/openbmc/phosphor-dbus-monitor" +SRCREV = "2ded5e1e3993913be34e8122f2b835468a2f9e91" + +inherit autotools \ + pkgconfig \ + pythonnative \ + phosphor-dbus-monitor \ + obmc-phosphor-systemd + +PACKAGE_BEFORE_PN = "phosphor-msl-verify" +SYSTEMD_PACKAGES = "${PN} phosphor-msl-verify" +SYSTEMD_SERVICE_phosphor-msl-verify = "phosphor-msl-verify.service" + +DEPENDS += " \ + ${PN}-config-native \ + phosphor-logging \ + autoconf-archive-native \ + sdbusplus-native \ + gtest \ + " +RDEPENDS_${PN} += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " + +RDEPENDS_phosphor-msl-verify += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " +FILES_phosphor-msl-verify = "${sbindir}/phosphor-msl-verify" + +S = "${WORKDIR}/git" + +EXTRA_OECONF = " \ + YAML_PATH=${STAGING_DIR_NATIVE}${config_dir} \ + " diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service new file mode 100644 index 0000000000..9440f0c2d0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-dbus-monitor.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor DBus Monitor +After=obmc-mapper.target + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-dbus-monitor +SyslogIdentifier=phosphor-dbus-monitor + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-msl-verify.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-msl-verify.service new file mode 100644 index 0000000000..cbefdeab14 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-dbus-monitor/phosphor-msl-verify.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor MSL Verification +After=mapper-wait@-xyz-openbmc_project-inventory.service +Wants=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env phosphor-msl-verify +SyslogIdentifier=phosphor-msl-verify diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-legacy-namespace-mapper-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-legacy-namespace-mapper-config-native.bb new file mode 100644 index 0000000000..67199f9f09 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-legacy-namespace-mapper-config-native.bb @@ -0,0 +1,10 @@ +SUMMARY="Add /org/openbmc namespace to phosphor-mapper" +DESCRIPTION="Add the legacy /org/openbmc path namespace and \ +org.openbmc nterface prefix to the mapper watch list." + +inherit phosphor-mapper +inherit native +inherit obmc-phosphor-license + +PHOSPHOR_MAPPER_NAMESPACE_append = " /org/openbmc" +PHOSPHOR_MAPPER_INTERFACE_append = " org.openbmc" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper-config-native.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper-config-native.bb new file mode 100644 index 0000000000..976c59b9c6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper-config-native.bb @@ -0,0 +1,41 @@ +SUMMARY = "Phosphor Mapper Configuration" +DESCRIPTION = "Meta-recipe, pulling in native recipes that wish to add \ +configuration files to the native /usr/share/phosphor-mapper filesystem." +HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr" +PR = "r1" + +inherit obmc-phosphor-license +inherit native +inherit phosphor-mapper + +PHOSPHOR_MAPPER_CONFIGS = " \ + phosphor-dbus-interfaces-mapper-config-native \ + phosphor-legacy-namespace-mapper-config-native \ + " + +DEPENDS += "${PHOSPHOR_MAPPER_CONFIGS}" + +# To add namespaces and blacklists to the mapper configuration, +# create a native recipe in your layer, and add it to +# PHOSPHOR_MAPPER_CONFIGS with a bbappend to this recipe. +# Recipes should set one of the variables below. +# Consult phosphor-mapper.bbclass for additional information. + +# Add path namespaces to be monitored. +PHOSPHOR_MAPPER_NAMESPACE = "" + +# Add interfaces to be monitored. +PHOSPHOR_MAPPER_INTERFACE = "" + +# Blacklist paths from being monitored. +PHOSPHOR_MAPPER_NAMESPACE_BLACKLIST = "" + +# Blacklist interfaces from being monitored. +PHOSPHOR_MAPPER_INTERFACE_BLACKLIST = "" + +do_install() { + install -d ${D}/${namespace_dir} + install -d ${D}/${interface_dir} + install -d ${D}/${blacklist_dir} + install -d ${D}/${interfaceblacklist_dir} +} diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb new file mode 100644 index 0000000000..ed7d4bb558 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper.bb @@ -0,0 +1,96 @@ +SUMMARY = "Phosphor DBUS Object Manager" +DESCRIPTION = "Phosphor DBUS object manager." +HOMEPAGE = "http://github.com/openbmc/phosphor-objmgr" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +inherit autotools pkgconfig +inherit obmc-phosphor-python-autotools +inherit obmc-phosphor-dbus-service +inherit obmc-phosphor-systemd +inherit phosphor-mapperdir + +DEPENDS += "systemd" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-logging" +DEPENDS += "${PN}-config-native" + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.ObjectMapper.service" +SYSTEMD_SERVICE_${PN} += " \ + mapper-wait@.service \ + mapper-subtree-remove@.service \ + " +RDEPENDS_libmapper += "libsystemd" +RDEPENDS_${PN} += " \ + python-argparse \ + python-xml \ + python-dbus \ + python-pygobject \ + pyphosphor-dbus \ + pyphosphor-utils \ + sdbusplus \ + phosphor-logging \ + " +SRC_URI += "git://github.com/openbmc/phosphor-objmgr" + +SRCREV = "d6729ea39d443bf62a27bbf64ef6bc7a123125c8" + +S = "${WORKDIR}/git" + +python populate_packages_prepend () { + mapperlibdir = d.getVar("libdir", True) + do_split_packages(d, mapperlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Phosphor mapper %s library', extra_depends='', allow_links=True) +} +PACKAGES_DYNAMIC += "^libmapper.*" +FILES_${PN}_remove = "${libdir}/lib*.so.* ${libdir}/*" + +# Construct a systemd environment file with mapper commandline +# from the native sysroot /usr/share/phosphor-mapper filesystem. +python do_emit_env() { + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('namespace_dir', True) + paths = [] + for p in os.listdir(path): + paths.append(os.sep.join(p.split('-'))) + + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('interface_dir', True) + interfaces = [] + for i in os.listdir(path): + interfaces.append('.'.join(i.split('-'))) + + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('blacklist_dir', True) + blacklists = [] + for b in os.listdir(path): + blacklists.append(os.sep + os.sep.join(b.split('-'))) + + path = d.getVar('STAGING_DIR_NATIVE', True) + \ + d.getVar('interfaceblacklist_dir', True) + interface_blacklists = [] + for ib in os.listdir(path): + interface_blacklists.append('.'.join(ib.split('-'))) + + path = [d.getVar('D', True) + d.getVar('envfiledir', True)] + path.append('obmc') + path.append('mapper') + parent = os.path.join(*path[:-1]) + path = os.path.join(*path) + + if not os.path.exists(parent): + os.makedirs(parent) + with open(path, 'w+') as fd: + fd.write('MAPPER_NAMESPACES="{}"'.format(' '.join(paths))) + fd.write('\n') + fd.write('MAPPER_INTERFACES="{}"'.format(' '.join(interfaces))) + fd.write('\n') + fd.write('MAPPER_BLACKLISTS="{}"'.format(' '.join(blacklists))) + fd.write('\n') + fd.write('MAPPER_INTERFACEBLACKLISTS="{}"'.format(' '.join(interface_blacklists))) + fd.write('\n') +} + +do_install[postfuncs] += "do_emit_env" +do_install[vardeps] += "PHOSPHOR_MAPPER_NAMESPACES" diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service new file mode 100644 index 0000000000..4bd411e75f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-subtree-remove@.service @@ -0,0 +1,22 @@ +[Unit] +Description=mapper subtree-remove %I +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +# We are using a Type=simple service instead of the normal Type=oneshot +# since Type=oneshot can't have Restart= lines +# https://github.com/systemd/systemd/issues/2582 +# Unfortunately Type=oneshot services halt any services which order after +# the oneshot on the completion of ExecStart= lines. For Type=simple, the +# halting is only until ExecStartPre lines have completed and ExecStart has +# begun executing. Since we want to wait for the `mapper wait` process to +# finish, it must be an ExecStartPre. All Type=simple services require an +# ExecStart so we use `true` as a placeholder to satisfy the requirement. +Type=simple +RemainAfterExit=no +Restart=on-failure +TimeoutStartSec=infinity +ExecStartPre=/usr/bin/env mapper subtree-remove %I +ExecStart=/usr/bin/env true +SyslogIdentifier=mapper diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service new file mode 100644 index 0000000000..f7744e2d8b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/mapper-wait@.service @@ -0,0 +1,22 @@ +[Unit] +Description=Wait for %I +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +# We are using a Type=simple service instead of the normal Type=oneshot +# since Type=oneshot can't have Restart= lines +# https://github.com/systemd/systemd/issues/2582 +# Unfortunately Type=oneshot services halt any services which order after +# the oneshot on the completion of ExecStart= lines. For Type=simple, the +# halting is only until ExecStartPre lines have completed and ExecStart has +# begun executing. Since we want to wait for the `mapper wait` process to +# finish, it must be an ExecStartPre. All Type=simple services require an +# ExecStart so we use `true` as a placeholder to satisfy the requirement. +Type=simple +RemainAfterExit=yes +Restart=on-failure +TimeoutStartSec=infinity +ExecStartPre=/usr/bin/env mapper wait %I +ExecStart=/usr/bin/env true +SyslogIdentifier=mapper diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.conf b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.conf new file mode 100644 index 0000000000..3d9fcc3271 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.conf @@ -0,0 +1,8 @@ +<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" + "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> +<busconfig> + <policy user="root"> + <allow own="xyz.openbmc_project.ObjectMapper"/> + <allow send_destination="xyz.openbmc_project.ObjectMapper"/> + </policy> +</busconfig> diff --git a/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service new file mode 100644 index 0000000000..aeb734da7d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dbus/phosphor-mapper/xyz.openbmc_project.ObjectMapper.service @@ -0,0 +1,21 @@ +[Unit] +Description=Phosphor DBus Service Discovery Manager +Before=obmc-mapper.target +After=dbus.service + +[Service] +Restart=always +Type=dbus +ExecStart=/usr/bin/env phosphor-mapper \ + --path_namespaces="${{MAPPER_NAMESPACES}}" \ + --interface_namespaces="${{MAPPER_INTERFACES}}" \ + --blacklists="${{MAPPER_BLACKLISTS}}" \ + --interface_blacklists="${{MAPPER_INTERFACEBLACKLISTS}}" +SyslogIdentifier=phosphor-mapper +BusName={BUSNAME} +TimeoutStartSec=300 +EnvironmentFile={envfiledir}/obmc/mapper +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/devtools/obmc-pydevtools.bb b/meta-phosphor/recipes-phosphor/devtools/obmc-pydevtools.bb new file mode 100644 index 0000000000..b8911aa537 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/devtools/obmc-pydevtools.bb @@ -0,0 +1,25 @@ +SUMMARY = "OpenBMC python devtools" +DESCRIPTION = "Shortcut scripts for developers." +PR = "r1" + +inherit skeleton-python + +VIRTUAL-RUNTIME_skeleton_workbook ?= "" + +RDEPENDS_${PN} += "\ + python-dbus \ + python-json \ + python-xml \ + python-pygobject \ + ${VIRTUAL-RUNTIME_skeleton_workbook} \ + " + +SKELETON_DIR = "pytools" + +do_install_append() { + if [ -f ${S}/obmcutil-completion.sh ] + then + install -d ${D}${sysconfdir}/profile.d + install -m 0644 -D -t ${D}${sysconfdir}/profile.d ${S}/obmcutil-completion.sh + fi +} diff --git a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb new file mode 100644 index 0000000000..b4800645bb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb @@ -0,0 +1,179 @@ +SUMMARY = "Phosphor Debug Collector" +DESCRIPTION = "Phosphor Debug Collector provides mechanisms \ +to collect various log files and system parameters. \ +This will be helpful for troubleshooting the problems in OpenBMC \ +based systems." + +PR = "r1" + +DEBUG_COLLECTOR_PKGS = " \ + ${PN}-manager \ + ${PN}-monitor \ + ${PN}-dreport \ + ${PN}-scripts \ +" +PACKAGE_BEFORE_PN += "${DEBUG_COLLECTOR_PKGS}" +ALLOW_EMPTY_${PN} = "1" + +DBUS_PACKAGES = "${PN}-manager" + +SYSTEMD_PACKAGES = "${PN}-monitor" + +inherit autotools \ + pkgconfig \ + obmc-phosphor-dbus-service \ + pythonnative \ + phosphor-debug-collector + +require phosphor-debug-collector.inc + +DEPENDS += " \ + phosphor-dbus-interfaces \ + phosphor-dbus-interfaces-native \ + phosphor-logging \ + sdbusplus \ + sdbusplus-native \ + autoconf-archive-native \ +" + +RDEPENDS_${PN}-manager += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + ${PN}-dreport \ +" +RDEPENDS_${PN}-monitor += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ +" +RDEPENDS_${PN}-dreport += " \ + systemd \ + ${VIRTUAL-RUNTIME_base-utils} \ + bash \ + xz \ +" +RDEPENDS_${PN}-scripts += " \ + bash \ +" + +MGR_SVC ?= "xyz.openbmc_project.Dump.Manager.service" + +SYSTEMD_SUBSTITUTIONS += "BMC_DUMP_PATH:${bmc_dump_path}:${MGR_SVC}" + +FILES_${PN}-manager += "${sbindir}/phosphor-dump-manager" +FILES_${PN}-monitor += "${sbindir}/phosphor-dump-monitor" +FILES_${PN}-dreport += "${bindir}/dreport" +FILES_${PN}-scripts += "${dreport_dir}" + +DBUS_SERVICE_${PN}-manager += "${MGR_SVC}" +SYSTEMD_SERVICE_${PN}-monitor += "obmc-dump-monitor.service" + +EXTRA_OECONF = "BMC_DUMP_PATH=${bmc_dump_path}" + +S = "${WORKDIR}/git" + +# Install dreport script +# From tools/dreport.d/dreport to /usr/bin/dreport +install_dreport() { + install -d ${D}${bindir} + install -m 0755 ${S}/tools/dreport.d/dreport \ + ${D}${bindir}/dreport +} + +# Install dreport sample configuration file +# From tools/dreport.d/sample.conf +# to /usr/share/dreport.d/conf.d/dreport.conf +install_dreport_conf_file() { + install -d ${D}${dreport_conf_dir} + install -m 0644 ${S}/tools/dreport.d/sample.conf \ + ${D}${dreport_conf_dir}/dreport.conf +} + +# Install dreport plugins +# From tools/dreport.d/plugins.d to /usr/share/dreport.d/plugins.d +install_dreport_plugins_scripts() { + install -d ${D}${dreport_plugin_dir} + install -m 0755 ${S}/tools/dreport.d/plugins.d/* ${D}${dreport_plugin_dir}/ +} + +# Install dreport utility functions +# From tools/dreport.d/include.d to /usr/share/dreport.d/include.d +install_dreport_include_scripts() { + install -d ${D}${dreport_include_dir} + install -m 0755 ${S}/tools/dreport.d/include.d/* \ + ${D}${dreport_include_dir}/ +} + +# Make the links for a single user plugin script +# Create user directories based on the dump type value in the config section +# Create softlinks for the base scripts in the user directories +def install_dreport_user_script(script_path, d): + import re + import configparser + + #Read the user types from the dreport.conf file + configure = configparser.ConfigParser() + conf_dir = d.getVar('D', True) + d.getVar('dreport_conf_dir', True) + confsource = os.path.join(conf_dir, "dreport.conf") + configure.read(confsource) + + config = ("config:") + section = "DumpType" + dreport_dir = d.getVar('D', True) + d.getVar('dreport_dir', True) + + script = os.path.basename(script_path) + srclink = os.path.join(d.getVar('dreport_plugin_dir', True), script) + + file = open(script_path, "r") + + for line in file: + if not config in line: + continue + revalue = re.search('[0-9]+.[0-9]+', line) + if not revalue: + bb.warn("Invalid format for config value =%s" % line) + continue + parse_value = revalue.group(0) + config_values = re.split('\W+', parse_value, 1) + if(len(config_values) != 2): + bb.warn("Invalid config value=%s" % parse_value) + break; + priority = config_values[1] + types = [int(d) for d in str(config_values[0])] + for type in types: + if not configure.has_option(section, str(type)): + bb.warn("Invalid dump type id =%s" % (str(type))) + continue + typestr = configure.get(section, str(type)) + destdir = os.path.join(dreport_dir, ("pl_" + typestr + ".d")) + if not os.path.exists(destdir): + os.makedirs(destdir) + linkname = "E" + priority + script + destlink = os.path.join(destdir, linkname) + os.symlink(srclink, destlink) + +#Make the links for all the plugins +python install_dreport_user_scripts() { + + source = d.getVar('S', True) + source_path = os.path.join(source, "tools", "dreport.d", "plugins.d") + scripts = os.listdir(source_path) + + for script in scripts: + srcname = os.path.join(source_path, script) + install_dreport_user_script(srcname, d) +} + +#Enable ubifs-workaround by DISTRO_FEATURE obmc-ubi-fs. +PACKAGECONFIG_append_df-obmc-ubi-fs = " ubifs-workaround" +PACKAGECONFIG[ubifs-workaround] = " \ + --enable-ubifs-workaround, \ + --disable-ubifs-workaround \ +" + +do_install[postfuncs] += "install_dreport" +do_install[postfuncs] += "install_dreport_conf_file" +do_install[postfuncs] += "install_dreport_plugins_scripts" +do_install[postfuncs] += "install_dreport_include_scripts" +do_install[postfuncs] += "install_dreport_user_scripts" diff --git a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.inc b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.inc new file mode 100644 index 0000000000..7837f3e35f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/phosphor-debug-collector" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-debug-collector" +SRCREV = "90d147a1ee5340278506bbdf94edc32bb77154f2" diff --git a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/obmc-dump-monitor.service b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/obmc-dump-monitor.service new file mode 100644 index 0000000000..0e8ef3b5d8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/obmc-dump-monitor.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Dump core monitor. + +[Service] +ExecStart=/usr/bin/env phosphor-dump-monitor +SyslogIdentifier=phosphor-dump-monitor +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.Manager.service b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.Manager.service new file mode 100644 index 0000000000..131c8cdaf6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/xyz.openbmc_project.Dump.Manager.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Dump Manager + +[Service] +ExecStartPre=/bin/sh -c 'mkdir -p {BMC_DUMP_PATH}' +ExecStart=/usr/bin/env phosphor-dump-manager +SyslogIdentifier=phosphor-dump-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/fans/files/Makefile b/meta-phosphor/recipes-phosphor/fans/files/Makefile new file mode 100644 index 0000000000..10e3fa2ae2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/files/Makefile @@ -0,0 +1,15 @@ +EXE = obmc-phosphor-fand +OBJS = $(EXE).o +DEPPKGS = gio-unix-2.0 glib-2.0 +CC ?= $(CROSS_COMPILE)gcc +INCLUDES += $(shell pkg-config --cflags $(DEPPKGS)) +LIBS += $(shell pkg-config --libs $(DEPPKGS)) + +%.o : %.c + $(CC) -c $^ $(CFLAGS) $(INCLUDES) -o $@ +$(EXE): $(OBJS) + $(CC) $^ $(LDFLAGS) $(LDFLAGS) -o $@ +clean: + rm -f $(OBJS) $(EXE) *.o *.d +distclean: clean + rm -f *.c~ *.h~ *.sh~ Makefile~ config.mk~ diff --git a/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.c b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.c new file mode 100644 index 0000000000..558ba10bcb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.c @@ -0,0 +1,29 @@ +/* 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. */ + +#include <stdio.h> +#include <stdlib.h> +#include <gio/gio.h> + +int main(int argc, char *argv[]) +{ + printf("obmc-phosphor-fand starting...\n"); + + while(1) + sleep(5); + + exit(EXIT_SUCCESS); +} diff --git a/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.service b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.service new file mode 100644 index 0000000000..958474989f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/files/obmc-phosphor-fand.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Fan Controller + +[Service] +Restart=always +ExecStart=/usr/bin/env obmc-phosphor-fand +SyslogIdentifier=obmc-phosphor-fand + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan.bb b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan.bb new file mode 100644 index 0000000000..60bc876160 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan.bb @@ -0,0 +1,13 @@ +SUMMARY = "OpenBMC fan control" +DESCRIPTION = "OpenBMC fan control." +PR = "r1" + +inherit skeleton-sdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +RDEPENDS_${PN} += "libsystemd" +SKELETON_DIR = "fanctl" + +DBUS_SERVICE_${PN} += "org.openbmc.control.Fans.service" +SYSTEMD_SERVICE_${PN} += "obmc-max-fans.service" diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/obmc-max-fans.service b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/obmc-max-fans.service new file mode 100644 index 0000000000..f062fc9c8c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/obmc-max-fans.service @@ -0,0 +1,11 @@ +[Unit] +Description=Set Fans to Maximum +Wants=mapper-wait@-org-openbmc-control-fans.service +After=mapper-wait@-org-openbmc-control-fans.service +After=obmc-fan-control.target + +[Service] +Type=oneshot +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/fans` /org/openbmc/control/fans org.openbmc.control.Fans setMax" +SyslogIdentifier=obmc-max-fans diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/org.openbmc.control.Fans.service b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/org.openbmc.control.Fans.service new file mode 100644 index 0000000000..ec6391d5cf --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-control-fan/org.openbmc.control.Fans.service @@ -0,0 +1,17 @@ +[Unit] +Description=Phosphor Fan Control +Wants=obmc-fans-ready.target +After=obmc-fans-ready.target +Wants=obmc-fan-control.target +Before=obmc-fan-control.target + +[Service] +Restart=always +ExecStart=/usr/bin/env fan_control.exe -f 6 +SyslogIdentifier=fan_control.exe +Type=dbus +BusName={BUSNAME} +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/fans/obmc-phosphor-fand.bb b/meta-phosphor/recipes-phosphor/fans/obmc-phosphor-fand.bb new file mode 100644 index 0000000000..6faab00a2c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/obmc-phosphor-fand.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor OpenBMC Fan Management." +DESCRIPTION = "Phosphor OpenBMC fan management reference implementation." +PR = "r1" + +inherit pkgconfig +inherit obmc-phosphor-sdbus-service +inherit obmc-phosphor-c-daemon + +PROVIDES += "virtual/obmc-fan-mgmt" +RPROVIDES_${PN} += "virtual-obmc-fan-mgmt" + +S = "${WORKDIR}" +SRC_URI += "file://Makefile \ + file://obmc-phosphor-fand.c \ + " diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bb new file mode 100644 index 0000000000..740b194adf --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor zone events definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://events.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D events.yaml ${DEST}/events.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config/events.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config/events.yaml new file mode 100644 index 0000000000..b89d1dca7f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-events-config/events.yaml @@ -0,0 +1,2 @@ +#Default zone events definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw-native.bb new file mode 100644 index 0000000000..7ae05ce808 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-mrw-native.bb @@ -0,0 +1,28 @@ +SUMMARY = "Generate fan control YAML from the MRW" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan +inherit mrw-xml + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-fan-control-fan-config" + +S = "${WORKDIR}" + +do_compile() { + ${bindir}/perl-native/perl \ + ${bindir}/gen_fan_zone_yaml.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -o ${S}/fans.yaml +} + +do_install() { + DEST=${D}${control_datadir} + install -D ${S}/fans.yaml ${DEST}/fans.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bb new file mode 100644 index 0000000000..76b0985ca5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "Phosphor fan definition example data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +PROVIDES += "virtual/phosphor-fan-control-fan-config" + +SRC_URI += "file://fans.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D fans.yaml ${DEST}/fans.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config/fans.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config/fans.yaml new file mode 100644 index 0000000000..8a6c271f2d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-fan-config/fans.yaml @@ -0,0 +1,2 @@ +#Default fan definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bb new file mode 100644 index 0000000000..065efa5393 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor zone conditions definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://zone_conditions.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D zone_conditions.yaml ${DEST}/zone_conditions.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config/zone_conditions.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config/zone_conditions.yaml new file mode 100644 index 0000000000..13406207c7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-conditions-config/zone_conditions.yaml @@ -0,0 +1,2 @@ +#Default zone conditions definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bb new file mode 100644 index 0000000000..4d8759e472 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor fan zone definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://zones.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${control_datadir} + install -D zones.yaml ${DEST}/zones.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config/zones.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config/zones.yaml new file mode 100644 index 0000000000..d25803ce69 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-control-zone-config/zones.yaml @@ -0,0 +1,2 @@ +#Default fan zone definition YAML - empty. +#For format, see documentation in fan control code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bb new file mode 100644 index 0000000000..02420e43e6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor fan monitor definition default data" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan + +SRC_URI += "file://monitor.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${monitor_datadir} + install -D monitor.yaml ${DEST}/monitor.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config/monitor.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config/monitor.yaml new file mode 100644 index 0000000000..ce60a22022 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-monitor-config/monitor.yaml @@ -0,0 +1,2 @@ +#Default fan monitor definition YAML - empty. +#For format, see documentation in fan monitor code repository example yaml. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config-native.bb new file mode 100644 index 0000000000..0eb38737c4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config-native.bb @@ -0,0 +1,22 @@ +# Provides the config file for the phosphor-fan-presence application. +# The default config file is empty. To provide a real one, +# append this recipe in a layer, add: +# FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" +# and provide a config file. + +SUMMARY = "Config file for phosphor-fan-presence" +PR = "r1" + +inherit native +inherit phosphor-fan +inherit obmc-phosphor-license + +PROVIDES += "virtual/phosphor-fan-presence-config" + +SRC_URI += "file://config.yaml" + +S = "${WORKDIR}" + +do_install() { + install -D config.yaml ${D}${presence_datadir}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config/config.yaml b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config/config.yaml new file mode 100644 index 0000000000..15a10f4094 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-config/config.yaml @@ -0,0 +1,3 @@ +# This file is a stub. Consult +# https://github.com/openbmc/phosphor-fan-presence +# for file format description and examples. diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb new file mode 100644 index 0000000000..47dc2a4a1a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan-presence-mrw-native.bb @@ -0,0 +1,26 @@ +SUMMARY = "Generate fan presence YAML from the MRW" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-fan +inherit mrw-xml + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-fan-presence-config" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${presence_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_presence_yaml.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -o ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.bb new file mode 100644 index 0000000000..9e4db307a4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.bb @@ -0,0 +1,116 @@ +SUMMARY = "Phosphor Fan" +DESCRIPTION = "Phosphor fan provides a set of fan monitoring and \ +control applications." +PR = "r1" + +require ${PN}.inc + +inherit autotools pkgconfig pythonnative +inherit obmc-phosphor-systemd +inherit phosphor-fan + +S = "${WORKDIR}/git" + +# Common build dependencies +DEPENDS += "autoconf-archive-native" +DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" +DEPENDS += "sdbusplus" +DEPENDS += "sdbusplus-native" +DEPENDS += "phosphor-logging" +DEPENDS += "libevdev" + +# Package configuration +FAN_PACKAGES = " \ + ${PN}-presence-tach \ + ${PN}-control \ + ${PN}-monitor \ +" + +ALLOW_EMPTY_${PN} = "1" +PACKAGE_BEFORE_PN += "${FAN_PACKAGES}" +PACKAGECONFIG ?= "presence control monitor" +SYSTEMD_PACKAGES = "${FAN_PACKAGES}" + +# -------------------------------------- +# ${PN}-presence-tach specific configuration +PACKAGECONFIG[presence] = " \ + --enable-presence \ + PRESENCE_CONFIG=${STAGING_DIR_NATIVE}${presence_datadir}/config.yaml, \ + --disable-presence, \ + virtual/phosphor-fan-presence-config \ + , \ +" +RDEPENDS_${PN}-presence-tach += "sdbusplus" + +# Needed to install into the obmc-chassis-poweron target +TMPL_TACH = "phosphor-fan-presence-tach@.service" +INSTFMT_TACH = "phosphor-fan-presence-tach@{0}.service" +POWERON_TGT = "obmc-chassis-poweron@{0}.target" +FMT_TACH = "../${TMPL_TACH}:${POWERON_TGT}.requires/${INSTFMT_TACH}" + +FILES_${PN}-presence-tach = "${sbindir}/phosphor-fan-presence-tach" +SYSTEMD_SERVICE_${PN}-presence-tach += "${TMPL_TACH}" +SYSTEMD_LINK_${PN}-presence-tach += "${@compose_list(d, 'FMT_TACH', 'OBMC_CHASSIS_INSTANCES')}" + +# -------------------------------------- +# ${PN}-control specific configuration +PACKAGECONFIG[control] = "--enable-control \ + FAN_DEF_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/fans.yaml \ + FAN_ZONE_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zones.yaml \ + ZONE_EVENTS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/events.yaml \ + ZONE_CONDITIONS_YAML_FILE=${STAGING_DIR_NATIVE}${control_datadir}/zone_conditions.yaml \ + FAN_ZONE_OUTPUT_DIR=${S}/control, \ + --disable-control, \ + virtual/phosphor-fan-control-fan-config \ + phosphor-fan-control-zone-config-native \ + phosphor-fan-control-events-config-native \ + phosphor-fan-control-zone-conditions-config-native \ + , \ +" + +RDEPENDS_${PN}-control += "sdbusplus" + +FAN_CONTROL_TGT = "obmc-fan-control-ready@{0}.target" + +TMPL_CONTROL = "phosphor-fan-control@.service" +INSTFMT_CONTROL = "phosphor-fan-control@{0}.service" +FMT_CONTROL = "../${TMPL_CONTROL}:${FAN_CONTROL_TGT}.requires/${INSTFMT_CONTROL}" + +TMPL_CONTROL_INIT = "phosphor-fan-control-init@.service" +INSTFMT_CONTROL_INIT = "phosphor-fan-control-init@{0}.service" +FMT_CONTROL_INIT = "../${TMPL_CONTROL_INIT}:${POWERON_TGT}.wants/${INSTFMT_CONTROL_INIT}" + +FILES_${PN}-control = "${sbindir}/phosphor-fan-control" +SYSTEMD_SERVICE_${PN}-control += "${TMPL_CONTROL} ${TMPL_CONTROL_INIT}" +SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN}-control += "${@compose_list(d, 'FMT_CONTROL_INIT', 'OBMC_CHASSIS_INSTANCES')}" + +# -------------------------------------- +# ${PN}-monitor specific configuration +PACKAGECONFIG[monitor] = "--enable-monitor \ + FAN_MONITOR_YAML_FILE=${STAGING_DIR_NATIVE}${monitor_datadir}/monitor.yaml \ + FAN_MONITOR_OUTPUT_DIR=${S}/monitor, \ + --disable-monitor, \ + phosphor-fan-monitor-config-native \ + , \ +" + +RDEPENDS_${PN}-monitor += "sdbusplus" + +TMPL_MONITOR = "phosphor-fan-monitor@.service" +INSTFMT_MONITOR = "phosphor-fan-monitor@{0}.service" +FMT_MONITOR = "../${TMPL_MONITOR}:${FAN_CONTROL_TGT}.requires/${INSTFMT_MONITOR}" + +TMPL_MONITOR_INIT = "phosphor-fan-monitor-init@.service" +INSTFMT_MONITOR_INIT = "phosphor-fan-monitor-init@{0}.service" +FMT_MONITOR_INIT = "../${TMPL_MONITOR_INIT}:${POWERON_TGT}.wants/${INSTFMT_MONITOR_INIT}" + +FILES_${PN}-monitor = "${sbindir}/phosphor-fan-monitor" +SYSTEMD_SERVICE_${PN}-monitor += "${TMPL_MONITOR} ${TMPL_MONITOR_INIT}" +SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR', 'OBMC_CHASSIS_INSTANCES')}" +SYSTEMD_LINK_${PN}-monitor += "${@compose_list(d, 'FMT_MONITOR_INIT', 'OBMC_CHASSIS_INSTANCES')}" + +# -------------------------------------- +# phosphor-cooling-type specific configuration +PACKAGECONFIG[cooling-type] = "--enable-cooling-type,--disable-cooling-type,," diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan.inc b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.inc new file mode 100644 index 0000000000..53b80bf2f1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/phosphor-fan-presence" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-fan-presence" +SRCREV = "ecd4bc7bf240b7d30ece98e74f7056b2cab1f38b" diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service new file mode 100644 index 0000000000..96b40f666b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control-init@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Fan Control Initialization +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-control --init +SyslogIdentifier=phosphor-fan-control + +[Install] +WantedBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service new file mode 100644 index 0000000000..8c5903e08f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-control@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor Fan Control Daemon +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-control --control +SyslogIdentifier=phosphor-fan-control + +[Install] +RequiredBy=obmc-fan-control-ready@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service new file mode 100644 index 0000000000..e8a6f699a4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor-init@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Fan Monitor Initialization +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-monitor --init +SyslogIdentifier=phosphor-fan-monitor + +[Install] +WantedBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service new file mode 100644 index 0000000000..ddecfba3c0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-monitor@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor Fan Monitor Daemon +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-monitor --monitor +SyslogIdentifier=phosphor-fan-monitor + +[Install] +RequiredBy=obmc-fan-control-ready@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-presence-tach@.service b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-presence-tach@.service new file mode 100644 index 0000000000..a324740c5f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-fan/phosphor-fan-presence-tach@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Fan Presence Tach Daemon +Wants=obmc-power-on@%i.target +After=obmc-power-on@%i.target +Conflicts=obmc-chassis-powered-off@%i.target + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-fan-presence-tach +SyslogIdentifier=phosphor-fan-presence-tach + +[Install] +RequiredBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control.bb b/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control.bb new file mode 100644 index 0000000000..28ad04b286 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/fans/phosphor-pid-control.bb @@ -0,0 +1,52 @@ +HOMEPAGE = "github.com/openbmc/phosphor-pid-control" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +SUMMARY = "Phosphor PID Fan Control" +DESCRIPTION = "Fan Control" +PR = "r1" + +SRC_URI = "git://github.com/openbmc/phosphor-pid-control" +SRCREV = "e2ec0f618a9b3b6809a98516abe63d5d833e7fe7" +S = "${WORKDIR}/git" + +inherit autotools pkgconfig +inherit pythonnative + +inherit phosphor-pid-control +inherit obmc-phosphor-ipmiprovider-symlink + +# Each platform will need a service file that starts +# at an appropriate time per system. For instance, if +# your system relies on passive dbus for fans or other +# sensors then it may be prudent to wait for all of them. + +DEPENDS += "autoconf-archive-native" +DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-logging" +DEPENDS += "libevdev" +DEPENDS += "libconfig" + +# We depend on someone providing their system's configuration. +DEPENDS += "virtual/phosphor-fans-sensor-inventory" +# We depend on this to be built first so we can build our providers. +DEPENDS += "phosphor-ipmi-host" + +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" + +FILES_${PN} = "${sbindir}/swampd ${sbindir}/setsensor" + +# The following installs the OEM IPMI handler for the fan controls. +FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}" +FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" + +EXTRA_OECONF = "SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor-list.yaml \ + PID_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/pid-list.yaml \ + ZONE_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/zone-info.yaml" + +HOSTIPMI_PROVIDER_LIBRARY += "libmanualcmds.so" diff --git a/meta-phosphor/recipes-phosphor/flash/files/OpenBMC.priv b/meta-phosphor/recipes-phosphor/flash/files/OpenBMC.priv new file mode 100644 index 0000000000..223d318098 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/files/OpenBMC.priv @@ -0,0 +1,16 @@ +-----BEGIN PRIVATE KEY----- +MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAPvSDLu6slkP1gri +PaeQXL9ysD69J/HjbBCIQ0RPfeWBb75US1tRTjPP0Ub8CtH8ExVf8iF1ulsZA78B +zIjBYZVp9pyD6LbpZ/hjV7rIH6dTNhoVpdA+F8LzmQ7cyhHG8l2JMvdunwF2uX5k +D4WDcZt/ITKZNQNavPtmIyD5HprdAgMBAAECgYEAuQkTSi5ZNpAoWz76xtGRFSwU +zUT4wQi3Mz6tDtjKTYXasiQGa0dHC1M9F8fDu6BZ9W7W4Dc9hArRcdzEighuxoI/ +nZI/0uL89iUEywnDEIHuS6D5JlZaj86/nx9YvQnO8F/seM+MX0EAWVrd5wC7aAF1 +h6Fu7ykZB4ggUjQAWwECQQD+AUiDOEO+8btLJ135dQfSGc5VFcZiequnKWVm6uXt +rX771hEYjYMjLqWGFg9G4gE3GuABM5chMINuQQUivy8tAkEA/cxfy19XkjtqcMgE +x/UDt6Nr+Ky/tk+4Y65WxPRDas0uxFOPk/vEjgVmz1k/TAy9G4giisluTvtmltr5 +DCLocQJBAJnRHx9PiD7uVhRJz6/L/iNuOzPtTsi+Loq5F83+O6T15qsM1CeBMsOw +cM5FN5UeMcwz+yjfHAsePMkcmMaU7jUCQHlg9+N8upXuIo7Dqj2zOU7nMmkgvSNE +5yuNImRZabC3ZolwaTdd7nf5r1y1Eyec5Ag5yENV6JKPe1Xkbb1XKJECQDngA0h4 +6ATvfP1Vrx4CbP11eKXbCsZ9OGPHSgyvVjn68oY5ZP3uPsIattoN7dE2BRfuJm7m +F0nIdUAhR0yTfKM= +-----END PRIVATE KEY----- diff --git a/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.py b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.py new file mode 100644 index 0000000000..5e5dd8f36e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.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-flashd starting..." + + while 1: + time.sleep(5) diff --git a/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.service b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.service new file mode 100644 index 0000000000..3a7f3d53a1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/files/obmc-phosphor-flashd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Flash Controller + +[Service] +Restart=always +ExecStart=/usr/bin/env obmc-phosphor-flashd +SyslogIdentifier=obmc-phosphor-flashd + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios.bb b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios.bb new file mode 100644 index 0000000000..f42bef443e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios.bb @@ -0,0 +1,13 @@ +SUMMARY = "OpenBMC org.openbmc.Flash example implementation" +DESCRIPTION = "A sample implementation for the org.openbmc.Flash DBUS API. \ +org.openbmc.Flash provides APIs for functions like BIOS flash access control \ +and updating." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +SKELETON_DIR = "flashbios" +DBUS_SERVICE_${PN} += "org.openbmc.control.Flash.service" +SYSTEMD_SERVICE_${PN} += "obmc-flash-init.service" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-init.service b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-init.service new file mode 100644 index 0000000000..de196d0ea7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/obmc-flash-init.service @@ -0,0 +1,12 @@ +[Unit] +Description=Initialize BIOS Flash +Wants=mapper-wait@-org-openbmc-control-flash-bios.service +After=mapper-wait@-org-openbmc-control-flash-bios.service + +[Service] +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/flash/bios` /org/openbmc/control/flash/bios org.openbmc.Flash init" +SyslogIdentifier=obmc-flash-init + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/org.openbmc.control.Flash.service b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/org.openbmc.control.Flash.service new file mode 100644 index 0000000000..842add34dd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bios/org.openbmc.control.Flash.service @@ -0,0 +1,14 @@ +[Unit] +Description=Phosphor BIOS Code Update +Wants=mapper-wait@-org-openbmc-managers-Download.service +After=mapper-wait@-org-openbmc-managers-Download.service + +[Service] +Restart=always +ExecStart=/usr/bin/env flash_bios.exe +SyslogIdentifier=flash_bios.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc.bb b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc.bb new file mode 100644 index 0000000000..5cf3855131 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc.bb @@ -0,0 +1,19 @@ +SUMMARY = "OpenBMC BMC update utility" +DESCRIPTION = "OpenBMC BMC update utility." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +RDEPENDS_${PN} += "\ + python-dbus \ + python-compression \ + python-shell \ + python-pygobject \ + python-subprocess \ + python-io \ + pyphosphor-dbus \ + " + +SKELETON_DIR = "pyflashbmc" +DBUS_SERVICE_${PN} += "org.openbmc.control.BmcFlash.service" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc/org.openbmc.control.BmcFlash.service b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc/org.openbmc.control.BmcFlash.service new file mode 100644 index 0000000000..bb97d8ab96 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-flash-bmc/org.openbmc.control.BmcFlash.service @@ -0,0 +1,15 @@ +[Unit] +Description=Phosphor BMC Code Update +Wants=mapper-wait@-org-openbmc-managers-Download.service +After=mapper-wait@-org-openbmc-managers-Download.service + +[Service] +Restart=always +ExecStart=/usr/bin/env bmc_update.py +SyslogIdentifier=bmc_update.py +Environment="PYTHONUNBUFFERED=1" +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download.bb b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download.bb new file mode 100644 index 0000000000..a608b0ab29 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download.bb @@ -0,0 +1,16 @@ +SUMMARY = "OpenBMC org.openbmc.managers.Download example implementation" +DESCRIPTION = "An example implementation for the org.openbmc.managers.Download DBUS API." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +RDEPENDS_${PN} += "\ + python-dbus \ + python-pygobject \ + python-subprocess \ + pyphosphor-dbus \ + " + +SKELETON_DIR = "pydownloadmgr" +DBUS_SERVICE_${PN} += "org.openbmc.managers.Download.service" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download/org.openbmc.managers.Download.service b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download/org.openbmc.managers.Download.service new file mode 100644 index 0000000000..f3ff75dfed --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-mgr-download/org.openbmc.managers.Download.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Download Manager + +[Service] +Restart=always +ExecStart=/usr/bin/env download_manager.py +SyslogIdentifier=download_manager.py +Environment="PYTHONUNBUFFERED=1" +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-op-flasher.bb b/meta-phosphor/recipes-phosphor/flash/obmc-op-flasher.bb new file mode 100644 index 0000000000..e70c354743 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-op-flasher.bb @@ -0,0 +1,11 @@ +SUMMARY = "OpenPOWER flashing utility." +DESCRIPTION = "A BMC/BIOS flashing utility for use on OpenPOWER system." +PR = "r1" + +inherit skeleton-gdbus +inherit pkgconfig + +DEPENDS += "pflash" +RDEPENDS_${PN} += "pflash" + +SKELETON_DIR = "op-flasher" diff --git a/meta-phosphor/recipes-phosphor/flash/obmc-phosphor-flashd.bb b/meta-phosphor/recipes-phosphor/flash/obmc-phosphor-flashd.bb new file mode 100644 index 0000000000..64a47a6cd0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/obmc-phosphor-flashd.bb @@ -0,0 +1,11 @@ +SUMMARY = "Phosphor OpenBMC Flash Management" +DESCRIPTION = "Phosphor OpenBMC flash management reference implementation." +PR = "r1" + +inherit obmc-phosphor-pydbus-service + +PROVIDES += "virtual/obmc-flash-mgmt" +RPROVIDES_${PN} += "virtual-obmc-flash-mgmt" + +S = "${WORKDIR}" +SRC_URI += "file://${PN}.py" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-image-signing.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-image-signing.bb new file mode 100644 index 0000000000..897bfdea4c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-image-signing.bb @@ -0,0 +1,29 @@ +SUMMARY = "OpenBMC image signing public key" +DESCRIPTION = "Public key information to be included in images for image verification." +PR = "r1" + +inherit allarch +inherit obmc-phosphor-license + +INSECURE_KEY = "${@'${SIGNING_KEY}' == '${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv'}" + +DEPENDS += "openssl-native" +DEPENDS += "${@oe.utils.conditional('INSECURE_KEY', 'True', 'phosphor-insecure-signing-key-native', '', d)}" + +FILES_${PN} += "${sysconfdir}/activationdata/" + +SIGNING_KEY ?= "${STAGING_DIR_NATIVE}${datadir}/OpenBMC.priv" +SIGNING_KEY_TYPE = "${@os.path.splitext(os.path.basename('${SIGNING_KEY}'))[0]}" + +do_install() { + openssl pkey -in "${SIGNING_KEY}" -pubout -out ${WORKDIR}/publickey + echo HashType=RSA-SHA256 > "${WORKDIR}/hashfunc" + + idir="${D}${sysconfdir}/activationdata/${SIGNING_KEY_TYPE}" + + install -d ${idir} + install -m 644 ${WORKDIR}/publickey ${idir} + install -m 644 ${WORKDIR}/hashfunc ${idir} +} + +SYSROOT_DIRS_append = " ${sysconfdir}" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-insecure-signing-key-native.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-insecure-signing-key-native.bb new file mode 100644 index 0000000000..55ebe57791 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-insecure-signing-key-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Insecure private key for testing and development" +DESCRIPTION = "Do not use this key to sign images." +PR = "r1" + +inherit allarch +inherit native +inherit obmc-phosphor-license + +SRC_URI += "file://OpenBMC.priv" + +do_install() { + bbplain "Using an insecure image signing key!" + install -d ${D}${datadir} + install -m 400 ${WORKDIR}/OpenBMC.priv ${D}${datadir} +} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-logging-error-logs-native.bbappend b/meta-phosphor/recipes-phosphor/flash/phosphor-logging-error-logs-native.bbappend new file mode 100644 index 0000000000..beb70b0e60 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-logging-error-logs-native.bbappend @@ -0,0 +1 @@ +DEPENDS += "phosphor-software-manager-error-native" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager-error-native.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager-error-native.bb new file mode 100644 index 0000000000..bf55058de6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager-error-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "Copy error yaml files to known path for elog parsing" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit native +inherit phosphor-dbus-yaml + +require phosphor-software-manager.inc + +S = "${WORKDIR}/git" + +do_install_append() { + SRC=${S}/xyz/openbmc_project/Software/ + DEST=${D}${yaml_dir}/xyz/openbmc_project/Software/ + install -d ${DEST} + install ${SRC}/*.errors.yaml ${DEST} + install ${SRC}/*.metadata.yaml ${DEST} +} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.bb b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.bb new file mode 100644 index 0000000000..0b6723c898 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.bb @@ -0,0 +1,104 @@ +SUMMARY = "Phosphor Software Management" +DESCRIPTION = "Phosphor Software Manager provides a set of system software \ +management daemons. It is suitable for use on a wide variety of OpenBMC \ +platforms." +PR = "r1" + +require ${PN}.inc + +SOFTWARE_MGR_PACKAGES = " \ + ${PN}-version \ + ${PN}-download-mgr \ + ${PN}-updater \ + ${PN}-updater-ubi \ + ${PN}-sync \ +" +PACKAGE_BEFORE_PN += "${SOFTWARE_MGR_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" + +DBUS_PACKAGES = "${SOFTWARE_MGR_PACKAGES}" + +# Set SYSTEMD_PACKAGES to empty because we do not want ${PN} and DBUS_PACKAGES +# handles the rest. +SYSTEMD_PACKAGES = "" + +PACKAGECONFIG[verify_signature] = "--enable-verify_signature,--disable-verify_signature" +PACKAGECONFIG[sync_bmc_files] = "--enable-sync_bmc_files,--disable-sync_bmc_files" +PACKAGECONFIG[ubifs_layout] = "--enable-ubifs_layout" + +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service +inherit pythonnative +inherit ${@bb.utils.contains('DISTRO_FEATURES', 'obmc-ubi-fs', 'phosphor-software-manager-ubi-fs', '', d)} + +DEPENDS += " \ + autoconf-archive-native \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + sdbus++-native \ +" + +RDEPENDS_${PN}-version += " \ + phosphor-logging \ + phosphor-dbus-interfaces \ + sdbusplus \ +" +RDEPENDS_${PN}-download-mgr += " \ + phosphor-logging \ + phosphor-dbus-interfaces \ + sdbusplus \ +" +RDEPENDS_${PN}-updater += " \ + bash \ + phosphor-logging \ + phosphor-dbus-interfaces \ + sdbusplus \ + virtual-obmc-image-manager \ +" +EXTRA_OECONF += " \ + ACTIVE_BMC_MAX_ALLOWED=1 \ + MEDIA_DIR=/run/media \ +" + +RPROVIDES_${PN}-version += " \ + virtual-obmc-image-manager \ +" + +FILES_${PN}-version += "${sbindir}/phosphor-version-software-manager ${exec_prefix}/lib/tmpfiles.d/software.conf" +FILES_${PN}-download-mgr += "${sbindir}/phosphor-download-manager" +FILES_${PN}-updater += " \ + ${sbindir}/phosphor-image-updater \ + ${sbindir}/obmc-flash-bmc \ + " +FILES_${PN}-sync += " \ + ${sbindir}/phosphor-sync-software-manager \ + ${sysconfdir}/synclist \ + " +DBUS_SERVICE_${PN}-version += "xyz.openbmc_project.Software.Version.service" +DBUS_SERVICE_${PN}-download-mgr += "xyz.openbmc_project.Software.Download.service" +DBUS_SERVICE_${PN}-updater += "xyz.openbmc_project.Software.BMC.Updater.service" +DBUS_SERVICE_${PN}-sync += "xyz.openbmc_project.Software.Sync.service" + +SYSTEMD_SERVICE_${PN}-updater += " \ + obmc-flash-bmc-setenv@.service \ +" + +SRC_URI += "file://software.conf" +SRC_URI += "file://obmc-flash-bmc" + +do_install_append() { + install -d ${D}${sbindir} + install -m 0755 ${WORKDIR}/obmc-flash-bmc ${D}${sbindir}/obmc-flash-bmc + + # /tmp/images is the software image upload directory. + # It should not be deleted since it is watched by the Image Manager + # for new images. + + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true', 'false', d)}; then + install -d ${D}${exec_prefix}/lib/tmpfiles.d + install -m 644 ${WORKDIR}/software.conf ${D}${exec_prefix}/lib/tmpfiles.d/ + fi +} + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.inc b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.inc new file mode 100644 index 0000000000..8e4a2b59a4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/phosphor-bmc-code-mgmt" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-bmc-code-mgmt" +SRCREV = "76c79df3fca0842ec9dd38f9627913cf5c64001e" diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc new file mode 100644 index 0000000000..0b1b16ed3f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc @@ -0,0 +1,516 @@ +#!/bin/bash +set -eo pipefail + +# Get the root mtd device number (mtdX) from "/dev/ubiblockX_Y on /" +findrootmtd() { + rootmatch=" on / " + m="$(mount | grep "${rootmatch}" | grep "ubiblock")" + m="${m##*ubiblock}" + m="${m%_*}" + if [ -z "${m}" ]; then + # default to bmc mtd (0) + m=0 + fi + echo "mtd${m}" +} + +findrootubi() { + rootmatch=" on / " + m="$(mount | grep "${rootmatch}")" + m="${m##*ubiblock}" + m="${m% on*}" + echo "ubi${m}" +} + +# Get the mtd device number (mtdX) +findmtd() { + m="$(grep -xl "$1" /sys/class/mtd/*/name)" + m="${m%/name}" + m="${m##*/}" + echo "${m}" +} + +# Get the mtd device number only (return X of mtdX) +findmtdnum() { + m="$(findmtd "$1")" + m="${m##mtd}" + echo "${m}" +} + +# Get the ubi device number (ubiX_Y) +findubi() { + u="$(grep -xl "$1" /sys/class/ubi/ubi?/subsystem/ubi*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get the ubi device number (ubiX_Y) on a specific mtd +findubi_onmtd() { + u="$(grep -xl "$1" /sys/class/ubi/ubi"$2"/subsystem/ubi"$2"*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get all ubi device names on a specific mtd that match requested string +findubiname_onmtd() { + u="$(grep -h "$1" /sys/class/ubi/ubi"$2"/subsystem/ubi"$2"*/name)" + u="${u%/name}" + u="${u##*/}" + echo "${u}" +} + +# Get the name from the requested ubiX_Y volume +findname() { + n="$(cat /sys/class/ubi/$1/name)" + echo "${n}" +} + +# Set the u-boot envs that perform a side switch on failure to boot +set_wdt2bite() { + if ! fw_printenv wdt2bite 2>/dev/null; then + fw_setenv wdt2bite "mw.l 0x1e785024 0xa 1; mw.b 0x1e78502c 0xb3 1" + fw_setenv bootalt "run wdt2bite" + fw_setenv obmc_bootcmd "ubi part obmc-ubi; run do_rwreset; ubi read \ +\${loadaddr} \${kernelname}; bootm \${loadaddr} || run bootalt" + fi +} + +# Make space on flash before creating new volumes. This can be enhanced +# determine current flash usage. For now only keep a "keepmax" number of them +ubi_remove_volumes() +{ + rootubi="$(findrootubi)" + rootname="$(findname "${rootubi}")" + rootversion="${rootname##*-}" + rootkernel="kernel-${rootversion}" + + # Just keep max number of volumes before updating, don't delete the version + # the BMC is booted from, and when a version is identified to be deleted, + # delete both the rofs and kernel volumes for that version. + rmnames="$(findubiname_onmtd "${name%-*}-" "${ro}")" + rmnames=(${rmnames}) + ubicount="${#rmnames[@]}" + while [ ${ubicount} -ge ${keepmax} ]; do + # Loop through existing volumes and skip currently active ones + for (( index=0; index<${#rmnames[@]}; index++ )); do + rmname="${rmnames[${index}]}" + rmversion="${rmname##*-}" + [ "${rmversion}" == "${version}" ] && continue + rmubi="$(findubi_onmtd "rofs-${rmversion}" "${ro}")" + if [[ ( "${rmubi}" != "${rootubi}" ) && + ( "${rmname}" != "${rootkernel}" ) ]]; then + ubi_remove "rofs-${rmversion}" "${ro}" + ubi_remove "kernel-${rmversion}" "${ro}" + # Remove priority value + fw_setenv "${rmversion}" + break + fi + done + # Decrease count regardless to avoid an infinite loop + (( ubicount-- )) + done +} + +ubi_rw() { + rwmtd="$(findmtd "${reqmtd}")" + rw="${rwmtd#mtd}" + ubidev="/dev/ubi${rw}" + + # Update rwfs_size, check imgsize was specified, otherwise it'd clear the var + if [ ! -z "$imgsize" ]; then + rwsize="$(fw_printenv -n rwfs_size 2>/dev/null)" || true + if [[ "${imgsize}" != "${rwsize}" ]]; then + fw_setenv rwfs_size "${imgsize}" + fi + fi + + vol="$(findubi "${name}")" + if [ -z "${vol}" ]; then + ubimkvol "${ubidev}" -N "${name}" -s "${imgsize}" + fi +} + +ubi_ro() { + keepmax=2 # Default 2 volumes per mtd + romtd="$(findmtd "${reqmtd}")" + romtd2="$(findmtd "${reqmtd2}")" + + if [ ! "${romtd}" == "${romtd2}" ]; then + # Request to use alternate mtd device, choose the non-root one + keepmax=1 # 1 volume on each of the requested mtds + rootmtd="$(findrootmtd)" + if [ "${rootmtd}" == "${romtd}" ]; then + romtd="${romtd2}" + fi + fi + ro="${romtd#mtd}" + ubidev="/dev/ubi${ro}" + + ubi_remove_volumes + + if [ -z "${imgfile}" ]; then + echo "Unable to create read-only volume. Image file not specified." + return 1 + fi + + # Create a ubi volume, dynamically sized to fit BMC image if size unspecified + img="/tmp/images/${version}/${imgfile}" + imgsize="$(stat -c '%s' ${img})" + + vol="$(findubi "${name}")" + if [ ! -z "${vol}" ]; then + # Allow a duplicate kernel volume on the alt mtd + if [[ "${name}" =~ "kernel" ]]; then + vol="$(findubi_onmtd "${name}" "${ro}")" + fi + fi + if [ -z "${vol}" ]; then + ubimkvol "${ubidev}" -N "${name}" -s "${imgsize}" --type=static + vol="$(findubi "${name}")" + fi +} + +# Squashfs images need a ubi block +ubi_block() { + vol="$(findubi "${name}")" + ubidevid="${vol#ubi}" + block="/dev/ubiblock${ubidevid}" + if [ ! -e "$block" ]; then + ubiblock --create "/dev/ubi${ubidevid}" + fi +} + +ubi_updatevol() { + vol="$(findubi "${name}")" + ubidevid="${vol#ubi}" + img="/tmp/images/${version}/${imgfile}" + ubiupdatevol "/dev/ubi${ubidevid}" "${img}" +} + +ubi_remove() { + rmname="$1" + rmmtd="$2" + if [ ! -z "${rmmtd}" ]; then + vol="$(findubi_onmtd "${rmname}" "${rmmtd}")" + else + vol="$(findubi "${rmname}")" + fi + + if [ ! -z "$vol" ]; then + vol="${vol%_*}" + + if grep -q "$rmname" /proc/mounts; then + mountdir=$(grep "$rmname" /proc/mounts | cut -d " " -f 2) + umount "$mountdir" + rm -r "$mountdir" + fi + + ubirmvol "/dev/${vol}" -N "$rmname" + fi +} + +ubi_cleanup() { + # When ubi_cleanup is run, it expects one or no active version. + activeVersion=$(busctl --list --no-pager tree \ + xyz.openbmc_project.Software.BMC.Updater | \ + grep /xyz/openbmc_project/software/ | tail -c 9) + + if [[ -z "$activeVersion" ]]; then + vols=$(ubinfo -a | grep "rofs-" | cut -c 14-) + vols=(${vols}) + else + vols=$(ubinfo -a | grep "rofs-" | \ + grep -v "$activeVersion" | cut -c 14-) + vols=(${vols}) + fi + + for (( index=0; index<${#vols[@]}; index++ )); do + ubi_remove ${vols[index]} + done +} + +mount_alt_rwfs() { + altNum="$(findmtdnum "alt-bmc")" + if [ ! -z "${altNum}" ]; then + altRwfs=$(ubinfo -a -d ${altNum} | grep -w "rwfs") || true + if [ ! -z "${altRwfs}" ]; then + altVarMount="/media/alt/var" + mkdir -p "${altVarMount}" + if mount ubi"${altNum}":rwfs "${altVarMount}" -t ubifs -o defaults; then + mkdir -p "${altVarMount}"/persist/etc + fi + fi + fi +} + +remount_ubi() { + bmcmtd="$(findmtd "bmc")" + altbmcmtd="$(findmtd "alt-bmc")" + mtds="${bmcmtd: -1}","${altbmcmtd: -1}" + + IFS=',' read -r -a mtds <<< "$mtds" + mtds=($(echo "${mtds[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')) + for mtd in ${mtds[@]}; do + # Get information on all ubi volumes + ubinfo=$(ubinfo -d ${mtd}) + presentVolumes=${ubinfo##*:} + IFS=', ' read -r -a array <<< "$presentVolumes" + for element in ${array[@]}; do + elementProperties=$(ubinfo -d $mtd -n $element) + # Get ubi volume name by getting rid of additional properties + name=${elementProperties#*Name:} + name="${name%Character*}" + name="$(echo -e "${name}" | tr -d '[:space:]')" + + if [[ ${name} == rofs-* ]]; then + mountdir="/media/${name}" + + if [ ! -d ${mountdir} ]; then + mkdir -p "${mountdir}" + # U-Boot will create the ubiblock for the running version, but not + # for the version on the other chip + if [ ! -e "/dev/ubiblock${mtd}_${element}" ]; then + ubiblock --create /dev/ubi${mtd}_${element} + fi + mount -t squashfs -o ro "/dev/ubiblock${mtd}_${element}" "${mountdir}" + fi + fi + done + done + + set_wdt2bite +} + +# Read the current env variable and set it on the alternate boot env +copy_env_var_to_alt() { + varName=$1 + value="$(fw_printenv -n "${varName}")" + fw_setenv -c /etc/alt_fw_env.config "${varName}" "${value}" +} + +# When the alternate bmc chip boots, u-boot thinks its the primary mtdX. +# Therefore need to swap the chip numbers when copying the ubiblock and root to +# alternate bmc u-boot environment. +copy_ubiblock_to_alt() { + value="$(fw_printenv -n ubiblock)" + bmcNum="$(findmtdnum "bmc")" + altNum="$(findmtdnum "alt-bmc")" + replaceAlt="${value/${altNum},/${bmcNum},}" + + if [[ "${value}" == "${replaceAlt}" ]]; then + replaceBmc="${value/${bmcNum},/${altNum},}" + value=${replaceBmc} + else + value=${replaceAlt} + fi + + fw_setenv -c /etc/alt_fw_env.config ubiblock "${value}" +} + +copy_root_to_alt() { + value="$(fw_printenv -n root)" + bmcNum="$(findmtdnum "bmc")" + altNum="$(findmtdnum "alt-bmc")" + replaceAlt="${value/${altNum}_/${bmcNum}_}" + + if [[ "${value}" == "${replaceAlt}" ]]; then + replaceBmc="${value/${bmcNum}_/${altNum}_}" + value=${replaceBmc} + else + value=${replaceAlt} + fi + + fw_setenv -c /etc/alt_fw_env.config root "${value}" +} + +ubi_setenv() { + # The U-Boot environment maintains two banks of environment variables. + # The banks need to be consistent with each other to ensure that these + # variables can reliably be read from file. In order to guarantee that the + # banks are both correct, we need to run fw_setenv twice. + variable=$1 + if [[ "$variable" == *"="* ]]; then + varName="${variable%=*}" + value="${variable##*=}" + # Write only if var is not set already to the requested value + currentValue="$(fw_printenv -n "${varName}" 2>/dev/null)" || true + if [[ "${currenValue}" != "${value}" ]]; then + fw_setenv "$varName" "$value" + fw_setenv "$varName" "$value" + fi + else + fw_setenv "$variable" + fw_setenv "$variable" + fi +} + +mtd_write() { + flashmtd="$(findmtd "${reqmtd}")" + img="/tmp/images/${version}/${imgfile}" + flashcp -v ${img} /dev/${flashmtd} +} + +backup_env_vars() { + copy_env_var_to_alt kernelname + copy_ubiblock_to_alt + copy_root_to_alt +} + +update_env_vars() { + vol="$(findubi rofs-"${version}")" + if [ -z "${vol}" ]; then + return 1 + fi + ubidevid="${vol#ubi}" + block="/dev/ubiblock${ubidevid}" + if [ ! -e "${block}" ]; then + return 1 + fi + ubi_setenv "kernelname=kernel-${version}" + ubi_setenv "ubiblock=$(echo "${ubidevid}" | sed 's/_/,/')" + ubi_setenv "root=${block}" +} + +#TODO: Replace the implementation with systemd-inhibitors lock +# once systemd/systemd#949 is resolved +rebootguardenable() { + dir="/run/systemd/system/" + file="reboot-guard.conf" + units=("reboot" "poweroff" "halt") + + for unit in "${units[@]}"; do + mkdir -p ${dir}${unit}.target.d + echo -e "[Unit]\nRefuseManualStart=yes" >> ${dir}${unit}.target.d/${file} + done +} + +#TODO: Replace the implementation with systemd-inhibitors lock +# once systemd/systemd#949 is resolved +rebootguarddisable() { + dir="/run/systemd/system/" + file="reboot-guard.conf" + units=("reboot" "poweroff" "halt") + + for unit in "${units[@]}"; do + rm -rf ${dir}${unit}.target.d/${file} + done +} + +# Create a copy in the alt mtd +create_vol_in_alt() { + alt="alt-bmc" + altmtd="$(findmtd "${alt}")" + if [ ! -z "${altmtd}" ]; then + reqmtd="${alt}" + reqmtd2="${alt}" + ubi_ro + ubi_updatevol + fi +} + +# Copy contents of one MTD device to another +mtd_copy() { + in=$1 + out=$2 + + # Must erase MTD first to prevent corruption + flash_eraseall "${out}" + dd if="${in}" of="${out}" +} + +mirroruboot() { + bmc="$(findmtd "u-boot")" + bmcdev="/dev/${bmc}" + alt="$(findmtd "alt-u-boot")" + altdev="/dev/${alt}" + + checksum_bmc="$(md5sum "${bmcdev}")" + checksum_bmc="${checksum_bmc% *}" + checksum_alt="$(md5sum "${altdev}")" + checksum_alt="${checksum_alt% *}" + + if [[ "${checksum_bmc}" != "${checksum_alt}" ]]; then + bmcenv="$(findmtd "u-boot-env")" + bmcenvdev="/dev/${bmcenv}" + altenv="$(findmtd "alt-u-boot-env")" + altenvdev="/dev/${altenv}" + + echo "Mirroring U-boot to alt chip" + mtd_copy "${bmcdev}" "${altdev}" + mtd_copy "${bmcenvdev}" "${altenvdev}" + + copy_ubiblock_to_alt + copy_root_to_alt + fi +} + +case "$1" in + mtduboot) + reqmtd="$2" + version="$3" + imgfile="image-u-boot" + mtd_write + ;; + ubirw) + reqmtd="$2" + name="$3" + imgsize="$4" + ubi_rw + ;; + ubiro) + reqmtd="$(echo "$2" | cut -d "+" -f 1)" + reqmtd2="$(echo "$2" | cut -d "+" -f 2)" + name="$3" + version="$4" + imgfile="image-rofs" + ubi_ro + ubi_updatevol + ubi_block + ;; + ubikernel) + reqmtd="$(echo "$2" | cut -d "+" -f 1)" + reqmtd2="$(echo "$2" | cut -d "+" -f 2)" + name="$3" + version="$4" + imgfile="image-kernel" + ubi_ro + ubi_updatevol + create_vol_in_alt + ;; + ubiremove) + name="$2" + ubi_remove "${name}" + ;; + ubicleanup) + ubi_cleanup + ;; + ubisetenv) + ubi_setenv "$2" + ;; + ubiremount) + remount_ubi + mount_alt_rwfs + ;; + createenvbackup) + backup_env_vars + ;; + updateubootvars) + version="$2" + update_env_vars + ;; + rebootguardenable) + rebootguardenable + ;; + rebootguarddisable) + rebootguarddisable + ;; + mirroruboot) + mirroruboot + ;; + *) + echo "Invalid argument" + exit 1 + ;; +esac diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service new file mode 100644 index 0000000000..f8c9135a16 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-cleanup.service @@ -0,0 +1,9 @@ +[Unit] +Description=Clean up UBI volumes unattached to a BMC version after DeleteAll + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStartPre=/usr/bin/env obmc-flash-bmc createenvbackup +ExecStart=/usr/bin/env obmc-flash-bmc ubicleanup +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-mirroruboot.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-mirroruboot.service new file mode 100644 index 0000000000..361dd61cd6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-mirroruboot.service @@ -0,0 +1,8 @@ +[Unit] +Description=Copy uboot from the currently booted bmc chip to the alternate chip + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc mirroruboot +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service new file mode 100644 index 0000000000..73b55d4f39 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-setenv@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Set U-Boot environment variable + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubisetenv %I +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service new file mode 100644 index 0000000000..388bb1a0df --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiremount.service @@ -0,0 +1,15 @@ +[Unit] +Description=Remount the ubi volume after a reboot +Wants=xyz.openbmc_project.Software.BMC.Updater.service +Before=xyz.openbmc_project.Software.BMC.Updater.service +Wants=obmc-flash-bmc-setenv@rwreset.service +After=obmc-flash-bmc-setenv@rwreset.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubiremount +SyslogIdentifier=obmc-flash-bmc + +[Install] +WantedBy=multi-user.target diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service new file mode 100644 index 0000000000..42aa026b98 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro-remove@.service @@ -0,0 +1,9 @@ +[Unit] +Description=Deletes read-only and kernel ubi volume %I + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubiremove rofs-%i +ExecStart=/usr/bin/env obmc-flash-bmc ubiremove kernel-%i +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service new file mode 100644 index 0000000000..5cd8565f56 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubiro@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Store read-only images %I to BMC storage +OnFailure=obmc-flash-bmc-ubiro-remove@%i.service + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStartPre=/usr/bin/env obmc-flash-bmc createenvbackup +ExecStart=/usr/bin/env obmc-flash-bmc ubiro {RO_MTD} rofs-%i %i +ExecStart=/usr/bin/env obmc-flash-bmc ubikernel {KERNEL_MTD} kernel-%i %i +ExecStart=/usr/bin/env obmc-flash-bmc mtduboot u-boot %i +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service new file mode 100644 index 0000000000..68c4ab2569 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw-remove.service @@ -0,0 +1,8 @@ +[Unit] +Description=Deletes BMC read-write ubi volume + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubiremove rwfs +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service new file mode 100644 index 0000000000..79d0ea3876 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-ubirw.service @@ -0,0 +1,8 @@ +[Unit] +Description=Create BMC read-write ubi volume + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc ubirw {RW_MTD} rwfs {RW_SIZE} +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-updateubootvars@.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-updateubootvars@.service new file mode 100644 index 0000000000..bab0b0297c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/obmc-flash-bmc-updateubootvars@.service @@ -0,0 +1,8 @@ +[Unit] +Description= Updates the u-boot variable to point BMC version to %I + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc updateubootvars %i +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-disable.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-disable.service new file mode 100644 index 0000000000..b09df99d3c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-disable.service @@ -0,0 +1,8 @@ +[Unit] +Description=Removes the guard that blocks BMC reboot + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc rebootguarddisable +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-enable.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-enable.service new file mode 100644 index 0000000000..4405e3dbbe --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/reboot-guard-enable.service @@ -0,0 +1,8 @@ +[Unit] +Description=Enable a guard that blocks BMC reboot + +[Service] +Type=oneshot +RemainAfterExit=no +ExecStart=/usr/bin/env obmc-flash-bmc rebootguardenable +SyslogIdentifier=obmc-flash-bmc diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/software.conf b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/software.conf new file mode 100644 index 0000000000..09ecd92e4b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/software.conf @@ -0,0 +1,3 @@ +# /tmp/images is the software image upload directory +# It should not be deleted if the UBI code update is used. +x /tmp/images diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/synclist b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/synclist new file mode 100644 index 0000000000..8213ce6a05 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/synclist @@ -0,0 +1,11 @@ +/etc/dropbear/ +/etc/group +/etc/gshadow +/etc/hostname +/etc/machine-id +/etc/passwd +/etc/shadow +/etc/ssl/ +/etc/ssl/certs/nginx/ +/etc/ssl/private/ +/etc/systemd/network/ diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/usr-local.mount b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/usr-local.mount new file mode 100644 index 0000000000..7aa2cf656a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/usr-local.mount @@ -0,0 +1,7 @@ +[Unit] +Description=/usr/local + +[Mount] +What=tmpfs +Where=/usr/local +Type=tmpfs diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service new file mode 100644 index 0000000000..ef1a1c434f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.BMC.Updater.service @@ -0,0 +1,16 @@ +[Unit] +Description=OpenBMC Software Update Manager +Wants=xyz.openbmc_project.Software.Version.service +Before=xyz.openbmc_project.Software.Version.service +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env phosphor-image-updater +SyslogIdentifier=phosphor-image-updater +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service new file mode 100644 index 0000000000..a4934f865f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Download.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor Download Manager + +[Service] +ExecStart=/usr/bin/env phosphor-download-manager +SyslogIdentifier=phosphor-download-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service new file mode 100644 index 0000000000..1ff33a2fe3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Sync.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Sync Manager that syncs files to the alternate BMC chip + +[Service] +ExecStart=/usr/bin/env phosphor-sync-software-manager +SyslogIdentifier=phosphor-sync-software-manager +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service new file mode 100644 index 0000000000..0141245b2f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/flash/phosphor-software-manager/xyz.openbmc_project.Software.Version.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Version Software Manager + +[Service] +ExecStartPre=/bin/sh -c 'mkdir -p /tmp/images' +ExecStart=/usr/bin/env phosphor-version-software-manager +SyslogIdentifier=phosphor-version-software-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor.bb b/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor.bb new file mode 100644 index 0000000000..b6b92fd6c1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor.bb @@ -0,0 +1,53 @@ +SUMMARY = "Phosphor GPIO monitor application" +DESCRIPTION = "Application to monitor gpio assertions" +HOMEPAGE = "http://github.com/openbmc/phosphor-gpio-monitor" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +GPIO_PACKAGES = " \ + ${PN}-monitor \ + ${PN}-presence \ +" + +PACKAGE_BEFORE_PN += "${GPIO_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" +SYSTEMD_PACKAGES = "${GPIO_PACKAGES}" + +RPROVIDES_${PN}-monitor += "virtual/obmc-gpio-monitor" +RPROVIDES_${PN}-presence += "virtual/obmc-gpio-presence" + +PROVIDES += "virtual/obmc-gpio-monitor" +PROVIDES += "virtual/obmc-gpio-presence" + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "libevdev" +DEPENDS += "phosphor-logging" + +RDEPENDS_${PN}-monitor += " \ + libsystemd \ + libevdev \ + phosphor-logging \ +" +RDEPENDS_${PN}-presence += " \ + libsystemd \ + libevdev \ + phosphor-logging \ + sdbusplus \ +" + +SYSTEMD_SERVICE_${PN}-monitor += "phosphor-gpio-monitor@.service" +SYSTEMD_SERVICE_${PN}-presence += "phosphor-gpio-presence@.service" + +FILES_${PN}-monitor += "${sbindir}/phosphor-gpio-monitor" +FILES_${PN}-monitor += "${sbindir}/phosphor-gpio-util" +FILES_${PN}-presence += "${sbindir}/phosphor-gpio-presence" + +SRC_URI += "git://github.com/openbmc/phosphor-gpio-monitor" +SRCREV = "96e01b7c110219bef0b0f68b6054454ae27dee95" +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service b/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service new file mode 100644 index 0000000000..8d0f4cd5bb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-monitor@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Phosphor GPIO %I monitor + +[Service] +Restart=no +EnvironmentFile={envfiledir}/obmc/gpio/%I +ExecStart=/usr/bin/env phosphor-gpio-monitor --path=${{DEVPATH}} --key=${{KEY}} --polarity=${{POLARITY}} --target=${{TARGET}} ${{EXTRA_ARGS}} +SyslogIdentifier=phosphor-gpio-monitor diff --git a/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-presence@.service b/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-presence@.service new file mode 100644 index 0000000000..df758246ff --- /dev/null +++ b/meta-phosphor/recipes-phosphor/gpio/phosphor-gpio-monitor/phosphor-gpio-presence@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor GPIO %I Presence +Wants=mapper-wait@-xyz-openbmc_project-inventory.service +After=mapper-wait@-xyz-openbmc_project-inventory.service +ConditionPathExists={envfiledir}/obmc/gpio/phosphor-power-supply-%i.conf + +[Service] +EnvironmentFile={envfiledir}/obmc/gpio/phosphor-power-supply-%i.conf +ExecStart=/usr/bin/env phosphor-gpio-presence --path=${{DEVPATH}} --inventory=${{INVENTORY}} --key=${{KEY}} --name=${{NAME}} --drivers=${{DRIVERS}} +SyslogIdentifier=phosphor-gpio-presence + +[Install] +RequiredBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/host/obmc-op-control-host.bb b/meta-phosphor/recipes-phosphor/host/obmc-op-control-host.bb new file mode 100644 index 0000000000..627f75956d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/host/obmc-op-control-host.bb @@ -0,0 +1,25 @@ +SUMMARY = "org.openbmc.control.Host implementation for OpenPOWER" +DESCRIPTION = "A host control implementation suitable for OpenPOWER systems." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +PROVIDES += "virtual/obmc-host-ctl" +RPROVIDES_${PN} += "virtual-obmc-host-ctl" + +SKELETON_DIR = "op-hostctl" + +FMT = "org.openbmc.control.Host@{0}.service" +DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_SERVICE_${PN} = " \ + op-start-host@.service \ + " + +START_TMPL = "op-start-host@.service" +START_TGTFMT = "obmc-host-startmin@{1}.target" +START_INSTFMT = "op-start-host@{0}.service" +START_FMT = "../${START_TMPL}:${START_TGTFMT}.requires/${START_INSTFMT}" + +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'START_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_CHASSIS_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/host/obmc-op-control-host/op-start-host@.service b/meta-phosphor/recipes-phosphor/host/obmc-op-control-host/op-start-host@.service new file mode 100644 index 0000000000..8703a4301f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/host/obmc-op-control-host/op-start-host@.service @@ -0,0 +1,21 @@ +[Unit] +Description=Start 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 +Wants=mapper-wait@-org-openbmc-control-host%i.service +After=mapper-wait@-org-openbmc-control-host%i.service +Conflicts=obmc-host-stop@%i.target +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/bin/sh -c "busctl call `mapper get-service /org/openbmc/control/host%i` /org/openbmc/control/host%i org.openbmc.control.Host boot" +SyslogIdentifier=op-start-host + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-phosphor/recipes-phosphor/host/obmc-op-control-host/org.openbmc.control.Host@.service b/meta-phosphor/recipes-phosphor/host/obmc-op-control-host/org.openbmc.control.Host@.service new file mode 100644 index 0000000000..9a64002ec4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/host/obmc-op-control-host/org.openbmc.control.Host@.service @@ -0,0 +1,14 @@ +[Unit] +Description=OpenPOWER Host%i Control +Wants=mapper-wait@-org-openbmc-managers-System.service +After=mapper-wait@-org-openbmc-managers-System.service + +[Service] +Restart=always +ExecStart=/usr/bin/env control_host.exe +SyslogIdentifier=control_host.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/host/phosphor-host-postd.bb b/meta-phosphor/recipes-phosphor/host/phosphor-host-postd.bb new file mode 100644 index 0000000000..92ff4890e3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/host/phosphor-host-postd.bb @@ -0,0 +1,26 @@ +SUMMARY = "Phosphor OpenBMC Post Code Daemon" +DESCRIPTION = "Phosphor OpenBMC Post Code Daemon" +PR = "r1" + +inherit autotools pkgconfig +inherit obmc-phosphor-systemd + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "systemd" + +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" + +SNOOP_DEVICE ?= "aspeed-lpc-snoop0" +POST_CODE_BYTES ?= "1" + +SERVICE_FILE = "lpcsnoop.service" +SYSTEMD_SERVICE_${PN} += "${SERVICE_FILE}" +SYSTEMD_SUBSTITUTIONS += "SNOOP_DEVICE:${SNOOP_DEVICE}:${SERVICE_FILE}" +SYSTEMD_SUBSTITUTIONS += "POST_CODE_BYTES:${POST_CODE_BYTES}:${SERVICE_FILE}" + +require ${PN}.inc + +S = "${WORKDIR}/git" + diff --git a/meta-phosphor/recipes-phosphor/host/phosphor-host-postd.inc b/meta-phosphor/recipes-phosphor/host/phosphor-host-postd.inc new file mode 100644 index 0000000000..8148950369 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/host/phosphor-host-postd.inc @@ -0,0 +1,6 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-host-postd" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" +SRC_URI += "git://github.com/openbmc/phosphor-host-postd" +SRCREV = "c820155fa71090122c7c0838900823570d073dfb" + diff --git a/meta-phosphor/recipes-phosphor/host/phosphor-host-postd/lpcsnoop.service b/meta-phosphor/recipes-phosphor/host/phosphor-host-postd/lpcsnoop.service new file mode 100644 index 0000000000..117702c04b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/host/phosphor-host-postd/lpcsnoop.service @@ -0,0 +1,10 @@ +[Unit] +Description=LPC Snoop Daemon +After=systemd-modules-load.service + +[Service] +Restart=always +ExecStart={sbindir}/snoopd -d "/dev/{SNOOP_DEVICE}" -b "{POST_CODE_BYTES}" + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/images/obmc-phosphor-debug-tarball.bb b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-debug-tarball.bb new file mode 100644 index 0000000000..e00e928433 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-debug-tarball.bb @@ -0,0 +1,3 @@ +DESCRIPTION = "Debug tools tarball for use with OpenBMC Phosphor" + +inherit obmc-phosphor-debug-tarball diff --git a/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb new file mode 100644 index 0000000000..8e481a1bd6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-image.bb @@ -0,0 +1,3 @@ +DESCRIPTION = "Image with Phosphor, an OpenBMC framework." + +inherit obmc-phosphor-image diff --git a/meta-phosphor/recipes-phosphor/images/obmc-phosphor-initramfs.bb b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-initramfs.bb new file mode 100644 index 0000000000..b68048a50d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/images/obmc-phosphor-initramfs.bb @@ -0,0 +1,21 @@ +DESCRIPTION = "Small image capable of booting a device. The kernel includes \ +the Minimal RAM-based Initial Root Filesystem (initramfs), which finds the \ +first 'init' program more efficiently." + +PACKAGE_INSTALL = "${VIRTUAL-RUNTIME_base-utils} udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL} obmc-phosphor-initfs" + +# Do not pollute the initrd image with rootfs features +IMAGE_FEATURES = "" + +export IMAGE_BASENAME = "obmc-phosphor-initramfs" +IMAGE_LINGUAS = "" + +LICENSE = "MIT" + +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +inherit core-image + +IMAGE_ROOTFS_SIZE = "8192" +IMAGE_ROOTFS_EXTRA_SPACE = "0" + +BAD_RECOMMENDATIONS += "busybox-syslog" diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh new file mode 100644 index 0000000000..62be89f039 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-init.sh @@ -0,0 +1,426 @@ +#!/bin/sh + +fslist="proc sys dev run" +rodir=run/initramfs/ro +rwdir=run/initramfs/rw +upper=$rwdir/cow +work=$rwdir/work + +cd / +mkdir -p $fslist +mount dev dev -tdevtmpfs +mount sys sys -tsysfs +mount proc proc -tproc +if ! grep run proc/mounts +then + mount tmpfs run -t tmpfs -o mode=755,nodev +fi + +mkdir -p $rodir $rwdir + +cp -rp init shutdown update whitelist bin sbin usr lib etc var run/initramfs + +# To start a interactive shell with job control at this point, run +# getty 38400 ttyS4 + +findmtd() { + m=$(grep -xl "$1" /sys/class/mtd/*/name) + m=${m%/name} + m=${m##*/} + echo $m +} + +blkid_fs_type() { + # Emulate util-linux's `blkid -s TYPE -o value $1` + # Example busybox blkid output: + # # blkid /dev/mtdblock5 + # /dev/mtdblock5: TYPE="squashfs" + # Process output to extract TYPE value "squashfs". + blkid $1 | sed -e 's/^.*TYPE="//' -e 's/".*$//' +} + +probe_fs_type() { + fst=$(blkid_fs_type $1) + echo ${fst:=jffs2} +} + +# This fw_get_env_var is a possibly broken version of fw_printenv that +# does not check the crc or flag byte. +# The u-boot environment starts with a crc32, followed by a flag byte +# when a redundannt environment is configured, followed by var=value\0 sets. +# The flag byte for nand is a 1 byte counter; for nor it is a 1 or 0 byte. + +get_fw_env_var() { + # do we have 1 or 2 copies of the environment? + # count non-blank non-comment lines + # copies=$(grep -v ^# /etc/fw_env.config | grep -c [::alnum::]) + # ... we could if we had the fw_env.config in the initramfs + copies=2 + + # * Change \n to \r and \0 to \n + # * Skip to the 5th byte to skip over crc + # * then skip to the first or 2nd byte to skip over flag if it exists + # * stop parsing at first empty line corresponding to the + # double \0 at the end of the environment. + # * print the value of the variable name passed as argument + + envdev=$(findmtd u-boot-env) + if test -n $envdev + then + cat /dev/$envdev | + tr '\n\000' '\r\n' | + tail -c +5 | tail -c +${copies-1} | + sed -ne '/^$/,$d' -e "s/^$1=//p" + fi +} + +setup_resolv() { + runresolv=/run/systemd/resolve/resolv.conf + etcresolv=/etc/resolv.conf + + if test ! -e $etcresolv -a ! -L $etcresolv + then + mkdir -p ${runresolv%/*} + ln -s $runresolv $etcresolv + fi + if test ! -f $runresolv + then + cat /proc/net/pnp > $runresolv + fi + + return 0 +} + +try_tftp() { + # split into tftp:// host:port/ path/on/remote + # then spilt off / and then :port from the end of host:port/ + # and : from the beginning of port + + rest="${1#tftp://}" + path=${rest#*/} + host=${rest%$path} + host="${host%/}" + port="${host#${host%:*}}" + host="${host%$port}" + port="${port#:}" + + setup_resolv + + if test -z "$host" -o -z "$path" + then + debug_takeover "Invalid tftp download url '$url'." + elif echo "Downloading '$url' from $host ..." && + ! tftp -g -r "$path" -l /run/image-rofs "$host" ${port+"$port"} + then + debug_takeover "Download of '$url' failed." + fi +} + +try_wget() { + setup_resolv + + echo "Downloading '$1' ..." + if ! wget -O /run/image-rofs "$1" + then + debug_takeover "Download of '$url' failed." + fi +} + +debug_takeover() { + echo "$@" + test -n "$@" && echo Enter password to try to manually fix. + cat << HERE +After fixing run exit to continue this script, or reboot -f to retry, or +touch /takeover and exit to become PID 1 allowing editing of this script. +HERE + + while ! sulogin && ! test -f /takeover + do + echo getty failed, retrying + done + + # Touch /takeover in the above getty to become pid 1 + if test -e /takeover + then + cat << HERE + +Takeover of init requested. Executing /bin/sh as PID 1. +When finished exec new init or cleanup and run reboot -f. + +Warning: No job control! Shell exit will panic the system! +HERE + export PS1=init#\ + exec /bin/sh + fi +} + +rofs=$(findmtd rofs) +rwfs=$(findmtd rwfs) + +rodev=/dev/mtdblock${rofs#mtd} +rwdev=/dev/mtdblock${rwfs#mtd} + +# Set to y for yes, anything else for no. +force_rwfst_jffs2=y +flash_images_before_init=n +consider_download_files=y +consider_download_tftp=y +consider_download_http=y +consider_download_ftp=y + +rofst=squashfs +rwfst=$(probe_fs_type $rwdev) +roopts=ro +rwopts=rw + +image=/run/initramfs/image- +trigger=${image}rwfs + +init=/sbin/init +fsckbase=/sbin/fsck. +fsck=$fsckbase$rwfst +fsckopts=-a +optfile=/run/initramfs/init-options +optbase=/run/initramfs/init-options-base +urlfile=/run/initramfs/init-download-url +update=/run/initramfs/update + +if test -e /${optfile##*/} +then + cp /${optfile##*/} $optfile +fi + +if test -e /${optbase##*/} +then + cp /${optbase##*/} $optbase +else + touch $optbase +fi + +if test ! -f $optfile +then + cat /proc/cmdline $optbase > $optfile + get_fw_env_var openbmcinit >> $optfile + get_fw_env_var openbmconce >> $optfile +fi + +echo rofs = $rofs $rofst rwfs = $rwfs $rwfst + +if grep -w debug-init-sh $optfile +then + debug_takeover "Debug initial shell requested by command line." +fi + +if test "x$consider_download_files" = xy && + grep -w openbmc-init-download-files $optfile +then + if test -f ${urlfile##*/} + then + cp ${urlfile##*/} $urlfile + fi + if test ! -f $urlfile + then + get_fw_env_var openbmcinitdownloadurl > $urlfile + fi + url="$(cat $urlfile)" + rest="${url#*://}" + proto="${url%$rest}" + + if test -z "$url" + then + echo "Download url empty. Ignoring download request." + elif test -z "$proto" + then + echo "Download failed." + elif test "$proto" = tftp:// + then + if test "x$consider_download_tftp" = xy + then + try_tftp "$url" + else + echo "Download failed." + fi + elif test "$proto" = http:// + then + if test "x$consider_download_http" = xy + then + try_wget "$url" + else + echo "Download failed." + fi + elif test "$proto" = ftp:// + then + if test "x$consider_download_ftp" = xy + then + try_wget "$url" + else + echo "Download failed." + fi + else + echo "Download failed." + fi +fi + +# If there are images in root move them to /run/initramfs/ or /run/ now. +imagebasename=${image##*/} +if test -n "${imagebasename}" && ls /${imagebasename}* > /dev/null 2>&1 +then + if test "x$flash_images_before_init" = xy + then + echo "Flash images found, will update before starting init." + mv /${imagebasename}* ${image%$imagebasename} + else + echo "Flash images found, will use but deferring flash update." + mv /${imagebasename}* /run/ + fi +fi + +if grep -w clean-rwfs-filesystem $optfile +then + echo "Cleaning of read-write overlay filesystem requested." + touch $trigger +fi + +if grep -w factory-reset $optfile +then + echo "Factory reset requested." + touch $trigger + do_save=--no-save-files +else + do_save=--save-files +fi + +if test "x$force_rwfst_jffs2" = xy -a $rwfst != jffs2 -a ! -f $trigger +then + echo "Converting read-write overlay filesystem to jffs2 forced." + touch $trigger +fi + +if ls $image* > /dev/null 2>&1 +then + if ! test -x $update + then + debug_takeover "Flash update requested but $update missing!" + elif test -f $trigger -a ! -s $trigger + then + if [ $do_save = "--save-files" ] + then + echo "Saving selected files from read-write overlay filesystem." + else + echo "No files will be selected for save." + fi + $update --no-restore-files $do_save + echo "Clearing read-write overlay filesystem." + flash_eraseall /dev/$rwfs + echo "Restoring saved files to read-write overlay filesystem." + touch $trigger + $update --no-save-files --clean-saved-files + else + $update --clean-saved-files $do_save + fi + + rwfst=$(probe_fs_type $rwdev) + fsck=$fsckbase$rwfst +fi + +if grep -w overlay-filesystem-in-ram $optfile +then + rwfst=none +fi + +copyfiles= +if grep -w copy-files-to-ram $optfile +then + rwfst=none + copyfiles=y +fi + +# It would be nice to do this after fsck but that mean rofs is mounted +# which triggers the mtd is mounted check +if test "$rwfst$copyfiles" = noney +then + touch $trigger + $update --copy-files --clean-saved-files --no-restore-files +fi + +if grep -w copy-base-filesystem-to-ram $optfile && + test ! -e /run/image-rofs && ! cp $rodev /run/image-rofs +then + # Remove any partial copy to avoid attempted usage later + if test -e /run/image-rofs + then + ls -l /run/image-rofs + rm -f /run/image-rofs + fi + debug_takeover "Copying $rodev to /run/image-rofs failed." +fi + +if test -s /run/image-rofs +then + rodev=/run/image-rofs + roopts=$roopts,loop +fi + +mount $rodev $rodir -t $rofst -o $roopts + +if test -x $rodir$fsck +then + for fs in $fslist + do + mount --bind $fs $rodir/$fs + done + chroot $rodir $fsck $fsckopts $rwdev + rc=$? + for fs in $fslist + do + umount $rodir/$fs + done + if test $rc -gt 1 + then + debug_takeover "fsck of read-write fs on $rwdev failed (rc=$rc)" + fi +elif test "$rwfst" != jffs2 -a "$rwfst" != none +then + echo "No '$fsck' in read only fs, skipping fsck." +fi + +if test "$rwfst" = none +then + echo "Running with read-write overlay in RAM for this boot." + echo "No state will be preserved unless flash update performed." +elif ! mount $rwdev $rwdir -t $rwfst -o $rwopts +then + msg="$(cat)" << HERE + +Mounting read-write $rwdev filesystem failed. Please fix and run + mount $rwdev $rwdir -t $rwfst -o $rwopts +to to continue, or do change nothing to run from RAM for this boot. +HERE + debug_takeover "$msg" +fi + +rm -rf $work +mkdir -p $upper $work + +mount -t overlay -o lowerdir=$rodir,upperdir=$upper,workdir=$work cow /root + +while ! chroot /root /bin/sh -c "test -x '$init' -a -s '$init'" +do + msg="$(cat)" << HERE + +Unable to confirm /sbin/init is an executable non-empty file +in merged file system mounted at /root. + +Change Root test failed! Invoking emergency shell. +HERE + debug_takeover "$msg" +done + +for f in $fslist +do + mount --move $f root/$f +done + +# switch_root /root $init +exec chroot /root $init + diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-shutdown.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-shutdown.sh new file mode 100644 index 0000000000..d3c8835959 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-shutdown.sh @@ -0,0 +1,102 @@ +#!/bin/sh + +echo shutdown: "$@" + +export PS1=shutdown-sh#\ +# exec bin/sh + +cd / +if [ ! -e /proc/mounts ] +then + mkdir -p /proc + mount proc /proc -tproc + umount_proc=1 +else + umount_proc= +fi + +# Remove an empty oldroot, that means we are not invoked from systemd-shutdown +rmdir /oldroot 2>/dev/null + +# Move /oldroot/run to /mnt in case it has the underlying rofs loop mounted. +# Ordered before /oldroot the overlay is unmounted before the loop mount +mkdir -p /mnt +mount --move /oldroot/run /mnt + +set -x +for f in $( awk '/oldroot|mnt/ { print $2 }' < /proc/mounts | sort -r ) +do + umount $f +done +set +x + +update=/run/initramfs/update +image=/run/initramfs/image- + +wdt="-t 1 -T 5" +wdrst="-T 15" + +if ls $image* > /dev/null 2>&1 +then + if test -x $update + then + if test -c /dev/watchdog + then + echo Pinging watchdog ${wdt+with args $wdt} + watchdog $wdt -F /dev/watchdog & + wd=$! + else + wd= + fi + $update --clean-saved-files + remaining=$(ls $image*) + if test -n "$remaining" + then + echo 1>&2 "Flash update failed to flash these images:" + echo 1>&2 "$remaining" + else + echo "Flash update completed." + fi + + if test -n "$wd" + then + kill -9 $wd + if test -n "$wdrst" + then + echo Resetting watchdog timeouts to $wdrst + watchdog $wdrst -F /dev/watchdog & + sleep 1 + # Kill the watchdog daemon, setting a timeout + # for the remaining shutdown work + kill -9 $! + fi + fi + else + echo 1>&2 "Flash update requested but $update program missing!" + fi +fi + +echo Remaining mounts: +cat /proc/mounts + +test "$umount_proc" && umount /proc && rmdir /proc + +# tcsattr(tty, TIOCDRAIN, mode) to drain tty messages to console +test -t 1 && stty cooked 0<&1 + +# Execute the command systemd told us to ... +if test -d /oldroot && test "$1" +then + if test "$1" = kexec + then + $1 -f -e + else + $1 -f + fi +fi + + +echo "Execute ${1-reboot} -f if all unmounted ok, or exec /init" + +export PS1=shutdown-sh#\ +exec /bin/sh diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh new file mode 100755 index 0000000000..278cd41d7b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/obmc-update.sh @@ -0,0 +1,274 @@ +#!/bin/sh + +echo update: "$@" + +echoerr() { + echo 1>&2 "ERROR: $@" +} + +cd / +if ! test -r /proc/mounts || ! test -f /proc/mounts +then + mkdir -p /proc + mount -t proc proc proc +fi +if ! test -d /sys/class +then + mkdir -p /sys + mount -t sysfs sys sys +fi +if ! test -c /dev/null +then + mkdir -p /dev + mount -t devtmpfs dev dev +fi + +# mtd number N with mtd name Name can be mounted via mtdN, or mtd:Name +# (with a mtd aware fs) or by /dev/mtdblockN (with a mtd or block fs). +mtdismounted() { + m=${1##mtd} + if grep -s "mtdblock$m " /proc/mounts || grep -s "mtd$m " /proc/mounts + then + return 0 + fi + n=$(cat /sys/class/mtd/mtd$m/name) + if test -n "$n" && grep -s "mtd:$n " /proc/mounts + then + return 0 + fi + return 1 +} + +# Detect child partitions when the whole flash is to be updated. +# Ignore mtdNro and mtdblockN names in the class subsystem directory. +childmtds() { + for m in /sys/class/mtd/$1/mtd* + do + m=${m##*/} + if test "${m%ro}" = "${m#mtdblock}" + then + echo $m + fi + done +} + +toobig() { + if test $(stat -L -c "%s" "$1") -gt $(cat /sys/class/mtd/"$2"/size) + then + return 0 + fi + return 1 +} + +findmtd() { + m=$(grep -xl "$1" /sys/class/mtd/*/name) + m=${m%/name} + m=${m##*/} + echo $m +} + +blkid_fs_type() { + # Emulate util-linux's `blkid -s TYPE -o value $1` + # Example busybox blkid output: + # # blkid /dev/mtdblock5 + # /dev/mtdblock5: TYPE="squashfs" + # Process output to extract TYPE value "squashfs". + blkid $1 | sed -e 's/^.*TYPE="//' -e 's/".*$//' +} + +probe_fs_type() { + fst=$(blkid_fs_type $1) + echo ${fst:=jffs2} +} + +rwfs=$(findmtd rwfs) + +rwdev=/dev/mtdblock${rwfs#mtd} +rwopts=rw +rorwopts=ro${rwopts#rw} + +rwdir=/run/initramfs/rw +upper=$rwdir/cow +save=/run/save/${upper##*/} + +mounted= +doflash=y +doclean= +dosave=y +dorestore=y +toram= +checksize=y +checkmount=y + +whitelist=/run/initramfs/whitelist +image=/run/initramfs/image- +imglist= + +while test "$1" != "${1#-}" +do + case "$1" in + --help) + cat <<HERE +Usage: $0 [options] -- Write images in /run/initramfs to flash (/dev/mtd*) + --help Show this message + --no-flash Don't attempt to write images to flash + --ignore-size Don't compare image size to mtd device size + --ignore-mount Don't check if destination is mounted + --save-files Copy whitelisted files to save directory in RAM + --no-save-files Don't copy whitelisted files to save directory + --copy-files Copy files from save directory to rwfs mountpoint + --restore-files Restore files from save directory to rwfs layer + --no-restore-files Don't restore saved files from ram to rwfs layer + --clean-saved-files Delete saved whitelisted files from RAM + --no-clean-saved-files Retain saved whitelisted files in RAM +HERE + + exit 0 ;; + + --no-clean-saved-files) + doclean= + shift ;; + --clean-saved-files) + doclean=y + shift ;; + --no-save-files) + dosave= + shift ;; + --save-files) + dosave=y + shift ;; + --no-restore-files) + dorestore= + shift ;; + --restore-files) + dorestore=y + shift ;; + --no-flash) + doflash= + shift ;; + --ignore-size) + checksize= + shift ;; + --ignore-mount) + checkmount= + doflash= + shift ;; + --copy-files) + toram=y + shift ;; + *) + echoerr "Unknown option $1. Try $0 --help." + exit 1 ;; + esac +done + +if test "x$dosave" = xy +then + if test ! -d $upper -a -n "$rwfs" + then + mkdir -p $rwdir + mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rorwopts + mounted=$rwdir + fi + + while read f + do + # Entries shall start with /, no trailing /.. or embedded /../ + if test "/${f#/}" != "$f" -o "${f%/..}" != "${f#*/../}" + then + echo 1>&2 "WARNING: Skipping bad whitelist entry $f." + continue + fi + if ! test -e "$upper/$f" + then + continue + fi + d="$save/$f" + while test "${d%/}" != "${d%/.}" + do + d="${d%/.}" + d="${d%/}" + done + mkdir -p "${d%/*}" + cp -rp "$upper/$f" "${d%/*}/" + done < $whitelist + + if test -n "$mounted" + then + umount $mounted + fi +fi + +imglist=$(echo $image*) +if test "$imglist" = "$image*" -a ! -e "$imglist" +then + # shell didn't expand the wildcard, so no files exist + echo "No images found to update." + imglist= +fi + +for f in $imglist +do + m=$(findmtd ${f#$image}) + if test -z "$m" + then + echoerr "Unable to find mtd partition for ${f##*/}." + exit 1 + fi + if test -n "$checksize" && toobig "$f" "$m" + then + echoerr "Image ${f##*/} too big for $m." + exit 1 + fi + for s in $m $(childmtds $m) + do + if test -n "$checkmount" && mtdismounted $s + then + echoerr "Device $s is mounted, ${f##*/} is busy." + exit 1 + fi + done +done + +if test -n "$doflash" +then + for f in $imglist + do + if test ! -s $f + then + echo "Skipping empty update of ${f#$image}." + rm $f + continue + fi + m=$(findmtd ${f#$image}) + echo "Updating ${f#$image}..." + flashcp -v $f /dev/$m && rm $f + done +fi + +if test -d $save -a "x$toram" = xy +then + mkdir -p $upper + cp -rp $save/. $upper/ +fi + +if test -d $save -a "x$dorestore" = xy +then + odir=$rwdir + rwdir=/run/rw + upper=$rwdir${upper#$odir} + + mkdir -p $rwdir + mount $rwdev $rwdir -t $(probe_fs_type $rwdev) -o $rwopts + mkdir -p $upper + cp -rp $save/. $upper/ + umount $rwdir + rmdir $rwdir +fi + +if test "x$doclean" = xy +then + rm -rf $save +fi + +exit diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/files/whitelist b/meta-phosphor/recipes-phosphor/initrdscripts/files/whitelist new file mode 100644 index 0000000000..20f1ec2a6d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/initrdscripts/files/whitelist @@ -0,0 +1,13 @@ +/etc/dropbear/dropbear_rsa_host_key +/etc/group +/etc/gshadow +/etc/machine-id +/etc/passwd +/etc/resolv.conf +/etc/shadow +/etc/systemd/network +/var/cache/obmc +/var/lib/obmc +/var/lib/phosphor-inventory-manager +/var/lib/phosphor-settings-manager +/var/lib/phosphor-state-manager diff --git a/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb b/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb new file mode 100644 index 0000000000..ab2c38e90e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/initrdscripts/obmc-phosphor-initfs.bb @@ -0,0 +1,35 @@ +SUMMARY = "Phosphor OpenBMC pre-init scripts" +DESCRIPTION = "Phosphor OpenBMC filesystem mount reference implementation." +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +PR = "r1" + +inherit allarch + +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_base-utils}" + +S = "${WORKDIR}" +SRC_URI += "file://obmc-init.sh" +SRC_URI += "file://obmc-shutdown.sh" +SRC_URI += "file://obmc-update.sh" +SRC_URI += "file://whitelist" + +do_install() { + for f in init-download-url init-options + do + if test -e $f + then + install -m 0755 ${WORKDIR}/$f ${D}/$f + fi + done + install -m 0755 ${WORKDIR}/obmc-init.sh ${D}/init + install -m 0755 ${WORKDIR}/obmc-shutdown.sh ${D}/shutdown + install -m 0755 ${WORKDIR}/obmc-update.sh ${D}/update + install -m 0644 ${WORKDIR}/whitelist ${D}/whitelist + install -d ${D}/dev + mknod -m 622 ${D}/dev/console c 5 1 +} + +FILES_${PN} += " /init /shutdown /update /whitelist /dev " +FILES_${PN} += " /init-options /init-download-url " diff --git a/meta-phosphor/recipes-phosphor/interfaces/bmcweb.bb b/meta-phosphor/recipes-phosphor/interfaces/bmcweb.bb new file mode 100644 index 0000000000..c0f53251f6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/bmcweb.bb @@ -0,0 +1,34 @@ +inherit obmc-phosphor-systemd +inherit useradd + +USERADD_PACKAGES = "${PN}" + +# add a user called httpd for the server to assume +USERADD_PARAM_${PN} = "-r -s /usr/sbin/nologin bmcweb" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENCE;md5=a6a4edad4aed50f39a66d098d74b265b" + +SRC_URI = "git://github.com/openbmc/bmcweb.git" + +PV = "1.0+git${SRCPV}" +SRCREV = "a38b0b206300c792979b900f506b85e535f5708a" + +S = "${WORKDIR}/git" + +DEPENDS = "openssl zlib boost libpam sdbusplus gtest nlohmann-json libtinyxml2 " + +FILES_${PN} += "${datadir}/** " + +inherit cmake + +EXTRA_OECMAKE = "-DBMCWEB_BUILD_UT=OFF -DYOCTO_DEPENDENCIES=ON" + +SYSTEMD_SERVICE_${PN} += "bmcweb.service bmcweb.socket" + +FULL_OPTIMIZATION = "-Os -pipe " + +do_install_append() { + rm -rf ${D}${includedir}/dbus + rm -rf ${D}${libdir}/cmake +} diff --git a/meta-phosphor/recipes-phosphor/interfaces/bmcweb/bmcweb.service b/meta-phosphor/recipes-phosphor/interfaces/bmcweb/bmcweb.service new file mode 100644 index 0000000000..86a7279a50 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/bmcweb/bmcweb.service @@ -0,0 +1,13 @@ +[Unit] +Description=Start bmcweb server + +Wants=network.target +After=network.target + +[Service] +ExecStart={bindir}/bmcweb +Type=simple +WorkingDirectory=/home/root + +[Install] +WantedBy=network.target diff --git a/meta-phosphor/recipes-phosphor/interfaces/bmcweb/bmcweb.socket b/meta-phosphor/recipes-phosphor/interfaces/bmcweb/bmcweb.socket new file mode 100644 index 0000000000..b1db27d475 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/bmcweb/bmcweb.socket @@ -0,0 +1,9 @@ +[Unit] +Description=BMC Webserver socket + +[Socket] +ListenStream=883 +ReusePort=true + +[Install] +WantedBy=sockets.target diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent.bb b/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent.bb new file mode 100644 index 0000000000..0150571208 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent.bb @@ -0,0 +1,21 @@ +SUMMARY = "python-gevent startup script" +DESCRIPTION = "python-gevent startup script." +PR = "r1" + +inherit allarch +inherit setuptools +inherit obmc-phosphor-systemd + +require phosphor-rest.inc + +PROVIDES += "virtual/obmc-wsgihost" +RPROVIDES_${PN} += "virtual-obmc-wsgihost" + +RDEPENDS_${PN} += " \ + python-gevent \ + " +RRECOMMENDS_${PN} += "python-gevent-websocket" + +S = "${WORKDIR}/git/servers/gevent" + +SYSTEMD_SERVICE_${PN} += " ${PN}.service ${PN}.socket" diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent/phosphor-gevent.service b/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent/phosphor-gevent.service new file mode 100644 index 0000000000..2dfc4cc10f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent/phosphor-gevent.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor Webserver +After=phosphor-gevent.socket +After=obmc-webserver-pre.target + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-gevent $APPLICATION +SyslogIdentifier=phosphor-gevent +Environment="PYTHONUNBUFFERED=1" +EnvironmentFile={envfiledir}/obmc/wsgi_app diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent/phosphor-gevent.socket b/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent/phosphor-gevent.socket new file mode 100644 index 0000000000..1ee86da087 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-gevent/phosphor-gevent.socket @@ -0,0 +1,8 @@ +[Unit] +Description=Phosphor Webserver socket + +[Socket] +ListenStream=443 + +[Install] +WantedBy=sockets.target diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest.bb b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest.bb new file mode 100644 index 0000000000..f18e55caa8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest.bb @@ -0,0 +1,42 @@ +SUMMARY = "Phosphor DBUS to REST WSGI Application" +DESCRIPTION = "Phosphor DBUS to REST WSGI Application." +PR = "r1" + +inherit allarch +inherit obmc-phosphor-systemd +inherit setuptools +inherit obmc-phosphor-discovery-service + +require phosphor-rest.inc + +RRECOMMENDS_${PN} += " \ + virtual-obmc-wsgihost \ + python-gevent-websocket \ + " + +RDEPENDS_${PN} += " \ + python-xml \ + python-dbus \ + phosphor-mapper \ + python-bottle \ + python-spwd \ + pyphosphor-utils \ + pyphosphor-dbus \ + pyphosphor-wsgi-apps-ns \ + " +SRC_URI += "file://url_config.json \ + " + +FILES_${PN}_append = " ${datadir}/rest-dbus/url_config.json" + +S = "${WORKDIR}/git/module" +SYSTEMD_SERVICE_${PN} = "" +SYSTEMD_OVERRIDE_${PN} += "rest-dbus.conf:obmc-mapper.target.d/rest-dbus.conf" +SYSTEMD_ENVIRONMENT_FILE_${PN} += "obmc/wsgi_app" +REGISTERED_SERVICES_${PN} += "phosphor_rest:tcp:443" + +do_install_append(){ + install -d ${D}${datadir}/rest-dbus + install -m 0644 -D ${WORKDIR}/url_config.json \ + ${D}${datadir}/rest-dbus/url_config.json +} diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest.inc b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest.inc new file mode 100644 index 0000000000..46aeb8bb56 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest.inc @@ -0,0 +1,7 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-rest-server" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +SRC_URI += "git://github.com/openbmc/phosphor-rest-server" +SRCREV = "6691e7ca4e2adf52bac1fc3a82ed35adfce4349c" + diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/obmc/wsgi_app b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/obmc/wsgi_app new file mode 100644 index 0000000000..7bbffe74ef --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/obmc/wsgi_app @@ -0,0 +1 @@ +APPLICATION=rest_dbus diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/rest-dbus.conf b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/rest-dbus.conf new file mode 100644 index 0000000000..a92f0f1ecf --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/rest-dbus.conf @@ -0,0 +1,3 @@ +[Unit] +Wants=obmc-webserver-pre.target +Before=obmc-webserver-pre.target diff --git a/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/url_config.json b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/url_config.json new file mode 100644 index 0000000000..d11b555b95 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/phosphor-rest/url_config.json @@ -0,0 +1,13 @@ +{ + "urls": [ + "/org/openbmc/*", + "/xyz/openbmc_project/*", + "/enumerate", + "/list", + "/login", + "/logout", + "/subscribe", + "/upload/image", + "/download/dump/*" + ] +} diff --git a/meta-phosphor/recipes-phosphor/interfaces/rest-dbus.bb b/meta-phosphor/recipes-phosphor/interfaces/rest-dbus.bb new file mode 100644 index 0000000000..9d4217b7ad --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/rest-dbus.bb @@ -0,0 +1,25 @@ +SUMMARY = "Phosphor OpenBMC REST framework" +DESCRIPTION = "Phosphor OpenBMC REST to DBUS daemon." +HOMEPAGE = "http://github.com/openbmc/rest-dbus" +PR = "r1" + +inherit allarch +inherit obmc-phosphor-license +inherit obmc-phosphor-systemd +inherit setuptools + +RDEPENDS_${PN} += " \ + python-netserver \ + python-json \ + python-dbus \ + python-xml \ + pyphosphor-dbus \ + " + +SYSTEMD_SERVICE_${PN} += "rest-dbus.service rest-dbus.socket" + +SRC_URI += "git://github.com/openbmc/rest-dbus.git" + +SRCREV = "3084b80c489c10b03207c8fb97d4437fd760f30d" + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/interfaces/rest-dbus/rest-dbus.service b/meta-phosphor/recipes-phosphor/interfaces/rest-dbus/rest-dbus.service new file mode 100644 index 0000000000..9afd0c45d5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/rest-dbus/rest-dbus.service @@ -0,0 +1,8 @@ +[Unit] +Description=Phosphor DBUS Browser + +[Service] +Restart=always +ExecStart=/usr/bin/env rest-dbus +SyslogIdentifier=rest-dbus +Environment="PYTHONUNBUFFERED=1" diff --git a/meta-phosphor/recipes-phosphor/interfaces/rest-dbus/rest-dbus.socket b/meta-phosphor/recipes-phosphor/interfaces/rest-dbus/rest-dbus.socket new file mode 100644 index 0000000000..7ab1959256 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/rest-dbus/rest-dbus.socket @@ -0,0 +1,8 @@ +[Unit] +Description=Phosphor DBUS Browser socket + +[Socket] +ListenStream=3000 + +[Install] +WantedBy=sockets.target diff --git a/meta-phosphor/recipes-phosphor/interfaces/slpd-lite.bb b/meta-phosphor/recipes-phosphor/interfaces/slpd-lite.bb new file mode 100644 index 0000000000..608796b360 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/slpd-lite.bb @@ -0,0 +1,19 @@ +SUMMARY = "Lightweight SLP Server" +DESCRIPTION = "Lightweight Unicast-only SLP Server" +HOMEPAGE = "http://github.com/openbmc/slpd-lite" +PR = "r1" + +inherit autotools pkgconfig +inherit obmc-phosphor-license +inherit obmc-phosphor-systemd + +SYSTEMD_SERVICE_${PN} += "slpd-lite.service" + +DEPENDS += "systemd" +DEPENDS += "autoconf-archive-native" + +SRC_URI += "git://github.com/openbmc/slpd-lite" + +SRCREV = "1f12e3805a69e8f7e5dada4b40e5c0860938a227" + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/interfaces/slpd-lite/slpd-lite.service b/meta-phosphor/recipes-phosphor/interfaces/slpd-lite/slpd-lite.service new file mode 100644 index 0000000000..5d587093f3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/interfaces/slpd-lite/slpd-lite.service @@ -0,0 +1,12 @@ +[Unit] +Description=Lightweight SLP Server + +After=network.target + +[Service] +ExecStart=/usr/bin/env slpd +SyslogIdentifier=slpd +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/inventory/obmc-inventory.bb b/meta-phosphor/recipes-phosphor/inventory/obmc-inventory.bb new file mode 100644 index 0000000000..db3a5b404c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/obmc-inventory.bb @@ -0,0 +1,31 @@ +SUMMARY = "Phosphor Inventory Generation" +DESCRIPTION = "Generates inventory data from the machine readable workbook" +PR = "r1" + +inherit mrw-xml + +S = "${WORKDIR}/git" + +PROVIDES += "virtual/obmc-inventory-data" +RPROVIDES_${PN} += "virtual-obmc-inventory-data" + +inherit allarch +inherit obmc-phosphor-license +inherit mrw-rev + +DEPENDS += "mrw-native mrw-api-native" + +SRC_URI += "${MRW_TOOLS_SRC_URI}" +SRCREV = "${MRW_TOOLS_SRCREV}" + +FILES_${PN} += "${datadir}/inventory" + +do_compile() { + ${STAGING_BINDIR_NATIVE}/perl-native/perl ${S}/inventory.pl \ + -x ${STAGING_DIR_NATIVE}${mrw_datadir}/${MRW_XML} -o inventory.json +} + +do_install() { + install -d ${D}${datadir}/inventory + install -m 0644 inventory.json ${D}${datadir}/inventory/inventory.json +} diff --git a/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-assettag-native.bb b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-assettag-native.bb new file mode 100644 index 0000000000..fe9e6ed053 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-assettag-native.bb @@ -0,0 +1,20 @@ +SUMMARY = "Recipe to create AssetTag property in inventory manager" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-inventory-manager + +PROVIDES += "virtual/phosphor-inventory-manager-assettag" + +SRC_URI += "file://assettag.yaml" + +S = "${WORKDIR}" + +do_install() { + # This recipe would provide the yaml for inventory manager to + # create AssetTag property at startup + + install -d ${D}${base_datadir}/events.d/ + install assettag.yaml ${D}${base_datadir}/events.d/assettag.yaml +} diff --git a/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-assettag/assettag.yaml b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-assettag/assettag.yaml new file mode 100644 index 0000000000..d3a0104b97 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-assettag/assettag.yaml @@ -0,0 +1,14 @@ +events: + - name: Creating AssetTag at startup + description: > + Create /system at startup and populate the AssetTag property with + empty string. + type: startup + actions: + - name: createObjects + objs: + /system: + xyz.openbmc_project.Inventory.Decorator.AssetTag: + AssetTag: + value: "" + type: string diff --git a/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-config-native.bb b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-config-native.bb new file mode 100644 index 0000000000..0b1c4533d5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager-config-native.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor Inventory Manager Configuration" +DESCRIPTION = "Meta-recipe, pulling in native recipes that wish to add \ +data to the native /usr/share/phosphor-inventory-manager filesystem." +HOMEPAGE = "http://github.com/openbmc/phosphor-inventory-manager" +PR = "r1" + +inherit obmc-phosphor-license +inherit native + +PHOSPHOR_INVENTORY_MANAGER_CONFIGS += "phosphor-inventory-manager-assettag-native" + +# To add additional managed inventory items, create a recipe in your layer, +# and add it to PHOSPHOR_INVENTORY_MANAGER_CONFIGS with a bbappend to this recipe. + +DEPENDS += "${PHOSPHOR_INVENTORY_MANAGER_CONFIGS}" diff --git a/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager.bb b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager.bb new file mode 100644 index 0000000000..46a1d2904b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager.bb @@ -0,0 +1,45 @@ +SUMMARY = "Phosphor Inventory Manager" +DESCRIPTION = "Phosphor Inventory Manager is an inventory object \ +lifecycle management application, suitable for use on a wide variety \ +of OpenBMC platforms." +PR = "r1" + +inherit autotools \ + pkgconfig \ + pythonnative \ + phosphor-dbus-yaml \ + phosphor-inventory-manager \ + obmc-phosphor-dbus-service + +require phosphor-inventory-manager.inc + +DEPENDS += " \ + ${PN}-config-native \ + phosphor-dbus-interfaces \ + phosphor-dbus-interfaces-native \ + phosphor-logging \ + sdbusplus \ + sdbusplus-native \ + autoconf-archive-native \ + cereal \ + " +RDEPENDS_${PN} += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " + +OBMC_INVENTORY_PATH="${OBMC_DBUS_PATH_ROOT}/inventory" +OBMC_INVENTORY_MGR_IFACE="${OBMC_DBUS_IFACE_ROOT}.Inventory.Manager" + +DBUS_SERVICE_${PN} = "${OBMC_INVENTORY_MGR_IFACE}.service" + +S = "${WORKDIR}/git" + +EXTRA_OECONF = " \ + YAML_PATH=${STAGING_DIR_NATIVE}${base_datadir} \ + BUSNAME=${OBMC_INVENTORY_MGR_IFACE} \ + INVENTORY_ROOT=${OBMC_INVENTORY_PATH} \ + IFACE=${OBMC_INVENTORY_MGR_IFACE} \ + IFACES_PATH=${STAGING_DIR_NATIVE}${yaml_dir} \ + " diff --git a/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager.inc b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager.inc new file mode 100644 index 0000000000..b65d568637 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-inventory-manager" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI = "git://github.com/openbmc/phosphor-inventory-manager" +SRCREV = "d6819c9fcc44b3691eeb98ef3675d553bb28eeeb" diff --git a/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager/xyz.openbmc_project.Inventory.Manager.service b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager/xyz.openbmc_project.Inventory.Manager.service new file mode 100644 index 0000000000..c3ae5adcc4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/inventory/phosphor-inventory-manager/xyz.openbmc_project.Inventory.Manager.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Inventory Manager +Before=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +Restart=always +Type=dbus +ExecStart=/usr/bin/env phosphor-inventory +SyslogIdentifier=phosphor-inventory +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-bt.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-bt.bb new file mode 100644 index 0000000000..8138803c55 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-bt.bb @@ -0,0 +1,26 @@ +SUMMARY = "Phosphor OpenBMC BT to DBUS" +DESCRIPTION = "Phosphor OpenBMC BT to DBUS." +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +DBUS_SERVICE_${PN} = "org.openbmc.HostIpmi.service" + +PROVIDES += "virtual/obmc-host-ipmi-hw" +RPROVIDES_${PN} += "virtual-obmc-host-ipmi-hw" +RRECOMMENDS_${PN} += "phosphor-ipmi-host" + +DEPENDS += "autoconf-archive-native" +DEPENDS += "systemd" +RDEPENDS_${PN} += "libsystemd" + +S = "${WORKDIR}/git" +SRC_URI += "git://github.com/openbmc/btbridge" +SRCREV="8fb36a936f9eb6662f0320d3c212995b8d9a7fca" + +# This is how linux-libc-headers says to include custom uapi headers +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +do_configure[depends] += "virtual/kernel:do_shared_workdir" diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-bt/org.openbmc.HostIpmi.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-bt/org.openbmc.HostIpmi.service new file mode 100644 index 0000000000..f5abfb5ffd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-bt/org.openbmc.HostIpmi.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor IPMI BT DBus Bridge + +[Service] +Restart=always +ExecStart=/usr/bin/env btbridged +SyslogIdentifier=btbridged +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory-native.bb new file mode 100644 index 0000000000..33c2aba90d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory-native.bb @@ -0,0 +1,21 @@ +SUMMARY = "Sample channel configuration for phosphor-host-ipmid" +PR = "r1" + +inherit native +inherit phosphor-ipmi-host +inherit obmc-phosphor-license + +PROVIDES += "virtual/phosphor-ipmi-channel-config" + +SRC_URI += "file://channel.yaml" + +S = "${WORKDIR}" + +do_install() { + # This recipe is supposed to create an output yaml file with + # a sample output file. + + DEST=${D}${sensor_datadir} + install -d ${DEST} + install channel.yaml ${DEST}/channel.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory/channel.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory/channel.yaml new file mode 100644 index 0000000000..819f25198f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-channel-inventory/channel.yaml @@ -0,0 +1,6 @@ +# Channel Number (must be unique) is the key +1: + # ifName the ethernet device name (used in the dbus path) + ifName: eth0 +2: + ifName: eth1 diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config.bb new file mode 100644 index 0000000000..933fd3b48c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config.bb @@ -0,0 +1,40 @@ +SUMMARY = "Phosphor IPMI daemon configuration" +PR = "r1" + +inherit obmc-phosphor-license +inherit allarch + +SRC_URI = " \ + file://cipher_list.json \ + file://dcmi_cap.json \ + file://dcmi_sensors.json \ + file://dev_id.json \ + file://power_reading.json \ + " + +FILES_${PN} = " \ + ${datadir}/ipmi-providers/cipher_list.json \ + ${datadir}/ipmi-providers/dcmi_cap.json \ + ${datadir}/ipmi-providers/dcmi_sensors.json \ + ${datadir}/ipmi-providers/dev_id.json \ + ${datadir}/ipmi-providers/power_reading.json \ + " + +do_fetch[noexec] = "1" +do_patch[noexec] = "1" +do_configure[noexec] = "1" +do_compile[noexec] = "1" + +do_install() { + install -d ${D}${datadir}/ipmi-providers + install -m 0644 -D ${WORKDIR}/cipher_list.json \ + ${D}${datadir}/ipmi-providers/cipher_list.json + install -m 0644 -D ${WORKDIR}/dcmi_cap.json \ + ${D}${datadir}/ipmi-providers/dcmi_cap.json + install -m 0644 -D ${WORKDIR}/dcmi_sensors.json \ + ${D}${datadir}/ipmi-providers/dcmi_sensors.json + install -m 0644 -D ${WORKDIR}/dev_id.json \ + ${D}${datadir}/ipmi-providers/dev_id.json + install -m 0644 -D ${WORKDIR}/power_reading.json \ + ${D}${datadir}/ipmi-providers/power_reading.json +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/cipher_list.json b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/cipher_list.json new file mode 100644 index 0000000000..767fc708c5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/cipher_list.json @@ -0,0 +1,14 @@ +{ + "a":{ + "cipher":3, + "authentication":1, + "integrity":1, + "confidentiality":1 + }, + "b":{ + "cipher":17, + "authentication":3, + "integrity":4, + "confidentiality":1 + } +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dcmi_cap.json b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dcmi_cap.json new file mode 100644 index 0000000000..2d88320819 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dcmi_cap.json @@ -0,0 +1,17 @@ +{ + "PowerManagement": 1, + "OOBSecondaryLan": 0, + "SerialTMODE": 0, + "InBandSystemInterfaceChannel": 1, + "SELAutoRollOver": 1, + "FlushEntireSELUponRollOver": 0, + "RecordLevelSELFlushUponRollOver": 0, + "NumberOfSELEntries": 200, + "TempMonitoringSamplingFreq":0, + "PowerMgmtDeviceSlaveAddress": 0, + "BMCChannelNumber": 0, + "DeviceRivision": 0, + "MandatoryPrimaryLanOOBSupport": 1, + "OptionalSecondaryLanOOBSupport": 255, + "OptionalSerialOOBMTMODECapability": 255 +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dcmi_sensors.json b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dcmi_sensors.json new file mode 100644 index 0000000000..502f6d1625 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dcmi_sensors.json @@ -0,0 +1,8 @@ +{ + "inlet": [ + ], + "baseboard": [ + ], + "cpu": [ + ] +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json new file mode 100644 index 0000000000..3440e0b2fd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json @@ -0,0 +1,2 @@ +{"id": 0, "revision": 0, "addn_dev_support": 0, + "manuf_id": 0, "prod_id": 0, "aux": 0} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/power_reading.json b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/power_reading.json new file mode 100644 index 0000000000..f3d051f6eb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-config/power_reading.json @@ -0,0 +1,3 @@ +{ + "path": "" +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-hostfw-config-example-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-hostfw-config-example-native.bb new file mode 100644 index 0000000000..aca1d0aabb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-hostfw-config-example-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "Sample hostfw inventory map for phosphor-ipmi-fru" +PR = "r1" + +inherit native +inherit phosphor-ipmi-fru + +require phosphor-ipmi-fru.inc + +PROVIDES += "virtual/phosphor-ipmi-fru-hostfw-config" + +S = "${WORKDIR}/git" + +do_install() { + DEST=${D}${hostfw_datadir} + install -d ${DEST} + + # TODO: copy example hostfw yaml to ${DEST}/config.yaml + # install fru-types.yaml ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-inventory-example-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-inventory-example-native.bb new file mode 100644 index 0000000000..acd98355ce --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-inventory-example-native.bb @@ -0,0 +1,20 @@ +SUMMARY = "Sample inventory map for phosphor-ipmi-fru" +PR = "r1" + +inherit native +inherit phosphor-ipmi-fru + +require phosphor-ipmi-fru.inc + +PROVIDES += "virtual/phosphor-ipmi-fru-inventory" + +S = "${WORKDIR}/git" + +do_install() { + # TODO: install this to inventory_datadir + # after ipmi-fru-parser untangles the host + # firmware config from the machine inventory. + DEST=${D}${config_datadir} + install -d ${DEST} + install scripts/example.yaml ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-inventory-mrw-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-inventory-mrw-native.bb new file mode 100644 index 0000000000..795c9b9c94 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-inventory-mrw-native.bb @@ -0,0 +1,29 @@ +SUMMARY = "Generate inventory map for phosphor-ipmi-fru from an MRW." +PR = "r1" + +inherit native +inherit phosphor-ipmi-fru +inherit mrw-xml + +require phosphor-ipmi-fru.inc + +DEPENDS += "mrw-native mrw-perl-tools-native" + +# TODO: remove this dependency after the MRW script +# has been updated to not require the hostfw metadata. +DEPENDS += "virtual/phosphor-ipmi-fru-hostfw-config" + +PROVIDES += "virtual/phosphor-ipmi-fru-inventory" + +S = "${WORKDIR}/git" +do_install() { + + DEST=${D}${config_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_ipmi_fru.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -m ${hostfw_datadir}/config.yaml \ + -o ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-merge-config-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-merge-config-native.bb new file mode 100644 index 0000000000..a44774ea1e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-merge-config-native.bb @@ -0,0 +1,23 @@ +SUMMARY = "To merge the Host and BMC config files generated from MRW " +DESCRIPTION = "Merge host provided FRU info config file, fru info config, \ +which is not sent by host config, and BMC accessible FRU info config \ +files generated by gen-ipmi-fru.pl into a single config file. \ +fru-gen parser parses the merged config file and generates cpp file" +PR = "r1" + +inherit native +inherit phosphor-ipmi-host +inherit obmc-phosphor-license + +DEPENDS += "virtual/phosphor-ipmi-fru-read-inventory" +DEPENDS += "virtual/phosphor-ipmi-fru-read-bmc-inventory" +DEPENDS += "virtual/phosphor-ipmi-fru-read-not-sent-by-host-inventory" +PROVIDES += "virtual/phosphor-ipmi-fru-merge-config" + +do_install_append() { + SRC=${config_datadir} + DEST=${D}${config_datadir} + install -d ${DEST} + cat ${SRC}/config.yaml ${SRC}/bmc-fru-config.yaml > ${DEST}/fru_config.yaml + cat ${SRC}/fru-config-not-sent-by-host.yaml >> ${DEST}/fru_config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-mrw-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-mrw-native.bb new file mode 100644 index 0000000000..0a1c8bd1d3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-mrw-native.bb @@ -0,0 +1,29 @@ +SUMMARY = "FRU properties config for ipmi-fru-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-fru +inherit mrw-xml + +SRC_URI += "file://config.yaml" + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-ipmi-fru-properties" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${properties_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_fru_properties.pl \ + -m ${mrw_datadir}/${MRW_XML} \ + -c config.yaml \ + -o ${DEST}/extra-properties.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-mrw/config.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-mrw/config.yaml new file mode 100644 index 0000000000..ad55610002 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-mrw/config.yaml @@ -0,0 +1,31 @@ +PROC: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Decorator.Cacheable: + Cached: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' + +DIMM: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Decorator.Cacheable: + Cached: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' + +SYS: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Decorator.Cacheable: + Cached: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' + +NODE: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'false' + xyz.openbmc_project.Inventory.Decorator.Cacheable: + Cached: 'false' + xyz.openbmc_project.Inventory.Item: + Present: 'true' diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-native.bb new file mode 100644 index 0000000000..8040f889d8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties-native.bb @@ -0,0 +1,22 @@ +SUMMARY = "FRU properties config for ipmi-fru-parser" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-fru + +SRC_URI += "file://extra-properties.yaml" + +PROVIDES += "virtual/phosphor-ipmi-fru-properties" + +S = "${WORKDIR}" + +do_install() { + # This recipe is supposed to create an output yaml file with + # FRU property values extracted from the MRW. This example recipe + # provides a sample output file. + + DEST=${D}${properties_datadir} + install -d ${DEST} + install extra-properties.yaml ${DEST} +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties/extra-properties.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties/extra-properties.yaml new file mode 100644 index 0000000000..626ef33b88 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-properties/extra-properties.yaml @@ -0,0 +1,11 @@ +/system/chassis/motherboard/cpu0: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'true' + xyz.openbmc_project.Inventory.Decorator.Cacheable: + Cached: 'true' + +/system/chassis/motherboard/dimm0: + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: 'true' + xyz.openbmc_project.Inventory.Decorator.Cacheable: + Cached: 'true' diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-bmc-inventory-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-bmc-inventory-native.bb new file mode 100644 index 0000000000..2f845d524d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-bmc-inventory-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "BMC accesible FRU inventory map for phosphor-ipmi-host" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-host + +SRC_URI += "file://bmc-fru-config.yaml" + +S = "${WORKDIR}" + +PROVIDES += "virtual/phosphor-ipmi-fru-read-bmc-inventory" + +do_install_append() { + DEST=${D}${config_datadir} + install -d ${DEST} + install bmc-fru-config.yaml ${DEST}/bmc-fru-config.yaml +} + diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-bmc-inventory/bmc-fru-config.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-bmc-inventory/bmc-fru-config.yaml new file mode 100644 index 0000000000..ac13efb44f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-bmc-inventory/bmc-fru-config.yaml @@ -0,0 +1,43 @@ +# A YAML similar to this sample would have to be generated, for eg with MRW +# inputs and system configuration, to depict IPMI FRU information. +# +# This file maps phosphor dbus inventory properties to IPMI properties +# +# This YAML could help generate C++ code. +# Format of the YAML: +# Fruid: +# Associated Fru paths +# d-bus Interfaces +# d-bus Properties +# IPMI Fru mapping +#5: +# /system/chassis/motherboard/fan1: +# xyz.openbmc_project.Inventory.Item: +# PrettyName: +# IPMIFruProperty: Product Name +# IPMIFruSection: Product +#6: +# /system/chassis/motherboard/boxelder/bmc: +# xyz.openbmc_project.Inventory.Item: +# PrettyName: +# IPMIFruProperty: Product Name +# IPMIFruSection: Board +# xyz.openbmc_project.Inventory.Decorator.Asset: +# BuildDate: +# IPMIFruProperty: Mfg Date +# IPMIFruSection: Board +# SerialNumber: +# IPMIFruProperty: Serial Number +# IPMIFruSection: Board +# PartNumber: +# IPMIFruProperty: Part Number +# IPMIFruSection: Board +# Manufacturer: +# IPMIFruProperty: Manufacturer +# IPMIFruSection: Board +#7: +# /system/chassis/motherboard/boxelder/bmc/ethernet: +# xyz.openbmc_project.Inventory.Item: +# PrettyName: +# IPMIFruProperty: Product Name +# IPMIFruSection: Product diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb new file mode 100644 index 0000000000..6031322f6e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-example-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "Sample inventory map for phosphor-ipmi-host" +PR = "r1" + +inherit native +inherit phosphor-ipmi-host + +require phosphor-ipmi-host.inc + +PROVIDES += "virtual/phosphor-ipmi-fru-read-inventory" + +S = "${WORKDIR}/git" + +do_install() { + DEST=${D}${config_datadir} + install -d ${DEST} + install scripts/fru-read-example.yaml ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb new file mode 100644 index 0000000000..3c5e36fce7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-inventory-mrw-native.bb @@ -0,0 +1,27 @@ +SUMMARY = "Generate inventory map for phosphor-ipmi-host from a MRW." +PR = "r1" + +inherit native +inherit phosphor-ipmi-host +inherit mrw-xml + +require phosphor-ipmi-host.inc + +DEPENDS += "mrw-native mrw-perl-tools-native" + +DEPENDS += "virtual/phosphor-ipmi-fru-hostfw-config" +PROVIDES += "virtual/phosphor-ipmi-fru-read-inventory" + +S = "${WORKDIR}/git" + +do_install() { + + DEST=${D}${config_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_ipmi_fru.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -m ${hostfw_datadir}/config.yaml \ + -o ${DEST}/config.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-not-sent-by-host-inventory-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-not-sent-by-host-inventory-native.bb new file mode 100644 index 0000000000..029e6a3b02 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-not-sent-by-host-inventory-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "The inventory map of frus not sent by host for phosphor-ipmi-host" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-host + +SRC_URI += "file://fru-config-not-sent-by-host.yaml" + +S = "${WORKDIR}" + +PROVIDES += "virtual/phosphor-ipmi-fru-read-not-sent-by-host-inventory" + +do_install_append() { + DEST=${D}${config_datadir} + install -d ${DEST} + install fru-config-not-sent-by-host.yaml ${DEST}/fru-config-not-sent-by-host.yaml +} + diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-not-sent-by-host-inventory/fru-config-not-sent-by-host.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-not-sent-by-host-inventory/fru-config-not-sent-by-host.yaml new file mode 100644 index 0000000000..9fa1fed43f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-read-not-sent-by-host-inventory/fru-config-not-sent-by-host.yaml @@ -0,0 +1,21 @@ +# A YAML similar to this sample would have to be generated, for eg with MRW +# inputs and system configuration, to depict IPMI FRU information. +# +# This file maps phosphor dbus inventory properties to IPMI properties +# +# This YAML could help generate C++ code. +# Format of the YAML: +# Fruid: +# Associated Fru paths +# d-bus Interfaces +# d-bus Properties +# IPMI Fru mapping +#20: +# /system/chassis/motherboard/gv100card0: +# entityID: 3 +# entityInstance: 1 +# interfaces: +# xyz.openbmc_project.Inventory.Item: +# PrettyName: +# IPMIFruProperty: Board Name +# IPMIFruSection: Board diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-whitelist-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-whitelist-native.bb new file mode 100644 index 0000000000..30c2443c3e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-whitelist-native.bb @@ -0,0 +1,6 @@ +SUMMARY = "Whitelisted IPMI FRU Parser commands" +DESCRIPTION = "Whitelisted IPMI FRU Parser commands for OpenBMC" + +inherit obmc-phosphor-license +inherit native +inherit phosphor-ipmi-host-whitelist
\ No newline at end of file diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-whitelist/phosphor-ipmi-fru-whitelist-native.conf b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-whitelist/phosphor-ipmi-fru-whitelist-native.conf new file mode 100644 index 0000000000..365c3d9526 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru-whitelist/phosphor-ipmi-fru-whitelist-native.conf @@ -0,0 +1,2 @@ +#<NetFn>:<Command> +0x0A:0x12 //<Storage>:<Write FRU Data>
\ No newline at end of file diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru.bb new file mode 100644 index 0000000000..251df427c2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru.bb @@ -0,0 +1,50 @@ +SUMMARY = "Phosphor IPMI Inventory Plugin" +DESCRIPTION = "A Phosphor IPMI plugin that updates inventory." +PR = "r1" + +inherit autotools pkgconfig +inherit obmc-phosphor-systemd +inherit obmc-phosphor-ipmiprovider-symlink +inherit phosphor-ipmi-fru +inherit pythonnative + +require ${PN}.inc + +DEPENDS += " \ + virtual/phosphor-ipmi-fru-hostfw-config\ + virtual/phosphor-ipmi-fru-inventory \ + virtual/phosphor-ipmi-fru-properties \ + systemd \ + sdbusplus \ + python-mako-native \ + python-pyyaml-native \ + phosphor-ipmi-host \ + phosphor-mapper \ + autoconf-archive-native \ + " + +RDEPENDS_${PN} += " \ + sdbusplus \ + " + +SYSTEMD_SERVICE_${PN} += "obmc-read-eeprom@.service" + +S = "${WORKDIR}/git" + +HOSTIPMI_PROVIDER_LIBRARY += "libstrgfnhandler.so" + +FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" + +# TODO: Fix the the ipmi-fru-parser code generator to handle split +# host firmware / inventory YAML and replace the OECONF below with: +# +# EXTRA_OECONF += "INVENTORY_YAML=${inventory_datadir}/config.yaml" +# EXTRA_OECONF += "HOSTFW_YAML=${hostfw_datadir}/config.yaml" +# +# For now the generator requires them to already be combined so we have: +EXTRA_OECONF = " \ + YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/config.yaml \ + PROP_YAML=${STAGING_DIR_NATIVE}${properties_datadir}/extra-properties.yaml \ + " diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru.inc b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru.inc new file mode 100644 index 0000000000..0b348ba1a3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "https://github.com/openbmc/ipmi-fru-parser" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=7702f203b58979ebbc31bfaeb44f219c" +SRC_URI += "git://github.com/openbmc/ipmi-fru-parser" +SRCREV = "c19b813e79e71a6b66887434f1dc4468df1d88bf" diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc-read-eeprom@.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc-read-eeprom@.service new file mode 100644 index 0000000000..4bae65d3f1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-fru/obmc-read-eeprom@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Read %I EEPROM +Wants=mapper-wait@-xyz-openbmc_project-inventory.service +After=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +Restart=no +Type=oneshot +EnvironmentFile={envfiledir}/obmc/eeproms/%I +ExecStart=/usr/bin/env phosphor-read-eeprom --eeprom $SYSFS_PATH --fruid $FRUID +SyslogIdentifier=phosphor-read-eeprom + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host.bb new file mode 100644 index 0000000000..7a2f7c1fd7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host.bb @@ -0,0 +1,122 @@ +SUMMARY = "Phosphor OpenBMC IPMI daemon" +DESCRIPTION = "Phosphor OpenBMC IPMI router and plugin libraries" +PR = "r1" + +RRECOMMENDS_${PN} += "packagegroup-obmc-ipmid-providers-libs" + +inherit autotools pkgconfig +inherit obmc-phosphor-ipmiprovider-symlink +inherit obmc-phosphor-license +inherit obmc-phosphor-sdbus-service +inherit obmc-phosphor-systemd +inherit phosphor-ipmi-host +inherit pythonnative + +def ipmi_whitelists(d): + whitelists = d.getVar( + 'VIRTUAL-RUNTIME_phosphor-ipmi-providers', True) or '' + whitelists = whitelists.split() + whitelists = [ '{}-whitelist-native'.format(x) for x in whitelists ] + return ' '.join(whitelists) + +DEPENDS += "autoconf-archive-native" +DEPENDS += "nlohmann-json" +DEPENDS += "obmc-targets" +DEPENDS += "${@ipmi_whitelists(d)}" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "phosphor-logging" +DEPENDS += "phosphor-mapper" +DEPENDS += "sdbusplus" +DEPENDS += "sdbus++-native" +DEPENDS += "virtual/phosphor-ipmi-inventory-sel" +DEPENDS += "virtual/phosphor-ipmi-fru-merge-config" +DEPENDS += "virtual/phosphor-ipmi-sensor-inventory" +DEPENDS += "virtual/phosphor-ipmi-channel-config" + +VIRTUAL-RUNTIME_ipmi-config ?= "phosphor-ipmi-config" + +RDEPENDS_${PN}-dev += "phosphor-logging" +RDEPENDS_${PN}-dev += "phosphor-mapper-dev" +RDEPENDS_${PN} += "clear-once" +RDEPENDS_${PN} += "libmapper" +RDEPENDS_${PN} += "network" +RDEPENDS_${PN} += "phosphor-dbus-interfaces" +RDEPENDS_${PN} += "phosphor-mapper" +RDEPENDS_${PN} += "phosphor-time-manager" +RDEPENDS_${PN} += "sdbusplus" +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_ipmi-config}" +RDEPENDS_${PN} += "virtual/obmc-watchdog" + +SYSTEMD_SERVICE_${PN} += "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service phosphor-ipmi-host.service" + +RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_obmc-settings-mgmt}" + + +require ${PN}.inc + +# Setup IPMI Whitelist Conf files +WHITELIST_CONF = " \ + ${STAGING_DATADIR_NATIVE}/phosphor-ipmi-host/*.conf \ + ${S}/host-ipmid-whitelist.conf \ + " +EXTRA_OECONF = " \ + WHITELIST_CONF="${WHITELIST_CONF}" \ + SENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/sensor.yaml \ + INVSENSOR_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/invsensor.yaml \ + FRU_YAML_GEN=${STAGING_DIR_NATIVE}${config_datadir}/fru_config.yaml \ + CHANNEL_YAML_GEN=${STAGING_DIR_NATIVE}${sensor_datadir}/channel.yaml \ + POWER_READING_SENSOR=${datadir}/ipmi-providers/power_reading.json\ + " + +S = "${WORKDIR}/git" + +SRC_URI += "file://merge_yamls.py " + +HOSTIPMI_PROVIDER_LIBRARY += "libipmi20.so" +HOSTIPMI_PROVIDER_LIBRARY += "libsysintfcmds.so" + +NETIPMI_PROVIDER_LIBRARY += "libipmi20.so" + +FILES_${PN}_append = " ${libdir}/host-ipmid/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/ipmid-providers/lib*${SOLIBS}" +FILES_${PN}_append = " ${libdir}/net-ipmid/lib*${SOLIBS}" +FILES_${PN}-dev_append = " ${libdir}/ipmid-providers/lib*${SOLIBSDEV} ${libdir}/ipmid-providers/*.la" + +# Soft Power Off +# install the soft power off service in the host shutdown target +SOFT_SVC = "xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service" +SOFT_TGTFMT = "obmc-host-shutdown@{0}.target" +SOFT_FMT = "../${SOFT_SVC}:${SOFT_TGTFMT}.requires/${SOFT_SVC}" +SYSTEMD_LINK_${PN} += "${@compose_list_zip(d, 'SOFT_FMT', 'OBMC_HOST_INSTANCES')}" + +#Collect all hardcoded sensor yamls from different recipes and +#merge all of them with sensor.yaml. +python do_merge_sensors () { + import subprocess + + # TODO: Perform the merge in a temporary directory? + workdir = d.getVar('WORKDIR', True) + nativedir = d.getVar('STAGING_DIR_NATIVE', True) + sensorsdir = d.getVar('sensor_datadir', True) + sensorsdir = sensorsdir[1:] + sensorsdir = os.path.join(nativedir, sensorsdir) + cmd = [] + cmd.append(os.path.join(workdir, 'merge_yamls.py')) + cmd.append(os.path.join(sensorsdir, 'sensor.yaml')) + + if os.stat(os.path.join(sensorsdir, 'sensor.yaml')).st_size == 0: + return + fetch = bb.fetch2.Fetch([], d) + override_urls = [url for url in fetch.urls if url.endswith('.hardcoded.yaml')] + for url in override_urls: + bb.debug(2, 'Overriding with source: ' + url) + local_base = os.path.basename(fetch.localpath(url)) + filename = os.path.join(workdir, local_base) + cmd.append(filename) + + # Invoke the script and don't catch any resulting exception. + subprocess.check_call(cmd) +} + +# python-pyyaml-native is installed by do_configure, so put this task after +addtask merge_sensors after do_configure before do_compile diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host.inc b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host.inc new file mode 100644 index 0000000000..c6247fb5c7 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-host-ipmid" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" +SRC_URI += "git://github.com/openbmc/phosphor-host-ipmid" +SRCREV = "1e12112baf56f9a8ec6dbf7fb409c84f35fff1e8" diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py new file mode 100755 index 0000000000..5e6c4b5e66 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/merge_yamls.py @@ -0,0 +1,59 @@ +#!/usr/bin/env python +"""Copied from phosphor-settings-manager +Loads a "target" YAML file and overwrites its values with values from +"override" YAML files. + +Override files are processed in the order given. + +Usage: + merge_settings.py <target yaml> [override yamls] +""" +import sys +import yaml +import copy + +def dict_merge(target, source): + """Deep merge for dicts. + + Works like dict.update() that recursively updates any dict values present in + both parameters. + + Args: + target (dict): Values to be overwritten by corresponding values from + `source`. + source (dict): Overriding values. Not changed by call. + + Returns: + `target` with values overwritten from those in `source` at any and all + levels of nested dicts. + """ + if not isinstance(source, dict): + return source + for k, v in source.iteritems(): + if k in target and isinstance(target[k], dict): + dict_merge(target[k], v) + else: + target[k] = copy.deepcopy(v) + return target + +if len(sys.argv) < 2: + sys.exit('Argument required: target yaml') + +if len(sys.argv) == 2: + # No overrides to handle + sys.exit(0) + +target_filename = sys.argv[1] +with open(target_filename) as target_file: + data = yaml.safe_load(target_file) + print('Loaded target YAML file ' + target_filename) + +for override_filename in sys.argv[2:]: + with open(override_filename) as override_file: + override = yaml.safe_load(override_file) + dict_merge(data, override) + print('Merged override YAML file ' + override_filename) + +with open(target_filename, 'w') as target_file: + yaml.dump(data, target_file, default_flow_style=False) + print('Wrote merged target YAML file ' + target_filename) diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service new file mode 100644 index 0000000000..3f10e11db0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/phosphor-ipmi-host.service @@ -0,0 +1,21 @@ +[Unit] +Description=Phosphor Inband IPMI +# TODO openbmc/openbmc#2059 - The wants/after below should be based on providers +Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot.service +After=mapper-wait@-xyz-openbmc_project-control-host0-boot.service +Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service +After=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service +Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service +After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service +Wants=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service +After=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service +Wants=clear-once.service +After=clear-once.service + +[Service] +Restart=always +ExecStart=/usr/bin/env ipmid +SyslogIdentifier=ipmid + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service new file mode 100644 index 0000000000..600c86ac2b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-host/xyz.openbmc_project.Ipmi.Internal.SoftPowerOff.service @@ -0,0 +1,14 @@ +[Unit] +Description=Soft power off of the host +Wants=mapper-wait@-org-openbmc-HostIpmi-1.service +After=mapper-wait@-org-openbmc-HostIpmi-1.service +Wants=obmc-host-stopping@0.target +Before=obmc-host-stopping@0.target +Conflicts=obmc-host-start@0.target +ConditionPathExists=!/run/openbmc/host@0-request + +[Service] +Restart=no +ExecStart=/usr/bin/env phosphor-softpoweroff +SyslogIdentifier=phosphor-softpoweroff +Type=oneshot diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-hw-example.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-hw-example.bb new file mode 100644 index 0000000000..4639a9025d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-hw-example.bb @@ -0,0 +1,13 @@ +SUMMARY = "Phosphor OpenBMC host IPMI to DBUS Example" +DESCRIPTION = "Phosphor OpenBMC host IPMI to DBUS example implementation." +PR = "r1" + +RDEPENDS_${PN} += "python-subprocess python-dbus python-pygobject" +RRECOMMENDS_${PN} += "phosphor-ipmi-host" + +inherit skeleton-python + +PROVIDES += "virtual/obmc-host-ipmi-hw" +RPROVIDES_${PN} += "virtual-obmc-host-ipmi-hw" + +SKELETON_DIR = "pyipmitest" diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-mrw-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-mrw-native.bb new file mode 100644 index 0000000000..f04d89f7d4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-mrw-native.bb @@ -0,0 +1,29 @@ +SUMMARY = "Inventory to Sensor config for phosphor-host-ipmi" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-host +inherit mrw-xml + +SRC_URI += "file://config.yaml" + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-ipmi-inventory-sel" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${sensor_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_ipmi_sel.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -m config.yaml \ + -o ${DEST}/invsensor.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-mrw/config.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-mrw/config.yaml new file mode 100644 index 0000000000..a6e5550d34 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-mrw/config.yaml @@ -0,0 +1,24 @@ +# Maps the Entity ID to the interested Sensor Type & Offset +0x01: + SensorType: 0x12 + Offset: 0x02 + +0x03: + SensorType: 0x07 + Offset: 0x08 + +0x07: + SensorType: 0xC7 + Offset: 0x00 + +0x20: + SensorType: 0x0C + Offset: 0x04 + +0xD0: + SensorType: 0x07 + Offset: 0x08 + +0xD8: + SensorType: 0x17 + Offset: 0x08 diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-native.bb new file mode 100644 index 0000000000..272e533885 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel-native.bb @@ -0,0 +1,21 @@ +SUMMARY = "Inventory to Sensor config for non-mrw machines" +PR = "r1" + +inherit native +inherit phosphor-ipmi-host +inherit obmc-phosphor-license + +PROVIDES += "virtual/phosphor-ipmi-inventory-sel" + +SRC_URI += "file://config.yaml" + +S = "${WORKDIR}" + +do_install() { + # This recipe would provide the sample inventory to sensor config + # mapping, for non-mrw machines. + + DEST=${D}${sensor_datadir} + install -d ${DEST} + install config.yaml ${DEST}/invsensor.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel/config.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel/config.yaml new file mode 100644 index 0000000000..c3b4ba186f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-inventory-sel/config.yaml @@ -0,0 +1,340 @@ +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0: + sensorID: 0xa6 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm1: + sensorID: 0xa8 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm10: + sensorID: 0xba + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm11: + sensorID: 0xbc + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm12: + sensorID: 0xbe + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm13: + sensorID: 0xc0 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm14: + sensorID: 0xc2 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm15: + sensorID: 0xc4 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm2: + sensorID: 0xaa + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm3: + sensorID: 0xac + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm4: + sensorID: 0xae + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm5: + sensorID: 0xb0 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm6: + sensorID: 0xb2 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm7: + sensorID: 0xb4 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm8: + sensorID: 0xb6 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm9: + sensorID: 0xb8 + sensorType: 0x0C + eventReadingType: 0x6F + offset: 0x04 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0: + sensorID: 0x5a + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core0: + sensorID: 0x12 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core1: + sensorID: 0x15 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core2: + sensorID: 0x18 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core3: + sensorID: 0x1b + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core4: + sensorID: 0x1e + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core5: + sensorID: 0x21 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core6: + sensorID: 0x24 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core7: + sensorID: 0x27 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core8: + sensorID: 0x2a + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core9: + sensorID: 0x2d + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core10: + sensorID: 0x30 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core11: + sensorID: 0x33 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core12: + sensorID: 0x36 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core13: + sensorID: 0x39 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core14: + sensorID: 0x3c + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core15: + sensorID: 0x3f + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core16: + sensorID: 0x42 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core17: + sensorID: 0x45 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core18: + sensorID: 0x48 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core19: + sensorID: 0x4b + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core20: + sensorID: 0x4e + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core21: + sensorID: 0x51 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core22: + sensorID: 0x54 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0/core23: + sensorID: 0x57 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1: + sensorID: 0xa4 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core0: + sensorID: 0x5c + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core1: + sensorID: 0x5f + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core2: + sensorID: 0x62 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core3: + sensorID: 0x65 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core4: + sensorID: 0x68 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core5: + sensorID: 0x6b + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core6: + sensorID: 0x6e + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core7: + sensorID: 0x71 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core8: + sensorID: 0x74 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core9: + sensorID: 0x77 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core10: + sensorID: 0x7a + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core11: + sensorID: 0x7d + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core12: + sensorID: 0x80 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core13: + sensorID: 0x83 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core14: + sensorID: 0x86 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core15: + sensorID: 0x89 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core16: + sensorID: 0x8c + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core17: + sensorID: 0x8f + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core18: + sensorID: 0x92 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core19: + sensorID: 0x95 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core20: + sensorID: 0x98 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core21: + sensorID: 0x9b + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core22: + sensorID: 0x9e + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1/core23: + sensorID: 0xa1 + sensorType: 0x07 + eventReadingType: 0x6F + offset: 0x08 +/xyz/openbmc_project/inventory/system/chassis/motherboard: + sensorID: 0x0c + sensorType: 0xC7 + eventReadingType: 0x03 + offset: 0x00 +/xyz/openbmc_project/inventory/system: + sensorID: 0x01 + sensorType: 0x12 + eventReadingType: 0x6F + offset: 0x02
\ No newline at end of file diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.service new file mode 100644 index 0000000000..1f0da75334 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-kcs/org.openbmc.HostIpmi.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor IPMI KCS DBus Bridge +After=phosphor-ipmi-host.service + +[Service] +Restart=always +ExecStart={sbindir}/kcsbridged --d="/dev/{KCS_DEVICE}" +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bb new file mode 100644 index 0000000000..9f25c0bf8c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-kcs_git.bb @@ -0,0 +1,34 @@ +SUMMARY = "Phosphor OpenBMC KCS to DBUS" +DESCRIPTION = "Phosphor OpenBMC KCS to DBUS." +PR = "r1" + +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://LICENSE;md5=b1beb00e508e89da1ed2a541934f28c0" + +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +PV = "1.0+git${SRCPV}" + +KCS_DEVICE ?= "ipmi-kcs3" + +DBUS_SERVICE_${PN} = "org.openbmc.HostIpmi.service" +SYSTEMD_SUBSTITUTIONS += "KCS_DEVICE:${KCS_DEVICE}:${DBUS_SERVICE_${PN}}" + +PROVIDES += "virtual/obmc-host-ipmi-hw" +RPROVIDES_${PN} += "virtual-obmc-host-ipmi-hw" +RRECOMMENDS_${PN} += "phosphor-ipmi-host" + +DEPENDS += " \ + autoconf-archive-native \ + systemd \ + " +RDEPENDS_${PN} += "libsystemd" + +S = "${WORKDIR}/git" +SRC_URI = "git://github.com/openbmc/kcsbridge.git;protocol=https" +SRCREV = "a1c50751b57a73ee38469c03960831ace72bc860" + +# This is how linux-libc-headers says to include custom uapi headers +CFLAGS_append = " -I ${STAGING_KERNEL_DIR}/include/uapi" +do_configure[depends] += "virtual/kernel:do_shared_workdir" diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net.bb new file mode 100644 index 0000000000..481e8f32f6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net.bb @@ -0,0 +1,25 @@ +SUMMARY = "Phosphor Network IPMI Daemon" +DESCRIPTION = "Daemon to support IPMI protocol over network" +HOMEPAGE = "https://github.com/openbmc/phosphor-net-ipmid" +PR = "r1" + +inherit autotools pkgconfig +inherit obmc-phosphor-license +inherit obmc-phosphor-systemd + +DEPENDS += "autoconf-archive-native" +DEPENDS += "phosphor-mapper" +DEPENDS += "systemd" +DEPENDS += "phosphor-ipmi-host" +RDEPENDS_${PN} += "libmapper" +RDEPENDS_${PN} += "libsystemd" + +SRC_URI += "git://github.com/openbmc/phosphor-net-ipmid" +SRCREV = "fe5a64587256eced4736cd70f23b5be58c8933a3" + +S = "${WORKDIR}/git" + +SYSTEMD_SERVICE_${PN} = " \ + ${PN}.service \ + ${PN}.socket \ + " diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service new file mode 100644 index 0000000000..b1f51dc65c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.service @@ -0,0 +1,16 @@ +[Unit] +Description=Network IPMI daemon +# TODO openbmc/openbmc#2059 - The wants/after below should be based on providers +Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot.service +After=mapper-wait@-xyz-openbmc_project-control-host0-boot.service +Wants=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service +After=mapper-wait@-xyz-openbmc_project-control-host0-boot-one_time.service +Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service +After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service +Wants=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service +After=mapper-wait@-xyz-openbmc_project-control-host0-restriction_mode.service + +[Service] +ExecStart=/usr/bin/env netipmid +SyslogIdentifier=netipmid +Restart=always diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket new file mode 100644 index 0000000000..077b7804c5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-net/phosphor-ipmi-net.socket @@ -0,0 +1,6 @@ +[Socket] +ListenDatagram=623 + +[Install] +WantedBy=sockets.target + diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bb new file mode 100644 index 0000000000..7fe9ae3da2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-config-native.bb @@ -0,0 +1,9 @@ +SUMMARY = "OpenBMC - IPMI sensors" +PR = "r1" + +inherit native +inherit obmc-phosphor-license + +OBMC_IPMI_SENSORS_PROVIDERS = "phosphor-ipmi-sensor-inventory-mrw-config-native" + +DEPENDS_append = " ${OBMC_IPMI_SENSORS_PROVIDERS} " diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config-native.bb new file mode 100644 index 0000000000..a33eb2b547 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config-native.bb @@ -0,0 +1,17 @@ +SUMMARY = "sensor config for phosphor-host-ipmid" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-host + +SRC_URI += "file://config.yaml" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${sensor_yamldir} + install -d ${DEST} + install config.yaml ${DEST}/config.yaml +} + diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml new file mode 100644 index 0000000000..d0e4f57d50 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-config/config.yaml @@ -0,0 +1,328 @@ +boot_count_sensor: + path: /xyz/openbmc_project/state/host0 + serviceInterface: org.freedesktop.DBus.Properties + readingType: readingAssertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameProperty + interfaces: + xyz.openbmc_project.Control.Boot.RebootAttempts: + AttemptsLeft: + Offsets: + 0xFF: + type: uint32_t + +os_boot_sensor: + path: /xyz/openbmc_project/state/host0 + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameProperty + interfaces: + xyz.openbmc_project.State.OperatingSystem.Status: + OperatingSystemState: + Offsets: + 0x01: + assert: "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.CBoot" + type: string + 0x02: + assert: "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.PXEBoot" + type: string + 0x03: + assert: "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.DiagBoot" + type: string + 0x04: + assert: "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.CDROMBoot" + type: string + 0x05: + assert: "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.ROMBoot" + type: string + 0x06: + assert: "xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete" + type: string + +fw_boot_sensor: + path: /xyz/openbmc_project/state/host0 + serviceInterface: org.freedesktop.DBus.Properties + readingType: eventdata2 + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameProperty + interfaces: + xyz.openbmc_project.State.Boot.Progress: + BootProgress: + Offsets: + 0x00: + type: string + set: "xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified" + 0x01: + type: string + set: "xyz.openbmc_project.State.Boot.Progress.ProgressStages.MemoryInit" + 0x03: + type: string + set: "xyz.openbmc_project.State.Boot.Progress.ProgressStages.SecondaryProcInit" + 0x07: + type: string + set: "xyz.openbmc_project.State.Boot.Progress.ProgressStages.PCIInit" + 0x13: + type: string + set: "xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart" + 0x14: + type: string + set: "xyz.openbmc_project.State.Boot.Progress.ProgressStages.MotherboardInit" + +dimm_func_sensor: + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Offsets: + 0x04: + type: "bool" + assert: false + deassert: true + Prereqs: + 0x06: + type: "bool" + assert: true + deassert: false + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + type: "bool" + assert: true + deassert: false + +cpu_func_sensor: + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Offsets: + 0x08: + type: "bool" + assert: false + deassert: true + Prereqs: + 0x07: + type: "bool" + assert: true + deassert: false + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + type: "bool" + assert: true + deassert: false + +cpucore_func_sensor: + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Offsets: + 0x08: + type: "bool" + assert: false + deassert: true + Prereqs: + 0x07: + type: "bool" + assert: true + deassert: false + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + type: "bool" + assert: true + deassert: false + skipOn: "deassert" + +tpm_required_sensor: + path: /xyz/openbmc_project/control/host0/TPMEnable + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.Control.TPM.Policy: + TPMEnable: + Offsets: + 0x00: + type: "bool" + assert: false + 0x01: + type: "bool" + assert: true + +gpu_func_sensor: + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Offsets: + 0x08: + type: "bool" + assert: false + deassert: true + Prereqs: + 0x07: + type: "bool" + assert: true + deassert: false + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + type: "bool" + assert: true + deassert: false +# Field replaceable doesn't come as a sensor data +# but we know that GPU is Field replaceable so setting +# true in both cases. + xyz.openbmc_project.Inventory.Decorator.Replaceable: + FieldReplaceable: + Offsets: + 0x07: + type: "bool" + assert: true + deassert: true + +host_auto_reboot_control_sensor: + path: /xyz/openbmc_project/control/host0/auto_reboot + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.Control.Boot.RebootPolicy: + AutoReboot: + Offsets: + 0x00: + type: "bool" + assert: false + 0x01: + type: "bool" + assert: true + +turbo_allowed_sensor: + path: /xyz/openbmc_project/control/host0/turbo_allowed + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.Control.Host.TurboAllowed: + TurboAllowed: + Offsets: + 0x00: + assert: false + deassert: true + type: bool + 0x01: + assert: true + deassert: false + type: bool + +cpucore_temp_sensor: + serviceInterface: org.freedesktop.DBus.Properties + readingType: readingData + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + multiplierM: 1 + offsetB: -127 + bExp: 0 + rExp: 0 + unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC + scale: -3 + interfaces: + xyz.openbmc_project.Sensor.Value: + Value: + Offsets: + 0xFF: + type: int64_t + +dimm_temp_sensor: + serviceInterface: org.freedesktop.DBus.Properties + readingType: readingData + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + multiplierM: 1 + offsetB: -127 + bExp: 0 + rExp: 0 + unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC + scale: -3 + interfaces: + xyz.openbmc_project.Sensor.Value: + Value: + Offsets: + 0xFF: + type: int64_t + +vrm_vdd_temp_sensor: + serviceInterface: org.freedesktop.DBus.Properties + readingType: readingData + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + multiplierM: 1 + offsetB: -127 + bExp: 0 + rExp: 0 + unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC + scale: -3 + interfaces: + xyz.openbmc_project.Sensor.Value: + Value: + Offsets: + 0xFF: + type: int64_t + +gpu_temp_sensor: + serviceInterface: org.freedesktop.DBus.Properties + readingType: readingData + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + multiplierM: 1 + offsetB: -127 + bExp: 0 + rExp: 0 + unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC + scale: -3 + interfaces: + xyz.openbmc_project.Sensor.Value: + Value: + Offsets: + 0xFF: + type: int64_t + +memory_temp_sensor: + serviceInterface: org.freedesktop.DBus.Properties + readingType: readingData + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + multiplierM: 1 + offsetB: -127 + bExp: 0 + rExp: 0 + unit: xyz.openbmc_project.Sensor.Value.Unit.DegreesC + scale: -3 + interfaces: + xyz.openbmc_project.Sensor.Value: + Value: + Offsets: + 0xFF: + type: int64_t diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb new file mode 100644 index 0000000000..e58e02a64a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw-native.bb @@ -0,0 +1,56 @@ +SUMMARY = "sensor config for phosphor-host-ipmid" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-ipmi-host +inherit pythonnative +inherit mrw-xml + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + phosphor-ipmi-sensor-config-native \ + phosphor-ipmi-sensor-inventory-mrw-config-native \ + python-pyyaml-native \ + " + +PROVIDES += "virtual/phosphor-ipmi-sensor-inventory" + +S = "${WORKDIR}" +SRC_URI += "file://merge_sensor_config.py" + +do_install() { + DEST=${D}${sensor_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_ipmi_sensor.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -m ${sensor_yamldir}/config.yaml \ + -o ${DEST}/sensor.yaml +} + +python do_merge_sensor_config () { + import subprocess + + # TODO: Perform the merge in a temporary directory? + workdir = d.getVar('WORKDIR', True) + nativedir = d.getVar('STAGING_DIR_NATIVE', True) + sensoryamldir = d.getVar('sensor_yamldir', True) + cmd = [] + cmd.append(os.path.join(workdir, 'merge_sensor_config.py')) + cmd.append(os.path.join(sensoryamldir, 'config.yaml')) + + fetch = os.listdir(sensoryamldir) + override_urls = [url for url in fetch if url.endswith('-config.yaml')] + for url in override_urls: + bb.debug(2, 'Merging extra configurations: ' + url) + filename = os.path.join(sensoryamldir, url) + cmd.append(filename) + + # Invoke the script and don't catch any resulting exception. + subprocess.check_call(cmd) +} +# python-pyyaml-native is installed by do_configure, so put this task after +addtask merge_sensor_config after do_configure before do_compile diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw/merge_sensor_config.py b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw/merge_sensor_config.py new file mode 120000 index 0000000000..6ae3bcae9f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-mrw/merge_sensor_config.py @@ -0,0 +1 @@ +../phosphor-ipmi-host/merge_yamls.py
\ No newline at end of file diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-native.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-native.bb new file mode 100644 index 0000000000..2464ff0056 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory-native.bb @@ -0,0 +1,22 @@ +SUMMARY = "Sensor config for phosphor-host-ipmi" +PR = "r1" + +inherit native +inherit phosphor-ipmi-host +inherit obmc-phosphor-license + +PROVIDES += "virtual/phosphor-ipmi-sensor-inventory" + +SRC_URI += "file://config.yaml" + +S = "${WORKDIR}" + +do_install() { + # This recipe is supposed to create an output yaml file with + # sensor data extracted from the mrw. + # provides a sample output file. + + DEST=${D}${sensor_datadir} + install -d ${DEST} + install config.yaml ${DEST}/sensor.yaml +} diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory/config.yaml b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory/config.yaml new file mode 100644 index 0000000000..cc463c421a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-sensor-inventory/config.yaml @@ -0,0 +1,2108 @@ +0x03: + entityID: 0x22 + entityInstance: 1 + sensorType: 0x0F + path: /xyz/openbmc_project/state/host0 + sensorReadingType: 0x6F + serviceInterface: org.freedesktop.DBus.Properties + readingType: eventdata2 + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameProperty + interfaces: + xyz.openbmc_project.State.Boot.Progress: + BootProgress: + Offsets: + 0x13: + type: string + set: xyz.openbmc_project.State.Boot.Progress.ProgressStages.OSStart + 0x00: + type: string + set: xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified + 0x01: + type: string + set: xyz.openbmc_project.State.Boot.Progress.ProgressStages.MemoryInit + 0x03: + type: string + set: xyz.openbmc_project.State.Boot.Progress.ProgressStages.SecondaryProcInit + 0x07: + type: string + set: xyz.openbmc_project.State.Boot.Progress.ProgressStages.PCIInit + 0x14: + type: string + set: xyz.openbmc_project.State.Boot.Progress.ProgressStages.MotherboardInit +0x05: + entityID: 0x23 + entityInstance: 1 + sensorType: 0x1F + path: /xyz/openbmc_project/state/host0 + sensorReadingType: 0x6F + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameProperty + interfaces: + xyz.openbmc_project.State.OperatingSystem.Status: + OperatingSystemState: + Offsets: + 0x02: + assert: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.PXEBoot + type: string + 0x06: + assert: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.BootComplete + type: string + 0x04: + assert: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.CDROMBoot + type: string + 0x01: + assert: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.CBoot + type: string + 0x03: + assert: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.DiagBoot + type: string + 0x05: + assert: xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.ROMBoot + type: string +0x07: + entityID: 0x22 + entityInstance: 2 + sensorType: 0xC3 + path: /xyz/openbmc_project/state/host0 + sensorReadingType: 0x6F + serviceInterface: org.freedesktop.DBus.Properties + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameProperty + interfaces: + xyz.openbmc_project.Control.Boot.RebootAttempts: + AttemptsLeft: + Offsets: + 0xFF: + type: uint32_t +0x12: + entityID: 0xD0 + entityInstance: 1 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core0 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x15: + entityID: 0xD0 + entityInstance: 2 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core1 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x18: + entityID: 0xD0 + entityInstance: 3 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core2 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x1b: + entityID: 0xD0 + entityInstance: 4 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core3 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x1e: + entityID: 0xD0 + entityInstance: 5 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core4 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x21: + entityID: 0xD0 + entityInstance: 6 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core5 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x24: + entityID: 0xD0 + entityInstance: 7 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core6 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x27: + entityID: 0xD0 + entityInstance: 8 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core7 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x2a: + entityID: 0xD0 + entityInstance: 9 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core8 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x2d: + entityID: 0xD0 + entityInstance: 10 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core9 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x30: + entityID: 0xD0 + entityInstance: 11 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core10 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x33: + entityID: 0xD0 + entityInstance: 12 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core11 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x36: + entityID: 0xD0 + entityInstance: 13 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core12 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x39: + entityID: 0xD0 + entityInstance: 14 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core13 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x3c: + entityID: 0xD0 + entityInstance: 15 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core14 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x3f: + entityID: 0xD0 + entityInstance: 16 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core15 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x42: + entityID: 0xD0 + entityInstance: 17 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core16 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x45: + entityID: 0xD0 + entityInstance: 18 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core17 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x48: + entityID: 0xD0 + entityInstance: 19 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core18 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x4b: + entityID: 0xD0 + entityInstance: 20 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core19 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x4e: + entityID: 0xD0 + entityInstance: 21 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core20 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x51: + entityID: 0xD0 + entityInstance: 22 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core21 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x54: + entityID: 0xD0 + entityInstance: 23 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core22 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x57: + entityID: 0xD0 + entityInstance: 24 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0/core23 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x5a: + entityID: 0x03 + entityInstance: 1 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu0 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool +0x5c: + entityID: 0xD0 + entityInstance: 25 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core0 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x5f: + entityID: 0xD0 + entityInstance: 26 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core1 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x62: + entityID: 0xD0 + entityInstance: 27 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core2 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x65: + entityID: 0xD0 + entityInstance: 28 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core3 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x68: + entityID: 0xD0 + entityInstance: 29 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core4 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x6b: + entityID: 0xD0 + entityInstance: 30 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core5 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x6e: + entityID: 0xD0 + entityInstance: 31 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core6 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x71: + entityID: 0xD0 + entityInstance: 32 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core7 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x74: + entityID: 0xD0 + entityInstance: 33 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core8 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x77: + entityID: 0xD0 + entityInstance: 34 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core9 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x7a: + entityID: 0xD0 + entityInstance: 35 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core10 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x7d: + entityID: 0xD0 + entityInstance: 36 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core11 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x80: + entityID: 0xD0 + entityInstance: 37 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core12 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x83: + entityID: 0xD0 + entityInstance: 38 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core13 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x86: + entityID: 0xD0 + entityInstance: 39 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core14 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x89: + entityID: 0xD0 + entityInstance: 40 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core15 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x8c: + entityID: 0xD0 + entityInstance: 41 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core16 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x8f: + entityID: 0xD0 + entityInstance: 42 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core17 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x92: + entityID: 0xD0 + entityInstance: 43 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core18 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x95: + entityID: 0xD0 + entityInstance: 44 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core19 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x98: + entityID: 0xD0 + entityInstance: 45 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core20 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x9b: + entityID: 0xD0 + entityInstance: 46 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core21 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0x9e: + entityID: 0xD0 + entityInstance: 47 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core22 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0xa1: + entityID: 0xD0 + entityInstance: 48 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1/core23 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameParentLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool + skipOn: deassert +0xa4: + entityID: 0x03 + entityInstance: 2 + sensorType: 0x07 + path: /system/chassis/motherboard/cpu1 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x07: + assert: true + deassert: false + type: bool + Offsets: + 0x08: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x07: + assert: true + deassert: false + type: bool +0xa6: + entityID: 0x20 + entityInstance: 1 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm0 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xa8: + entityID: 0x20 + entityInstance: 2 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm1 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xaa: + entityID: 0x20 + entityInstance: 3 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm2 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xac: + entityID: 0x20 + entityInstance: 4 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm3 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xae: + entityID: 0x20 + entityInstance: 5 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm4 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xb0: + entityID: 0x20 + entityInstance: 6 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm5 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xb2: + entityID: 0x20 + entityInstance: 7 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm6 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xb4: + entityID: 0x20 + entityInstance: 8 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm7 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xb6: + entityID: 0x20 + entityInstance: 9 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm8 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xb8: + entityID: 0x20 + entityInstance: 10 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm9 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xba: + entityID: 0x20 + entityInstance: 11 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm10 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xbc: + entityID: 0x20 + entityInstance: 12 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm11 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xbe: + entityID: 0x20 + entityInstance: 13 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm12 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xc0: + entityID: 0x20 + entityInstance: 14 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm13 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xc2: + entityID: 0x20 + entityInstance: 15 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm14 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool +0xc4: + entityID: 0x20 + entityInstance: 16 + sensorType: 0x0C + path: /system/chassis/motherboard/dimm15 + sensorReadingType: 0x6F + serviceInterface: xyz.openbmc_project.Inventory.Manager + readingType: assertion + mutability: Mutability::Write|Mutability::Read + sensorNamePattern: nameLeaf + interfaces: + xyz.openbmc_project.State.Decorator.OperationalStatus: + Functional: + Prereqs: + 0x06: + assert: true + deassert: false + type: bool + Offsets: + 0x04: + assert: false + deassert: true + type: bool + xyz.openbmc_project.Inventory.Item: + Present: + Offsets: + 0x06: + assert: true + deassert: false + type: bool diff --git a/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-tool.bb b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-tool.bb new file mode 100644 index 0000000000..dbc50aabaf --- /dev/null +++ b/meta-phosphor/recipes-phosphor/ipmi/phosphor-ipmi-tool.bb @@ -0,0 +1,36 @@ +SUMMARY = "Phosphor ipmi tool for injecting ipmi commands" +DESCRIPTION = "IPMI Tool with dbus capabilities" +HOMEPAGE = "https://github.com/openbmc/ipmitool" +PR = "r1" + + +inherit obmc-phosphor-license + +DEPENDS += "systemd \ + phosphor-ipmi-host \ + " + +RDEPENDS_${PN} += "libsystemd \ + libcrypto \ + virtual-obmc-host-ipmi-hw \ + " + + +SRC_URI += "git://github.com/openbmc/ipmitool" + +SRCREV = "dfdfd89ec9b36c115a98f589880fd757a162af19" + + +S = "${WORKDIR}/git" + + +do_compile() { + ${S}/bootstrap --enable-intf-dbus + ${S}/configure --host x86_64 + make +} + +do_install() { + install -m 0755 -d ${D}${sbindir} + install -m 0755 ${S}/src/ipmitool ${D}${sbindir} +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-example-native.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-example-native.bb new file mode 100644 index 0000000000..4b546d05ff --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-example-native.bb @@ -0,0 +1,16 @@ +SUMMARY = "Phosphor LED Group Management with example data" +PR = "r1" + +inherit native +require phosphor-led-manager.inc + +PROVIDES += "virtual/phosphor-led-manager-config-native" + +S = "${WORKDIR}/git" + +# Copies example led layout yaml file +do_install() { + SRC=${S} + DEST=${D}${datadir}/phosphor-led-manager + install -D ${SRC}/led.yaml ${DEST}/led.yaml +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-mrw-native.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-mrw-native.bb new file mode 100644 index 0000000000..920f637453 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-config-mrw-native.bb @@ -0,0 +1,24 @@ +SUMMARY = "Phosphor LED Group Management with MRW generated data" +PR = "r1" + +inherit native +inherit obmc-phosphor-utils +inherit obmc-phosphor-license +inherit mrw-xml + +PROVIDES += "virtual/phosphor-led-manager-config-native" +DEPENDS += "mrw-native mrw-perl-tools-native" + +# Generate a YAML files based on MRW input +do_install_append() { + USE_MRW="${@df_enabled(d, 'obmc-mrw', 'yes')}" + DEST=${D}${datadir}/phosphor-led-manager + + if [ "${USE_MRW}" = "yes" ]; then + install -d ${DEST}/ + ${STAGING_BINDIR_NATIVE}/perl-native/perl \ + ${STAGING_BINDIR_NATIVE}/gen_led_groups.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -o ${DEST}/led.yaml + fi +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-error-native.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-error-native.bb new file mode 100644 index 0000000000..c8ec04127f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager-error-native.bb @@ -0,0 +1,21 @@ +SUMMARY = "Copy error yaml files to known path for elog parsing" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit native +inherit phosphor-dbus-yaml + +require phosphor-led-manager.inc + +S = "${WORKDIR}/git" + +do_install_append() { + SRC=${S}/xyz/openbmc_project/Led/ + DEST=${D}${yaml_dir}/xyz/openbmc_project/Led/ + install -d ${DEST}/Fru + install ${SRC}/*.errors.yaml ${DEST} + install ${SRC}/*.metadata.yaml ${DEST} + install ${SRC}/Fru/*.errors.yaml ${DEST}/Fru + install ${SRC}/Fru/*.metadata.yaml ${DEST}/Fru +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.bb new file mode 100644 index 0000000000..d501d332a1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.bb @@ -0,0 +1,56 @@ +SUMMARY = "Phosphor LED Group Management Daemon" +DESCRIPTION = "Daemon to cater to triggering actions on LED groups" +PR = "r1" + +require ${PN}.inc + +inherit autotools pkgconfig pythonnative +inherit obmc-phosphor-dbus-service obmc-phosphor-systemd + +LED_MGR_PACKAGES = " \ + ${PN}-ledmanager \ + ${PN}-faultmonitor \ +" + +PACKAGE_BEFORE_PN += "${LED_MGR_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" + +DBUS_PACKAGES = "${PN}-ledmanager" + +SYSTEMD_PACKAGES = "${LED_MGR_PACKAGES}" + +DEPENDS += "python-pyyaml-native" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-logging" + +DEPENDS += "virtual/${PN}-config-native" +RDEPENDS_${PN}-ledmanager += "libsystemd" +RDEPENDS_${PN}-ledmanager += "phosphor-logging" + +RDEPENDS_${PN}-faultmonitor += "libsystemd" +RDEPENDS_${PN}-faultmonitor += "phosphor-logging" + +S = "${WORKDIR}/git" + +FILES_${PN}-ledmanager += "${sbindir}/phosphor-ledmanager" +FILES_${PN}-faultmonitor += "${sbindir}/phosphor-fru-fault-monitor" + +DBUS_SERVICE_${PN}-ledmanager += "xyz.openbmc_project.LED.GroupManager.service" + +SYSTEMD_SERVICE_${PN}-ledmanager += "obmc-led-group-start@.service obmc-led-group-stop@.service" +SYSTEMD_SERVICE_${PN}-faultmonitor += "obmc-fru-fault-monitor.service" + +SYSTEMD_LINK_${PN}-ledmanager += "../obmc-led-group-start@.service:${SYSTEMD_DEFAULT_TARGET}.wants/obmc-led-group-start@bmc_booted.service" + +STATES = "start stop" +TMPLFMT = "obmc-led-group-{0}@.service" +TGTFMT = "obmc-power-{0}@0.target" +INSTFMT = "obmc-led-group-{0}@power_on.service" +FMT = "../${TMPLFMT}:${TGTFMT}.wants/${INSTFMT}" +SYSTEMD_LINK_${PN}-ledmanager += "${@compose_list(d, 'FMT', 'STATES')}" + +# Install the override to set up a Conflicts relation +SYSTEMD_OVERRIDE_${PN}-ledmanager += "bmc_booted.conf:obmc-led-group-start@bmc_booted.service.d/bmc_booted.conf" + +EXTRA_OECONF = "YAML_PATH=${STAGING_DATADIR_NATIVE}/${PN}" diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.inc b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.inc new file mode 100644 index 0000000000..0562742e55 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-led-manager" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRC_URI += "git://github.com/openbmc/phosphor-led-manager" +SRCREV = "08d613e7d549d647105bb7ff5a6d3716708d2332" diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/bmc_booted.conf b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/bmc_booted.conf new file mode 100644 index 0000000000..a300f6ace3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/bmc_booted.conf @@ -0,0 +1,3 @@ +[Unit] +Wants={SYSTEMD_DEFAULT_TARGET} +After={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-fru-fault-monitor.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-fru-fault-monitor.service new file mode 100644 index 0000000000..4810a7e860 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-fru-fault-monitor.service @@ -0,0 +1,12 @@ +[Unit] +Description=FRU Fault monitor service +Wants=mapper-wait@-xyz-openbmc_project-led-groups.service +After=mapper-wait@-xyz-openbmc_project-led-groups.service + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-fru-fault-monitor +SyslogIdentifier=phosphor-fru-fault-monitor + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-start@.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-start@.service new file mode 100644 index 0000000000..e0e1fc9356 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-start@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Assert %i LED +Wants=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +After=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +Conflicts=obmc-led-group-stop@%i.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/led/groups/%i` /xyz/openbmc_project/led/groups/%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Led.Group Asserted b true" +SyslogIdentifier=obmc-led-group-start diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-stop@.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-stop@.service new file mode 100644 index 0000000000..7b3966943a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/obmc-led-group-stop@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Assert %i LED +Wants=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +After=mapper-wait@-xyz-openbmc_project-led-groups-%i.service +Conflicts=obmc-led-group-start@%i.service + +[Service] +Type=oneshot +RemainAfterExit=yes +Restart=no +ExecStart=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/led/groups/%i` /xyz/openbmc_project/led/groups/%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.Led.Group Asserted b false" +SyslogIdentifier=obmc-led-group-stop diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/xyz.openbmc_project.LED.GroupManager.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/xyz.openbmc_project.LED.GroupManager.service new file mode 100644 index 0000000000..2f9a25e91e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-manager/xyz.openbmc_project.LED.GroupManager.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor LED Group Management Daemon +Before=mapper-wait@-xyz-openbmc_project-led-groups.service + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-ledmanager +SyslogIdentifier=phosphor-ledmanager +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs.bb b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs.bb new file mode 100644 index 0000000000..76da1b56af --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs.bb @@ -0,0 +1,26 @@ +SUMMARY = "Phosphor Physical LED Controller daemon" +DESCRIPTION = "Daemon to trigger actions on a physical LED" +HOMEPAGE = "http://github.com/openbmc/phosphor-led-sysfs" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-dbus-interfaces" +RDEPENDS_${PN} += "libsystemd" + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.led.controller@.service" + +SRC_URI += "git://github.com/openbmc/phosphor-led-sysfs" +SRC_URI += "file://70-leds.rules" +SRCREV = "8609c65aaa48eeff85cd9dd375253d7755581993" +S = "${WORKDIR}/git" + +do_install_append() { + install -d ${D}/${base_libdir}/udev/rules.d/ + install ${WORKDIR}/70-leds.rules ${D}/${base_libdir}/udev/rules.d/ +} diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/70-leds.rules b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/70-leds.rules new file mode 100644 index 0000000000..372d81293f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/70-leds.rules @@ -0,0 +1 @@ +SUBSYSTEM=="leds", ACTION=="add", TAG+="systemd", ENV{SYSTEMD_WANTS}+="xyz.openbmc_project.led.controller@sys-class-leds-$name" diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/xyz.openbmc_project.led.controller@.service b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/xyz.openbmc_project.led.controller@.service new file mode 100644 index 0000000000..c673cda66f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-led-sysfs/xyz.openbmc_project.led.controller@.service @@ -0,0 +1,7 @@ +[Unit] +Description=Phosphor sysfs LED controller + +[Service] +Restart=always +ExecStart=/usr/bin/env phosphor-ledcontroller -p %f +SyslogIdentifier=phosphor-ledcontroller diff --git a/meta-phosphor/recipes-phosphor/leds/phosphor-logging-error-logs-native.bbappend b/meta-phosphor/recipes-phosphor/leds/phosphor-logging-error-logs-native.bbappend new file mode 100644 index 0000000000..3f2c5c811b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/leds/phosphor-logging-error-logs-native.bbappend @@ -0,0 +1 @@ +DEPENDS += "phosphor-led-manager-error-native" diff --git a/meta-phosphor/recipes-phosphor/logging/ffdc.bb b/meta-phosphor/recipes-phosphor/logging/ffdc.bb new file mode 100644 index 0000000000..8c832d7082 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/ffdc.bb @@ -0,0 +1,22 @@ +SUMMARY = "FFDC collector script" +DESCRIPTION = "Command line tool to collect and tar up debug data" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +RDEPENDS_${PN} += " \ + systemd \ + ${VIRTUAL-RUNTIME_base-utils} \ + " + +S = "${WORKDIR}/git" +SRC_URI += "git://github.com/openbmc/phosphor-debug-collector" + +SRCREV = "90d147a1ee5340278506bbdf94edc32bb77154f2" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ffdc \ + ${D}${bindir}/ffdc +} diff --git a/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-example-native.bb b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-example-native.bb new file mode 100644 index 0000000000..f76d202e16 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-example-native.bb @@ -0,0 +1,18 @@ +SUMMARY = "Generated callout information for phosphor-logging" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-logging + +SRC_URI += "file://callouts.yaml" + +PROVIDES += "virtual/phosphor-logging-callouts" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${callouts_datadir} + install -d ${DEST} + install callouts.yaml ${DEST} +} diff --git a/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-example/callouts.yaml b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-example/callouts.yaml new file mode 100644 index 0000000000..5b92a04c4f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-example/callouts.yaml @@ -0,0 +1 @@ +/sys/devices/device: /system/chassis/motherboard/device diff --git a/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-mrw-native.bb b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-mrw-native.bb new file mode 100644 index 0000000000..96852d4cab --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-callouts-mrw-native.bb @@ -0,0 +1,26 @@ +SUMMARY = "Generated callout information for phosphor-logging" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-logging +inherit mrw-xml + +DEPENDS += " \ + mrw-native \ + mrw-perl-tools-native \ + " + +PROVIDES += "virtual/phosphor-logging-callouts" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${callouts_datadir} + install -d ${DEST} + + ${bindir}/perl-native/perl \ + ${bindir}/gen_callouts.pl \ + -m ${mrw_datadir}/${MRW_XML} \ + -o ${DEST}/callouts.yaml +} diff --git a/meta-phosphor/recipes-phosphor/logging/phosphor-logging-error-logs-native.bb b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-error-logs-native.bb new file mode 100644 index 0000000000..0dfacb1b60 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/phosphor-logging-error-logs-native.bb @@ -0,0 +1,13 @@ +SUMMARY = "Phosphor OpenBMC - error log meta data generation" +PR = "r1" + +inherit native +inherit obmc-phosphor-license + +#To append new recipes that copies error yaml files to the known +#location, add DEPENDS relationhip using bbappend to +#phosphor-logging-error-log-native recipe with the native +#recipe name + +#Refer to openpower-debug-collector-error-native.bb to see how +#to copy error yaml files to a known location diff --git a/meta-phosphor/recipes-phosphor/logging/phosphor-logging.bb b/meta-phosphor/recipes-phosphor/logging/phosphor-logging.bb new file mode 100644 index 0000000000..9adbc4ff4b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/phosphor-logging.bb @@ -0,0 +1,97 @@ +SUMMARY = "Phosphor OpenBMC event and error logging" +DESCRIPTION = "An error and event log daemon application, and \ + supporting tools for OpenBMC." +HOMEPAGE = "https://github.com/openbmc/phosphor-logging" +PR = "r1" + +inherit autotools pkgconfig +inherit pythonnative +inherit obmc-phosphor-license +inherit obmc-phosphor-dbus-service +inherit phosphor-logging +inherit phosphor-dbus-yaml + +DEPENDS += "autoconf-archive-native" +DEPENDS += "systemd" +DEPENDS += "python-mako-native" +DEPENDS += "python-pyyaml-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" +DEPENDS += "virtual/phosphor-logging-callouts" +DEPENDS += "phosphor-logging-error-logs-native" +DEPENDS += "phosphor-logging-native" +DEPENDS += "cereal" + +PACKAGE_BEFORE_PN = "${PN}-test" +FILES_${PN}-test = "${bindir}/*-test" + +PACKAGE_BEFORE_PN += "${PN}-elog" +FILES_${PN}-elog += "${elog_dir}" + +# Package configuration +LOGGING_PACKAGES = " \ + ${PN}-base \ +" + +ALLOW_EMPTY_${PN} = "1" +PACKAGE_BEFORE_PN += "${LOGGING_PACKAGES}" +SYSTEMD_PACKAGES = "${LOGGING_PACKAGES}" +DBUS_PACKAGES = "${LOGGING_PACKAGES}" + +RDEPENDS_${PN}-base += "sdbusplus phosphor-dbus-interfaces" +FILES_${PN}-base += " \ + ${sbindir}/phosphor-log-manager \ + ${libdir}/libphosphor_logging.so.* \ +" +DBUS_SERVICE_${PN}-base += "xyz.openbmc_project.Logging.service" + +SRC_URI += "git://github.com/openbmc/phosphor-logging" +SRCREV = "5ac1bde129258d906246f5d4ad78e036f03a6e80" + +S = "${WORKDIR}/git" + +# Do not DEPEND on the specified packages for native build +# as they will not be available in host machine +DEPENDS_remove_class-native = " \ + virtual/phosphor-logging-callouts \ + sdbus++ \ + systemd \ + cereal \ + " + +# Do not DEPEND on the specified packages for native SDK build +# as they will not be available in host machine +DEPENDS_remove_class-nativesdk = " \ + virtual/phosphor-logging-callouts \ + sdbus++-native \ + cereal \ + systemd \ + phosphor-dbus-interfaces \ + " + +PACKAGECONFIG ??= "metadata-processing install_scripts" + +PACKAGECONFIG[metadata-processing] = " \ + --enable-metadata-processing, \ + --disable-metadata-processing, , \ + " + +# Provide a means to enable/disable install_scripts feature +PACKAGECONFIG[install_scripts] = " \ + --enable-install_scripts, \ + --disable-install_scripts, ,\ + " + +# Enable install_scripts during native and native SDK build +PACKAGECONFIG_add_class-native = "install_scripts" +PACKAGECONFIG_add_class-nativesdk = "install_scripts" + +# Disable install_scripts during target build +PACKAGECONFIG_remove_class-target = "install_scripts" + +EXTRA_OECONF = " \ + YAML_DIR=${STAGING_DIR_NATIVE}${yaml_dir} \ + CALLOUTS_YAML=${STAGING_DIR_NATIVE}${callouts_datadir}/callouts.yaml \ + " + +BBCLASSEXTEND += "native nativesdk" diff --git a/meta-phosphor/recipes-phosphor/logging/phosphor-logging/xyz.openbmc_project.Logging.service b/meta-phosphor/recipes-phosphor/logging/phosphor-logging/xyz.openbmc_project.Logging.service new file mode 100644 index 0000000000..946c3bf161 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/logging/phosphor-logging/xyz.openbmc_project.Logging.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor Log Manager + +[Service] +ExecStart=/usr/bin/env phosphor-log-manager +SyslogIdentifier=phosphor-log-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/mboxd/files/99-aspeed-lpc-ctrl.rules b/meta-phosphor/recipes-phosphor/mboxd/files/99-aspeed-lpc-ctrl.rules new file mode 100644 index 0000000000..9cf2fbad13 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mboxd/files/99-aspeed-lpc-ctrl.rules @@ -0,0 +1 @@ +SUBSYSTEM=="misc", KERNEL=="aspeed-lpc-ctrl", TAG+="systemd" diff --git a/meta-phosphor/recipes-phosphor/mboxd/files/99-aspeed-mbox.rules b/meta-phosphor/recipes-phosphor/mboxd/files/99-aspeed-mbox.rules new file mode 100644 index 0000000000..12e90d86c8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mboxd/files/99-aspeed-mbox.rules @@ -0,0 +1 @@ +SUBSYSTEM=="misc", KERNEL=="aspeed-mbox", TAG+="systemd" diff --git a/meta-phosphor/recipes-phosphor/mboxd/files/aspeed-lpc-ctrl-h.patch b/meta-phosphor/recipes-phosphor/mboxd/files/aspeed-lpc-ctrl-h.patch new file mode 100644 index 0000000000..122594e9f0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mboxd/files/aspeed-lpc-ctrl-h.patch @@ -0,0 +1,39 @@ +--- /dev/null 2017-01-17 09:45:47.987442339 +1030 ++++ include/linux/aspeed-lpc-ctrl.h 2017-01-17 11:12:17.711635876 +1030 +@@ -0,0 +1,36 @@ ++/* ++ * Copyright 2017 IBM Corp. ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU General Public License ++ * as published by the Free Software Foundation; either version ++ * 2 of the License, or (at your option) any later version. ++ */ ++ ++#ifndef _LINUX_ASPEED_LPC_CTRL_H ++#define _LINUX_ASPEED_LPC_CTRL_H ++ ++#include <linux/ioctl.h> ++ ++/* Window types */ ++#define ASPEED_LPC_CTRL_WINDOW_FLASH 1 ++#define ASPEED_LPC_CTRL_WINDOW_MEMORY 2 ++ ++struct aspeed_lpc_ctrl_mapping { ++ __u8 window_type; ++ __u8 window_id; ++ __u16 flags; ++ __u32 addr; ++ __u32 offset; ++ __u32 size; ++}; ++ ++#define __ASPEED_LPC_CTRL_IOCTL_MAGIC 0xb2 ++ ++#define ASPEED_LPC_CTRL_IOCTL_GET_SIZE _IOWR(__ASPEED_LPC_CTRL_IOCTL_MAGIC, \ ++ 0x00, struct aspeed_lpc_ctrl_mapping) ++ ++#define ASPEED_LPC_CTRL_IOCTL_MAP _IOW(__ASPEED_LPC_CTRL_IOCTL_MAGIC, \ ++ 0x01, struct aspeed_lpc_ctrl_mapping) ++ ++#endif /* _LINUX_ASPEED_LPC_CTRL_H */ diff --git a/meta-phosphor/recipes-phosphor/mboxd/mboxd.bb b/meta-phosphor/recipes-phosphor/mboxd/mboxd.bb new file mode 100644 index 0000000000..03428b7a8a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mboxd/mboxd.bb @@ -0,0 +1,51 @@ +SUMMARY = "Phosphor OpenBMC MBOX Daemon" +DESCRIPTION = "Phosphor OpenBMC MBOX Daemon" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +inherit autotools pkgconfig +inherit obmc-phosphor-systemd + +DEPENDS += "autoconf-archive-native" +DEPENDS += "systemd" +DEPENDS += "phosphor-logging" +RDEPENDS_${PN} += "libsystemd" + +S = "${WORKDIR}/git" + +SRC_URI += "git://github.com/openbmc/phosphor-mboxd.git" + +SRC_URI += "file://99-aspeed-mbox.rules" +SRC_URI += "file://99-aspeed-lpc-ctrl.rules" +SRC_URI += "file://aspeed-lpc-ctrl-h.patch" + +SRCREV="acdbdd141ece313f259ad6231e132f0a4bc3e062" + +PROVIDES += "mboxctl" + +MBOXD_FLASH_SIZE ??= "32M" +SYSTEMD_SUBSTITUTIONS += "FLASH_SIZE:${MBOXD_FLASH_SIZE}:${PN}.service" + +# Hacks because ${STAGING_KERNEL_DIR} points to the kernel source tree, not the +# installed, pre-processed headers. Requires the aspeed-lpc-ctrl-h patch above. +CFLAGS_append = " -I include" + +do_install_append() { + install -d ${D}/lib/udev/rules.d + install -m 0644 ${WORKDIR}/99-aspeed-mbox.rules ${D}/lib/udev/rules.d + install -m 0644 ${WORKDIR}/99-aspeed-lpc-ctrl.rules ${D}/lib/udev/rules.d +} + +TMPL = "mboxd-reload@.service" +TGTFMT = "obmc-chassis-poweron@{0}.target" +INSTFMT = "mboxd-reload@{0}.service" +FMT = "../${TMPL}:${TGTFMT}.wants/${INSTFMT}" + +SYSTEMD_SERVICE_${PN} += "mboxd.service" +SYSTEMD_SERVICE_${PN} += "mboxd-reload@.service" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'OBMC_CHASSIS_INSTANCES')}" + +# Enable virtual-pnor by DISTRO_FEATURE openpower-ubi-fs. +PACKAGECONFIG_append_df-openpower-ubi-fs = "virtual-pnor" +PACKAGECONFIG[virtual-pnor] = "--enable-virtual-pnor,--disable-virtual-pnor" diff --git a/meta-phosphor/recipes-phosphor/mboxd/mboxd/mboxd-reload@.service b/meta-phosphor/recipes-phosphor/mboxd/mboxd/mboxd-reload@.service new file mode 100644 index 0000000000..be02c7a2ce --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mboxd/mboxd/mboxd-reload@.service @@ -0,0 +1,16 @@ +[Unit] +Description=Reload mboxd during power on +Wants=obmc-power-start-pre@%i.target +Before=obmc-power-start-pre@%i.target +Wants=mapper-wait@-org-openbmc-mboxd.service +After=mapper-wait@-org-openbmc-mboxd.service +Conflicts=obmc-chassis-poweroff@%i.target + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/bin/env mboxctl --reset +SyslogIdentifier=mboxctl + +[Install] +WantedBy=obmc-chassis-poweron@%i.target diff --git a/meta-phosphor/recipes-phosphor/mboxd/mboxd/mboxd.service b/meta-phosphor/recipes-phosphor/mboxd/mboxd/mboxd.service new file mode 100644 index 0000000000..35081d85ab --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mboxd/mboxd/mboxd.service @@ -0,0 +1,15 @@ +[Unit] +Description=Phosphor MBOX Daemon +BindsTo=dev-aspeed\x2dlpc\x2dctrl.device +After=dev-aspeed\x2dlpc\x2dctrl.device +BindsTo=dev-aspeed\x2dmbox.device +After=dev-aspeed\x2dmbox.device + + +[Service] +Restart=always +ExecStart=/usr/bin/env mboxd --flash {FLASH_SIZE} --window-size 1M +SyslogIdentifier=mboxd + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/mrw/mrw-api-native.bb b/meta-phosphor/recipes-phosphor/mrw/mrw-api-native.bb new file mode 100644 index 0000000000..1930388ed4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mrw/mrw-api-native.bb @@ -0,0 +1,21 @@ +SUMMARY = "Phosphor OpenBMC machine readable workbook API modules" +DESCRIPTION = "The API for the MRW XML generated by the Serverwiz tool" +PR = "r1" + +S = "${WORKDIR}/scripts" + +inherit obmc-phosphor-license +inherit native +inherit perlnative +inherit cpan-base +inherit mrw-rev + +DEPENDS += "libxml-simple-perl-native json-perl-native" + +SRC_URI += "${MRW_API_SRC_URI}" +SRCREV = "${MRW_API_SRCREV}" + +do_install() { + install -d ${D}${PERLLIBDIRS_class-native}/perl/site_perl/${PERLVERSION}/mrw + install -m 0755 Targets.pm ${D}${PERLLIBDIRS_class-native}/perl/site_perl/${PERLVERSION}/mrw/Targets.pm +} diff --git a/meta-phosphor/recipes-phosphor/mrw/mrw-native.bb b/meta-phosphor/recipes-phosphor/mrw/mrw-native.bb new file mode 100644 index 0000000000..db9cbd9027 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mrw/mrw-native.bb @@ -0,0 +1,20 @@ +SUMMARY = "Phosphor OpenBMC machine readable workbook" +DESCRIPTION = "Pulls down system specific data" +PR = "r1" + +S = "${WORKDIR}/git" + +inherit obmc-phosphor-license +inherit obmc-xmlpatch +inherit native +inherit mrw-xml + +PHOSPHOR_MRW_URI ?= "http://missing-mrw-uri" +SRC_URI += "${PHOSPHOR_MRW_URI}" +SRCREV = "${PHOSPHOR_MRW_REV}" + +do_install() { + install -d ${D}/${mrw_datadir} + install -m 0644 ${MRW_XML} ${D}/${mrw_datadir} +} + diff --git a/meta-phosphor/recipes-phosphor/mrw/mrw-patch-native.bb b/meta-phosphor/recipes-phosphor/mrw/mrw-patch-native.bb new file mode 100644 index 0000000000..acaec73aa1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mrw/mrw-patch-native.bb @@ -0,0 +1,19 @@ +SUMMARY = "Phosphor machine readable workbook patching script" +DESCRIPTION = "Retrieve the script that can patch the MRW XML" +PR = "r1" + +S = "${WORKDIR}/git" + +inherit obmc-phosphor-license +inherit native +inherit mrw-rev + +DEPENDS += "python-native python-lxml-native" + +SRC_URI += "${MRW_TOOLS_SRC_URI}" +SRCREV = "${MRW_TOOLS_SRCREV}" + +do_install() { + install -d ${D}${bindir}/obmc-mrw + install -m 0755 patchxml.py ${D}${bindir}/obmc-mrw +} diff --git a/meta-phosphor/recipes-phosphor/mrw/mrw-perl-tools-native.bb b/meta-phosphor/recipes-phosphor/mrw/mrw-perl-tools-native.bb new file mode 100644 index 0000000000..91651227b3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/mrw/mrw-perl-tools-native.bb @@ -0,0 +1,13 @@ +SUMMARY = "OpenBMC MRW Perl Tools" +DESCRIPTION = "OpenBMC Perl tools for the machine readable workbook" +S = "${WORKDIR}/git" + +inherit obmc-phosphor-license +inherit native +inherit cpan_build +inherit mrw-rev + +DEPENDS += "libmodule-build-perl-native mrw-api-native yaml-tiny-native" + +SRC_URI += "${MRW_TOOLS_SRC_URI}" +SRCREV = "${MRW_TOOLS_SRCREV}" diff --git a/meta-phosphor/recipes-phosphor/network/inarp.bb b/meta-phosphor/recipes-phosphor/network/inarp.bb new file mode 100644 index 0000000000..90969c2487 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/network/inarp.bb @@ -0,0 +1,18 @@ +SUMMARY = "Inverse ARP daemon" +DESCRIPTION = "Daemon to respond to Inverse-ARP requests" +HOMEPAGE = "http://github.com/openbmc/inarp" +PR = "r1" + +inherit autotools +inherit obmc-phosphor-license +inherit obmc-phosphor-systemd + +DEPENDS += "autoconf-archive-native" +RDEPENDS_${PN} += "network" + +SRC_URI += "git://github.com/openbmc/inarp" +SRCREV = "6e296617f041d7665b2540151646af452088482c" + +S = "${WORKDIR}/git" + +exec_prefix="/usr/local" diff --git a/meta-phosphor/recipes-phosphor/network/inarp/inarp.service b/meta-phosphor/recipes-phosphor/network/inarp/inarp.service new file mode 100644 index 0000000000..5d26559f06 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/network/inarp/inarp.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Inverse ARP + +[Service] +ExecStart=/usr/bin/env inarp +SyslogIdentifier=inarp +Restart=always + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/network/network.bb b/meta-phosphor/recipes-phosphor/network/network.bb new file mode 100644 index 0000000000..3170d56ee0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/network/network.bb @@ -0,0 +1,27 @@ +SUMMARY = "Network DBUS object" +DESCRIPTION = "Network DBUS object" +HOMEPAGE = "http://github.com/openbmc/phosphor-networkd" +PR = "r1" + +inherit autotools pkgconfig +inherit pythonnative +inherit obmc-phosphor-license +inherit obmc-phosphor-dbus-service +inherit phosphor-networkd-rev + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.Network.service" + +DEPENDS += "systemd" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" +DEPENDS += "phosphor-logging" +DEPENDS += "libnl" + +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" +RDEPENDS_${PN} += "phosphor-logging" +RDEPENDS_${PN} += "libnl" +RDEPENDS_${PN} += "libnl-genl" + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/network/network/xyz.openbmc_project.Network.service b/meta-phosphor/recipes-phosphor/network/network/xyz.openbmc_project.Network.service new file mode 100644 index 0000000000..b9f7da7285 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/network/network/xyz.openbmc_project.Network.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor Network Manager +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env phosphor-network-manager +SyslogIdentifier=phosphor-network-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/network/phosphor-snmp/xyz.openbmc_project.Network.SNMP.service b/meta-phosphor/recipes-phosphor/network/phosphor-snmp/xyz.openbmc_project.Network.SNMP.service new file mode 100644 index 0000000000..f5a1d7274f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/network/phosphor-snmp/xyz.openbmc_project.Network.SNMP.service @@ -0,0 +1,13 @@ +[Unit] +Description=Phosphor SNMP conf Manager +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env phosphor-network-snmpconf +SyslogIdentifier=phosphor-network-snmpconf +Restart=always +Type=dbus +BusName=xyz.openbmc_project.Network.SNMP + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/network/phosphor-snmp_git.bb b/meta-phosphor/recipes-phosphor/network/phosphor-snmp_git.bb new file mode 100644 index 0000000000..7818579f05 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/network/phosphor-snmp_git.bb @@ -0,0 +1,31 @@ +SUMMARY = "SNMP Manager Configuration" +DESCRIPTION = "SNMP Manager Configuration." +HOMEPAGE = "http://github.com/openbmc/phosphor-snmp" +PR = "r1" +PV = "0.1+git${SRCPV}" + +inherit autotools pkgconfig +inherit pythonnative +inherit obmc-phosphor-dbus-service + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${WORKDIR}/git/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" + +SRC_URI += "git://github.com/openbmc/phosphor-snmp" +SRCREV = "f4ecf883389f5d9d7ebf635d62b20b91ef72e048" + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.Network.SNMP.service" + +DEPENDS += "systemd" +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" +DEPENDS += "phosphor-logging" +DEPENDS += "net-snmp" + +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" +RDEPENDS_${PN} += "phosphor-logging" +RDEPENDS_${PN} += "net-snmp-libs" + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb new file mode 100644 index 0000000000..5c184babf6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-apps.bb @@ -0,0 +1,133 @@ +SUMMARY = "OpenBMC - Applications" +PR = "r1" + +inherit packagegroup +inherit obmc-phosphor-license + +PROVIDES = "${PACKAGES}" +PACKAGES = " \ + ${PN}-bmc-state-mgmt \ + ${PN}-chassis-state-mgmt \ + ${PN}-extras \ + ${PN}-extrasdev \ + ${PN}-extrasdevtools \ + ${PN}-fan-control \ + ${PN}-host-state-mgmt \ + ${PN}-inventory \ + ${PN}-leds \ + ${PN}-logging \ + ${PN}-sensors \ + ${PN}-software \ + ${PN}-host-check-mgmt \ + ${PN}-debug-collector \ + ${PN}-settings \ + ${PN}-network \ + ${PN}-user-mgmt \ + " + +SUMMARY_${PN}-bmc-state-mgmt = "BMC state management" +RDEPENDS_${PN}-bmc-state-mgmt = " \ + ${VIRTUAL-RUNTIME_obmc-bmc-state-manager} \ + " + +SUMMARY_${PN}-chassis-state-mgmt = "Chassis state management" +RDEPENDS_${PN}-chassis-state-mgmt = " \ + ${VIRTUAL-RUNTIME_obmc-chassis-state-manager} \ + " + +SUMMARY_${PN}-extras = "Extra features" +RDEPENDS_${PN}-extras = " \ + phosphor-rest \ + phosphor-dbus-monitor \ + phosphor-systemd-policy \ + " + +SUMMARY_${PN}-extrasdev = "Development features" +RDEPENDS_${PN}-extrasdev = " \ + rest-dbus \ + " + +SUMMARY_${PN}-extrasdevtools = "Development tools" +RDEPENDS_${PN}-extrasdevtools = " \ + " + +# Use the fan control package group for applications +# implementing fan control or system fan policy only. +# Applications that create inventory or sensors should +# be added those respective package groups instead. +SUMMARY_${PN}-fan-control = "Fan control" +RDEPENDS_${PN}-fan-control = " \ + ${VIRTUAL-RUNTIME_obmc-fan-control} \ + phosphor-fan-monitor \ + " + +SUMMARY_${PN}-host-state-mgmt = "Host state management" +RDEPENDS_${PN}-host-state-mgmt = " \ + ${VIRTUAL-RUNTIME_obmc-host-state-manager} \ + ${VIRTUAL-RUNTIME_obmc-discover-system-state} \ + " + +SUMMARY_${PN}-inventory = "Inventory applications" +RDEPENDS_${PN}-inventory = " \ + ${VIRTUAL-RUNTIME_obmc-inventory-manager} \ + ${VIRTUAL-RUNTIME_obmc-fan-presence} \ + " + +SUMMARY_${PN}-leds = "LED applications" +RDEPENDS_${PN}-leds = " \ + ${VIRTUAL-RUNTIME_obmc-leds-manager} \ + ${VIRTUAL-RUNTIME_obmc-leds-sysfs} \ + ${VIRTUAL-RUNTIME_obmc-led-monitor} \ + " + +SUMMARY_${PN}-logging = "Logging applications" +RDEPENDS_${PN}-logging = " \ + phosphor-logging \ + " + +SUMMARY_${PN}-sensors = "Sensor applications" +RDEPENDS_${PN}-sensors = " \ + ${VIRTUAL-RUNTIME_obmc-sensors-hwmon} \ + " + +# These packages are not required with UBI enabled +${PN}-software-extras = " \ + obmc-flash-bmc \ + obmc-mgr-download \ + " + +${PN}-software-extras_df-obmc-ubi-fs = " \ + phosphor-image-signing \ + phosphor-software-manager-updater-ubi \ + " + +SUMMARY_${PN}-software = "Software applications" +RDEPENDS_${PN}-software = " \ + ${VIRTUAL-RUNTIME_obmc-bmc-download-mgr} \ + ${VIRTUAL-RUNTIME_obmc-bmc-updater} \ + ${VIRTUAL-RUNTIME_obmc-bmc-version} \ + ${${PN}-software-extras} \ + " + +SUMMARY_${PN}-debug-collector = "BMC debug collector" +RDEPENDS_${PN}-debug-collector = " \ + ${VIRTUAL-RUNTIME_obmc-dump-manager} \ + ${VIRTUAL-RUNTIME_obmc-dump-monitor} \ + phosphor-debug-collector-dreport \ + phosphor-debug-collector-scripts \ + " + +SUMMARY_${PN}-settings = "Settings applications" +RDEPENDS_${PN}-settings = " \ + ${VIRTUAL-RUNTIME_obmc-settings-mgmt} \ + " + +SUMMARY_${PN}-network = "BMC Network Manager" +RDEPENDS_${PN}-network = " \ + ${VIRTUAL-RUNTIME_obmc-network-manager} \ + " + +SUMMARY_${PN}-user-mgmt = "User management applications" +RDEPENDS_${PN}-user-mgmt = " \ + ${VIRTUAL-RUNTIME_obmc-user-mgmt} \ + " diff --git a/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bb b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bb new file mode 100644 index 0000000000..cbe7e7fb98 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-ipmid-providers.bb @@ -0,0 +1,11 @@ +SUMMARY = "OpenBMC - IPMI providers" +PR = "r1" + +inherit packagegroup +inherit obmc-phosphor-license + +PROVIDES = "${PACKAGES}" +PACKAGES = "${PN}-libs" + +SUMMARY_${PN}-libs = "Extra providers for ipmid." +RDEPENDS_${PN}-libs = "${VIRTUAL-RUNTIME_phosphor-ipmi-providers}" diff --git a/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bb b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bb new file mode 100644 index 0000000000..1a6d4b7876 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/packagegroups/packagegroup-obmc-phosphor-debugtools.bb @@ -0,0 +1,15 @@ +SUMMARY = "Phosphor OpenBMC - Debug Tools" +PR = "r1" + +inherit packagegroup +inherit obmc-phosphor-license + +RDEPENDS_${PN} = " \ + strace \ + ldd \ + ethtool \ + net-tools \ + phosphor-logging-test \ + lmsensors-sensors \ + tcpdump \ + " diff --git a/meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts.bb b/meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts.bb new file mode 100644 index 0000000000..30e0f3613a --- /dev/null +++ b/meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts.bb @@ -0,0 +1,22 @@ +inherit obmc-phosphor-license +inherit allarch +inherit update-alternatives + +RDEPENDS_${PN} += "${VIRTUAL-RUNTIME_base-utils}" + +SRC_URI += "file://init" + +FILES_${PN} += "${base_sbindir}/init" + +do_install() { + install -d ${D}/${base_sbindir} + install -m 0755 ${WORKDIR}/init ${D}/${base_sbindir}/preinit-mounts +} + +ALTERNATIVE_${PN} = "init" +ALTERNATIVE_TARGET[init] = "${base_sbindir}/preinit-mounts" +ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" + +# Use a number higher than the systemd init alternative so that +# ours is enabled instead. +ALTERNATIVE_PRIORITY[init] ?= "400" diff --git a/meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts/init b/meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts/init new file mode 100644 index 0000000000..91f8038f9e --- /dev/null +++ b/meta-phosphor/recipes-phosphor/preinit-mounts/preinit-mounts/init @@ -0,0 +1,19 @@ +#!/bin/sh + +if ! mount ubi0:rwfs /var -t ubifs -o defaults; then + if ! mount ubi0:rwfs /var -t ubifs -o defaults,ro; then + mount tmpfs /var -t tmpfs -o defaults + fi +fi + +mkdir -p /var/persist/etc /var/persist/etc-work /var/persist/home/root + +rm -rf /var/persist/etc-work/* +# rm -rf specifically skips . and .. directories; pipe all output to null to avoid the error message +rm -rf /var/persist/etc-work/.* > /dev/null 2>&1 + +if ! mount overlay /etc -t overlay -o defaults,lowerdir=/etc,upperdir=/var/persist/etc,workdir=/var/persist/etc-work; then + mount overlay /etc -t overlay -o defaults,lowerdir=/etc:/var/persist/etc +fi + +exec /lib/systemd/systemd diff --git a/meta-phosphor/recipes-phosphor/sensors/obmc-mgr-sensor.bb b/meta-phosphor/recipes-phosphor/sensors/obmc-mgr-sensor.bb new file mode 100644 index 0000000000..5eacac0671 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/obmc-mgr-sensor.bb @@ -0,0 +1,20 @@ +SUMMARY = "OpenBMC sensor manager" +DESCRIPTION = "OpenBMC sensor manager." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +VIRTUAL-RUNTIME_skeleton_workbook ?= "" + +RDEPENDS_${PN} += "\ + python-dbus \ + python-json \ + python-pygobject\ + pyphosphor \ + pyphosphor-dbus \ + ${VIRTUAL-RUNTIME_skeleton_workbook} \ + " + +SKELETON_DIR = "pysensormgr" +DBUS_SERVICE_${PN} += "org.openbmc.Sensors.service" diff --git a/meta-phosphor/recipes-phosphor/sensors/obmc-mgr-sensor/org.openbmc.Sensors.service b/meta-phosphor/recipes-phosphor/sensors/obmc-mgr-sensor/org.openbmc.Sensors.service new file mode 100644 index 0000000000..a4cb16439c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/obmc-mgr-sensor/org.openbmc.Sensors.service @@ -0,0 +1,15 @@ +[Unit] +Description=Phosphor Sensor Manager +Wants=mapper-wait@-xyz-openbmc_project-control-power_supply_redundancy.service +After=mapper-wait@-xyz-openbmc_project-control-power_supply_redundancy.service + +[Service] +Restart=always +ExecStart=/usr/bin/env sensor_manager2.py +SyslogIdentifier=sensor_manager2.py +Type=dbus +BusName={BUSNAME} +Environment="PYTHONUNBUFFERED=1" + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb new file mode 100644 index 0000000000..c6d0cba731 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon-config-mrw.bb @@ -0,0 +1,53 @@ +SUMMARY = "Phosphor hwmon configuration generator" +DESCRIPTION = "Generate phosphor-hwmon configuration from an MRW." +PR = "r1" + +inherit obmc-phosphor-license +inherit allarch +inherit mrw-xml + +DEPENDS += "mrw-perl-tools-native mrw-native" + +do_compile_append() { + ${STAGING_BINDIR_NATIVE}/perl-native/perl \ + ${STAGING_BINDIR_NATIVE}/hwmon.pl \ + -x ${mrw_datadir}/${MRW_XML} \ + -d ${WORKDIR}/mrw-config-files +} + +def find_conf_files(dir): + from fnmatch import fnmatch + myfiles = [] + + #These conf files generated by hwmon.pl are in + #subdirectories which we need to preserve the path to. + for root, dirs, files in os.walk(dir): + for name in files: + if fnmatch(name, "*.conf"): + myfiles.append(os.path.join(root, name)) + + return myfiles + +python install_conf_files() { + from shutil import copy + + conf_file_dir = os.path.join( + d.getVar("WORKDIR", True), + 'mrw-config-files') + files = find_conf_files(conf_file_dir) + + install_dir = os.path.join(d.getVar("D", True), + "etc", "default", "obmc", "hwmon") + + dir_len = len(conf_file_dir) + + for f in files: + dest = os.path.join(install_dir, f[dir_len + 1:]) + parent = os.path.dirname(dest) + if not os.path.exists(parent): + os.makedirs(parent) + + copy(f, dest) +} + +do_install[postfuncs] += "install_conf_files" diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon.bb b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon.bb new file mode 100644 index 0000000000..fe051b57a9 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon.bb @@ -0,0 +1,53 @@ +SUMMARY = "OpenBMC hwmon poller" +DESCRIPTION = "OpenBMC hwmon poller." +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +inherit autotools pkgconfig obmc-phosphor-systemd + +PACKAGE_BEFORE_PN = "max31785-msl" +SYSTEMD_PACKAGES = "${PN} max31785-msl" + +SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Hwmon@.service" +SYSTEMD_SERVICE_max31785-msl = "phosphor-max31785-msl@.service" + +DEPENDS += "autoconf-archive-native" +DEPENDS += " \ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + " + + +RDEPENDS_${PN} += "\ + sdbusplus \ + phosphor-dbus-interfaces \ + phosphor-logging \ + bash \ + " + +RRECOMMENDS_${PN} += "${VIRTUAL-RUNTIME_phosphor-hwmon-config}" + +FILES_max31785-msl = "${bindir}/max31785-msl" +RDEPENDS_max31785-msl = "${VIRTUAL-RUNTIME_base-utils} i2c-tools" + +SRC_URI += "git://github.com/openbmc/phosphor-hwmon" +SRC_URI += "file://70-hwmon.rules" +SRC_URI += "file://70-iio.rules" +SRC_URI += "file://start_hwmon.sh" + +SRCREV = "c9c818ed854f23a87dd77c2209b6a27805825adb" + +S = "${WORKDIR}/git" + +do_install_append() { + + install -d ${D}/${base_libdir}/udev/rules.d/ + install ${WORKDIR}/70-hwmon.rules ${D}/${base_libdir}/udev/rules.d/ + install ${WORKDIR}/70-iio.rules ${D}/${base_libdir}/udev/rules.d/ + + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/start_hwmon.sh ${D}${bindir} +} diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules new file mode 100644 index 0000000000..503b2d002b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-hwmon.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="hwmon", ACTION=="add", RUN="/usr/bin/start_hwmon.sh start %p %E{OF_FULLNAME}" +SUBSYSTEM=="hwmon", ACTION=="remove", RUN="/usr/bin/start_hwmon.sh stop %p %E{OF_FULLNAME}" diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-iio.rules b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-iio.rules new file mode 100644 index 0000000000..45fb4b0fb6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/70-iio.rules @@ -0,0 +1,2 @@ +SUBSYSTEM=="iio", ACTION=="add", RUN="/usr/bin/start_hwmon.sh start %p %E{OF_FULLNAME}" +SUBSYSTEM=="iio", ACTION=="remove", RUN="/usr/bin/start_hwmon.sh stop %p %E{OF_FULLNAME}" diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service new file mode 100644 index 0000000000..d9de6c0810 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/phosphor-max31785-msl@.service @@ -0,0 +1,11 @@ +[Unit] +Description=Phosphor MAX31785 MSL +ConditionFileNotEmpty={envfiledir}/obmc/hwmon-max31785/%I.conf +Wants=mapper-wait@-xyz-openbmc_project-inventory.service +After=mapper-wait@-xyz-openbmc_project-inventory.service + +[Service] +Type=oneshot +ExecStart=/usr/bin/env max31785-msl -p "${{PATHS}}" -b ${{BUS}} -r ${{REVISION}} +EnvironmentFile={envfiledir}/obmc/hwmon-max31785/%I.conf +SyslogIdentifier=max31785-msl diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh new file mode 100755 index 0000000000..cde0f96ca6 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/start_hwmon.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +action=$1 +devpath=$2 +of_fullname=$3 + +#Use of_fullname if it's there, otherwise use devpath. + +path=$of_fullname +if [ -z "$path" ] +then + path=$devpath + + if [[ "$path" =~ (.*)/hwmon/hwmon[0-9]+$ ]]; + then + path=${BASH_REMATCH[1]} + fi +fi + +path="${path//:/--}" + +systemctl $action 'xyz.openbmc_project.Hwmon@'$path'.service' diff --git a/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service new file mode 100644 index 0000000000..9d3e2635e3 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/sensors/phosphor-hwmon/xyz.openbmc_project.Hwmon@.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor Hwmon Poller +ConditionFileNotEmpty=/etc/default/obmc/hwmon/%I.conf +After=xyz.openbmc_project.ObjectMapper.service + +[Service] +Restart=on-failure +ExecStart=/usr/bin/env phosphor-hwmon-readd -o %f +SyslogIdentifier=phosphor-hwmon-readd +EnvironmentFile=/etc/default/obmc/hwmon/%I.conf diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-defaults-native.bb b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-defaults-native.bb new file mode 100644 index 0000000000..37b8d4ef61 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-defaults-native.bb @@ -0,0 +1,18 @@ +SUMMARY = "Default settings" +PR = "r1" + +inherit native +inherit obmc-phosphor-license +inherit phosphor-settings-manager + +SRC_URI += "file://defaults.yaml" + +PROVIDES += "virtual/phosphor-settings-defaults" + +S = "${WORKDIR}" + +do_install() { + DEST=${D}${settings_datadir} + install -d ${DEST} + install defaults.yaml ${DEST} +} diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml new file mode 100644 index 0000000000..de00b8e68d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-defaults/defaults.yaml @@ -0,0 +1,117 @@ +/xyz/openbmc_project/control/minimum_ship_level_required: + - Interface: xyz.openbmc_project.Control.MinimumShipLevel + Properties: + MinimumShipLevelRequired: + Default: 'true' + +/xyz/openbmc_project/control/host0/auto_reboot: + - Interface: xyz.openbmc_project.Control.Boot.RebootPolicy + Properties: + AutoReboot: + Default: 'true' + +/xyz/openbmc_project/control/host0/boot: + - Interface: xyz.openbmc_project.Control.Boot.Source + Properties: + BootSource: + Default: Source::Sources::Default + - Interface: xyz.openbmc_project.Control.Boot.Mode + Properties: + BootMode: + Default: Mode::Modes::Regular + +/xyz/openbmc_project/control/host0/boot/one_time: + - Interface: xyz.openbmc_project.Control.Boot.Source + Properties: + BootSource: + Default: Source::Sources::Default + - Interface: xyz.openbmc_project.Control.Boot.Mode + Properties: + BootMode: + Default: Mode::Modes::Regular + - Interface: xyz.openbmc_project.Object.Enable + Properties: + Enabled: + Default: 'true' + +/xyz/openbmc_project/control/host0/power_cap: + - Interface: xyz.openbmc_project.Control.Power.Cap + Properties: + PowerCap: + Default: 0 + Validation: + Type: "range" + Validator: "0..1000" + Unit: "Watts" + PowerCapEnable: + Default: 'false' + +/xyz/openbmc_project/control/host0/power_restore_policy: + - Interface: xyz.openbmc_project.Control.Power.RestorePolicy + Properties: + PowerRestorePolicy: + Default: RestorePolicy::Policy::AlwaysOff + +/xyz/openbmc_project/time/owner: + - Interface: xyz.openbmc_project.Time.Owner + Properties: + TimeOwner: + Default: Owner::Owners::BMC + +/xyz/openbmc_project/time/sync_method: + - Interface: xyz.openbmc_project.Time.Synchronization + Properties: + TimeSyncMethod: + Default: Synchronization::Method::NTP + +/xyz/openbmc_project/network/host0/intf: + - Interface: xyz.openbmc_project.Network.MACAddress + Properties: + MACAddress: + Default: '"00:00:00:00:00:00"' + Validation: + Type: "regex" + Validator: '^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$' + +#needs to implement address validation TODO openbmc/issues/2046 +/xyz/openbmc_project/network/host0/intf/addr: + - Interface: xyz.openbmc_project.Network.IP + Properties: + Address: + Default: '"0.0.0.0"' + PrefixLength: + Default: 0 + Validation: + Type: "range" + Validator: 0..128 + Unit: "bits" + Origin: + Default: IP::AddressOrigin::Static + Gateway: + Default: '"0.0.0.0"' + Type: + Default: IP::Protocol::IPv4 + +/xyz/openbmc_project/control/host0/restriction_mode: + - Interface: xyz.openbmc_project.Control.Security.RestrictionMode + Properties: + RestrictionMode: + Default: RestrictionMode::Modes::None + +/xyz/openbmc_project/control/host0/TPMEnable: + - Interface: xyz.openbmc_project.Control.TPM.Policy + Properties: + TPMEnable: + Default: 'false' + +/xyz/openbmc_project/control/power_supply_redundancy: + - Interface: xyz.openbmc_project.Control.PowerSupplyRedundancy + Properties: + PowerSupplyRedundancyEnabled: + Default: 'true' + +/xyz/openbmc_project/control/host0/turbo_allowed: + - Interface: xyz.openbmc_project.Control.Host.TurboAllowed + Properties: + TurboAllowed: + Default: 'true' diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager.bb b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager.bb new file mode 100644 index 0000000000..a63a1f24aa --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager.bb @@ -0,0 +1,67 @@ +SUMMARY = "Phosphor Settings Manager" +DESCRIPTION = "Phosphor Settings Manager is an application that creates \ +d-bus objects to represent various user settings." +PR = "r1" + +inherit autotools +inherit obmc-phosphor-dbus-service +inherit pythonnative +inherit phosphor-settings-manager + +require phosphor-settings-manager.inc + +DBUS_SERVICE_${PN} = "xyz.openbmc_project.Settings.service" + +DEPENDS += "python-pyyaml-native" +DEPENDS += "python-mako-native" +DEPENDS += "autoconf-archive-native" +DEPENDS += "virtual/phosphor-settings-defaults" +DEPENDS += "${@df_enabled(d, 'obmc-mrw', 'phosphor-settings-read-settings-mrw-native')}" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces phosphor-dbus-interfaces-native" +DEPENDS += "phosphor-logging" +DEPENDS += "cereal" + +RDEPENDS_${PN} += "sdbusplus phosphor-dbus-interfaces" + +S = "${WORKDIR}/git" +SRC_URI += "file://merge_settings.py" + +EXTRA_OECONF = " \ + SETTINGS_YAML=${STAGING_DIR_NATIVE}${settings_datadir}/defaults.yaml \ + " + +# Collect files in SRC_URI that end in ".override.yml" and call a script that +# writes their contents over that of settings.yaml, which is then updated to +# the merged data values. +# This doesn't correctly handle globs in ".override.yml" entries in SRC_URI. +python do_merge_settings () { + import subprocess + + # TODO: Perform the merge in a temporary directory? + workdir = d.getVar('WORKDIR', True) + nativedir = d.getVar('STAGING_DIR_NATIVE', True) + settingsdir = d.getVar('settings_datadir', True) + settingsdir = settingsdir[1:] + settingsdir = os.path.join(nativedir, settingsdir) + cmd = [] + cmd.append(os.path.join(workdir, 'merge_settings.py')) + cmd.append(os.path.join(settingsdir, 'defaults.yaml')) + # Used for any settings from the MRW + use_mrw = df_enabled(d, 'obmc-mrw', 'true') + if (use_mrw == 'true'): + cmd.append(os.path.join(settingsdir, 'mrw-settings.override.yaml')) + + fetch = bb.fetch2.Fetch([], d) + override_urls = [url for url in fetch.urls if url.endswith('.override.yml')] + for url in override_urls: + bb.debug(2, 'Overriding with source: ' + url) + local_base = os.path.basename(fetch.localpath(url)) + filename = os.path.join(workdir, local_base) + cmd.append(filename) + + # Invoke the script and don't catch any resulting exception. + subprocess.check_call(cmd) +} +# python-pyyaml-native is installed by do_configure, so put this task after +addtask merge_settings after do_configure before do_compile diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager.inc b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager.inc new file mode 100644 index 0000000000..b6c6b0b8ae --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager.inc @@ -0,0 +1,5 @@ +HOMEPAGE = "http://github.com/openbmc/phosphor-settingsd" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" +SRC_URI += "git://github.com/openbmc/phosphor-settingsd" +SRCREV = "58d2efeef84aa2812dfc249d7005c765c4b2091a" diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager/merge_settings.py b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager/merge_settings.py new file mode 100755 index 0000000000..01f5e35523 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager/merge_settings.py @@ -0,0 +1,58 @@ +#!/usr/bin/env python +"""Loads a "target" YAML file and overwrites its values with values from +"override" YAML files. + +Override files are processed in the order given. + +Usage: + merge_settings.py <target yaml> [override yamls] +""" +import sys +import yaml +import copy + +def dict_merge(target, source): + """Deep merge for dicts. + + Works like dict.update() that recursively updates any dict values present in + both parameters. + + Args: + target (dict): Values to be overwritten by corresponding values from + `source`. + source (dict): Overriding values. Not changed by call. + + Returns: + `target` with values overwritten from those in `source` at any and all + levels of nested dicts. + """ + if not isinstance(source, dict): + return source + for k, v in source.iteritems(): + if k in target and isinstance(target[k], dict): + dict_merge(target[k], v) + else: + target[k] = copy.deepcopy(v) + return target + +if len(sys.argv) < 2: + sys.exit('Argument required: target yaml') + +if len(sys.argv) == 2: + # No overrides to handle + sys.exit() + +target_filename = sys.argv[1] +with open(target_filename) as target_file: + data = yaml.safe_load(target_file) + print('Loaded target YAML file ' + target_filename) + +for override_filename in sys.argv[2:]: + with open(override_filename) as override_file: + override = yaml.safe_load(override_file) + dict_merge(data, override) + print('Merged override YAML file ' + override_filename) + +with open(target_filename, 'w') as target_file: + yaml.dump(data, target_file) + print('Wrote merged target YAML file ' + target_filename) diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service new file mode 100644 index 0000000000..50e21665ce --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-manager/xyz.openbmc_project.Settings.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor Settings Daemon + +[Service] +ExecStart=/usr/bin/env phosphor-settings-manager +SyslogIdentifier=phosphor-settings-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb new file mode 100644 index 0000000000..d5ec1bc531 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-read-settings-mrw-native.bb @@ -0,0 +1,37 @@ +# Generates MRW settings override yaml for phosphor-settings-manager +# The default YAML file, mrw-override-settings.yaml, is empty, therefore no +# settings will be overwritten. To override, modify mrw-override-settings.yaml. + +SUMMARY = "Generates MRW settings override YAML for phosphor-settings-manager." +PR = "r1" + +inherit native +inherit phosphor-settings-manager +inherit mrw-xml + +inherit obmc-phosphor-license + +DEPENDS += "mrw-native mrw-perl-tools-native" + +SRC_URI += "file://mrw-override-settings.yaml" + +S = "${WORKDIR}" + +MRW_EXPRESSION_VARS ?= "" + +do_install() { + DEST=${D}${config_datadir} + install -D mrw-override-settings.yaml ${DEST}/mrw-override-settings.yaml + + SETTINGS=${D}${settings_datadir} + install -d ${SETTINGS} + + # gen_settings.pl replaces any MRW variables with their value + ${bindir}/perl-native/perl \ + ${bindir}/gen_settings.pl \ + -i ${mrw_datadir}/${MRW_XML} \ + -s ${DEST}/mrw-override-settings.yaml \ + -o ${SETTINGS}/mrw-settings.override.yaml \ + ${MRW_EXPRESSION_VARS} \ + -f +} diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings-read-settings-mrw/mrw-override-settings.yaml b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-read-settings-mrw/mrw-override-settings.yaml new file mode 100644 index 0000000000..c0fbedeccb --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings-read-settings-mrw/mrw-override-settings.yaml @@ -0,0 +1,3 @@ +# Default MRW settings override definition YAML - empty. +# Any MRW variables, marked by MRW_<MRW variable name>, are replaced with their +# MRW value. diff --git a/meta-phosphor/recipes-phosphor/settings/phosphor-settings/merge_settings.py b/meta-phosphor/recipes-phosphor/settings/phosphor-settings/merge_settings.py new file mode 120000 index 0000000000..f1395f0010 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/settings/phosphor-settings/merge_settings.py @@ -0,0 +1 @@ +../phosphor-settings-manager/merge_settings.py
\ No newline at end of file diff --git a/meta-phosphor/recipes-phosphor/skeleton/obmc-libobmc-intf.bb b/meta-phosphor/recipes-phosphor/skeleton/obmc-libobmc-intf.bb new file mode 100644 index 0000000000..b02b83234f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/skeleton/obmc-libobmc-intf.bb @@ -0,0 +1,21 @@ +SUMMARY = "OpenBMC gdbus library" +DESCRIPTION = "libopenbmc_intf provides a set of gpio access \ +methods and the GDBUS skeleton code for the org.openbmc DBUS API." +PR = "r1" + +inherit skeleton +inherit pkgconfig + +DEPENDS += "glib-2.0" +DEPENDS += "cjson" + +SKELETON_DIR = "libopenbmc_intf" + +SRC_URI += "file://gpio_defs.json" + +do_install() { + oe_runmake install DESTDIR=${D} + + install -d ${D}${sysconfdir}/default/obmc/gpio/ + install -m 0644 ${WORKDIR}/gpio_defs.json ${D}/${sysconfdir}/default/obmc/gpio/ +} diff --git a/meta-phosphor/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json b/meta-phosphor/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json new file mode 100644 index 0000000000..6e4ef9ff96 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/skeleton/obmc-libobmc-intf/gpio_defs.json @@ -0,0 +1,3 @@ +{ + "_comments": "This file should be overridden with one from the machine layer." +} diff --git a/meta-phosphor/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf b/meta-phosphor/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf new file mode 100644 index 0000000000..2e3ca1a5bc --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/obmc/phosphor-reboot-host/reboot.conf @@ -0,0 +1 @@ +REBOOT_DELAY=5 diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service new file mode 100644 index 0000000000..f398038993 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-discover-system-state@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Reboot If Enabled +Wants=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service +After=mapper-wait@-xyz-openbmc_project-control-host0-power_restore_policy.service +Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service +After=mapper-wait@-xyz-openbmc_project-state-host%i.service +Wants=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +After=mapper-wait@-xyz-openbmc_project-state-chassis%i.service +After=op-reset-chassis-on@%i.service +ConditionPathExists=!/run/openbmc/chassis@%i-on + +[Service] +Restart=no +Type=oneshot +ExecStart=/usr/bin/env phosphor-discover-system-state --host %i +SyslogIdentifier=phosphor-discover-system-state + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-reboot-host@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-reboot-host@.service new file mode 100644 index 0000000000..27479f2def --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-reboot-host@.service @@ -0,0 +1,18 @@ +[Unit] +Description=Reboot host%i +Wants=obmc-host-stop@%i.target +After=obmc-host-stop@%i.target + +[Service] +#ExecStart={base_bindir}/systemctl start obmc-host-start@%i.target +# This service is starting another target that conflicts with the +# target this service is running in. OpenBMC needs a refactor of +# how it does its host reset path. Until then, this short term +# solution does the job. +# Since this is a part of the reboot target, call the startmin +# target which does the minimum required to start the host. +ExecStart=/bin/sh -c "sleep ${{REBOOT_DELAY}} && systemctl start obmc-host-startmin@%i.target" +EnvironmentFile={envfiledir}/obmc/phosphor-reboot-host/reboot.conf + +[Install] +WantedBy=obmc-host-reboot@%i.target diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-check@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-check@.service new file mode 100644 index 0000000000..6062320b20 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-check@.service @@ -0,0 +1,19 @@ +[Unit] +Description=Check Host%i status on BMC reset +Wants=mapper-wait@-xyz-openbmc_project-control-host%i.service +After=mapper-wait@-xyz-openbmc_project-control-host%i.service +Wants=obmc-host-reset-running@%i.target +Before=obmc-host-reset-running@%i.target +Wants=op-reset-chassis-on@%i.service +After=op-reset-chassis-on@%i.service +Conflicts=obmc-host-stop@%i.target +ConditionPathExists=/run/openbmc/chassis@%i-on + +[Service] +RemainAfterExit=yes +Type=oneshot +ExecStart=/usr/bin/env phosphor-host-check +SyslogIdentifier=phosphor-host-check + +[Install] +WantedBy=obmc-host-reset@%i.target diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service new file mode 100644 index 0000000000..35de4304bd --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-reboot-attempts@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Reset host reboot counter +Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service +After=mapper-wait@-xyz-openbmc_project-state-host%i.service +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Restart=no +Type=oneshot +ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host%i` /xyz/openbmc_project/state/host%i xyz.openbmc_project.Control.Boot.RebootAttempts AttemptsLeft u 3" + +[Install] +WantedBy=obmc-host-start@%i.target diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-running@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-running@.service new file mode 100644 index 0000000000..a49bbdd16b --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-host-running@.service @@ -0,0 +1,13 @@ +[Unit] +Description=Start host%i running after BMC reset +After=obmc-host-reset-running@%i.target +Requires=obmc-host-reset-running@%i.target +ConditionPathExists=/run/openbmc/host@%i-on + +[Service] +RemainAfterExit=no +ExecStart=/bin/systemctl start obmc-host-start@%i.target + + +[Install] +WantedBy=obmc-host-reset@%i.target diff --git a/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-sensor-states@.service b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-sensor-states@.service new file mode 100644 index 0000000000..689372f4a2 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/phosphor-reset-sensor-states@.service @@ -0,0 +1,15 @@ +[Unit] +Description=Reset host sensors +After=phosphor-reset-host-check@%i.service +Wants=mapper-wait@-xyz-openbmc_project-state-host%i.service +After=mapper-wait@-xyz-openbmc_project-state-host%i.service +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Restart=no +Type=oneshot +ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host0` /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.Boot.Progress BootProgress s xyz.openbmc_project.State.Boot.Progress.ProgressStages.Unspecified" +ExecStart=/bin/sh -c "busctl set-property `mapper get-service /xyz/openbmc_project/state/host0` /xyz/openbmc_project/state/host0 xyz.openbmc_project.State.OperatingSystem.Status OperatingSystemState s xyz.openbmc_project.State.OperatingSystem.Status.OSStatus.Inactive" + +[Install] +WantedBy=obmc-host-reset@%i.target diff --git a/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.BMC.service b/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.BMC.service new file mode 100644 index 0000000000..057af648d8 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.BMC.service @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor BMC State Manager +Before=mapper-wait@-xyz-openbmc_project-state-bmc.service +Wants=obmc-mapper.target +After=obmc-mapper.target + + +[Service] +ExecStart=/usr/bin/env phosphor-bmc-state-manager +SyslogIdentifier=phosphor-bmc-state-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.Chassis.service b/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.Chassis.service new file mode 100644 index 0000000000..259dd16af0 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.Chassis.service @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor Chassis State Manager +Before=mapper-wait@-xyz-openbmc_project-state-chassis.service +Wants=obmc-mapper.target +After=obmc-mapper.target +After=org.openbmc.control.Power@0.service + +[Service] +ExecStart=/usr/bin/env phosphor-chassis-state-manager +SyslogIdentifier=phosphor-chassis-state-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service b/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service new file mode 100644 index 0000000000..26f523eaab --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/files/xyz.openbmc_project.State.Host.service @@ -0,0 +1,18 @@ +[Unit] +Description=Phosphor Host State Manager +Wants=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service +After=mapper-wait@-xyz-openbmc_project-control-host0-auto_reboot.service +Before=mapper-wait@-xyz-openbmc_project-state-host.service +After=phosphor-reset-host-running@0.service +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +ExecStart=/usr/bin/env phosphor-host-state-manager +SyslogIdentifier=phosphor-host-state-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/state/phosphor-state-manager.bb b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager.bb new file mode 100644 index 0000000000..4acaa56888 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/state/phosphor-state-manager.bb @@ -0,0 +1,141 @@ +SUMMARY = "Phosphor State Management" +DESCRIPTION = "Phosphor State Manager provides a set of system state \ +management daemons. It is suitable for use on a wide variety of OpenBMC \ +platforms." +HOMEPAGE = "https://github.com/openbmc/phosphor-state-manager" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" + +STATE_MGR_PACKAGES = " \ + ${PN}-host \ + ${PN}-chassis \ + ${PN}-bmc \ + ${PN}-discover \ + ${PN}-host-check \ + ${PN}-reset-sensor-states \ +" +PACKAGE_BEFORE_PN += "${STATE_MGR_PACKAGES}" +ALLOW_EMPTY_${PN} = "1" + +DBUS_PACKAGES = "${STATE_MGR_PACKAGES}" + +SYSTEMD_PACKAGES = "${PN}-discover \ + ${PN}-reset-sensor-states \ +" + +# The host-check function will check if the host is running +# after a BMC reset. +# The reset-sensor-states function will reset the host +# sensors on a BMC reset or system power loss. +# Neither is required for host state function but are +# recommended to deal properly with these reset scenarios. +RRECOMMENDS_${PN}-host = "${PN}-host-check ${PN}-reset-sensor-states" + +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-logging" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "cereal" +RDEPENDS_${PN} += "sdbusplus" + +RDEPENDS_${PN}-host += "libsystemd phosphor-dbus-interfaces" +RDEPENDS_${PN}-chassis += "libsystemd phosphor-dbus-interfaces" +RDEPENDS_${PN}-bmc += "libsystemd phosphor-dbus-interfaces" +RDEPENDS_${PN}-discover += "libsystemd phosphor-dbus-interfaces" +RDEPENDS_${PN}-host-check += "libsystemd phosphor-dbus-interfaces" +RDEPENDS_${PN}-reset-sensor-states += "libsystemd phosphor-dbus-interfaces" + +FILES_${PN}-host = "${sbindir}/phosphor-host-state-manager" +DBUS_SERVICE_${PN}-host += "xyz.openbmc_project.State.Host.service" +DBUS_SERVICE_${PN}-host += "phosphor-reboot-host@.service" +SYSTEMD_ENVIRONMENT_FILE_${PN}-host += "obmc/phosphor-reboot-host/reboot.conf" +SYSTEMD_SERVICE_${PN}-host += "phosphor-reset-host-reboot-attempts@.service" + +FILES_${PN}-chassis = "${sbindir}/phosphor-chassis-state-manager" +DBUS_SERVICE_${PN}-chassis += "xyz.openbmc_project.State.Chassis.service" + +FILES_${PN}-bmc = "${sbindir}/phosphor-bmc-state-manager" +DBUS_SERVICE_${PN}-bmc += "xyz.openbmc_project.State.BMC.service" + +FILES_${PN}-discover = "${sbindir}/phosphor-discover-system-state" +SYSTEMD_SERVICE_${PN}-discover += "phosphor-discover-system-state@.service" + +FILES_${PN}-host-check = "${sbindir}/phosphor-host-check" +SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-check@.service" +SYSTEMD_SERVICE_${PN}-host-check += "phosphor-reset-host-running@.service" + +SYSTEMD_SERVICE_${PN}-reset-sensor-states += "phosphor-reset-sensor-states@.service" + +RESET_CHECK_TMPL = "phosphor-reset-host-check@.service" +RESET_CHECK_TGTFMT = "obmc-host-reset@{1}.target" +RESET_CHECK_INSTFMT = "phosphor-reset-host-check@{0}.service" +RESET_CHECK_FMT = "../${RESET_CHECK_TMPL}:${RESET_CHECK_TGTFMT}.requires/${RESET_CHECK_INSTFMT}" + +SENSOR_RESET_TMPL = "phosphor-reset-sensor-states@.service" +SENSOR_RESET_TGTFMT = "obmc-host-reset@{1}.target" +SENSOR_RESET_INSTFMT = "phosphor-reset-sensor-states@{0}.service" +SENSOR_RESET_FMT = "../${SENSOR_RESET_TMPL}:${SENSOR_RESET_TGTFMT}.requires/${SENSOR_RESET_INSTFMT}" + +RESET_RUNNING_TMPL = "phosphor-reset-host-running@.service" +RESET_RUNNING_TGTFMT = "obmc-host-reset@{1}.target" +RESET_RUNNING_INSTFMT = "phosphor-reset-host-running@{0}.service" +RESET_RUNNING_FMT = "../${RESET_RUNNING_TMPL}:${RESET_RUNNING_TGTFMT}.requires/${RESET_RUNNING_INSTFMT}" + +SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_CHECK_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_RUNNING_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}" + +SYSTEMD_LINK_${PN}-reset-sensor-states += "${@compose_list_zip(d, 'SENSOR_RESET_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}" + +# Force the standby target to run the host reset check target +RESET_TMPL_CTRL = "obmc-host-reset@.target" +SYSD_TGT = "${SYSTEMD_DEFAULT_TARGET}" +RESET_INSTFMT_CTRL = "obmc-host-reset@{0}.target" +RESET_FMT_CTRL = "../${RESET_TMPL_CTRL}:${SYSD_TGT}.wants/${RESET_INSTFMT_CTRL}" +SYSTEMD_LINK_${PN}-host-check += "${@compose_list_zip(d, 'RESET_FMT_CTRL', 'OBMC_HOST_INSTANCES')}" + +TMPL = "phosphor-discover-system-state@.service" +INSTFMT = "phosphor-discover-system-state@{0}.service" +FMT = "../${TMPL}:${SYSTEMD_DEFAULT_TARGET}.wants/${INSTFMT}" +SYSTEMD_LINK_${PN}-discover += "${@compose_list(d, 'FMT', 'OBMC_HOST_INSTANCES')}" + +# Force the shutdown target to run the chassis-poweroff target +CHASSIS_STOP_TMPL = "obmc-chassis-poweroff@.target" +HOST_STOP_TGTFMT = "obmc-host-shutdown@{1}.target" +CHASSIS_STOP_INSTFMT = "obmc-chassis-poweroff@{0}.target" +HOST_STOP_FMT = "../${CHASSIS_STOP_TMPL}:${HOST_STOP_TGTFMT}.requires/${CHASSIS_STOP_INSTFMT}" +SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_STOP_FMT', 'OBMC_CHASSIS_INSTANCES', 'OBMC_HOST_INSTANCES')}" + +# Force the host reboot target to run the shutdown target +HOST_SHUTDOWN_TMPL = "obmc-host-shutdown@.target" +HOST_REBOOT_TGTFMT = "obmc-host-reboot@{0}.target" +HOST_SHUTDOWN_INSTFMT = "obmc-host-shutdown@{0}.target" +HOST_REBOOT_FMT = "../${HOST_SHUTDOWN_TMPL}:${HOST_REBOOT_TGTFMT}.requires/${HOST_SHUTDOWN_INSTFMT}" +SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_FMT', 'OBMC_HOST_INSTANCES')}" + +# And also force the reboot target to call the host startmin service +HOST_REBOOT_SVC = "phosphor-reboot-host@.service" +HOST_REBOOT_SVC_INST = "phosphor-reboot-host@{0}.service" +HOST_REBOOT_SVC_FMT = "../${HOST_REBOOT_SVC}:${HOST_REBOOT_TGTFMT}.requires/${HOST_REBOOT_SVC_INST}" +SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_REBOOT_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}" + +# Force the host-start target to call the host-startmin target +HOST_STARTMIN_TMPL = "obmc-host-startmin@.target" +HOST_START_TGTFMT = "obmc-host-start@{0}.target" +HOST_STARTMIN_INSTFMT = "obmc-host-startmin@{0}.target" +HOST_START_FMT = "../${HOST_STARTMIN_TMPL}:${HOST_START_TGTFMT}.requires/${HOST_STARTMIN_INSTFMT}" +SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_START_FMT', 'OBMC_HOST_INSTANCES')}" + +# Force the host-start target to call the reboot count reset service +HOST_RST_RBT_ATTEMPTS_SVC = "phosphor-reset-host-reboot-attempts@.service" +HOST_RST_RBT_ATTEMPTS_SVC_INST = "phosphor-reset-host-reboot-attempts@{0}.service" +HOST_RST_RBT_ATTEMPTS_SVC_FMT = "../${HOST_RST_RBT_ATTEMPTS_SVC}:${HOST_START_TGTFMT}.requires/${HOST_RST_RBT_ATTEMPTS_SVC_INST}" +SYSTEMD_LINK_${PN}-host += "${@compose_list_zip(d, 'HOST_RST_RBT_ATTEMPTS_SVC_FMT', 'OBMC_HOST_INSTANCES', 'OBMC_HOST_INSTANCES')}" + +SRC_URI += "git://github.com/openbmc/phosphor-state-manager" +SRCREV = "a965cf06a6bb6b130a2e4f1202978aac9124be68" + +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/system/files/obmc-phosphor-sysd.py b/meta-phosphor/recipes-phosphor/system/files/obmc-phosphor-sysd.py new file mode 100644 index 0000000000..c8080ac2c9 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/files/obmc-phosphor-sysd.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-watchdogd starting..." + + while 1: + time.sleep(5) diff --git a/meta-phosphor/recipes-phosphor/system/files/obmc-phosphor-sysd.service b/meta-phosphor/recipes-phosphor/system/files/obmc-phosphor-sysd.service new file mode 100644 index 0000000000..d4dacf546d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/files/obmc-phosphor-sysd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Phosphor System Manager + +[Service] +Restart=always +ExecStart=/usr/bin/env obmc-phosphor-sysd +SyslogIdentifier=obmc-phosphor-sysd + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/system/obmc-control-bmc.bb b/meta-phosphor/recipes-phosphor/system/obmc-control-bmc.bb new file mode 100644 index 0000000000..eb5b4a8107 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/obmc-control-bmc.bb @@ -0,0 +1,13 @@ +SUMMARY = "OpenBMC org.openbmc.control.Bmc example implementation" +DESCRIPTION = "A sample implementation for the org.openbmc.control.Bmc DBUS API. \ +org.openbmc.control.Bmc provides APIs for functions like resetting the BMC." +PR = "r1" + +inherit skeleton-gdbus +inherit obmc-phosphor-dbus-service +inherit pkgconfig + +SKELETON_DIR = "bmcctl" + +FMT = "org.openbmc.control.Bmc@{0}.service" +DBUS_SERVICE_${PN} += "${@compose_list(d, 'FMT', 'OBMC_BMC_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/system/obmc-control-bmc/org.openbmc.control.Bmc@.service b/meta-phosphor/recipes-phosphor/system/obmc-control-bmc/org.openbmc.control.Bmc@.service new file mode 100644 index 0000000000..9685efecd5 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/obmc-control-bmc/org.openbmc.control.Bmc@.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor BMC%i Control + +[Service] +Restart=always +ExecStart=/usr/bin/env control_bmc.exe +SyslogIdentifier=control_bmc.exe +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/system/obmc-mgr-system.bb b/meta-phosphor/recipes-phosphor/system/obmc-mgr-system.bb new file mode 100644 index 0000000000..0df36f9c17 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/obmc-mgr-system.bb @@ -0,0 +1,22 @@ +SUMMARY = "OpenBMC system manager" +DESCRIPTION = "OpenBMC system manager." +PR = "r1" + +inherit skeleton-python +inherit obmc-phosphor-dbus-service + +VIRTUAL-RUNTIME_skeleton_workbook ?= "" + +RDEPENDS_${PN} += "\ + python-dbus \ + python-json \ + python-subprocess \ + python-pygobject \ + pyphosphor \ + pyphosphor-dbus \ + ${VIRTUAL-RUNTIME_skeleton_workbook} \ + " + +SKELETON_DIR = "pysystemmgr" + +DBUS_SERVICE_${PN} += "org.openbmc.managers.System.service" diff --git a/meta-phosphor/recipes-phosphor/system/obmc-mgr-system/org.openbmc.managers.System.service b/meta-phosphor/recipes-phosphor/system/obmc-mgr-system/org.openbmc.managers.System.service new file mode 100644 index 0000000000..9d1761fd85 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/obmc-mgr-system/org.openbmc.managers.System.service @@ -0,0 +1,16 @@ +[Unit] +Description=Phosphor System Manager +Wants=obmc-mapper.target +After=obmc-mapper.target + +[Service] +Restart=always +ExecStart=/usr/bin/env system_manager.py +SyslogIdentifier=system_manager.py +Type=dbus +BusName={BUSNAME} +Environment="PYTHONUNBUFFERED=1" +TimeoutStartSec=180s + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/system/obmc-phosphor-sysd.bb b/meta-phosphor/recipes-phosphor/system/obmc-phosphor-sysd.bb new file mode 100644 index 0000000000..7a21c2fe6f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/system/obmc-phosphor-sysd.bb @@ -0,0 +1,11 @@ +SUMMARY = "Phosphor OpenBMC System Management" +DESCRIPTION = "Phosphor OpenBMC system management reference implementation." +PR = "r1" + +inherit obmc-phosphor-pydbus-service + +PROVIDES += "virtual/obmc-system-mgmt" +RPROVIDES_${PN} += "virtual-obmc-system-mgmt" + +S = "${WORKDIR}" +SRC_URI += "file://${PN}.py" diff --git a/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb new file mode 100644 index 0000000000..ce58a532a4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy.bb @@ -0,0 +1,20 @@ +SUMMARY = "Phosphor systemd configuration overrides" +DESCRIPTION = "Overrides for systemd and its applications" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${PHOSPHORBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +DEPENDS += "systemd" + +SRC_URI = "file://service-restart-policy.conf" +SRC_URI += "file://disable-duplicate-kernel-msg.conf" + +FILES_${PN} += "${systemd_unitdir}/system.conf.d/service-restart-policy.conf" +FILES_${PN} += "${systemd_unitdir}/journald.conf.d/disable-duplicate-kernel-msg.conf" + + +do_install() { + install -m 644 -D ${WORKDIR}/service-restart-policy.conf ${D}${systemd_unitdir}/system.conf.d/service-restart-policy.conf + install -m 644 -D ${WORKDIR}/disable-duplicate-kernel-msg.conf ${D}${systemd_unitdir}/journald.conf.d/disable-duplicate-kernel-msg.conf +} diff --git a/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf new file mode 100644 index 0000000000..beb2f445f9 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/disable-duplicate-kernel-msg.conf @@ -0,0 +1,13 @@ +# This file overrides some defaults for systemd +# +# OpenBMC uses busybox which uses klogd which causes duplicate +# kernel messages to show up in the journal due to syslog. +# This override prevents journald from reading from kmsg so +# only one instance of the kernel messages will show up in +# journald instead of the two of each currently put in the +# journal +# +# See systemd-system.conf(5) for details on the conf files + +[Journal] +ReadKMsg=no diff --git a/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf new file mode 100644 index 0000000000..54516c2d47 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/systemd-policy/phosphor-systemd-policy/service-restart-policy.conf @@ -0,0 +1,31 @@ +# This file overrides some defaults for systemd +# +# - Change the RestartSec from 100ms to 1s. +# When a service hits a failure, our new debug collection service kicks +# in. When a core file is involved, it's been found that generating 5 core +# files within ~500ms puts a huge strain on the BMC. Also, if the bmc is +# going to get a fix on a restart of a service, the more time the better +# (think retries on device driver scenarios). +# +# - Change the StartLimitBurst to 2 +# Five just seems excessive for our services in openbmc. In all fail +# scenarios seen so far (other then with phosphor-hwmon), either +# restarting once does the job or restarting all 5 times does not help +# and we just end up hitting the 5 limit anyway. +# +# - Change the StartLimitIntervalSec to 30s +# The BMC CPU performance is already challenged. When a service is +# failing and a core dump is being generated and collected into a dump, +# it's even more challenged. Recent failures have shown situations where +# the service does not fail again until 15-20 seconds after the initial +# failure which means the default of 10s for this results in the service +# being restarted indefinitely. Change this to 30s to only allow a service +# to be restarted StartLimitBurst times within a 30s interval before +# being put in a permanent fail state. +# +# See systemd-system.conf(5) for details on the conf files + +[Manager] +DefaultRestartSec=1s +DefaultStartLimitBurst=2 +DefaultStartLimitIntervalSec=30s diff --git a/meta-phosphor/recipes-phosphor/users/phosphor-user-manager.bb b/meta-phosphor/recipes-phosphor/users/phosphor-user-manager.bb new file mode 100644 index 0000000000..2c05c9ba7d --- /dev/null +++ b/meta-phosphor/recipes-phosphor/users/phosphor-user-manager.bb @@ -0,0 +1,29 @@ +SUMMARY = "Phosphor User Manager Daemon" +DESCRIPTION = "Daemon that does user management" +HOMEPAGE = "http://github.com/openbmc/phosphor-user-manager" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus" +DEPENDS += "phosphor-logging" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "boost" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "phosphor-logging" + +inherit useradd + +USERADD_PACKAGES = "${PN}" +# add groups needed for privilege maintenance +GROUPADD_PARAM_${PN} = "priv-admin; priv-operator; priv-user; priv-callback " + +DBUS_SERVICE_${PN} += "xyz.openbmc_project.User.Manager.service" + +SRC_URI += "git://github.com/openbmc/phosphor-user-manager" +SRCREV = "10eb23f8d64d197dade920178b193c1979235156" +S = "${WORKDIR}/git" diff --git a/meta-phosphor/recipes-phosphor/users/phosphor-user-manager/xyz.openbmc_project.User.Manager.service b/meta-phosphor/recipes-phosphor/users/phosphor-user-manager/xyz.openbmc_project.User.Manager.service new file mode 100644 index 0000000000..f8926e77cf --- /dev/null +++ b/meta-phosphor/recipes-phosphor/users/phosphor-user-manager/xyz.openbmc_project.User.Manager.service @@ -0,0 +1,12 @@ +[Unit] +Description=Phosphor User Manager + +[Service] +ExecStart=/usr/bin/env phosphor-user-manager +SyslogIdentifier=phosphor-user-manager +Restart=always +Type=dbus +BusName={BUSNAME} + +[Install] +WantedBy={SYSTEMD_DEFAULT_TARGET} diff --git a/meta-phosphor/recipes-phosphor/video/fbterm/fb.modes b/meta-phosphor/recipes-phosphor/video/fbterm/fb.modes new file mode 100644 index 0000000000..dfc51fe973 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/fbterm/fb.modes @@ -0,0 +1,7 @@ +mode "800x600-60" + # D: 40.00 MHz, H: 37.879 kHz, V: 60.32 Hz + geometry 800 600 800 600 32 + timings 0 88 40 23 1 128 4 + hsync high + vsync high +endmode diff --git a/meta-phosphor/recipes-phosphor/video/fbterm/fbterm b/meta-phosphor/recipes-phosphor/video/fbterm/fbterm new file mode 100644 index 0000000000..0cf29d433c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/fbterm/fbterm @@ -0,0 +1 @@ +FB_MODE=800x600-60 diff --git a/meta-phosphor/recipes-phosphor/video/fbterm/fbterm.service b/meta-phosphor/recipes-phosphor/video/fbterm/fbterm.service new file mode 100644 index 0000000000..2b18c91ef1 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/fbterm/fbterm.service @@ -0,0 +1,8 @@ +[Unit] +Description=UART renderer +Requires=obmc-console@ttyVUART0.service + +[Service] +EnvironmentFile={envfiledir}/fbterm +ExecStartPre=/usr/sbin/fbset $FB_MODE +ExecStart=/usr/bin/fbterm --write-only obmc-console-client diff --git a/meta-phosphor/recipes-phosphor/video/fbterm_git.bb b/meta-phosphor/recipes-phosphor/video/fbterm_git.bb new file mode 100644 index 0000000000..0c171dd3a4 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/fbterm_git.bb @@ -0,0 +1,29 @@ +HOMEPAGE = "https://github.com/jk-ozlabs/fbterm" +LICENSE = "GPLv2+" + +SRC_URI += "git://github.com/jk-ozlabs/fbterm.git;nobranch=1" +SRC_URI += "file://fb.modes" +PR = "r1" + +LIC_FILES_CHKSUM = "file://${S}/COPYING;md5=d8e20eece214df8ef953ed5857862150" + +DEPENDS += "freetype" +DEPENDS += "fontconfig" + +inherit autotools +inherit pkgconfig +inherit obmc-phosphor-systemd + +SRCREV = "c15430560aeb82a27358cc320af4a29e1296e6c1" +PV = "1.7+git${SRCPV}" + +S = "${WORKDIR}/git" + +do_install() { + oe_runmake 'DESTDIR=${D}' install-exec + install -d ${D}${sysconfdir}/ + install -m 0644 ${WORKDIR}/fb.modes ${D}${sysconfdir}/ +} + +SYSTEMD_SERVICE_${PN} += "fbterm.service" +SYSTEMD_ENVIRONMENT_FILE_${PN} += "fbterm" diff --git a/meta-phosphor/recipes-phosphor/video/liberation-fonts_2.00.1.bbappend b/meta-phosphor/recipes-phosphor/video/liberation-fonts_2.00.1.bbappend new file mode 100644 index 0000000000..5283a7841f --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/liberation-fonts_2.00.1.bbappend @@ -0,0 +1,9 @@ + +do_install () { + install -d ${D}${datadir}/fonts/ttf/ + for i in LiberationMono-Regular.ttf; do + install -m 0644 $i ${D}${prefix}/share/fonts/ttf/${i} + done + install -d ${D}${sysconfdir}/fonts/conf.d/ + install -m 0644 ${WORKDIR}/30-liberation-aliases.conf ${D}${sysconfdir}/fonts/conf.d/ +} diff --git a/meta-phosphor/recipes-phosphor/video/uart-render-controller/uart-render-controller.service b/meta-phosphor/recipes-phosphor/video/uart-render-controller/uart-render-controller.service new file mode 100644 index 0000000000..3fd688f31c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/uart-render-controller/uart-render-controller.service @@ -0,0 +1,14 @@ + +[Unit] +Description=UART render controller +Requires=xyz.openbmc_project.State.Host.service +After=xyz.openbmc_project.State.Host.service + +[Service] +ExecStart=/usr/sbin/obmc-uart-render-controller \ + /sys/devices/platform/ahb/ahb:apb/1e6e2000.syscon/1e6e2000.syscon:scratch/vga0 \ + /sys/devices/platform/ahb/ahb:apb/1e6e2000.syscon/1e6e2000.syscon:scratch/dac_mux \ + fbterm.service + +[Install] +WantedBy=obmc-standby.target diff --git a/meta-phosphor/recipes-phosphor/video/uart-render-controller_git.bb b/meta-phosphor/recipes-phosphor/video/uart-render-controller_git.bb new file mode 100644 index 0000000000..c8780a4e77 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/video/uart-render-controller_git.bb @@ -0,0 +1,30 @@ +HOMEPAGE = "https://github.com/jk-ozlabs/uart-render-controller" +LICENSE = "GPLv2+" + +SRC_URI += "git://github.com/jk-ozlabs/uart-render-controller;branch=master" +SRC_URI += "file://uart-render-controller.service" + +PR = "r1" + +LIC_FILES_CHKSUM = "file://${S}/LICENSE;md5=fa818a259cbed7ce8bc2a22d35a464fc" + +inherit autotools +inherit pkgconfig +inherit systemd + +DEPENDS += "autoconf-archive-native" +DEPENDS += "systemd" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "fbterm" + +SRCREV = "14decab20f621c050760e5f3310f5a960cf21211" +PV = "0.1+git${SRCPV}" + +S = "${WORKDIR}/git" + +SYSTEMD_SERVICE_${PN} += "uart-render-controller.service" + +do_install_append() { + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/uart-render-controller.service ${D}${systemd_system_unitdir}/ +} diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog.bb b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog.bb new file mode 100644 index 0000000000..fe94365225 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog.bb @@ -0,0 +1,50 @@ +SUMMARY = "Phosphor Watchdog application" +DESCRIPTION = "Application that implements software watchdog" +HOMEPAGE = "http://github.com/openbmc/phosphor-watchdog" +PR = "r1" + +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +inherit autotools pkgconfig +inherit obmc-phosphor-dbus-service + +RPROVIDES_${PN} += "virtual/obmc-watchdog" +PROVIDES += "virtual/obmc-watchdog" + +DEPENDS += "autoconf-archive-native" +DEPENDS += "sdbusplus sdbusplus-native" +DEPENDS += "phosphor-dbus-interfaces" +DEPENDS += "phosphor-logging" +RDEPENDS_${PN} += "libsystemd" +RDEPENDS_${PN} += "phosphor-logging" + +SRC_URI += "git://github.com/openbmc/phosphor-watchdog" +SRCREV = "d5353086a46402c95d6079c033e9d2f3555c6b5f" +S = "${WORKDIR}/git" + +# Copies config file having arguments for host watchdog +SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/watchdog/poweron" + +# Install the override to set up a Conflicts relation +SYSTEMD_OVERRIDE_${PN} += "poweron.conf:phosphor-watchdog@poweron.service.d/poweron.conf" + +# For now, watching PowerOn is the only usecase +OBMC_HOST_WATCHDOG_INSTANCES = "poweron" + +# This is really a DBUS service but the service name is +# an argument, so making it this way. +WATCHDOG_TMPL = "phosphor-watchdog@.service" +ENABLE_WATCHDOG_TMPL = "obmc-enable-host-watchdog@.service" +SYSTEMD_SERVICE_${PN} += "${WATCHDOG_TMPL}" + +# To Enable Host Watchdog early during poweron +SYSTEMD_SERVICE_${PN} += "${ENABLE_WATCHDOG_TMPL}" + +WATCHDOG_TGTFMT = "phosphor-watchdog@{0}.service" +ENABLE_WATCHDOG_TGTFMT = "obmc-enable-host-watchdog@{0}.service" + +WATCHDOG_FMT = "../${WATCHDOG_TMPL}:obmc-host-startmin@{1}.target.wants/${WATCHDOG_TGTFMT}" +ENABLE_WATCHDOG_FMT = "../${ENABLE_WATCHDOG_TMPL}:obmc-host-startmin@{0}.target.wants/${ENABLE_WATCHDOG_TGTFMT}" + +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'WATCHDOG_FMT', 'OBMC_HOST_WATCHDOG_INSTANCES', 'OBMC_HOST_INSTANCES')}" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'ENABLE_WATCHDOG_FMT', 'OBMC_HOST_INSTANCES')}" diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service new file mode 100644 index 0000000000..0cf5e7cd37 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/obmc-enable-host-watchdog@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Start Watchdog%i +Wants=obmc-host-started@%i.target +After=obmc-host-started@%i.target +Wants=mapper-wait@-xyz-openbmc_project-watchdog-host%i.service +After=mapper-wait@-xyz-openbmc_project-watchdog-host%i.service +Conflicts=obmc-host-stop@%i.target +ConditionPathExists=!/run/openbmc/host@%i-on + +[Service] +Type=oneshot +ExecStart=/bin/sh -c "busctl call `mapper get-service /xyz/openbmc_project/watchdog/host%i` /xyz/openbmc_project/watchdog/host%i org.freedesktop.DBus.Properties Set ssv xyz.openbmc_project.State.Watchdog Enabled b true" +RemainAfterExit=yes +SyslogIdentifier=obmc-enable-host-watchdog diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/poweron b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/poweron new file mode 100644 index 0000000000..591d6dcd7c --- /dev/null +++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/obmc/watchdog/poweron @@ -0,0 +1,3 @@ +DEVPATH=/xyz/openbmc_project/watchdog/host0 +SERVICE=xyz.openbmc_project.Watchdog +TARGET=obmc-host-timeout@0.target diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service new file mode 100644 index 0000000000..52c1290256 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/phosphor-watchdog@.service @@ -0,0 +1,8 @@ +[Unit] +Description=Phosphor %I watchdog + +[Service] +Restart=no +EnvironmentFile={envfiledir}/obmc/watchdog/%I +ExecStart=/usr/bin/env phosphor-watchdog --continue --service=${{SERVICE}} --path=${{DEVPATH}} --target=${{TARGET}} +SyslogIdentifier=phosphor-watchdog diff --git a/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf new file mode 100644 index 0000000000..b253249829 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/watchdog/phosphor-watchdog/poweron.conf @@ -0,0 +1,4 @@ +[Unit] +Conflicts=obmc-host-stop@0.target +Conflicts=obmc-chassis-poweroff@0.target +Conflicts=obmc-host-quiesce@0.target diff --git a/meta-phosphor/recipes-phosphor/webui/phosphor-webui.bb b/meta-phosphor/recipes-phosphor/webui/phosphor-webui.bb new file mode 100644 index 0000000000..5ec201f634 --- /dev/null +++ b/meta-phosphor/recipes-phosphor/webui/phosphor-webui.bb @@ -0,0 +1,45 @@ +# This recipe requires online access to build, as it uses NPM for dependency +# management and resolution. + +LICENSE = "Apache-2.0" +SRC_URI = "git://github.com/openbmc/phosphor-webui.git" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRCREV = "e364faa0314c8c98a31260bf69df78a104b106a1" +S = "${WORKDIR}/git" + +DEPENDS_prepend = "nodejs-native " + +# allarch is required because the files this recipe produces (html and +# javascript) are valid for any target, regardless of architecture. The allarch +# class removes your compiler definitions, as it assumes that anything that +# requires a compiler is platform specific. Unfortunately, one of the build +# tools uses libsass for compiling the css templates, and it needs a compiler to +# build the library that it then uses to compress the scss into normal css. +# Enabling allarch, then re-adding the compiler flags was the best of the bad +# options + +inherit allarch + +export CXX = "${BUILD_CXX}" +export CC = "${BUILD_CC}" +export CFLAGS = "${BUILD_CFLAGS}" +export CPPFLAGS = "${BUILD_CPPFLAGS}" +export CXXFLAGS = "${BUILD_CXXFLAGS}" + +FILES_${PN} += "${datadir}/www/*" + +do_compile () { + cd ${S} + rm -rf node_modules + npm --loglevel info --proxy=${HTTP_PROXY} --https-proxy=${HTTPS_PROXY} install + npm run-script build +} + +do_install () { + # create directory structure + install -d ${D}${datadir}/www + cp -r ${S}/dist/** ${D}${datadir}/www + find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' + + find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' + +} + |