[PATCH v3] fff-wireless: Reintroduce initial setup of wireless interfaces

Adrian Schmutzler freifunk at adrianschmutzler.de
Mo Okt 9 00:31:07 CEST 2017


Workaround!

VARIANTE 2: Use 11s mesh with correct interface name

This is required as configurenetwork reads the MAC addresses
from the WiFi interfaces.

Changes in v3:
 - Use 11s mesh to actually create w2mesh and not w2ibss

Changes in v2:
 - Fixed call of wifiAddAP

Apply only after the KeyX2 patchset!

Signed-off-by: Adrian Schmutzler <freifunk at adrianschmutzler.de>
---
 .../files/etc/uci-defaults/60-fff-wireless         | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless

diff --git a/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless b/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless
new file mode 100644
index 0000000..7e2fcf9
--- /dev/null
+++ b/src/packages/fff/fff-wireless/files/etc/uci-defaults/60-fff-wireless
@@ -0,0 +1,32 @@
+#!/bin/sh
+# Copyright 2016 Tim Niemeyer
+# License GPLv3
+
+. /lib/functions/fff/wireless
+
+if ! wifiDelAll; then
+	echo "Can't delete current wifi setup"
+	exit 1
+fi
+
+for phy in $(iw phy | awk '/^Wiphy/{ print $2 }'); do
+	radio="$(wifiAddPhyCond "$phy" "2" "1")"
+	radio5="$(wifiAddPhyCond "$phy" "5" "36")"
+	[ -n "$radio5" ] && radio="$radio5"
+	if [ -z "$radio" ] ; then
+		echo "Can't create radio for $phy"
+		exit 1
+	fi
+
+	if ! wifiAddAP "$radio" "do.not.use" "mesh" "ap" "0" ; then
+		echo "Can't add AP interface on $radio."
+		exit 1
+	fi
+
+	if ! wifiAddMesh "$radio" "mesh.do.not.use" ; then
+		echo "Can't add Mesh interface on $radio."
+		exit 1
+	fi
+done
+
+# vim: set noexpandtab:tabstop=4
-- 
2.7.4



Mehr Informationen über die Mailingliste franken-dev