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,17 @@
SUMMARY = "Phosphor LED Group Management with example data"
PROVIDES += "virtual/phosphor-led-manager-config-native"
PV = "1.0+git${SRCPV}"
PR = "r1"
S = "${WORKDIR}/git"
inherit native
# Copies example led layout yaml file
do_install() {
SRC=${S}
DEST=${D}${datadir}/phosphor-led-manager
install -D ${SRC}/led.yaml ${DEST}/led.yaml
}
require phosphor-led-manager.inc
@@ -0,0 +1,22 @@
SUMMARY = "Phosphor LED Group Management with MRW generated data"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
DEPENDS += "mrw-native mrw-perl-tools-native"
PROVIDES += "virtual/phosphor-led-manager-config-native"
PR = "r1"
inherit mrw-xml
inherit native
# Generate a YAML files based on MRW input
do_install:append() {
USE_MRW="${@bb.utils.contains('DISTRO_FEATURES', 'obmc-mrw', 'yes', 'no', d)}"
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
}
@@ -0,0 +1,11 @@
SUMMARY = "phosphor-led-manager: install phosphor-logging yaml"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
PV = "1.0+git${SRCPV}"
PR = "r1"
S = "${WORKDIR}/git"
inherit phosphor-logging-yaml-provider
require 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;branch=master;protocol=https"
SRCREV = "f1ed4796e79756287c668f4b269fd1fddbcd8ab6"
@@ -0,0 +1,3 @@
[Unit]
Wants=multi-user.target
After=multi-user.target
@@ -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=multi-user.target
@@ -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
@@ -0,0 +1,12 @@
[Unit]
Description=Deassert %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
@@ -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=multi-user.target
@@ -0,0 +1,67 @@
SUMMARY = "Phosphor LED Group Management Daemon"
DESCRIPTION = "Daemon to cater to triggering actions on LED groups"
DEPENDS += "${PYTHON_PN}-native"
DEPENDS += "${PYTHON_PN}-pyyaml-native"
DEPENDS += "${PYTHON_PN}-inflection-native"
DEPENDS += "cli11"
DEPENDS += "nlohmann-json"
DEPENDS += "phosphor-logging"
DEPENDS += "sdbusplus ${PYTHON_PN}-sdbus++-native"
DEPENDS += "systemd"
PACKAGECONFIG ??= "\
${@oe.utils.conditional( \
'PREFERRED_PROVIDER_virtual/${PN}-config-native', \
'phosphor-led-manager-config-example-native', \
'use-json', 'use-yaml', d)} \
"
PACKAGECONFIG[use-json] = "-Duse-json=enabled,,,,,use-yaml"
PACKAGECONFIG[use-yaml] = "-Duse-json=disabled,,virtual/${PN}-config-native,,,use-json"
PACKAGECONFIG[use-lamp-test] = "-Duse-lamp-test=enabled, -Duse-lamp-test=disabled"
PACKAGECONFIG[monitor-operational-status] = "-Dmonitor-operational-status=enabled, \
-Dmonitor-operational-status=disabled"
PV = "1.0+git${SRCPV}"
PR = "r1"
SYSTEMD_PACKAGES = "${PN} ${PN}-faultmonitor"
S = "${WORKDIR}/git"
SYSTEMD_SERVICE:${PN} += "obmc-led-group-start@.service obmc-led-group-stop@.service"
SYSTEMD_SERVICE:${PN}-faultmonitor += "obmc-fru-fault-monitor.service"
SYSTEMD_LINK:${PN} += "../obmc-led-group-start@.service:multi-user.target.wants/obmc-led-group-start@bmc_booted.service"
STATES = "start stop"
SYSTEMD_LINK:${PN} += "${@compose_list_zip(d, 'FMT', 'CHASSIS_TARGETS', 'STATES')}"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'CHASSIS_LED_BLACKOUT_FMT', 'OBMC_CHASSIS_INSTANCES' )}"
# Install the override to set up a Conflicts relation
SYSTEMD_OVERRIDE:${PN} += "bmc_booted.conf:obmc-led-group-start@bmc_booted.service.d/bmc_booted.conf"
inherit meson pkgconfig python3native
inherit obmc-phosphor-dbus-service obmc-phosphor-systemd
EXTRA_OEMESON:append = " -Dtests=disabled"
do_compile:prepend() {
if [ -f "${LED_YAML_PATH}/led.yaml" ]; then
cp "${LED_YAML_PATH}/led.yaml" "${S}/led.yaml"
elif [ -f "${STAGING_DATADIR_NATIVE}/${PN}/led.yaml" ]; then
cp "${STAGING_DATADIR_NATIVE}/${PN}/led.yaml" "${S}/led.yaml"
elif [ -f "${WORKDIR}/led.yaml" ]; then
cp "${WORKDIR}/led.yaml" "${S}/led.yaml"
fi
}
RDEPENDS:${PN} += "bash"
FILES:${PN}-faultmonitor += "${bindir}/phosphor-fru-fault-monitor"
require ${PN}.inc
PACKAGE_BEFORE_PN += "${PN}-faultmonitor"
DBUS_SERVICE:${PN} += "xyz.openbmc_project.LED.GroupManager.service"
CHASSIS_TARGETS = "poweron poweroff"
TMPLFMT = "obmc-led-group-{1}@.service"
TGTFMT = "obmc-chassis-{0}@0.target"
INSTFMT = "obmc-led-group-{1}@power_on.service"
FMT = "../${TMPLFMT}:${TGTFMT}.wants/${INSTFMT}"
CHASSIS_BLACKOUT_TGT = "obmc-chassis-blackout@{0}.target"
LED_STOP_SVC = "obmc-led-group-stop@.service"
LED_POWER_STOP_SVC = "obmc-led-group-stop@power_on.service"
CHASSIS_LED_BLACKOUT_FMT = "../${LED_STOP_SVC}:${CHASSIS_BLACKOUT_TGT}.wants/${LED_POWER_STOP_SVC}"
@@ -0,0 +1,24 @@
SUMMARY = "Phosphor Physical LED Controller daemon"
DESCRIPTION = "Daemon to trigger actions on a physical LED"
HOMEPAGE = "http://github.com/openbmc/phosphor-led-sysfs"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
DEPENDS += "cli11"
DEPENDS += "sdbusplus"
DEPENDS += "systemd"
DEPENDS += "phosphor-dbus-interfaces"
DEPENDS += "boost"
SRCREV = "f4eb29dac78ffa34d9db29b04fccfb9e926421b9"
PV = "1.0+git${SRCPV}"
PR = "r1"
SRC_URI = "git://github.com/openbmc/phosphor-led-sysfs;branch=master;protocol=https"
S = "${WORKDIR}/git"
inherit meson pkgconfig
inherit obmc-phosphor-dbus-service
EXTRA_OEMESON:append = " -Dtests=disabled"
SYSTEMD_SERVICE:${PN} += "xyz.openbmc_project.led.controller@.service"