diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2009-08-03 07:48:21 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2009-08-03 07:48:21 +0000 |
commit | 839df2f4ac6d2bee1df62d6cfb1427ff7b0af2c2 (patch) | |
tree | 8e5677ff753faf1485c57a4161791831addbf765 | |
parent | c4ef19ed00a3cc56ce7d0eca9f179f5f0b3386a1 (diff) | |
download | upstream-839df2f4ac6d2bee1df62d6cfb1427ff7b0af2c2.tar.gz upstream-839df2f4ac6d2bee1df62d6cfb1427ff7b0af2c2.tar.bz2 upstream-839df2f4ac6d2bee1df62d6cfb1427ff7b0af2c2.zip |
[ar71xx] init mac address on the TEW-632BRP boards (closes #5403)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@17100 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | target/linux/ar71xx/base-files/etc/preinit.arch | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/target/linux/ar71xx/base-files/etc/preinit.arch b/target/linux/ar71xx/base-files/etc/preinit.arch new file mode 100644 index 0000000000..6e09039059 --- /dev/null +++ b/target/linux/ar71xx/base-files/etc/preinit.arch @@ -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 |