2020-09-13 07:06:13 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. /lib/functions.sh
|
|
|
|
. /lib/functions/uci-defaults.sh
|
|
|
|
. /lib/functions/system.sh
|
|
|
|
|
|
|
|
rtl838x_setup_switch()
|
|
|
|
{
|
2020-11-03 16:45:52 +00:00
|
|
|
local lan lan_list
|
2020-09-13 07:06:13 +00:00
|
|
|
|
2020-11-03 16:45:52 +00:00
|
|
|
for lan in /sys/class/net/lan*; do
|
|
|
|
lan_list="$lan_list $(basename $lan)"
|
2020-09-13 07:06:13 +00:00
|
|
|
done
|
2020-11-26 11:02:21 +00:00
|
|
|
ucidef_set_bridge_device switch
|
2020-09-13 07:06:13 +00:00
|
|
|
ucidef_set_interface_lan "$lan_list"
|
|
|
|
}
|
|
|
|
|
|
|
|
rtl838x_setup_macs()
|
|
|
|
{
|
|
|
|
local board="$1"
|
|
|
|
local lan_mac
|
|
|
|
local wan_mac
|
|
|
|
local label_mac
|
|
|
|
|
|
|
|
case $board in
|
2020-11-26 11:02:21 +00:00
|
|
|
allnet,all-sg8208m|\
|
|
|
|
netgear,gs110tpp-v1)
|
2020-09-13 07:06:13 +00:00
|
|
|
lan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
|
|
|
label_mac=$lan_mac
|
|
|
|
esac
|
|
|
|
|
|
|
|
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
|
|
|
|
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
|
|
|
|
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
|
|
|
|
}
|
|
|
|
|
|
|
|
board_config_update
|
|
|
|
board=$(board_name)
|
|
|
|
rtl838x_setup_switch
|
|
|
|
rtl838x_setup_macs $board
|
|
|
|
board_config_flush
|
|
|
|
|
|
|
|
exit 0
|