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,10 @@
{
"forceLEDs":[
"virtual_enc_fault",
"virtual_enc_id"
],
"skipLEDs":[
"virtual_enc_fault",
"virtual_enc_id"
]
}
@@ -0,0 +1,7 @@
[Unit]
Description=Create the virtual physical LEDs
[Service]
Restart=always
ExecStart=/usr/libexec/phosphor-led-sysfs/phosphor-ledcontroller -p %f
SyslogIdentifier=obmc-led-create-virtual-leds
@@ -0,0 +1,13 @@
[Unit]
Description=Set the Asserted property of all the LED groups to %i
Wants=xyz.openbmc_project.LED.GroupManager.service
After=xyz.openbmc_project.LED.GroupManager.service
After=phosphor-reset-chassis-running@0.service
ConditionPathExists=!/run/openbmc/chassis@0-on
[Service]
Type=oneshot
Restart=no
EnvironmentFile={envfiledir}/obmc/led/set-all/groups/config
ExecStart=/bin/bash -c "led-set-all-groups-asserted.sh %i ${{EXCLUDED_GROUPS}}"
SyslogIdentifier=obmc-led-set-all-groups-asserted
@@ -0,0 +1 @@
EXCLUDED_GROUPS=bmc_booted power_on
@@ -0,0 +1,62 @@
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SYSTEMD_SERVICE:${PN}:append:p10bmc = " obmc-led-set-all-groups-asserted@.service obmc-led-create-virtual-leds@.service"
# Copies config file having arguments for led-set-all-groups-asserted.sh
SYSTEMD_ENVIRONMENT_FILE:${PN}:append:p10bmc =" obmc/led/set-all/groups/config"
# Use the JSON configuration file at runtime than the static led.yaml
# Also, enable Lamp Test and OperationalStatus monitor feature for
# p10bmc systems
PACKAGECONFIG:append:p10bmc = " use-lamp-test monitor-operational-status"
# Install the lamp test override file for p10bmc
SRC_URI:append:p10bmc = " file://lamp-test-led-overrides.json"
pkg_postinst:${PN}:p10bmc () {
# Needed this to run as part of BMC boot
mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
TARGET="../obmc-led-set-all-groups-asserted@.service"
ln -s $TARGET $LINK
# Needed this to run as part of Power On
mkdir -p $D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants
LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
TARGET="../obmc-led-set-all-groups-asserted@.service"
ln -s $TARGET $LINK
# Needed this to run as part of BMC boot
mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service"
TARGET_FAULT="../obmc-led-create-virtual-leds@.service"
ln -s $TARGET_FAULT $LINK_FAULT
# Needed this to run as part of BMC boot
mkdir -p $D$systemd_system_unitdir/multi-user.target.wants
LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service"
TARGET_ID="../obmc-led-create-virtual-leds@.service"
ln -s $TARGET_ID $LINK_ID
}
pkg_prerm:${PN}:p10bmc () {
LINK="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-set-all-groups-asserted@false.service"
rm $LINK
LINK="$D$systemd_system_unitdir/obmc-chassis-poweron@0.target.wants/obmc-led-set-all-groups-asserted@false.service"
rm $LINK
LINK_FAULT="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-fault.service"
rm $LINK_FAULT
LINK_ID="$D$systemd_system_unitdir/multi-user.target.wants/obmc-led-create-virtual-leds@sys-class-leds-virtual-enc-id.service"
rm $LINK_ID
}
# Install lamp test override json
do_install:append:p10bmc() {
install -d ${D}${datadir}/${BPN}/
install -m 0644 ${WORKDIR}/lamp-test-led-overrides.json ${D}${datadir}/${BPN}/
}
@@ -0,0 +1,18 @@
SUMMARY = "Phosphor LED Group Management for Mihawk"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit native
PROVIDES += "virtual/phosphor-led-manager-config-native"
SRC_URI += "file://led.yaml"
S = "${WORKDIR}"
# Copies example led layout yaml file
do_install() {
SRC=${S}
DEST=${D}${datadir}/phosphor-led-manager
install -D ${SRC}/led.yaml ${DEST}/led.yaml
}
@@ -0,0 +1,11 @@
BmcBooted:
PowerOn:
EnclosureFault:
EnclosureIdentify:
Fan0Fault:
Fan1Fault:
Fan2Fault:
Fan3Fault:
Fan4Fault:
Powersupply0Fault:
Powersupply1Fault: