mirror of
https://github.com/openwrt/openwrt.git
synced 2025-02-09 20:31:35 +00:00
init mac address on the TEW-632BRP boards (closes #5403)
SVN-Revision: 17100
This commit is contained in:
parent
39c22483bd
commit
bfd20cb57d
24
target/linux/ar71xx/base-files/etc/preinit.arch
Normal file
24
target/linux/ar71xx/base-files/etc/preinit.arch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2009 OpenWrt.org
|
||||||
|
#
|
||||||
|
|
||||||
|
. /lib/ar71xx.sh
|
||||||
|
|
||||||
|
tew632brp_init_mac_address() {
|
||||||
|
local mtd mac
|
||||||
|
|
||||||
|
mtd=$(grep config /proc/mtd | cut -d: -f1)
|
||||||
|
[ -z $mtd ] && return
|
||||||
|
|
||||||
|
mac=$(grep lan_mac /dev/$mtd | cut -d= -f2)
|
||||||
|
[ ! -z $mac ] && ifconfig eth0 hw ether $mac 2>/dev/null
|
||||||
|
|
||||||
|
mac=$(grep wan_mac /dev/$mtd | cut -d= -f2)
|
||||||
|
[ ! -z $mac ] && ifconfig eth1 hw ether $mac 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
case $(ar71xx_board_name) in
|
||||||
|
tew-632brp)
|
||||||
|
tew632brp_init_mac_address
|
||||||
|
;;
|
||||||
|
esac
|
Loading…
x
Reference in New Issue
Block a user