diff options
author | Felix Fietkau <nbd@openwrt.org> | 2010-06-01 14:41:37 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2010-06-01 14:41:37 +0000 |
commit | 45861299890816297f66352587476ac5a35b0605 (patch) | |
tree | 22c7ad29e2c7d03ce7211ce3e29d92271ac6a669 /target | |
parent | 2b743a266f630e745664b3e27f1c967b9dfbdb1b (diff) | |
download | mtk-20170518-45861299890816297f66352587476ac5a35b0605.zip mtk-20170518-45861299890816297f66352587476ac5a35b0605.tar.gz mtk-20170518-45861299890816297f66352587476ac5a35b0605.tar.bz2 |
orion: fix lan and wan mac address for wrt530n v2 (patch by maddes from #7113)
SVN-Revision: 21647
Diffstat (limited to 'target')
-rw-r--r-- | target/linux/orion/base-files/etc/uci-defaults/hardware | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/target/linux/orion/base-files/etc/uci-defaults/hardware b/target/linux/orion/base-files/etc/uci-defaults/hardware index 9c97496..7f727eb 100644 --- a/target/linux/orion/base-files/etc/uci-defaults/hardware +++ b/target/linux/orion/base-files/etc/uci-defaults/hardware @@ -28,6 +28,23 @@ set system.wifi_led.mode='link tx rx' set system.wifi_led.default='0' commit system __EOF + +# add mac address from U-Boot partition to lan and wan devices + MTD=`grep -e 'u-boot' /proc/mtd` + MTD=`echo ${MTD} | sed 's/[a-z]*\([0-9]*\):.*/\1/'` + [ -n "${MTD}" ] && { + MACADDR=`dd if=/dev/mtdblock${MTD} bs=1 skip=262048 count=6 2>/dev/null | hexdump -e '1/1 "%02x"'` + MACADDR2=$(( 0x${MACADDR} + 1)) + MACADDR2=`printf "%012x" ${MACADDR2}` + + MACADDR=`echo ${MACADDR} | sed 's/\(..\)/\1:/g' | sed 's/:$//'` + MACADDR2=`echo ${MACADDR2} | sed 's/\(..\)/\1:/g' | sed 's/:$//'` + + uci set network.eth0.macaddr=${MACADDR} + uci set network.lan.macaddr=${MACADDR} + uci set network.wan.macaddr=${MACADDR2} + uci commit network + } } case "${hardware}" in |