summaryrefslogtreecommitdiff
path: root/meta-quanta/meta-gbs/recipes-gbs
diff options
context:
space:
mode:
authorGeorge Hung <george.hung@quantatw.com>2020-09-03 03:53:35 +0300
committerAndrew Geissler <geissonator@yahoo.com>2020-09-04 18:48:21 +0300
commit0d7b79cd35c7d9f89649f06fa53a638741f36d87 (patch)
tree82d492dc105080083f50d7d876d7a95fc8b53588 /meta-quanta/meta-gbs/recipes-gbs
parent635e0e4637e40ba03f69204265427550fd404f4c (diff)
downloadopenbmc-0d7b79cd35c7d9f89649f06fa53a638741f36d87.tar.xz
meta-quanta: gbs: fix only detect POST done state once
Fix the boot status LED behavior: 1. turn off boot status LED when system power off 2. keep monitoring POST done state GPIO to blink or turn on LED (From meta-quanta rev: d967cf675b25186828187c32e39ac29e70088c26) Signed-off-by: George Hung <george.hung@quantatw.com> Change-Id: I74c13a88a8c52cb430261653a99501841d634106 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-gbs')
-rw-r--r--meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.service5
-rw-r--r--meta-quanta/meta-gbs/recipes-gbs/boot-status-led/files/boot-status-led.sh38
2 files changed, 29 insertions, 14 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
index 0627a94d9..ea44dda2d 100644
--- 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
@@ -1,14 +1,13 @@
[Unit]
Description=Boot Status LED Manager
After=xyz.openbmc_project.LED.GroupManager.service
-Requires=xyz.openbmc_project.LED.GroupManager.service
+Wants=xyz.openbmc_project.LED.GroupManager.service
[Service]
ExecStart=/usr/bin/boot-status-led.sh
StandardOutput=syslog
Type=simple
-RemainAfterExit=yes
-Restart=no
+Restart=yes
[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
index 65fc0bc50..a80082a1c 100644
--- 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
@@ -11,22 +11,38 @@ 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
+PWR_STATE_SERVICE="xyz.openbmc_project.State.Chassis"
+PWR_STATE_OBJPATH="/xyz/openbmc_project/state/chassis0"
+PWR_STATE_INTERFACE_NAME="xyz.openbmc_project.State.Chassis"
+PWR_STATE_Property="CurrentPowerState"
+
boot_status=""
-check_flag=0
+power_state=""
+led_status=""
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
+ power_state="$(busctl get-property $PWR_STATE_SERVICE $PWR_STATE_OBJPATH $PWR_STATE_INTERFACE_NAME $PWR_STATE_Property | awk '{print $2}')"
+
+ boot_status="$(busctl get-property $BOOT_SERVICE_NAME $BOOT_STATUS_OBJPATH $BOOT_INTERFACE_NAME $BOOT_Property | awk '{print $2}')"
+
+ if [[ $power_state != "\"xyz.openbmc_project.State.Chassis.PowerState.On\"" ]];then
+ if [[ $led_status != "OFF" ]];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 false
+ led_status="OFF"
+ fi
+ continue
+ else
+ if [[ $boot_status != "\"Standby\"" ]] && [[ $led_status != "BLINKING" ]];then
+ busctl set-property $LED_SERVICE_NAME $LED_INACTIVE_OBJPATH $LED_INTERFACE_NAME $LED_Property b true
+ led_status="BLINKING"
+ elif [[ $boot_status == "\"Standby\"" ]] && [[ $led_status != "ON" ]];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
+ led_status="ON"
+ fi
fi
sleep 1
done