brcm2708: properly detect the Raspberry Pi Zero
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / base-files / etc / diag.sh
index 55e68b1a008db6171d73c483986c42eb2f2e1997..2a866e4339bdf873ae92587420bc06f5831c81f8 100644 (file)
@@ -1,12 +1,22 @@
 #!/bin/sh
-#
-# Copyright (C) 2015 OpenWrt.org
-#
+# Copyright (C) 2015-2016 OpenWrt.org
 
 . /lib/functions/leds.sh
+. /lib/brcm2708.sh
 
 set_state() {
-       status_led="led0"
+       case "$(brcm2708_board_name)" in
+       rpi-b |\
+       rpi-cm |\
+       rpi-zero)
+               status_led="led0"
+               ;;
+       rpi-b-plus |\
+       rpi-2-b |\
+       rpi-3-b)
+               status_led="led1"
+               ;;
+       esac
 
        case "$1" in
        preinit)