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
|
2012-07-12 16:29:46 +03:00
|
|
|
3g-6200n)
|
|
|
|
mac=$(ramips_get_mac_binary factory 4)
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
|
|
|
;;
|
2012-01-24 13:48:47 +02:00
|
|
|
bc2 |\
|
2012-08-12 15:48:24 +03:00
|
|
|
dir-620-a1 |\
|
2012-02-19 18:44:49 +02:00
|
|
|
esr-9753 |\
|
2012-03-29 19:03:04 +03:00
|
|
|
freestation5 |\
|
2012-01-24 13:48:47 +02:00
|
|
|
nw718 |\
|
2012-06-19 12:52:15 +03:00
|
|
|
psr-680w |\
|
2012-02-13 17:18:04 +02:00
|
|
|
rt-n56u |\
|
2012-02-19 18:44:49 +02:00
|
|
|
sl-r7205)
|
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
|
|
|
|
;;
|
2012-07-24 23:38:43 +03:00
|
|
|
dap-1350)
|
|
|
|
mac=$(ramips_get_mac_binary devdata 46)
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
|
|
|
;;
|
2012-08-17 20:56:07 +03:00
|
|
|
all0239-3g |\
|
2012-01-24 13:48:47 +02:00
|
|
|
all0256n |\
|
2012-08-17 20:56:05 +03:00
|
|
|
all5002 |\
|
2012-08-29 13:37:43 +03:00
|
|
|
carambola |\
|
2012-08-17 20:56:05 +03:00
|
|
|
dir-615-h1 |\
|
2012-06-23 16:58:29 +03:00
|
|
|
fonera20n |\
|
2011-12-05 19:27:07 +02:00
|
|
|
hw550-3g |\
|
2011-12-14 22:51:26 +02:00
|
|
|
nbg-419n |\
|
2011-12-28 10:43:32 +02:00
|
|
|
omni-emb |\
|
2012-04-21 15:30:40 +03:00
|
|
|
w306r-v20 |\
|
2012-02-11 17:11:36 +02:00
|
|
|
w502u |\
|
2012-03-27 22:29:57 +03:00
|
|
|
wl-330n |\
|
2012-04-23 19:56:05 +03:00
|
|
|
wl-330n3g |\
|
2012-03-04 18:09:13 +02:00
|
|
|
wr6202 |\
|
|
|
|
xdxrn502j)
|
2011-12-05 19:27:06 +02:00
|
|
|
mac=$(ramips_get_mac_binary factory 40)
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
|
|
|
;;
|
2012-01-26 12:44:23 +02:00
|
|
|
wl341v3)
|
|
|
|
mac=$(ramips_get_mac_binary board-nvram 65440)
|
|
|
|
ifconfig eth0 hw ether $mac 2>/dev/null
|
|
|
|
;;
|
2012-03-04 18:09:11 +02:00
|
|
|
rt-n10-plus)
|
|
|
|
mac=$(ramips_get_mac_binary devconf 4)
|
|
|
|
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
|