AA: ramips: fix ASUS WL-330N3G MAC address
[openwrt/svn-archive/archive.git] / target / linux / ramips / base-files / lib / preinit / 06_set_iface_mac
1 #
2 # Copyright (C) 2011 OpenWrt.org
3 #
4
5 preinit_set_mac_address() {
6 local mac
7
8 . /lib/ramips.sh
9
10 case $(ramips_board_name) in
11 3g-6200n |\
12 wl-330n |\
13 wl-330n3g)
14 mac=$(ramips_get_mac_binary factory 4)
15 ifconfig eth0 hw ether $mac 2>/dev/null
16 ;;
17 bc2 |\
18 dir-620-a1 |\
19 esr-9753 |\
20 freestation5 |\
21 nw718 |\
22 psr-680w |\
23 rt-n56u |\
24 sl-r7205)
25 mac=$(ramips_get_mac_binary factory 4)
26 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
27 ifconfig eth0 hw ether $mac 2>/dev/null
28 ;;
29 dir-300-b1 |\
30 dir-300-b2 |\
31 dir-600-b1)
32 mac=$(ramips_get_mac_binary devdata 16388)
33 ifconfig eth0 hw ether $mac 2>/dev/null
34 ;;
35 dir-645)
36 mac=$(ramips_get_mac_nvram nvram lanmac)
37 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
38 ifconfig eth0 hw ether $mac 2>/dev/null
39 ;;
40 dap-1350)
41 mac=$(ramips_get_mac_binary devdata 46)
42 ifconfig eth0 hw ether $mac 2>/dev/null
43 ;;
44 all0239-3g |\
45 all0256n |\
46 all5002 |\
47 carambola |\
48 dir-615-h1 |\
49 fonera20n |\
50 hw550-3g |\
51 nbg-419n |\
52 omni-emb |\
53 tew-691gr |\
54 tew-692gr |\
55 w306r-v20 |\
56 w502u |\
57 wr6202 |\
58 xdxrn502j)
59 mac=$(ramips_get_mac_binary factory 40)
60 ifconfig eth0 hw ether $mac 2>/dev/null
61 ;;
62 wl341v3)
63 mac=$(ramips_get_mac_binary board-nvram 65440)
64 ifconfig eth0 hw ether $mac 2>/dev/null
65 ;;
66 rt-n10-plus)
67 mac=$(ramips_get_mac_binary devconf 4)
68 ifconfig eth0 hw ether $mac 2>/dev/null
69 ;;
70 esac
71 }
72
73 boot_hook_add preinit_main preinit_set_mac_address