FirmwareEntwicklung/buildalldevice

Aus Freifunk Franken
Version vom 28. Juli 2019, 13:21 Uhr von Fblaese (Diskussion | Beiträge)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu:Navigation, Suche


Hiermit kann die Firmware für jedes Device gebaut werden.

Nachteil:

  • Es gibt keine Batman Ethernet Ports mehr, als Netzwerksettings wird das genommen, was LEDE mitliefert. Falls Batmanports benötigt werden, müssen diese händisch konfiguriert werden (Anleitung folgt)
  • So gut wie jedes Gerät ungetestet. Entwickelt wurde das ganze auf einen WR801ND worauf es auch funktioniert.
  • Das ganze ist nur zusammen gefrickelt und eigentlich nur auf Funktion und nicht auf Schönheit getrimmt.
  • Im moment wird die fertige *.bin noch nicht nach /bin kopiert, man muss sie händisch aus build/ar71xx/bin/targets/ar71xx/generic herausholen.
  • Aktuell nur für ar71xx-generic gebaut, kann aber theoretisch für jede LEDE Hardware gemacht werden.
  • VPN Zeug (l2tp und fastd) bisher komplett ungetestet!

Da es ungetestet ist, keine Garantie auf Funktion! Es kann sein das manche Geräte manche Funktionen nicht unterstützen und daher nicht funktionieren! Brickgefahr!


Download fertiger Pakete hier: http://fff-gw-cd1.fff.community/dev/alpha/all/ Nutzung auf eigene Gefahr!

Patchset:

From 982d72daa0018fd3c2775d8e0f419a9e0f4aaf81 Mon Sep 17 00:00:00 2001
From: Christian Dresel <fff@chrisi01.de>
Date: Thu, 16 Mar 2017 15:28:44 +0100
Subject: [PATCH] Build Firmware for all devices

Signed-off-by: Christian Dresel <fff@chrisi01.de>
---
 bsp/ar71xx/.config                                 | 177 +++++++++++++--------
 bsp/default/root_file_system/etc/config/alfred     |   2 +-
 community/franken.cfg                              |   4 +-
 .../files/etc/uci-defaults/93-fff-batman-adv       |   2 +-
 .../files/etc/uci-defaults/93-fff-nodewatcher      |   4 +-
 .../fff/fff-uradvd/files/etc/init.d/fff-uradvd     |   2 +-
 .../fff/fff-vpn-select/files/usr/sbin/vpn-select   |   2 +-
 .../fff-wireless/files/lib/functions/fff/wireless  |  50 +++++-
 8 files changed, 171 insertions(+), 72 deletions(-)

diff --git a/bsp/ar71xx/.config b/bsp/ar71xx/.config
index 4cedc41..0ed77c3 100644
--- a/bsp/ar71xx/.config
+++ b/bsp/ar71xx/.config
@@ -3,71 +3,15 @@
 #
 CONFIG_TARGET_ar71xx=y
 CONFIG_TARGET_ar71xx_generic=y
-CONFIG_TARGET_MULTI_PROFILE=y
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_gl-ar150=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_gl-ar150=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_archer-c7-v2=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_archer-c7-v2=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_cpe210-220=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_cpe210-220=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_cpe510-520=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_cpe510-520=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-mr3020-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-mr3020-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wa850re-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wa850re-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wa860re-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wa860re-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wdr3500-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wdr3500-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wdr3600-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wdr3600-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wdr4300-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wdr4300-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wdr4310-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wdr4310-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr1043nd-v1=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr1043nd-v1=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr1043nd-v2=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr1043nd-v2=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr1043nd-v3=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr1043nd-v3=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr1043nd-v4=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr1043nd-v4=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr740n-v4=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr740n-v4=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr741nd-v2=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr741nd-v2=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr741nd-v4=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr741nd-v4=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr841-v10=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr841-v10=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr841-v11=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr841-v11=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr841-v7=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr841-v7=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr841-v8=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr841-v8=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr841-v9=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr841-v9=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_tl-wr842n-v2=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_tl-wr842n-v2=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-bullet-m=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_ubnt-bullet-m=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-loco-m-xw=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_ubnt-loco-m-xw=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-nano-m=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_ubnt-nano-m=""
-CONFIG_TARGET_DEVICE_ar71xx_generic_DEVICE_ubnt-unifi=y
-CONFIG_TARGET_DEVICE_PACKAGES_ar71xx_generic_DEVICE_ubnt-unifi=""
+CONFIG_TARGET_ar71xx_generic_Default=y
 CONFIG_BUSYBOX_CUSTOM=y
