Initial commit

This commit is contained in:
Your Name
2026-04-23 17:07:55 +08:00
commit b7e39e063b
16725 changed files with 1625565 additions and 0 deletions
@@ -0,0 +1,15 @@
SUMMARY = "Enables reboots on host failures"
DESCRIPTION = "Manages the settings entry that controls reboots \
on host failures"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
PR = "r1"
SYSTEMD_SERVICE:${PN} += "${TMPL}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'LINK_FMT', 'OBMC_HOST_INSTANCES')}"
inherit obmc-phosphor-systemd
TMPL = "host-failure-reboots@.service"
INSTFMT = "host-failure-reboots@{0}.service"
LINK_FMT = "${TMPL}:${INSTFMT}"
@@ -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=multi-user.target
@@ -0,0 +1,43 @@
SUMMARY = "OpenBMC Buttons"
DESCRIPTION = "OpenBMC All buttons"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
DEPENDS += " \
systemd \
sdbusplus \
sdeventplus \
phosphor-dbus-interfaces \
phosphor-logging \
"
SRCREV = "9456ffc9f21c92f890266be54a151bf59b413411"
PACKAGECONFIG ??= "signals handler"
PACKAGECONFIG[signals] = ",,gpioplus nlohmann-json,"
PACKAGECONFIG[handler] = ",,,${VIRTUAL-RUNTIME_obmc-host-state-manager} ${VIRTUAL-RUNTIME_obmc-chassis-state-manager}"
PV = "1.0+git${SRCPV}"
PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-buttons.git;branch=master;protocol=https"
S = "${WORKDIR}/git"
SYSTEMD_PACKAGES = "${BUTTON_PACKAGES}"
SYSTEMD_SERVICE:${PN}-signals = "xyz.openbmc_project.Chassis.Buttons.service"
SYSTEMD_SERVICE:${PN}-handler = "phosphor-button-handler.service"
inherit meson pkgconfig systemd
FILES:${PN}-signals = "${bindir}/buttons"
FILES:${PN}-handler = "${bindir}/button-handler"
ALLOW_EMPTY:${PN} = "1"
BUTTON_PACKAGES = "${PN}-signals ${PN}-handler"
PACKAGE_BEFORE_PN += "${BUTTON_PACKAGES}"
do_install:append() {
if [ -e "${WORKDIR}/gpio_defs.json" ]; then
install -m 0755 -d ${D}/etc/default/obmc/gpio
install -m 0644 -D ${WORKDIR}/gpio_defs.json \
${D}/etc/default/obmc/gpio
fi
}
@@ -0,0 +1,16 @@
SUMMARY = "Chassis Power Control"
HOMEPAGE = "https://github.com/openbmc/phosphor-power-control"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
DEPENDS += "phosphor-logging"
DEPENDS += "nlohmann-json"
DEPENDS += "gpioplus"
SRCREV = "09fdcb592a9320b9363fb1c7fec872a69ac95189"
PV = "1.0+git${SRCPV}"
PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-power-control;branch=master;protocol=https"
S = "${WORKDIR}/git"
inherit meson pkgconfig
@@ -0,0 +1,2 @@
POLL_INTERVAL="3000"
PGOOD_TIMEOUT="10"
@@ -0,0 +1,13 @@
[Unit]
Description=Phosphor Power%i Control
[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=multi-user.target
@@ -0,0 +1,23 @@
[Unit]
Description=Wait for Power%i to turn off
Before=obmc-power-off@%i.target
Wants=obmc-power-stop@%i.target
Before=obmc-power-stop@%i.target
Wants=obmc-power-stop-pre@%i.target
After=obmc-power-stop-pre@%i.target
Wants=mapper-wait@-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/host@%i-request
ExecStart=/bin/rm -f /run/openbmc/mpreboot@%i
[Install]
# Installation of templated services occur in bitbake recipes
# Leave it commented out here for documentation purposes
#WantedBy=obmc-host-stop@%i.target
@@ -0,0 +1,23 @@
[Unit]
Description=Wait for Power%i to turn on
Wants=obmc-power-start-pre@%i.target
After=obmc-power-start-pre@%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
After=obmc-power-start@%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]
# Installation of templated services occur in bitbake recipes
# Leave it commented out here for documentation purposes
#WantedBy=obmc-host-start@%i.target
@@ -0,0 +1,39 @@
SUMMARY = "org.openbmc.control.Power implementation for OpenBMC"
DESCRIPTION = "A power control implementation suitable for OpenBMC systems."
PR = "r1"
PV = "1.0+git${SRCPV}"
inherit skeleton-gdbus
inherit obmc-phosphor-dbus-service
inherit pkgconfig
DEPENDS += "libmapper systemd"
SKELETON_DIR = "op-pwrctl"
DBUS_SERVICE:${PN} += "org.openbmc.control.Power@.service"
OBMC_CONTROL_INST = "org.openbmc.control.Power@{0}.service"
OBMC_CONTROL_SVC = "org.openbmc.control.Power@.service"
OBMC_CONTROL_FMT = "../${OBMC_CONTROL_SVC}:multi-user.target.wants/${OBMC_CONTROL_INST}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'OBMC_CONTROL_FMT', 'OBMC_POWER_INSTANCES')}"
SYSTEMD_SERVICE:${PN} += " \
phosphor-wait-power-on@.service \
phosphor-wait-power-off@.service \
"
SYSTEMD_ENVIRONMENT_FILE:${PN} += "obmc/power_control"
START_TGTFMT = "obmc-chassis-poweron@{1}.target"
ON_TMPL = "phosphor-wait-power-on@.service"
ON_INSTFMT = "phosphor-wait-power-on@{0}.service"
ON_FMT = "../${ON_TMPL}:${START_TGTFMT}.requires/${ON_INSTFMT}"
STOP_TGTFMT = "obmc-chassis-poweroff@{1}.target"
OFF_TMPL = "phosphor-wait-power-off@.service"
OFF_INSTFMT = "phosphor-wait-power-off@{0}.service"
OFF_FMT = "../${OFF_TMPL}:${STOP_TGTFMT}.requires/${OFF_INSTFMT}"
# Build up requires relationship for START_TGTFMT and STOP_TGTFMT
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')}"