summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-05-29 16:39:18 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-05-29 16:39:18 +0000
commitffbb4f88a9a6b564b5b8a270e56f459ccbf6ace3 (patch)
tree34d7c618f271373031d58bdfa26d012319cad474
parent4e40bdc19087d45471114c56020e4107e063509a (diff)
downloadmtk-20170518-ffbb4f88a9a6b564b5b8a270e56f459ccbf6ace3.zip
mtk-20170518-ffbb4f88a9a6b564b5b8a270e56f459ccbf6ace3.tar.gz
mtk-20170518-ffbb4f88a9a6b564b5b8a270e56f459ccbf6ace3.tar.bz2
ramips: use the generic uci-default functions for initial LED setup
SVN-Revision: 31993
-rwxr-xr-xtarget/linux/ramips/base-files/etc/uci-defaults/leds49
1 files changed, 8 insertions, 41 deletions
diff --git a/target/linux/ramips/base-files/etc/uci-defaults/leds b/target/linux/ramips/base-files/etc/uci-defaults/leds
index f87a64f..fdfce39 100755
--- a/target/linux/ramips/base-files/etc/uci-defaults/leds
+++ b/target/linux/ramips/base-files/etc/uci-defaults/leds
@@ -1,51 +1,14 @@
#!/bin/sh
+. /lib/functions/uci-defaults.sh
. /lib/ramips.sh
set_usb_led() {
- local sysfs="$1"
-
- uci batch <<EOF
-set system.usb_led=led
-set system.usb_led.name='usb'
-set system.usb_led.sysfs='$sysfs'
-set system.usb_led.trigger='usbdev'
-set system.usb_led.dev='1-1'
-set system.usb_led.interval='50'
-commit system
-EOF
+ ucidef_set_led_usbdev "usb" "USB" "$1" "1-1"
}
set_wifi_led() {
- local sysfs="$1"
-
- uci batch <<EOF
-set system.wifi_led=led
-set system.wifi_led.name='wifi'
-set system.wifi_led.sysfs='$sysfs'
-set system.wifi_led.trigger='netdev'
-set system.wifi_led.dev='wlan0'
-set system.wifi_led.mode='link rx tx'
-commit system
-EOF
-}
-
-set_wan_led() {
- local sysfs="$1"
- local name="$2"
- local trigger="$3"
- local dev="$4"
- local mode="$5"
-
- uci batch <<EOF
-set system.${name}_led=led
-set system.${name}_led.name='$name'
-set system.${name}_led.sysfs='$sysfs'
-set system.${name}_led.trigger='$trigger'
-set system.${name}_led.dev='$dev'
-set system.${name}_led.mode='$mode'
-commit system
-EOF
+ ucidef_set_led_netdev "wifi_led" "wifi" "$1" "wlan0"
}
board=$(ramips_board_name)
@@ -61,7 +24,7 @@ case $board in
dir-600-b1|\
dir-600-b2)
# ANDed with vlan switch port 4 led state
- set_wan_led "d-link:amber:wan" wan_switch default-on
+ ucidef_set_led_default "wan" "WAN LED (amber)" "d-link:amber:wan" "1"
;;
esr-9753)
set_wifi_led "rt2800pci-phy0::radio"
@@ -101,3 +64,7 @@ case $board in
set_usb_led "wcr150gn:amber:user"
;;
esac
+
+ucidef_commit_leds
+
+exit 0