-CONFIG_TARGET_PER_DEVICE_ROOTFS=y
 # CONFIG_BUSYBOX_CONFIG_BRCTL is not set
 # CONFIG_BUSYBOX_CONFIG_CROND is not set
 # CONFIG_BUSYBOX_CONFIG_CRONTAB is not set
 # CONFIG_BUSYBOX_CONFIG_FEATURE_FAST_TOP is not set
 # CONFIG_BUSYBOX_CONFIG_FEATURE_NTPD_SERVER is not set
 CONFIG_CLEAN_IPKG=y
+CONFIG_DRIVER_11AC_SUPPORT=y
 # CONFIG_DROPBEAR_CURVE25519 is not set
 # CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 is not set
 # CONFIG_FASTD_ENABLE_MAC_GHASH is not set
@@ -79,17 +23,124 @@ CONFIG_CLEAN_IPKG=y
 # CONFIG_KERNEL_DEBUG_INFO is not set
 # CONFIG_KERNEL_DEBUG_KERNEL is not set
 # CONFIG_PACKAGE_ALFRED_VIS is not set
+CONFIG_PACKAGE_ath10k-firmware-qca988x=m
+# CONFIG_PACKAGE_fff-base is not set
+# CONFIG_PACKAGE_fff-network is not set
+CONFIG_PACKAGE_kmod-ath10k=m
 CONFIG_PACKAGE_kmod-ifb=y
 CONFIG_PACKAGE_kmod-ledtrig-heartbeat=y
 CONFIG_PACKAGE_kmod-ledtrig-netdev=y
-CONFIG_PACKAGE_kmod-nls-base=y
 CONFIG_PACKAGE_kmod-sched-connmark=y
-CONFIG_PACKAGE_kmod-usb-core=y
-CONFIG_PACKAGE_kmod-usb-ledtrig-usbport=y
-CONFIG_PACKAGE_kmod-usb-ohci=y
-CONFIG_PACKAGE_kmod-usb2=y
 CONFIG_PACKAGE_opkg=m
 CONFIG_PACKAGE_qos-scripts=y
+CONFIG_PACKAGE_rssileds=m
 CONFIG_PACKAGE_tc=y
 CONFIG_STRIP_KERNEL_EXPORTS=y
 CONFIG_TARGET_SQUASHFS_BLOCK_SIZE=512
+# CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_AUTHENTICATION is not set
+# CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_LONG_OPTIONS is not set
+# CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_OPENSSL is not set
+# CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_SSL_HELPER is not set
+# CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_STATUSBAR is not set
+CONFIG_BUSYBOX_CONFIG_FEATURE_WGET_TIMEOUT=y
+CONFIG_BUSYBOX_CONFIG_WGET=y
+# CONFIG_FASTD_ENABLE_CIPHER_AES128_CTR is not set
+CONFIG_FASTD_ENABLE_CIPHER_NULL=y
+# CONFIG_FASTD_ENABLE_CIPHER_SALSA20 is not set
+# CONFIG_FASTD_ENABLE_CIPHER_SALSA2012 is not set
+# CONFIG_FASTD_ENABLE_MAC_GHASH is not set
+# CONFIG_FASTD_ENABLE_MAC_UHASH is not set
+# CONFIG_FASTD_ENABLE_METHOD_CIPHER_TEST is not set
+# CONFIG_FASTD_ENABLE_METHOD_COMPOSED_GMAC is not set
+# CONFIG_FASTD_ENABLE_METHOD_COMPOSED_UMAC is not set
+# CONFIG_FASTD_ENABLE_METHOD_GENERIC_GMAC is not set
+# CONFIG_FASTD_ENABLE_METHOD_GENERIC_POLY1305 is not set
+# CONFIG_FASTD_ENABLE_METHOD_GENERIC_UMAC is not set
+CONFIG_FASTD_ENABLE_METHOD_NULL=y
+# CONFIG_FASTD_ENABLE_METHOD_XSALSA20_POLY1305 is not set
+# CONFIG_FASTD_WITH_CAPABILITIES is not set
+# CONFIG_FASTD_WITH_CMDLINE_COMMANDS is not set
+# CONFIG_FASTD_WITH_CMDLINE_LOGGING is not set
+# CONFIG_FASTD_WITH_CMDLINE_OPERATION is not set
+# CONFIG_FASTD_WITH_CMDLINE_USER is not set
+# CONFIG_FASTD_WITH_DYNAMIC_PEERS is not set
+CONFIG_FASTD_WITH_STATUS_SOCKET=y
+# CONFIG_HASERL_shell_lua is not set
+# CONFIG_HASERL_shell_luac is not set
+# CONFIG_HASERL_with_lua is not set
+CONFIG_KMOD_BATMAN_ADV_LEGACY_BATCTL=y
+CONFIG_KMOD_BATMAN_ADV_LEGACY_BLA=y
+CONFIG_KMOD_BATMAN_ADV_LEGACY_DAT=y
+# CONFIG_KMOD_BATMAN_ADV_LEGACY_DEBUG_LOG is not set
+CONFIG_KMOD_BATMAN_ADV_LEGACY_NC=y
+# CONFIG_PACKAGE_ALFRED_BATHOSTS is not set
+# CONFIG_PACKAGE_ALFRED_GPSD is not set
+# CONFIG_PACKAGE_ALFRED_VIS is not set
+CONFIG_PACKAGE_alfred=y
+CONFIG_PACKAGE_arptables=y
+CONFIG_PACKAGE_ebtables=y
+CONFIG_PACKAGE_ebtables-utils=y
+CONFIG_PACKAGE_fastd=y
+CONFIG_PACKAGE_fff-batman-adv-legacy=y
+CONFIG_PACKAGE_fff-boardname=y
+CONFIG_PACKAGE_fff-fastd=y
+CONFIG_PACKAGE_fff-firewall=y
+CONFIG_PACKAGE_fff-nodewatcher=y
+CONFIG_PACKAGE_fff-random=y
+CONFIG_PACKAGE_fff-support=y
+CONFIG_PACKAGE_fff-sysupgrade=y
+CONFIG_PACKAGE_fff-timeserver=y
+CONFIG_PACKAGE_fff-tunneldigger=y
+CONFIG_PACKAGE_fff-uradvd=y
+CONFIG_PACKAGE_fff-vpn-select=y
+CONFIG_PACKAGE_fff-web=y
+CONFIG_PACKAGE_fff-wireless=y
+CONFIG_PACKAGE_haserl=y
+CONFIG_PACKAGE_ip-bridge=y
+CONFIG_PACKAGE_ip-tiny=y
+CONFIG_PACKAGE_ip6tables=y
+# CONFIG_PACKAGE_ip6tables-extra is not set
+# CONFIG_PACKAGE_ip6tables-mod-nat is not set
+CONFIG_PACKAGE_iptables-mod-filter=y
+CONFIG_PACKAGE_kmod-arptables=y
+CONFIG_PACKAGE_kmod-batman-adv-legacy=y
+CONFIG_PACKAGE_kmod-br-netfilter=y
+CONFIG_PACKAGE_kmod-bridge=y
+CONFIG_PACKAGE_kmod-crypto-crc32c=y
+CONFIG_PACKAGE_kmod-crypto-hash=y
+CONFIG_PACKAGE_kmod-ebtables=y
+CONFIG_PACKAGE_kmod-ebtables-ipv4=y
+CONFIG_PACKAGE_kmod-ebtables-ipv6=y
+# CONFIG_PACKAGE_kmod-ebtables-watchers is not set
+CONFIG_PACKAGE_kmod-ip6tables=y
+CONFIG_PACKAGE_kmod-ipt-filter=y
+CONFIG_PACKAGE_kmod-l2tp=y
+CONFIG_PACKAGE_kmod-l2tp-eth=y
+CONFIG_PACKAGE_kmod-l2tp-ip=y
+CONFIG_PACKAGE_kmod-lib-crc16=y
+CONFIG_PACKAGE_kmod-lib-crc32c=y
+CONFIG_PACKAGE_kmod-lib-textsearch=y
+CONFIG_PACKAGE_kmod-llc=y
+CONFIG_PACKAGE_kmod-nf-conntrack6=y
+CONFIG_PACKAGE_kmod-nf-ipt6=y
+CONFIG_PACKAGE_kmod-sched=y
+CONFIG_PACKAGE_kmod-stp=y
+CONFIG_PACKAGE_kmod-tun=y
+CONFIG_PACKAGE_kmod-udptunnel4=y
+CONFIG_PACKAGE_kmod-udptunnel6=y
+CONFIG_PACKAGE_libmbedtls=y
+CONFIG_PACKAGE_libpthread=y
+CONFIG_PACKAGE_librt=y
+CONFIG_PACKAGE_libuecc=y
+CONFIG_PACKAGE_libustream-mbedtls=y
+CONFIG_PACKAGE_micrond=y
+CONFIG_PACKAGE_odhcp6c=y
+CONFIG_PACKAGE_odhcp6c_ext_cer_id=0
+CONFIG_PACKAGE_px5g-mbedtls=y
+CONFIG_PACKAGE_simple-tc=y
+CONFIG_PACKAGE_tunneldigger=y
+CONFIG_PACKAGE_uhttpd=y
+# CONFIG_PACKAGE_uhttpd-mod-lua is not set
+# CONFIG_PACKAGE_uhttpd-mod-ubus is not set
+CONFIG_PACKAGE_uradvd=y
+CONFIG_PACKAGE_wireless-tools=y
diff --git a/bsp/default/root_file_system/etc/config/alfred b/bsp/default/root_file_system/etc/config/alfred
index 5fd4259..57fe921 100644
--- a/bsp/default/root_file_system/etc/config/alfred
+++ b/bsp/default/root_file_system/etc/config/alfred
@@ -1,5 +1,5 @@
 config 'alfred' 'alfred'
