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,30 @@
SUMMARY = "Romulus ID Button pressed application"
PR = "r1"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
inherit obmc-phosphor-systemd
DEPENDS += "phosphor-gpio-monitor"
RDEPENDS:${PN} += "phosphor-gpio-monitor-monitor"
S = "${WORKDIR}"
SRC_URI += "file://toggle_identify_led.sh"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${WORKDIR}/toggle_identify_led.sh \
${D}${bindir}/toggle_identify_led.sh
}
SYSTEMD_ENVIRONMENT_FILE:${PN} +="obmc/gpio/id_button"
ID_BUTTON_SERVICE = "id_button"
TMPL = "phosphor-gpio-monitor@.service"
INSTFMT = "phosphor-gpio-monitor@{0}.service"
TGT = "multi-user.target"
FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}"
SYSTEMD_SERVICE:${PN} += "id-button-pressed.service"
SYSTEMD_LINK:${PN} += "${@compose_list(d, 'FMT', 'ID_BUTTON_SERVICE')}"
@@ -0,0 +1,9 @@
[Unit]
Description=ID Button Pressed Service
Wants=mapper-wait@-xyz-openbmc_project-led-groups.service
After=mapper-wait@-xyz-openbmc_project-led-groups.service
StartLimitIntervalSec=0
[Service]
Type=oneshot
ExecStart=/usr/bin/toggle_identify_led.sh
@@ -0,0 +1,5 @@
DEVPATH=/dev/input/by-path/platform-gpio-keys-event
KEY=135
POLARITY=1
TARGET=id-button-pressed.service
EXTRA_ARGS=--continue
@@ -0,0 +1,20 @@
#!/bin/sh
# Toggle the state of identify LED Group
SERVICE="xyz.openbmc_project.LED.GroupManager"
INTERFACE="xyz.openbmc_project.Led.Group"
PROPERTY="Asserted"
# Get current state
object=$(busctl tree $SERVICE --list | grep identify)
state=$(busctl get-property $SERVICE "$object" $INTERFACE $PROPERTY \
| awk '{print $NF;}')
if [ "$state" = "false" ]; then
target='true'
else
target='false'
fi
# Set target state
busctl set-property $SERVICE "$object" $INTERFACE $PROPERTY b $target