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
23 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
27 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
28 ucidef_add_switch
"rtl8366s" "1" "1"
29 ucidef_add_switch_vlan
"rtl8366s" "1" "1 2 3 4 5t"
30 ucidef_add_switch_vlan
"rtl8366s" "2" "0 5t"
34 RT3X5X
=`cat /proc/cpuinfo | grep RT3.5`
35 if [ -n "${RT3X5X}" ]; then
36 ucidef_set_interfaces_lan_wan
"eth0.1" "eth0.2"
38 ucidef_set_interfaces_lan_wan
"eth0" "eth1"
52 lan_mac
=$
(ramips_get_mac_nvram
"u-boot" 262148)
53 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
60 lan_mac
=$
(ramips_get_mac_binary factory
4)
61 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
65 lan_mac
=$
(ramips_get_mac_binary factory
4)
66 wan_mac
=$
(ramips_get_mac_binary factory
40)
70 [ -n $lan_mac ] && ucidef_set_interface_macaddr lan
$lan_mac
71 [ -n $wan_mac ] && ucidef_set_interface_macaddr wan
$wan_mac
74 [ -e /etc
/config
/network
] && exit 0
76 touch /etc
/config
/network
78 board
=$
(ramips_board_name
)
80 ramips_setup_interfaces
$board
81 ramips_setup_macs
$board