2 # Copyright (C) 2011 OpenWrt.org
5 preinit_set_mac_address() {
11 case $(ramips_board_name) in
18 mac=$(mtd_get_mac_binary factory 4)
19 ifconfig eth0 hw ether $mac 2>/dev/null
30 mac=$(mtd_get_mac_binary factory 4)
31 mac=$(macaddr_setbit_la "$mac")
32 ifconfig eth0 hw ether $mac 2>/dev/null
37 mac=$(mtd_get_mac_binary devdata 16388)
38 ifconfig eth0 hw ether $mac 2>/dev/null
41 mac=$(mtd_get_mac_ascii nvram lanmac)
42 mac=$(macaddr_setbit_la "$mac")
43 ifconfig eth0 hw ether $mac 2>/dev/null
46 mac=$(mtd_get_mac_binary devdata 46)
47 ifconfig eth0 hw ether $mac 2>/dev/null
66 mac=$(mtd_get_mac_binary factory 40)
67 ifconfig eth0 hw ether $mac 2>/dev/null
70 mac=$(mtd_get_mac_binary board-nvram 65440)
71 ifconfig eth0 hw ether $mac 2>/dev/null
74 mac=$(mtd_get_mac_binary devconf 4)
75 ifconfig eth0 hw ether $mac 2>/dev/null
80 boot_hook_add preinit_main preinit_set_mac_address