[PATCH] new file: bsp/ar71xx/root_file_system/etc/network.tl-wa860re modified: bsp/board_ar71xx.bsp modified: bsp/default/root_file_system/etc/network.sh modified: bsp/default/root_file_system/etc/rc.local.tpl
fff at chrisi01.de
fff at chrisi01.de
Do Dez 31 14:45:25 CET 2015
From: Christian Dresel <fff at chrisi01.de>
---
bsp/ar71xx/root_file_system/etc/network.tl-wa860re | 32 ++++++++++++++++++++++
bsp/board_ar71xx.bsp | 2 ++
bsp/default/root_file_system/etc/network.sh | 14 +++++++++-
bsp/default/root_file_system/etc/rc.local.tpl | 3 ++
4 files changed, 50 insertions(+), 1 deletion(-)
create mode 100644 bsp/ar71xx/root_file_system/etc/network.tl-wa860re
diff --git a/bsp/ar71xx/root_file_system/etc/network.tl-wa860re b/bsp/ar71xx/root_file_system/etc/network.tl-wa860re
new file mode 100644
index 0000000..d4a5611
--- /dev/null
+++ b/bsp/ar71xx/root_file_system/etc/network.tl-wa860re
@@ -0,0 +1,32 @@
+WANDEV=eth0
+SWITCHDEV=eth0
+CLIENT_PORTS=""
+WAN_PORTS=""
+BATMAN_PORTS=""
+
+. /etc/network.mode
+
+CLIENTIF="w2ap"
+ETHMESHMAC=
+ROUTERMAC=w2mesh
+
+uci set network.$SWITCHDEV=interface
+uci set network.$SWITCHDEV.ifname=$SWITCHDEV
+uci set network.mesh.ifname="bat0"
+
+if [ "$ETHMODE" = "WAN" ] ; then
+ ## Activate for WAN:
+ echo "net.ipv6.conf.$WANDEV.accept_ra_defrtr = 1" >> /etc/sysctl.conf
+ echo "net.ipv6.conf.$WANDEV.accept_ra_pinfo = 1" >> /etc/sysctl.conf
+ echo "net.ipv6.conf.$WANDEV.autoconf = 1" >> /etc/sysctl.conf
+ echo "net.ipv6.conf.$WANDEV.accept_ra_rtr_pref = 1" >> /etc/sysctl.conf
+ uci set network.wan.ifname=$WANDEV
+elif [ "$ETHMODE" = "CLIENT" ] ; then
+ ## Activate Client:
+ CLIENTIF="w2ap eth0"
+ uci set network.mesh.ifname="bat0 $SWITCHDEV"
+else
+ ## Activate BATMAN:
+ uci set network.ethmesh.ifname="$SWITCHDEV"
+ ETH0MAC=1
+fi
diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
index d6055b2..6e01f03 100644
--- a/bsp/board_ar71xx.bsp
+++ b/bsp/board_ar71xx.bsp
@@ -26,6 +26,8 @@ board_postbuild() {
cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr1043nd-v1-squashfs-*.bin ./bin/
cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr1043nd-v2-squashfs-*.bin ./bin/
+
+ cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wa860re-v1-squashfs-*.bin ./bin/
}
board_clean() {
diff --git a/bsp/default/root_file_system/etc/network.sh b/bsp/default/root_file_system/etc/network.sh
index 63d3815..6c64083 100644
--- a/bsp/default/root_file_system/etc/network.sh
+++ b/bsp/default/root_file_system/etc/network.sh
@@ -100,4 +100,16 @@ if [[ -n "$ROUTERMAC" ]]; then
ifconfig br-mesh up
/etc/init.d/network restart
fi
-fi
\ No newline at end of file
+fi
+
+if [[ -n "$ETH0MAC" ]]; then
+ echo "Fixing MAC on eth0"
+ sleep 10
+ NEW_MACADDR=$(cat /sys/class/net/w2ap/address)
+ uci set network.eth0.macaddr=$NEW_MACADDR
+ uci commit
+ ifconfig eth0 down
+ ifconfig eth0 hw ether $NEW_MACADDR
+ ifconfig eth0 up
+ /etc/init.d/network restart
+fi
diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
index b115fc1..6f83886 100755
--- a/bsp/default/root_file_system/etc/rc.local.tpl
+++ b/bsp/default/root_file_system/etc/rc.local.tpl
@@ -23,6 +23,9 @@ case "$BOARD" in
nanostation-m)
BOARD=ubnt-nano-m
;;
+ tl-wa860re)
+ BOARD=tl-wa860re-v1
+ ;;
esac
if ! uci get board.model.name; then
--
2.1.4
Mehr Informationen über die Mailingliste franken-dev