summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-05-29 16:39:20 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-05-29 16:39:20 +0000
commitc81c6516de0640c59591d26f29f61a755fdcb736 (patch)
tree462a6697c7c4e1a55e9816bf80f4819011646c10 /target
parentffbb4f88a9a6b564b5b8a270e56f459ccbf6ace3 (diff)
downloadmtk-20170518-c81c6516de0640c59591d26f29f61a755fdcb736.zip
mtk-20170518-c81c6516de0640c59591d26f29f61a755fdcb736.tar.gz
mtk-20170518-c81c6516de0640c59591d26f29f61a755fdcb736.tar.bz2
kirkwood: use the generic uci-default functions for initial LED setup
SVN-Revision: 31994
Diffstat (limited to 'target')
-rw-r--r--target/linux/kirkwood/base-files/etc/uci-defaults/leds42
1 files changed, 4 insertions, 38 deletions
diff --git a/target/linux/kirkwood/base-files/etc/uci-defaults/leds b/target/linux/kirkwood/base-files/etc/uci-defaults/leds
index a0b1c1c..6d11d93 100644
--- a/target/linux/kirkwood/base-files/etc/uci-defaults/leds
+++ b/target/linux/kirkwood/base-files/etc/uci-defaults/leds
@@ -3,55 +3,21 @@
# Copyright (C) 2012 OpenWrt.org
#
-COMMIT_SYSTEM=0
-
-set_led_netdev() {
- local cfg="led_$1"
- local sysfs=$2
- local dev=$3
-
- uci -q get system.$cfg && return 0
-
- uci batch <<EOF
-set system.$cfg='led'
-set system.$cfg.sysfs='$sysfs'
-set system.$cfg.trigger='netdev'
-set system.$cfg.dev='$dev'
-set system.$cfg.mode='link tx rx'
-EOF
- COMMIT_SYSTEM=1
-}
-
-set_led_default() {
- local cfg="led_$1"
- local sysfs=$2
- local default=$3
-
- uci -q get system.$cfg && return 0
-
- uci batch <<EOF
-set system.$cfg='led'
-set system.$cfg.sysfs='$sysfs'
-set system.$cfg.trigger='none'
-set system.$cfg.default='$default'
-EOF
- COMMIT_SYSTEM=1
-}
-
+. /lib/fuctions/uci-defaults.sh
. /lib/kirkwood.sh
hardware=$(kirkwood_hardware_name)
case "$hardware" in
"Seagate FreeAgent DockStar")
- set_led_netdev "eth0" "dockstar:orange:misc" "eth0"
- set_led_default "health" "dockstar:green:health" "1"
+ ucidef_set_led_netdev "eth0" "dockstar:orange:misc" "eth0"
+ ucidef_set_led_default "health" "dockstar:green:health" "1"
;;
*)
;;
esac
-[ "$COMMIT_SYSTEM" == "1" ] && uci commit system
+ucidef_commit_leds
exit 0