2 # Copyright (C) 2011 OpenWrt.org
9 [ -z $(which maccalc) ] && return
13 part=$(find_mtd_part "factory")
14 [ -z $part ] && return
16 mac=$(dd bs=1 skip=4 count=6 if=$part 2>/dev/null | maccalc bin2mac)
19 mac=$(maccalc or "$mac" "02:00:00:00:00:00")
20 ifconfig eth0 hw ether $mac 2>/dev/null
23 preinit_set_mac_address() {
26 case $(ramips_board_name) in
33 boot_hook_add preinit_main preinit_set_mac_address