2 # Copyright (C) 2011 OpenWrt.org
5 preinit_set_mac_address() {
11 case $(ramips_board_name) in
21 mac=$(mtd_get_mac_binary factory 4)
22 ifconfig eth0 hw ether $mac 2>/dev/null
38 mac=$(mtd_get_mac_binary factory 4)
39 mac=$(macaddr_setbit_la "$mac")
40 ifconfig eth0 hw ether $mac 2>/dev/null
43 mac=$(mtd_get_mac_binary devdata 13)
44 ifconfig eth0 hw ether $mac 2>/dev/null
51 mac=$(mtd_get_mac_binary devdata 16388)
52 ifconfig eth0 hw ether $mac 2>/dev/null
55 mac=$(mtd_get_mac_ascii nvram lanmac)
56 mac=$(macaddr_setbit_la "$mac")
57 ifconfig eth0 hw ether $mac 2>/dev/null
60 mac=$(mtd_get_mac_binary devdata 46)
61 ifconfig eth0 hw ether $mac 2>/dev/null
84 mac=$(mtd_get_mac_binary factory 40)
85 ifconfig eth0 hw ether $mac 2>/dev/null
91 mac=$(mtd_get_mac_binary factory 4)
92 mac=$(macaddr_add "$mac" -1)
93 ifconfig eth0 hw ether $mac 2>/dev/null
96 mac=$(mtd_get_mac_binary board-nvram 65440)
97 ifconfig eth0 hw ether $mac 2>/dev/null
100 mac=$(mtd_get_mac_binary devconf 4)
101 ifconfig eth0 hw ether $mac 2>/dev/null
106 boot_hook_add preinit_main preinit_set_mac_address