2011-08-15 21:55:53 +03:00
|
|
|
#
|
|
|
|
# Copyright (C) 2011 OpenWrt.org
|
|
|
|
#
|
|
|
|
|
2011-12-05 19:27:04 +02:00
|
|
|
preinit_set_mac_address() {
|
2011-08-15 21:55:53 +03:00
|
|
|
local mac
|
|
|
|
|
|
|
|
. /lib/ramips.sh
|
|
|
|
|
|
|
|
case $(ramips_board_name) in
|
2011-10-25 00:49:36 +03:00
|
|
|
bc2 | nw718)
|
2011-12-05 19:27:04 +02:00
|
|
|
mac=$(ramips_get_mac_binary factory 4)
|
|
|
|
mac=$(maccalc or "$mac" "02:00:00:00:00:00")
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
2011-08-15 21:55:53 +03:00
|
|
|
;;
|
2011-12-06 22:06:08 +02:00
|
|
|
dir-300-b1 |\
|
|
|
|
dir-300-b2 |\
|
|
|
|
dir-600-b1)
|
|
|
|
mac=$(ramips_get_mac_binary devdata 16388)
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
|
|
|
;;
|
2011-12-05 19:27:07 +02:00
|
|
|
hw550-3g |\
|
2011-12-14 22:51:26 +02:00
|
|
|
nbg-419n |\
|
|
|
|
omni-emb)
|
2011-12-05 19:27:06 +02:00
|
|
|
mac=$(ramips_get_mac_binary factory 40)
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
|
|
|
;;
|
2011-08-15 21:55:53 +03:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
boot_hook_add preinit_main preinit_set_mac_address
|