-    option interface 'br-mesh'
+    option interface 'br-lan'
     option mode 'slave'
     option batmanif 'bat0'
     option start_vis '0'
diff --git a/community/franken.cfg b/community/franken.cfg
index 833e98e..7790c67 100644
--- a/community/franken.cfg
+++ b/community/franken.cfg
@@ -4,5 +4,5 @@ ESSID_AP=franken.freifunk.net
 ESSID_MESH=batman.franken.freifunk.net
 BSSID_MESH=02:CA:FF:EE:BA:BE
 VPN_PROJECT=fff
-NTPD_IP=fe80::ff:feee:1%br-mesh
-UPGRADE_PATH=http://[fe80::ff:feee:1%br-mesh]/dev/firmware/current
+NTPD_IP=fe80::ff:feee:1%br-lan
+UPGRADE_PATH=http://[fe80::ff:feee:1%br-lan]/dev/firmware/current
diff --git a/src/packages/fff/fff-batman-adv-legacy/files/etc/uci-defaults/93-fff-batman-adv b/src/packages/fff/fff-batman-adv-legacy/files/etc/uci-defaults/93-fff-batman-adv
index 9bc3928..c4ddb66 100644
--- a/src/packages/fff/fff-batman-adv-legacy/files/etc/uci-defaults/93-fff-batman-adv
+++ b/src/packages/fff/fff-batman-adv-legacy/files/etc/uci-defaults/93-fff-batman-adv
@@ -2,7 +2,7 @@
 
 uci batch <<EOF
   delete batman-adv.bat0
-  set batman-adv.bat0=mesh
+  set batman-adv.bat0=lan
   set batman-adv.bat0.gw_mode='client'
   set batman-adv.bat0.gw_sel_class='1'
   set batman-adv.bat0.bridge_loop_avoidance='0'
diff --git a/src/packages/fff/fff-nodewatcher/files/etc/uci-defaults/93-fff-nodewatcher b/src/packages/fff/fff-nodewatcher/files/etc/uci-defaults/93-fff-nodewatcher
index 4e56435..32e7e1c 100644
--- a/src/packages/fff/fff-nodewatcher/files/etc/uci-defaults/93-fff-nodewatcher
+++ b/src/packages/fff/fff-nodewatcher/files/etc/uci-defaults/93-fff-nodewatcher
@@ -9,9 +9,9 @@ uci batch <<EOF
   set nodewatcher.@script[0].data_file='/tmp/crawldata/node.data'
   set nodewatcher.@script[0].status_text_file='/tmp/status.txt'
   add nodewatcher network
-  set nodewatcher.@network[0].mesh_interface='br-mesh'
+  set nodewatcher.@network[0].mesh_interface='br-lan'
   set nodewatcher.@network[0].iface_blacklist='lo ifb0'
-  set nodewatcher.@network[0].ip_whitelist='br-mesh'
+  set nodewatcher.@network[0].ip_whitelist='br-lan'
 EOF
 uci commit
 
