2 # Copyright (C) 2011 OpenWrt.org
5 preinit_set_mac_address() {
11 case $(ramips_board_name) in
17 mac=$(mtd_get_mac_binary factory 4)
18 ifconfig eth0 hw ether $mac 2>/dev/null
29 mac=$(mtd_get_mac_binary factory 4)
30 mac=$(macaddr_setbit_la "$mac")
31 ifconfig eth0 hw ether $mac 2>/dev/null
36 mac=$(mtd_get_mac_binary devdata 16388)
37 ifconfig eth0 hw ether $mac 2>/dev/null
40 mac=$(mtd_get_mac_ascii nvram lanmac)
41 mac=$(macaddr_setbit_la "$mac")
42 ifconfig eth0 hw ether $mac 2>/dev/null
45 mac=$(mtd_get_mac_binary devdata 46)
46 ifconfig eth0 hw ether $mac 2>/dev/null
65 mac=$(mtd_get_mac_binary factory 40)
66 ifconfig eth0 hw ether $mac 2>/dev/null
69 mac=$(mtd_get_mac_binary board-nvram 65440)
70 ifconfig eth0 hw ether $mac 2>/dev/null
73 mac=$(mtd_get_mac_binary devconf 4)
74 ifconfig eth0 hw ether $mac 2>/dev/null
79 boot_hook_add preinit_main preinit_set_mac_address