diff options
author | George Hung <george.hung@quantatw.com> | 2020-05-13 12:25:22 +0300 |
---|---|---|
committer | Andrew Geissler <geissonator@yahoo.com> | 2020-06-12 15:59:16 +0300 |
commit | ce97fb1b619a0f606bfb9290e81ae643dcc0c53a (patch) | |
tree | ebcc6680b84aa24c538c73ba6f7897bec8819798 /meta-quanta/meta-gbs/recipes-gbs/boot-status-led | |
parent | d6d41d248453aa0925ecbee9d896712be4780553 (diff) | |
download | openbmc-ce97fb1b619a0f606bfb9290e81ae643dcc0c53a.tar.xz |
meta-quanta: gbs: boot status led action
The sys_boot_status LED would be set blinking
until host post done. When host post done, the
action of sys_boot_status would be set on
Note:
1. LED action is set in led.yaml under
"gbs-led-manager-config" directory
2. sys_boot_status LED gpio is set in kernel dts
(From meta-quanta rev: 961e0f5890d3bc7b25491a024a694ea9ed01cb70)
Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: Ia2f5ff923b8dc6a7eda31d8d37e63a31d6d62028
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-gbs/boot-status-led')
3 files changed, 73 insertions, 0 deletions
diff --git a/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service new file mode 100644 index 000000000..0627a94d9 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service @@ -0,0 +1,14 @@ +[Unit] +Description=Boot Status LED Manager +After=xyz.openbmc_project.LED.GroupManager.service +Requires=xyz.openbmc_project.LED.GroupManager.service + +[Service] +ExecStart=/usr/bin/boot-status-led.sh +StandardOutput=syslog +Type=simple +RemainAfterExit=yes +Restart=no + +[Install] +WantedBy=multi-user.target diff --git a/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.sh b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.sh new file mode 100644 index 000000000..65fc0bc50 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +BOOT_SERVICE_NAME="xyz.openbmc_project.State.Host" +BOOT_STATUS_OBJPATH="/xyz/openbmc_project/state/os" +BOOT_INTERFACE_NAME="xyz.openbmc_project.State.OperatingSystem.Status" +BOOT_Property="OperatingSystemState" + +LED_SERVICE_NAME="xyz.openbmc_project.LED.GroupManager" +LED_INACTIVE_OBJPATH="/xyz/openbmc_project/led/groups/boot_status_inactive" +LED_STANDBY_OBJPATH="/xyz/openbmc_project/led/groups/boot_status_standby" +LED_INTERFACE_NAME="xyz.openbmc_project.Led.Group" +LED_Property="Asserted" + +dbus_state=0 +boot_status="" +check_flag=0 + +mapper wait $LED_INACTIVE_OBJPATH +mapper wait $LED_STANDBY_OBJPATH +while true; do + boot_status=$(busctl get-property $BOOT_SERVICE_NAME $BOOT_STATUS_OBJPATH $BOOT_INTERFACE_NAME $BOOT_Property | awk '{print $2}') + + if [ $boot_status != "\"Standby\"" ] && [ $check_flag -eq 0 ];then + busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b true + check_flag=1 + elif [ $boot_status == "\"Standby\"" ];then + busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b false + busctl set-property $LED_SERVICE_NAME $LED_STANDBY_OBJPATH $LED_INTERFACE_NAME $LED_Property b true + break + fi + sleep 1 +done + +exit 0 diff --git a/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/gbs-boot-status-led.bb b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/gbs-boot-status-led.bb new file mode 100644 index 000000000..61c6ed407 --- /dev/null +++ b/meta-quanta/meta-gbs/recipes-gbs/boot-status-led/gbs-boot-status-led.bb @@ -0,0 +1,25 @@ +SUMMARY = "OpenBMC Quanta Boot Status LED Service" +DESCRIPTION = "OpenBMC Quanta Boot Status LED Daemon." +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" + +inherit systemd + +DEPENDS += "systemd" +RDEPENDS_${PN} += "bash" + +SRC_URI = " file://boot-status-led.sh \ + file://boot-status-led.service \ + " + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/boot-status-led.sh ${D}${bindir}/ + + install -d ${D}${systemd_system_unitdir} + install -m 0644 ${WORKDIR}/boot-status-led.service ${D}${systemd_system_unitdir} +} + +SYSTEMD_PACKAGES = "${PN}" +SYSTEMD_SERVICE_${PN} = "boot-status-led.service" |