forked from freifunk-franken/firmware
fff-hoods: manually create wifi station interface
The mac80211 interface script in OpenWrt depends on wpa_supplicant for the creation of station interfaces. While this is conveniant, it isn't strictly necessary for connecting to unencrypted networks. To be able to create station interfaces if wpa_supplicant is removed, the station interface for obtaining the initial configuration is now created using iw commands only. This makes it possible to replace wpad-mini with hostapd-mini, which does not include wpa_supplicant and therefore shrinks the uncompressed binary by around 200KiB. Signed-off-by: Fabian Bläse <fabian@blaese.de> Acked-by: Christian Dresel <fff@chrisi01.de> Reviewed-by: Robert Langhammer <rlanghammer@web.de> Reviewed-by: Adrian Schmutzler <freifunk@adrianschmutzler.de> Tested-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
parent
5ebb60f0ef
commit
fe6ae924aa
|
@ -1,7 +1,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=fff-hoods
|
PKG_NAME:=fff-hoods
|
||||||
PKG_RELEASE:=7
|
PKG_RELEASE:=8
|
||||||
|
|
||||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
. /lib/functions/fff/wireless
|
|
||||||
|
|
||||||
# Set up wXsta
|
|
||||||
for radio in $(wifiListRadio); do
|
|
||||||
# wXsta: We can use $freq here, as the initial radios are not set up with auto
|
|
||||||
freq="$(wifiGetFreq $radio)"
|
|
||||||
|
|
||||||
uci batch <<-__EOF__
|
|
||||||
set network.configsta${freq}=interface
|
|
||||||
set network.configsta${freq}.proto='static'
|
|
||||||
|
|
||||||
set wireless.w${freq}sta='wifi-iface'
|
|
||||||
set wireless.w${freq}sta.device='${radio}'
|
|
||||||
set wireless.w${freq}sta.network='configsta${freq}'
|
|
||||||
set wireless.w${freq}sta.ifname='w${freq}sta'
|
|
||||||
set wireless.w${freq}sta.mode='sta'
|
|
||||||
set wireless.w${freq}sta.ssid='config.franken.freifunk.net'
|
|
||||||
set wireless.w${freq}sta.disabled='1'
|
|
||||||
__EOF__
|
|
||||||
done
|
|
||||||
|
|
||||||
uci commit network
|
|
||||||
uci commit wireless
|
|
||||||
|
|
||||||
# vim: set noexpandtab:tabstop=4
|
|
|
@ -15,29 +15,33 @@ getWirelessHoodfile() {
|
||||||
|
|
||||||
# Set channel to auto, enable wXsta, disable other interfaces
|
# Set channel to auto, enable wXsta, disable other interfaces
|
||||||
for radio in $(wifiListRadio); do
|
for radio in $(wifiListRadio); do
|
||||||
uci set "wireless.${radio}.channel=auto"
|
|
||||||
|
|
||||||
freq="$(wifiGetFreq $radio)"
|
freq="$(wifiGetFreq $radio)"
|
||||||
uci set wireless.w${freq}ap.disabled='1'
|
uci set wireless.w${freq}ap.disabled='1'
|
||||||
uci set wireless.w${freq}mesh.disabled='1'
|
uci set wireless.w${freq}mesh.disabled='1'
|
||||||
uci set wireless.w${freq}configap.disabled='1'
|
uci set wireless.w${freq}configap.disabled='1'
|
||||||
uci set wireless.w${freq}sta.disabled='0'
|
|
||||||
done
|
done
|
||||||
|
|
||||||
uci commit wireless
|
uci commit wireless
|
||||||
reload_config
|
reload_config
|
||||||
|
|
||||||
wifi
|
# wait for wireless interfaces to vanish
|
||||||
# wait a moment to start the interface
|
sleep 8;
|
||||||
sleep 10;
|
|
||||||
|
|
||||||
if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then
|
|
||||||
return 0
|
for phy in $(ls /sys/class/ieee80211); do
|
||||||
elif /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then
|
iw phy $phy interface add configsta type managed
|
||||||
return 0
|
ip link set up configsta
|
||||||
else
|
iw dev configsta connect -w config.franken.freifunk.net 2>/dev/null
|
||||||
return 1
|
|
||||||
fi
|
if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%configsta]:2342/keyxchangev2data"; then
|
||||||
|
iw dev configsta del
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
iw dev configsta del
|
||||||
|
done
|
||||||
|
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
getEthernetHoodfile() {
|
getEthernetHoodfile() {
|
||||||
|
|
|
@ -158,8 +158,7 @@ if [ -s "$hoodfiletmp" ]; then
|
||||||
mesh_type="$mesh_type2"
|
mesh_type="$mesh_type2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Disable wXsta, wXconfigap
|
# Disable wXconfigap
|
||||||
uci set wireless.w${freq}sta.disabled='1'
|
|
||||||
uci set wireless.w${freq}configap.disabled='1'
|
uci set wireless.w${freq}configap.disabled='1'
|
||||||
|
|
||||||
# Configure wXap
|
# Configure wXap
|
||||||
|
|
Loading…
Reference in New Issue