Initial commit
This commit is contained in:
13
target/linux/realtek/base-files/etc/board.d/01_leds
Normal file
13
target/linux/realtek/base-files/etc/board.d/01_leds
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
board_config_update
|
||||
|
||||
case $board in
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
71
target/linux/realtek/base-files/etc/board.d/02_network
Normal file
71
target/linux/realtek/base-files/etc/board.d/02_network
Normal file
@@ -0,0 +1,71 @@
|
||||
|
||||
. /lib/functions.sh
|
||||
. /lib/functions/uci-defaults.sh
|
||||
. /lib/functions/system.sh
|
||||
|
||||
ucidef_set_poe() {
|
||||
json_select_object poe
|
||||
json_add_string "budget" "$1"
|
||||
json_select_array ports
|
||||
for port in $2; do
|
||||
json_add_string "" "$port"
|
||||
done
|
||||
json_select ..
|
||||
json_select ..
|
||||
}
|
||||
|
||||
board=$(board_name)
|
||||
board_config_update
|
||||
|
||||
lan_list=""
|
||||
for lan in /sys/class/net/lan*; do
|
||||
lan_list="$lan_list $(basename $lan)"
|
||||
done
|
||||
ucidef_set_bridge_device switch
|
||||
ucidef_set_interface_wan "$lan_list"
|
||||
ucidef_set_interface "lan" device "lan1:t" protocol "static" vlan 100
|
||||
|
||||
lan_mac=""
|
||||
wan_mac=""
|
||||
label_mac=""
|
||||
case $board in
|
||||
*)
|
||||
wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
label_mac=$lan_mac
|
||||
;;
|
||||
esac
|
||||
|
||||
lan_mac=$(macaddr_setbit_la $wan_mac)
|
||||
|
||||
ucidef_set_interface_macaddr "lan" $lan_mac
|
||||
ucidef_set_interface_macaddr "wan" $wan_mac
|
||||
ucidef_set_bridge_mac "$wan_mac"
|
||||
ucidef_set_network_device_mac eth0 $wan_mac
|
||||
for lan in $lan_list; do
|
||||
ucidef_set_network_device_mac $lan $lan_mac
|
||||
lan_mac=$(macaddr_add $lan_mac 1)
|
||||
done
|
||||
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
||||
|
||||
case $board in
|
||||
netgear,gs110tpp-v1)
|
||||
ucidef_set_poe 130 "$lan_list"
|
||||
;;
|
||||
netgear,gs310tp-v1)
|
||||
ucidef_set_poe 55 "$lan_list"
|
||||
;;
|
||||
zyxel,gs1900-10hp)
|
||||
ucidef_set_poe 77 "$lan_list"
|
||||
;;
|
||||
zyxel,gs1900-8hp-v1|\
|
||||
zyxel,gs1900-8hp-v2)
|
||||
ucidef_set_poe 70 "$lan_list"
|
||||
;;
|
||||
zyxel,gs1900-24hp-v2)
|
||||
ucidef_set_poe 170 "$lan_list"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
Reference in New Issue
Block a user