Skip to content

Commit

Permalink
[led]: Skip ledinit if there is no led_proc_init.soc file for broadco…
Browse files Browse the repository at this point in the history
…m platform (#5483)

Some platforms don't leverage the brcm led coprocessor.
However ledinit will try to load a non existing file and exit with an
error code.
This change is a cosmetic fix mostly.

- How to verify it

Boot a platform without the configuration and verify in the syslog that the exit status of ledinit is 0
Boot a platform with the configuration and verify in the syslog that the exit status of ledinit is 0 and the leds are working.
Verified by adding a dumb led_proc_init.soc on an Arista platform which usually doesn't use it.
  • Loading branch information
Staphylo authored Oct 2, 2020
1 parent c0bbb7b commit db6fa1d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions platform/broadcom/docker-syncd-brcm/start_led.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

PLATFORM_DIR=/usr/share/sonic/platform
SYNCD_SOCKET_FILE=/var/run/sswsyncd/sswsyncd.socket
LED_PROC_INIT_SOC=${PLATFORM_DIR}/led_proc_init.soc

if [ ! -f "$LED_PROC_INIT_SOC" ]; then
echo "No soc led configuration found under $LED_SOC_INIT_SOC"
exit 0
fi

# Function: wait until syncd has created the socket for bcmcmd to connect to
wait_syncd() {
Expand Down Expand Up @@ -30,8 +36,8 @@ wait_syncd() {
}

# If this platform has an initialization file for the Broadcom LED microprocessor, load it
if [[ -r ${PLATFORM_DIR}/led_proc_init.soc && ! -f /var/warmboot/warm-starting ]]; then
if [[ -r "$LED_PROC_INIT_SOC" && ! -f /var/warmboot/warm-starting ]]; then
wait_syncd
fi

/usr/bin/bcmcmd -t 60 "rcload /usr/share/sonic/platform/led_proc_init.soc"
/usr/bin/bcmcmd -t 60 "rcload $LED_PROC_INIT_SOC"

0 comments on commit db6fa1d

Please sign in to comment.