source: trunk/target/linux/lantiq/base-files/etc/uci-defaults/leds @ 31062

Last change on this file since 31062 was 31062, checked in by blogic, 5 years ago

[lantiq] update /etc/uci-defaults/*

  • Property svn:executable set to *
File size: 2.8 KB
Line 
1#!/bin/sh
2#
3# Copyright (C) 2011 OpenWrt.org
4# based on ar71xx
5#
6
7COMMIT_SYSTEM=0
8
9set_led_netdev() {
10        local cfg="led_$1"
11        local name=$2
12        local sysfs=$3
13        local dev=$4
14
15        uci -q get system.$cfg && return 0
16
17        uci batch <<EOF
18set system.$cfg='led'
19set system.$cfg.name='$name'
20set system.$cfg.sysfs='$sysfs'
21set system.$cfg.trigger='netdev'
22set system.$cfg.dev='$dev'
23set system.$cfg.mode='link tx rx'
24EOF
25        COMMIT_SYSTEM=1
26}
27
28set_led_usbdev() {
29        local cfg="led_$1"
30        local name=$2
31        local sysfs=$3
32        local dev=$4
33
34        uci -q get system.$cfg && return 0
35
36        uci batch <<EOF
37set system.$cfg='led'
38set system.$cfg.name='$name'
39set system.$cfg.sysfs='$sysfs'
40set system.$cfg.trigger='usbdev'
41set system.$cfg.dev='$dev'
42set system.$cfg.interval='50'
43EOF
44        COMMIT_SYSTEM=1
45}
46
47set_led_wlan() {
48        local cfg="led_$1"
49        local name=$2
50        local sysfs=$3
51        local trigger=$4
52
53        uci -q get system.$cfg && return 0
54
55        uci batch <<EOF
56set system.$cfg='led'
57set system.$cfg.name='$name'
58set system.$cfg.sysfs='$sysfs'
59set system.$cfg.trigger='$trigger'
60EOF
61        COMMIT_SYSTEM=1
62}
63
64set_led_default() {
65        local cfg="led_$1"
66        local name=$2
67        local sysfs=$3
68        local default=$4
69
70        uci -q get system.$cfg && return 0
71
72        uci batch <<EOF
73set system.$cfg='led'
74set system.$cfg.name='$name'
75set system.$cfg.sysfs='$sysfs'
76set system.$cfg.default='$default'
77EOF
78        COMMIT_SYSTEM=1
79}
80
81. /lib/lantiq.sh
82
83board=$(lantiq_board_name)
84
85case "$board" in
86ARV4520PW|ARV452CPW)
87        set_led_netdev "wifi" "wifi" "soc:blue:wifi" "wlan0"
88        set_led_usbdev "usb" "USB" "soc:blue:usb" "1-1"
89        set_led_default "fxs1" "fxs1" "soc:blue:fxs1" "1"
90        set_led_default "fxs2" "fxs2" "soc:blue:fxs2" "1"
91        set_led_default "online" "online" "soc:blue:internet" "1"
92        ;;
93
94ARV7525PW)
95        set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
96        set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
97        set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
98        set_led_default "dsl" "dsl" "soc:red:dsl" "1"
99        set_led_default "online" "online" "soc:green:online" "1"
100        ;;
101
102ARV4525PW)
103        set_led_netdev "wifi" "wifi" "soc:green:wifi" "wlan0"
104        set_led_default "fxs1" "fxs1" "soc:green:fxs1" "1"
105        set_led_default "fxs2" "fxs2" "soc:green:fxs2" "1"
106        set_led_default "dsl" "dsl" "soc:green:dsl" "1"
107        set_led_default "online" "online" "soc:green:online" "1"
108        ;;
109
110GIGASX76X)
111        set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
112        set_led_netdev "online" "online" "soc:green:online" "pppoe-wan"
113        set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
114        ;;
115
116ARV4519PW)
117        set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
118        set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
119        set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
120        ;;
121
122ARV7518PW)
123        set_led_wlan "wifi" "wifi" "soc:green:wifi" "phy0radio"
124        set_led_netdev "internet" "internet" "soc:green:internet" "pppoe-wan"
125        set_led_usbdev "usb" "USB" "soc:green:usb" "1-1"
126        ;;
127esac
128
129[ "$COMMIT_SYSTEM" == "1" ] && uci commit system
130
131exit 0
Note: See TracBrowser for help on using the repository browser.