ramips: rt305x: add support for the Asus WL-330N3G board
[openwrt/openwrt.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 bc2 |\
12 esr-9753 |\
13 freestation5 |\
14 nw718 |\
15 rt-n56u |\
16 sl-r7205)
17 mac=$(ramips_get_mac_binary factory 4)
18 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
19 ifconfig eth0 hw ether $mac 2>/dev/null
20 ;;
21 dir-300-b1 |\
22 dir-300-b2 |\
23 dir-600-b1)
24 mac=$(ramips_get_mac_binary devdata 16388)
25 ifconfig eth0 hw ether $mac 2>/dev/null
26 ;;
27 all0256n |\
28 hw550-3g |\
29 nbg-419n |\
30 omni-emb |\
31 w306r-v20 |\
32 w502u |\
33 wl-330n |\
34 wl-330n3g |\
35 wr6202 |\
36 xdxrn502j)
37 mac=$(ramips_get_mac_binary factory 40)
38 ifconfig eth0 hw ether $mac 2>/dev/null
39 ;;
40 wl341v3)
41 mac=$(ramips_get_mac_binary board-nvram 65440)
42 ifconfig eth0 hw ether $mac 2>/dev/null
43 ;;
44 rt-n10-plus)
45 mac=$(ramips_get_mac_binary devconf 4)
46 ifconfig eth0 hw ether $mac 2>/dev/null
47 ;;
48 esac
49 }
50
51 boot_hook_add preinit_main preinit_set_mac_address