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 | bfd20cb57da0ec8d758324679dcddda9650a8d47 (patch) | |
tree | a298a0afd3619c0ff12f545f52a835a7ba1e5bd0 | |
parent | 39c22483bd2a9c0e523d11dbde968c539ff5ebd5 (diff) | |
download | upstream-bfd20cb57da0ec8d758324679dcddda9650a8d47.tar.gz upstream-bfd20cb57da0ec8d758324679dcddda9650a8d47.tar.bz2 upstream-bfd20cb57da0ec8d758324679dcddda9650a8d47.zip |
init mac address on the TEW-632BRP boards (closes #5403)
SVN-Revision: 17100
-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 |