diff --git a/src/packages/fff/fff-uradvd/files/etc/init.d/fff-uradvd b/src/packages/fff/fff-uradvd/files/etc/init.d/fff-uradvd
index c9d8b9d..bf7b933 100755
--- a/src/packages/fff/fff-uradvd/files/etc/init.d/fff-uradvd
+++ b/src/packages/fff/fff-uradvd/files/etc/init.d/fff-uradvd
@@ -16,5 +16,5 @@ service_triggers()
 
 start_service() {
         procd_open_instance
-        procd_set_param command "$URADVD_BIN" -i br-mesh -p $(uci get network.globals.ula_prefix)
+        procd_set_param command "$URADVD_BIN" -i br-lan -p $(uci get network.globals.ula_prefix)
 }
diff --git a/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-select b/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-select
index a0878c5..0c65533 100755
--- a/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-select
+++ b/src/packages/fff/fff-vpn-select/files/usr/sbin/vpn-select
@@ -50,7 +50,7 @@ if ping -w5 -c3 "$test_ipv4_host1" &>/dev/null ||
     # set some vars
     . /etc/community.cfg
     project="$VPN_PROJECT"
-    mac=$(awk '{ mac=toupper($1); gsub(":", "", mac); print mac }' /sys/class/net/br-mesh/address 2>/dev/null)
+    mac=$(awk '{ mac=toupper($1); gsub(":", "", mac); print mac }' /sys/class/net/br-lan/address 2>/dev/null)
     lat=$(uci get system.@system[0].latitude)
     long=$(uci get system.@system[0].longitude)
     hostname=$(cat /proc/sys/kernel/hostname)
diff --git a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
index 59c8ce2..fed6335 100644
--- a/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
+++ b/src/packages/fff/fff-wireless/files/lib/functions/fff/wireless
@@ -102,7 +102,7 @@ wifiAddAP() {
 	uci batch <<-__EOF__
 		set wireless.${iface}='wifi-iface'
 		set wireless.${iface}.device='${radio}'
-		set wireless.${iface}.network='mesh'
+		set wireless.${iface}.network='lan'
 		set wireless.${iface}.ifname='${iface}'
 		set wireless.${iface}.mode='ap'
 		set wireless.${iface}.ssid='${essid}'
@@ -114,4 +114,52 @@ wifiAddAP() {
 	echo "${iface}"
 }
 
+uci set network.lan.ipaddr=
+uci set network.lan.netmask=
+
+OLD=$(uci get network.lan.ifname)
+uci set network.lan.ifname="bat0 $OLD"
+uci commit network
+/etc/init.d/network restart
+
+if uci get network.lan.ip6addr
+then
+    echo "IPv6 for mesh is set already"
+else
+    # Some time needed :(
+    sleep 5
+
+    for ip in $(ip -6 addr show br-lan | awk '/fdff/{ print $2 }'); do
+        ip -6 addr del $ip dev br-lan
+    done
+
+    prefix="fdff:0::/64"
+    # Set $prefix::MAC as IP
+    suffix=$(awk -F: '{ print $1$2":"$3$4":"$5$6 }' /sys/class/net/br-lan/address)
+    addr=$(echo $prefix | sed -e 's/\//'$suffix'\//')
+    ip -6 addr add $addr dev br-lan
+
+    uci -q del network.globals
+    uci -q set network.globals=globals
+    uci -q set network.globals.ula_prefix=$prefix
+    uci -q add_list network.lan.ip6addr=$addr
+    uci -q set network.lan.proto=static
+
+    # Set $prefix::1 as IP
+    suffix="1"
+    addr=$(echo $prefix | sed -e 's/\//'$suffix'\//')
+    ip -6 addr add $addr dev br-lan
+    uci -q add_list network.lan.ip6addr=$addr
+
+    # Set $prefix::link-local as IP
+    suffix=$(awk -F: '{ printf("%02x%s:%sff:fe%s:%s%s\n", xor(("0x"$1),2), $2, $3, $4, $5, $6) }' /sys/class/net/br-lan/address)
+    addr=$(echo $prefix | sed -e 's/\//'$suffix'\//')
+    ip -6 addr add $addr dev br-lan
+    uci -q add_list network.lan.ip6addr=$addr
+
+    uci -q commit network
+
+    /etc/init.d/fff-uradvd restart
+fi
+
 # vim: set noexpandtab:tabstop=4
-- 
2.1.4