2 # Copyright (C) 2011 OpenWrt.org
5 preinit_set_mac_address() {
11 case $(ramips_board_name) in
20 mac=$(mtd_get_mac_binary factory 4)
21 ifconfig eth0 hw ether $mac 2>/dev/null
33 mac=$(mtd_get_mac_binary factory 4)
34 mac=$(macaddr_setbit_la "$mac")
35 ifconfig eth0 hw ether $mac 2>/dev/null
41 mac=$(mtd_get_mac_binary devdata 16388)
42 ifconfig eth0 hw ether $mac 2>/dev/null
45 mac=$(mtd_get_mac_ascii nvram lanmac)
46 mac=$(macaddr_setbit_la "$mac")
47 ifconfig eth0 hw ether $mac 2>/dev/null
50 mac=$(mtd_get_mac_binary devdata 46)
51 ifconfig eth0 hw ether $mac 2>/dev/null
71 mac=$(mtd_get_mac_binary factory 40)
72 ifconfig eth0 hw ether $mac 2>/dev/null
75 mac=$(mtd_get_mac_binary board-nvram 65440)
76 ifconfig eth0 hw ether $mac 2>/dev/null
79 mac=$(mtd_get_mac_binary devconf 4)
80 ifconfig eth0 hw ether $mac 2>/dev/null
85 boot_hook_add preinit_main preinit_set_mac_address