treewide: use the generic board_name function
[openwrt/staging/chunkeey.git] / target / linux / mxs / base-files / etc / diag.sh
index e48fa96af63a7f988cfc35cad26d425e183b1f5a..3b05f6da5f9b6730e7e023b34be086c4602df80a 100644 (file)
@@ -1,11 +1,11 @@
 #!/bin/sh
-# Copyright (C) 2013 OpenWrt.org
+# Copyright (C) 2013-2014 OpenWrt.org
 
+. /lib/functions.sh
 . /lib/functions/leds.sh
-. /lib/mxs.sh
 
 get_status_led() {
-       case $(mxs_board_name) in
+       case $(board_name) in
        duckbill)
                status_led="duckbill:green:status"
                ;;
@@ -13,7 +13,7 @@ get_status_led() {
                status_led="green"
                ;;
        *)
-               status_led=$(cd /sys/class/leds && ls -1 *:status 2> /dev/null | head -n 1)
+               status_led=$(cd /sys/class/leds && ls -1d *:status 2> /dev/null | head -n 1)
                ;;
        esac
 }
@@ -28,6 +28,9 @@ set_state() {
        failsafe)
                status_led_blink_failsafe
                ;;
+       preinit_regular)
+               status_led_blink_preinit_regular
+               ;;
        done)
                status_led_on
                ;;