2 # Copyright (C) 2011 OpenWrt.org
5 preinit_set_mac_address() {
10 case $(ramips_board_name) in
12 mac=$(ramips_get_mac_binary factory 4)
13 ifconfig eth0 hw ether $mac 2>/dev/null
23 mac=$(ramips_get_mac_binary factory 4)
24 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
25 ifconfig eth0 hw ether $mac 2>/dev/null
30 mac=$(ramips_get_mac_binary devdata 16388)
31 ifconfig eth0 hw ether $mac 2>/dev/null
34 mac=$(ramips_get_mac_binary devdata 46)
35 ifconfig eth0 hw ether $mac 2>/dev/null
51 mac=$(ramips_get_mac_binary factory 40)
52 ifconfig eth0 hw ether $mac 2>/dev/null
55 mac=$(ramips_get_mac_binary board-nvram 65440)
56 ifconfig eth0 hw ether $mac 2>/dev/null
59 mac=$(ramips_get_mac_binary devconf 4)
60 ifconfig eth0 hw ether $mac 2>/dev/null
65 boot_hook_add preinit_main preinit_set_mac_address