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
20 ucidef_set_interface_lan
"eth0.1"
27 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
32 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
33 ucidef_add_switch
"rtl8366s" "1" "1"
34 ucidef_add_switch_vlan
"rtl8366s" "1" "1 2 3 4 5t"
35 ucidef_add_switch_vlan
"rtl8366s" "2" "0 5t"
40 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
41 ucidef_add_switch
"rtl8366rb" "1" "1"
42 ucidef_add_switch_vlan
"rtl8366rb" "1" "0 1 2 3 5t"
43 ucidef_add_switch_vlan
"rtl8366rb" "2" "4 5t"
47 ucidef_set_interface_lan_wan
"eth0.2" "eth0.1"
51 ucidef_set_interface_lan
"eth0"
55 RT3X5X
=`cat /proc/cpuinfo | grep RT3.5`
56 if [ -n "${RT3X5X}" ]; then
57 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
59 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
73 lan_mac
=$
(ramips_get_mac_binary factory
40)
82 lan_mac
=$
(ramips_get_mac_binary factory
4)
83 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
89 lan_mac
=$
(ramips_get_mac_binary devdata
16388)
90 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
95 lan_mac
=$
(ramips_get_mac_binary factory
4)
96 wan_mac
=$
(ramips_get_mac_binary factory
40)
100 lan_mac
=$
(ramips_get_mac_binary
"u-boot" 262148)
101 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
105 lan_mac
=$
(ramips_get_mac_binary factory
40)
106 wan_mac
=$
(ramips_get_mac_binary factory
46)
110 lan_mac
=$
(ramips_get_mac_binary factory
4)
111 wan_mac
=$
(ramips_get_mac_binary factory
40)
115 lan_mac
=$
(ramips_get_mac_binary factory
4)
120 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan
$lan_mac
121 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan
$wan_mac
124 [ -e /etc
/config
/network
] && exit 0
126 touch /etc
/config
/network
128 board
=$
(ramips_board_name
)
130 ramips_setup_interfaces
$board
131 ramips_setup_macs
$board