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
21 ucidef_set_interface_lan
"eth0.1"
30 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
36 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
37 ucidef_add_switch
"switch0" "1" "1"
38 ucidef_add_switch_vlan
"switch0" "1" "1 2 3 4 5t"
39 ucidef_add_switch_vlan
"switch0" "2" "0 5t"
44 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
45 ucidef_add_switch
"switch0" "1" "1"
46 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 5t"
47 ucidef_add_switch_vlan
"switch0" "2" "4 5t"
51 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
52 ucidef_add_switch
"switch0" "1" "1"
53 ucidef_add_switch_vlan
"switch0" "1" "0 1 2 3 8t"
54 ucidef_add_switch_vlan
"switch0" "2" "4 8t"
59 ucidef_set_interfaces_lan_wan
"eth0.2" "eth0.1"
63 ucidef_set_interface_lan
"eth0"
67 RT3X5X
=`cat /proc/cpuinfo | grep RT3.5`
68 if [ -n "${RT3X5X}" ]; then
69 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
71 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
85 lan_mac
=$
(ramips_get_mac_binary factory
40)
95 lan_mac
=$
(ramips_get_mac_binary factory
4)
96 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
102 lan_mac
=$
(ramips_get_mac_binary devdata
16388)
103 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
109 lan_mac
=$
(ramips_get_mac_binary factory
4)
110 wan_mac
=$
(ramips_get_mac_binary factory
40)
114 lan_mac
=$
(ramips_get_mac_binary
"u-boot" 262148)
115 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
119 lan_mac
=$
(ramips_get_mac_binary factory
4)
120 wan_mac
=$
(ramips_get_mac_binary factory
32772)
124 lan_mac
=$
(ramips_get_mac_binary factory
40)
125 wan_mac
=$
(ramips_get_mac_binary factory
46)
129 lan_mac
=$
(ramips_get_mac_binary board-nvram
65440)
130 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
134 lan_mac
=$
(ramips_get_mac_binary factory
4)
139 [ -n "$lan_mac" ] && ucidef_set_interface_macaddr lan
$lan_mac
140 [ -n "$wan_mac" ] && ucidef_set_interface_macaddr wan
$wan_mac
143 [ -e /etc
/config
/network
] && exit 0
145 touch /etc
/config
/network
147 board
=$
(ramips_board_name
)
149 ramips_setup_interfaces
$board
150 ramips_setup_macs
$board