[PATCH] Add support for Ubiquiti Bullet M

Christian Dresel fff at chrisi01.de
Do Mär 31 10:45:34 CEST 2016


Signed-off-by: Christian Dresel <fff at chrisi01.de>

	new file:   bsp/ar71xx/root_file_system/etc/network.ubnt-bullet-m
	modified:   bsp/board_ar71xx.bsp
	modified:   bsp/default/root_file_system/etc/rc.local.tpl
---
 .../root_file_system/etc/network.ubnt-bullet-m     | 31 ++++++++++++++++++++++
 bsp/board_ar71xx.bsp                               |  2 ++
 bsp/default/root_file_system/etc/rc.local.tpl      |  3 +++
 3 files changed, 36 insertions(+)
 create mode 100644 bsp/ar71xx/root_file_system/etc/network.ubnt-bullet-m

diff --git a/bsp/ar71xx/root_file_system/etc/network.ubnt-bullet-m b/bsp/ar71xx/root_file_system/etc/network.ubnt-bullet-m
new file mode 100644
index 0000000..1e9223f
--- /dev/null
+++ b/bsp/ar71xx/root_file_system/etc/network.ubnt-bullet-m
@@ -0,0 +1,31 @@
+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"
+fi
diff --git a/bsp/board_ar71xx.bsp b/bsp/board_ar71xx.bsp
index 4876631..6b9c21f 100644
--- a/bsp/board_ar71xx.bsp
+++ b/bsp/board_ar71xx.bsp
@@ -14,6 +14,8 @@ board_postbuild() {
 
     cp $target/bin/ar71xx/openwrt-ar71xx-generic-ubnt-loco-m-xw-squashfs-*.bin ./bin/
 
+    cp $target/bin/ar71xx/openwrt-ar71xx-generic-ubnt-bullet-m-squashfs-*.bin ./bin/
+
     cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr740n-v4-squashfs-*.bin ./bin/
 
     cp $target/bin/ar71xx/openwrt-ar71xx-generic-tl-wr741nd-v2-squashfs-*.bin ./bin/
diff --git a/bsp/default/root_file_system/etc/rc.local.tpl b/bsp/default/root_file_system/etc/rc.local.tpl
index ddf208d..1e8294d 100755
--- a/bsp/default/root_file_system/etc/rc.local.tpl
+++ b/bsp/default/root_file_system/etc/rc.local.tpl
@@ -26,6 +26,9 @@ case "$BOARD" in
     nanostation-m)
         BOARD=ubnt-nano-m
         ;;
+    bullet-m)
+        BOARD=ubnt-bullet-m
+        ;;
     loco-m-xw)
         BOARD=ubnt-loco-m-xw
         ;;
-- 
2.1.4




Mehr Informationen über die Mailingliste franken-dev