5 .
/lib
/functions
/uci-defaults.sh
7 if [ ! -x /usr
/sbin
/maccalc
]; then
8 echo "$0: maccalc not found!"
18 part
=$
(find_mtd_part
"$mtdname")
19 if [ -z "$part" ]; then
20 echo "get_mac_binary: partition $mtdname not found!" >&2
24 dd bs
=1 skip
=$seek count
=6 if=$part 2>/dev
/null |
/usr
/sbin
/maccalc bin2mac
34 part
=$
(find_mtd_part
"$mtdname")
35 if [ -z "$part" ]; then
36 echo "get_mac_nvram: partition $mtdname not found!" >&2
40 mac_dirty
=$
(strings "$part" |
sed -n 's/'"$key"'=//p')
42 maccalc add
"$mac_dirty" 0
45 ramips_setup_interfaces
()
49 ucidef_set_interface_loopback
56 ucidef_set_interfaces_lan_wan
"eth0.1 eth0.2"
60 RT3X5X
=`cat /proc/cpuinfo | grep RT3.5`
61 [ -z "${RT3X5X}" ] || \
62 ucidef_set_interfaces_lan_wan
"eth0.1 eth0.2"
75 lan_mac
=$
(get_mac_nvram
"u-boot" 262148)
76 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
82 lan_mac
=$
(get_mac_binary factory
4)
83 wan_mac
=$
(/usr
/sbin
/maccalc add
"$lan_mac" 1)
87 [ -n $lan_mac ] && ucidef_set_interface_macaddr lan
$lan_mac
88 [ -n $wan_mac ] && ucidef_set_interface_macaddr wan
$wan_mac
91 board
=$
(ramips_board_name
)
93 ramips_setup_interfaces
$board
94 ramips_setup_macs
$board