5 .
/lib
/functions
/uci-defaults.sh
7 if [ ! -x /usr
/sbin
/maccalc
]; then
8 echo "$0: maccalc not found!"
12 ramips_setup_interfaces
()
16 ucidef_set_interface_loopback
24 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
28 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
29 ucidef_add_switch
"rtl8366rb" "1" "1"
30 ucidef_add_switch_vlan
"rtl8366rb" "1" "0 1 2 3 5t"
31 ucidef_add_switch_vlan
"rtl8366rb" "2" "4 5t"
35 ucidef_set_interface_lan
"eth0"
39 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
40 ucidef_add_switch
"rtl8366s" "1" "1"
41 ucidef_add_switch_vlan
"rtl8366s" "1" "1 2 3 4 5t"
42 ucidef_add_switch_vlan
"rtl8366s" "2" "0 5t"
46 RT3X5X
=`cat /proc/cpuinfo | grep RT3.5`
47 if [ -n "${RT3X5X}" ]; then
48 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
50 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
64 lan_mac
=$
(ramips_get_mac_nvram
"u-boot" 262148)
65 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
73 lan_mac
=$
(ramips_get_mac_binary factory
4)
74 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
80 lan_mac
=$
(ramips_get_mac_binary devdata
16388)
81 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
86 lan_mac
=$
(ramips_get_mac_binary factory
4)
87 wan_mac
=$
(ramips_get_mac_binary factory
40)
91 lan_mac
=$
(ramips_get_mac_binary factory
40)
92 wan_mac
=$
(ramips_get_mac_binary factory
46)
96 lan_mac
=$
(ramips_get_mac_binary factory
4)
101 [ -n $lan_mac ] && ucidef_set_interface_macaddr lan
$lan_mac
102 [ -n $wan_mac ] && ucidef_set_interface_macaddr wan
$wan_mac
105 [ -e /etc
/config
/network
] && exit 0
107 touch /etc
/config
/network
109 board
=$
(ramips_board_name
)
111 ramips_setup_interfaces
$board
112 ramips_setup_macs
$board