Message ID | 20200105214322.2559139-1-fabian@blaese.de |
---|---|
State | Superseded |
Headers | show |
diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta deleted file mode 100644 index e9867b9..0000000 --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta +++ /dev/null @@ -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 diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile index b148eca..d9119ac 100644 --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile @@ -15,29 +15,33 @@ getWirelessHoodfile() { # Set channel to auto, enable wXsta, disable other interfaces for radio in $(wifiListRadio); do - uci set "wireless.${radio}.channel=auto" - freq="$(wifiGetFreq $radio)" uci set wireless.w${freq}ap.disabled='1' uci set wireless.w${freq}mesh.disabled='1' uci set wireless.w${freq}configap.disabled='1' - uci set wireless.w${freq}sta.disabled='0' done uci commit wireless reload_config - wifi - # wait a moment to start the interface - sleep 10; + # wait for wireless interfaces to vanish + sleep 5; - if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then - return 0 - elif /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then - return 0 - else - return 1 - fi + + for phy in $(ls /sys/class/ieee80211); do + iw phy $phy interface add configsta type managed + ip link set up configsta + iw dev configsta connect -w config.franken.freifunk.net 2>/dev/null + + 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() {
Hi, coole Sache. Leider habe ich morgen keine Zeit, das auszuprobieren, bevor es wieder mit der Arbeit los geht. Zwei schnelle Fragen unten. > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf > Of Fabian Bläse > Sent: Sonntag, 5. Januar 2020 22:43 > To: franken-dev@freifunk.net > Subject: [PATCH] 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> > --- > .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- > .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- > 2 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 > src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > > diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > deleted file mode 100644 > index e9867b9..0000000 > --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > +++ /dev/null > @@ -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 > diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > index b148eca..d9119ac 100644 > --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > @@ -15,29 +15,33 @@ getWirelessHoodfile() { > > # Set channel to auto, enable wXsta, disable other interfaces > for radio in $(wifiListRadio); do > - uci set "wireless.${radio}.channel=auto" > - > freq="$(wifiGetFreq $radio)" > uci set wireless.w${freq}ap.disabled='1' > uci set wireless.w${freq}mesh.disabled='1' > uci set wireless.w${freq}configap.disabled='1' > - uci set wireless.w${freq}sta.disabled='0' > done > > uci commit wireless > reload_config > > - wifi > - # wait a moment to start the interface > - sleep 10; > + # wait for wireless interfaces to vanish > + sleep 5; > > - if /bin/busybox wget -T15 -O "$file" > "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > - return 0 > - elif /bin/busybox wget -T15 -O "$file" > "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > - return 0 > - else > - return 1 > - fi > + > + for phy in $(ls /sys/class/ieee80211); do > + iw phy $phy interface add configsta type managed > + ip link set up configsta > + iw dev configsta connect -w config.franken.freifunk.net > 2>/dev/null > + > + 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 Brauchen wir da vorher noch sowas wie "ip link set down configsta" oder macht das iw automatisch mit? Nicht, dass da irgendwelche Leichen übrig bleiben. Außerdem: In configurehood gibt es noch eine Zeile, die das wXsta im Erfolgsfall wieder ausmacht. Die müsstest du auch noch löschen. Sobald ich Zeit habe, werde ich damit etwas herumspielen und weiteres Feedback geben. Grüße Adrian > + done > + > + return 1 > } > > getEthernetHoodfile() { > -- > 2.24.1
On 05.01.20 23:17, mail@adrianschmutzler.de wrote:>> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> index b148eca..d9119ac 100644 >> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> @@ -15,29 +15,33 @@ getWirelessHoodfile() { >> >> # Set channel to auto, enable wXsta, disable other interfaces >> for radio in $(wifiListRadio); do >> - uci set "wireless.${radio}.channel=auto" >> - >> freq="$(wifiGetFreq $radio)" >> uci set wireless.w${freq}ap.disabled='1' >> uci set wireless.w${freq}mesh.disabled='1' >> uci set wireless.w${freq}configap.disabled='1' >> - uci set wireless.w${freq}sta.disabled='0' >> done >> >> uci commit wireless >> reload_config >> >> - wifi >> - # wait a moment to start the interface >> - sleep 10; >> + # wait for wireless interfaces to vanish >> + sleep 5; >> >> - if /bin/busybox wget -T15 -O "$file" >> "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then >> - return 0 >> - elif /bin/busybox wget -T15 -O "$file" >> "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then >> - return 0 >> - else >> - return 1 >> - fi >> + >> + for phy in $(ls /sys/class/ieee80211); do >> + iw phy $phy interface add configsta type managed >> + ip link set up configsta >> + iw dev configsta connect -w config.franken.freifunk.net >> 2>/dev/null >> + >> + 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 > > Brauchen wir da vorher noch sowas wie "ip link set down configsta" oder macht das iw automatisch mit? Nicht, dass da irgendwelche Leichen übrig bleiben.Ne. "ip link set" setzt nur den administrative link state eines Interfaces, der ein Interface administrativ ein- oder ausschaltet. Das Interface wird von iw im Kernel angelegt und bei "iw dev <dev> del" wieder entfernt. Dann ist es vollständig weg und hat daher auch keinen administrative link state mehr. > Außerdem: > In configurehood gibt es noch eine Zeile, die das wXsta im Erfolgsfall wieder ausmacht. Die müsstest du auch noch löschen.Das stimmt. Ich warte mal noch auf weiteres Feedback, bevor ich das ändere. Gruß Fabian
Oh man. Dieses Thunderbird ist so kaputt.. Ich versuchs nochmal: On 05.01.20 23:17, mail@adrianschmutzler.de wrote: >> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> index b148eca..d9119ac 100644 >> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> @@ -15,29 +15,33 @@ getWirelessHoodfile() { >> >> # Set channel to auto, enable wXsta, disable other interfaces >> for radio in $(wifiListRadio); do >> - uci set "wireless.${radio}.channel=auto" >> - >> freq="$(wifiGetFreq $radio)" >> uci set wireless.w${freq}ap.disabled='1' >> uci set wireless.w${freq}mesh.disabled='1' >> uci set wireless.w${freq}configap.disabled='1' >> - uci set wireless.w${freq}sta.disabled='0' >> done >> >> uci commit wireless >> reload_config >> >> - wifi >> - # wait a moment to start the interface >> - sleep 10; >> + # wait for wireless interfaces to vanish >> + sleep 5; >> >> - if /bin/busybox wget -T15 -O "$file" >> "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then >> - return 0 >> - elif /bin/busybox wget -T15 -O "$file" >> "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then >> - return 0 >> - else >> - return 1 >> - fi >> + >> + for phy in $(ls /sys/class/ieee80211); do >> + iw phy $phy interface add configsta type managed >> + ip link set up configsta >> + iw dev configsta connect -w config.franken.freifunk.net >> 2>/dev/null >> + >> + 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 > > Brauchen wir da vorher noch sowas wie "ip link set down configsta" oder macht das iw automatisch mit? Nicht, dass da irgendwelche Leichen übrig bleiben. Ne. "ip link set" setzt nur den administrative link state eines Interfaces, der ein Interface administrativ ein- oder ausschaltet. Das Interface wird von iw im Kernel angelegt und bei "iw dev <dev> del" wieder entfernt. Dann ist es vollständig weg und hat daher auch keinen administrative link state mehr. > Außerdem: > In configurehood gibt es noch eine Zeile, die das wXsta im Erfolgsfall wieder ausmacht. Die müsstest du auch noch löschen. Das stimmt. Ich warte mal noch auf weiteres Feedback, bevor ich das ändere. Gruß Fabian
Hi 200KiB sind sehr wertvolle 200KiB von mir ein klares: Acked-by: Christian Dresel <fff@chrisi01.de> Code hab ich mir jetzt noch nicht näher angeguckt. Gruß Christian On 05.01.20 22:43, Fabian Bläse wrote: > 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> > --- > .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- > .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- > 2 files changed, 17 insertions(+), 40 deletions(-) > delete mode 100644 src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > > diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > deleted file mode 100644 > index e9867b9..0000000 > --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > +++ /dev/null > @@ -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 > diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > index b148eca..d9119ac 100644 > --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > @@ -15,29 +15,33 @@ getWirelessHoodfile() { > > # Set channel to auto, enable wXsta, disable other interfaces > for radio in $(wifiListRadio); do > - uci set "wireless.${radio}.channel=auto" > - > freq="$(wifiGetFreq $radio)" > uci set wireless.w${freq}ap.disabled='1' > uci set wireless.w${freq}mesh.disabled='1' > uci set wireless.w${freq}configap.disabled='1' > - uci set wireless.w${freq}sta.disabled='0' > done > > uci commit wireless > reload_config > > - wifi > - # wait a moment to start the interface > - sleep 10; > + # wait for wireless interfaces to vanish > + sleep 5; > > - if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > - return 0 > - elif /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > - return 0 > - else > - return 1 > - fi > + > + for phy in $(ls /sys/class/ieee80211); do > + iw phy $phy interface add configsta type managed > + ip link set up configsta > + iw dev configsta connect -w config.franken.freifunk.net 2>/dev/null > + > + 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() { >
Wenn du das irgendwann als v2 schickst, bitte auch das PKG_RELEASE erhöhen (ist ja nur fff-hoods). Ich habe vor das diese Woche noch zu testen. Gruß Adrian > -----Original Message----- > From: Fabian Bläse [mailto:fabian@blaese.de] > Sent: Montag, 6. Januar 2020 00:54 > To: mail@adrianschmutzler.de; franken-dev@freifunk.net > Subject: Re: [PATCH] fff-hoods: manually create wifi station interface > > Oh man. Dieses Thunderbird ist so kaputt.. Ich versuchs nochmal: > > On 05.01.20 23:17, mail@adrianschmutzler.de wrote: > >> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> index b148eca..d9119ac 100644 > >> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> @@ -15,29 +15,33 @@ getWirelessHoodfile() { > >> > >> # Set channel to auto, enable wXsta, disable other interfaces > >> for radio in $(wifiListRadio); do > >> - uci set "wireless.${radio}.channel=auto" > >> - > >> freq="$(wifiGetFreq $radio)" > >> uci set wireless.w${freq}ap.disabled='1' > >> uci set wireless.w${freq}mesh.disabled='1' > >> uci set wireless.w${freq}configap.disabled='1' > >> - uci set wireless.w${freq}sta.disabled='0' > >> done > >> > >> uci commit wireless > >> reload_config > >> > >> - wifi > >> - # wait a moment to start the interface > >> - sleep 10; > >> + # wait for wireless interfaces to vanish > >> + sleep 5; > >> > >> - if /bin/busybox wget -T15 -O "$file" > >> "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > >> - return 0 > >> - elif /bin/busybox wget -T15 -O "$file" > >> "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > >> - return 0 > >> - else > >> - return 1 > >> - fi > >> + > >> + for phy in $(ls /sys/class/ieee80211); do > >> + iw phy $phy interface add configsta type managed > >> + ip link set up configsta > >> + iw dev configsta connect -w config.franken.freifunk.net > >> 2>/dev/null > >> + > >> + 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 > > > > Brauchen wir da vorher noch sowas wie "ip link set down configsta" oder > macht das iw automatisch mit? Nicht, dass da irgendwelche Leichen übrig > bleiben. > Ne. "ip link set" setzt nur den administrative link state eines Interfaces, der > ein Interface administrativ ein- oder ausschaltet. Das Interface wird von iw im > Kernel angelegt und bei "iw dev <dev> del" wieder entfernt. Dann ist es > vollständig weg und hat daher auch keinen administrative link state mehr. > > > Außerdem: > > In configurehood gibt es noch eine Zeile, die das wXsta im Erfolgsfall wieder > ausmacht. Die müsstest du auch noch löschen. > Das stimmt. Ich warte mal noch auf weiteres Feedback, bevor ich das ändere. > > Gruß > Fabian
Und noch ne Frage: Da steht jetzt nirgends mehr channel=auto Ist das implizit oder fehlt das noch?
Hallo, ich habe das gerade auf mehreren Geräten mit hostapd-mini getestet (mit meiner FW und dem Fix in configurehood). Funktioniert einwandfrei (auch wenn man den Kanal ändert). Wenn man noch TARGET_SQUASHFS_BLOCK_SIZE auf 1024 stellt und simple-tc abwählt, kann man die tiny-Devices mit 19.07 bauen (ohne die Karte zu entfernen). Review und Tested-by schicke ich dann bei einer v2. Vielen Dank. Grüße Adrian > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf > Of Fabian Bläse > Sent: Sonntag, 5. Januar 2020 22:43 > To: franken-dev@freifunk.net > Subject: [PATCH] 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> > --- > .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- > .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- > 2 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 > src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > > diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > deleted file mode 100644 > index e9867b9..0000000 > --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > +++ /dev/null > @@ -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 > diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > index b148eca..d9119ac 100644 > --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > @@ -15,29 +15,33 @@ getWirelessHoodfile() { > > # Set channel to auto, enable wXsta, disable other interfaces > for radio in $(wifiListRadio); do > - uci set "wireless.${radio}.channel=auto" > - > freq="$(wifiGetFreq $radio)" > uci set wireless.w${freq}ap.disabled='1' > uci set wireless.w${freq}mesh.disabled='1' > uci set wireless.w${freq}configap.disabled='1' > - uci set wireless.w${freq}sta.disabled='0' > done > > uci commit wireless > reload_config > > - wifi > - # wait a moment to start the interface > - sleep 10; > + # wait for wireless interfaces to vanish > + sleep 5; > > - if /bin/busybox wget -T15 -O "$file" > "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > - return 0 > - elif /bin/busybox wget -T15 -O "$file" > "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > - return 0 > - else > - return 1 > - fi > + > + for phy in $(ls /sys/class/ieee80211); do > + iw phy $phy interface add configsta type managed > + ip link set up configsta > + iw dev configsta connect -w config.franken.freifunk.net > 2>/dev/null > + > + 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() { > -- > 2.24.1
Das Radio wird jetzt komplett an OpenWRT vorbei konfiguriert, in so fern ist diese Einstellung dann irrelevant. Andererseits wird der Kanal im Station Mode bei OpenWRT so oder so nicht statisch gesetzt. Selbst wenn der Kanal mit channel= explizit angegeben ist, kann man sich mit einem AP auf einem anderen Kanal verbinden. Gruß Fabian On 08.01.20 00:47, Adrian Schmutzler wrote: > Und noch ne Frage: Da steht jetzt nirgends mehr channel=auto > Ist das implizit oder fehlt das noch?
Hmm. Bei mir hat es sogar gereicht, die Block Size auf 1024 (also den OpenWRT default) zu setzen und hostapd-mini zu verwenden. Gruß Fabian On 09.01.20 00:52, mail@adrianschmutzler.de wrote: > Hallo, > > ich habe das gerade auf mehreren Geräten mit hostapd-mini getestet (mit meiner FW und dem Fix in configurehood). > > Funktioniert einwandfrei (auch wenn man den Kanal ändert). > > Wenn man noch TARGET_SQUASHFS_BLOCK_SIZE auf 1024 stellt und simple-tc abwählt, kann man die tiny-Devices mit 19.07 bauen (ohne die Karte zu entfernen). > > Review und Tested-by schicke ich dann bei einer v2. > > Vielen Dank. > > Grüße > > Adrian
Hi, geht ohne simple-tc der macnocker noch? der verwendet doch tc. Viele Grüße Robert Am 10.01.20 um 12:05 schrieb Fabian Bläse: > Hmm. Bei mir hat es sogar gereicht, die Block Size auf 1024 (also den OpenWRT default) zu setzen und hostapd-mini zu verwenden. > > Gruß > Fabian > > On 09.01.20 00:52, mail@adrianschmutzler.de wrote: >> Hallo, >> >> ich habe das gerade auf mehreren Geräten mit hostapd-mini getestet (mit meiner FW und dem Fix in configurehood). >> >> Funktioniert einwandfrei (auch wenn man den Kanal ändert). >> >> Wenn man noch TARGET_SQUASHFS_BLOCK_SIZE auf 1024 stellt und simple-tc abwählt, kann man die tiny-Devices mit 19.07 bauen (ohne die Karte zu entfernen). >> >> Review und Tested-by schicke ich dann bei einer v2. >> >> Vielen Dank. >> >> Grüße >> >> Adrian
> Hmm. Bei mir hat es sogar gereicht, die Block Size auf 1024 (also den OpenWRT default) zu setzen und hostapd-mini zu verwenden.
Da hatte ich auf den 4mlzma Geräten ca. 2 kiB zu groß und auf den 4m Geräten ca. 10 kiB zu groß (weil bei letzteren scheinbar der Start des rootfs weiter hinten liegt).
Kann aber auch an meiner FW liegen, ich habe ja z.B. ein viel größeres Skript für den WiFi scan etc.
Grüße
Adrian
Der macnocker verwendet das "tc" executable. Das darf daher (aktuell) nicht weg. Theoretisch müsste man das ganze auf netlink umstellen können. Tim hat das damals so gebaut, weil das einfacher war iirc. Gruß Fabian On 10.01.20 12:14, robert wrote: > Hi, > > geht ohne simple-tc der macnocker noch? der verwendet doch tc. > > Viele Grüße > Robert
Hi Fabian, die Platzersparnis überwiegt! Da kann man schon mal den Openwrt Standard verlassen, alles mit uci zu machen. Und auf den Nodes braucht man es nicht. Reviewed-by: Robert Langhammer <rlanghammer@web.de> Am 05.01.20 um 22:43 schrieb Fabian Bläse: > 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> > --- > .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- > .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- > 2 files changed, 17 insertions(+), 40 deletions(-) > delete mode 100644 src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > > diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > deleted file mode 100644 > index e9867b9..0000000 > --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > +++ /dev/null > @@ -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 > diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > index b148eca..d9119ac 100644 > --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > @@ -15,29 +15,33 @@ getWirelessHoodfile() { > > # Set channel to auto, enable wXsta, disable other interfaces > for radio in $(wifiListRadio); do > - uci set "wireless.${radio}.channel=auto" > - > freq="$(wifiGetFreq $radio)" > uci set wireless.w${freq}ap.disabled='1' > uci set wireless.w${freq}mesh.disabled='1' > uci set wireless.w${freq}configap.disabled='1' > - uci set wireless.w${freq}sta.disabled='0' > done > > uci commit wireless > reload_config > > - wifi > - # wait a moment to start the interface > - sleep 10; > + # wait for wireless interfaces to vanish > + sleep 5; > > - if /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > - return 0 > - elif /bin/busybox wget -T15 -O "$file" "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > - return 0 > - else > - return 1 > - fi > + > + for phy in $(ls /sys/class/ieee80211); do > + iw phy $phy interface add configsta type managed > + ip link set up configsta > + iw dev configsta connect -w config.franken.freifunk.net 2>/dev/null > + > + 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() {
Genau. macnocker verwendet "tc". Der simple-tc verzichtet explizit auf die Package tc, und ist somit eine Art Alternative. Das ist daher relevant, weil tc sehr groß ist. Wirft man einfach nur tc aus der Firmware raus, kann man die tiny devices in 19.07 ohne jegliche andere Maßnahmen bauen. Falls also jemand Zeit investieren würde/möchte, den macnocker so umzuschreiben, dass er kein tc mehr braucht, würde das die tiny devices wohl bis ins 20.xx release retten und wäre daher den Aufwand wahrscheinlich wert. Getestet habe ich den MacNocker auf tiny tatsächlich nicht, werde ich gelegentlich mal noch machen. Grüße Adrian > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf Of > Fabian Bläse > Sent: Freitag, 10. Januar 2020 12:36 > To: robert <rlanghammer@web.de>; franken-dev@freifunk.net > Subject: Re: [PATCH] fff-hoods: manually create wifi station interface > > Der macnocker verwendet das "tc" executable. Das darf daher (aktuell) > nicht weg. > > Theoretisch müsste man das ganze auf netlink umstellen können. > Tim hat das damals so gebaut, weil das einfacher war iirc. > > Gruß > Fabian > > On 10.01.20 12:14, robert wrote: > > Hi, > > > > geht ohne simple-tc der macnocker noch? der verwendet doch tc. > > > > Viele Grüße > > Robert > >
Hallo nochmal, wenn die Sache mal durch ist: Ich gehe davon aus, dass man mit ähnlicher Syntax dann einen "Debug-AP" temporär aufmachen kann, so wie schon mal vor einiger Zeit diskutiert? Also sprich, dass man per WLAN auf die Geräte zugreifen kann, wenn kein Gateway verfügbar ist (zum Konfigurieren, Debuggen, etc.) Grüße Adrian > -----Original Message----- > From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf Of > Fabian Bläse > Sent: Sonntag, 5. Januar 2020 22:43 > To: franken-dev@freifunk.net > Subject: [PATCH] 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> > --- > .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- > .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- > 2 files changed, 17 insertions(+), 40 deletions(-) > delete mode 100644 src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff- > wXsta > > diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > deleted file mode 100644 > index e9867b9..0000000 > --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > +++ /dev/null > @@ -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 > diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > index b148eca..d9119ac 100644 > --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > @@ -15,29 +15,33 @@ getWirelessHoodfile() { > > # Set channel to auto, enable wXsta, disable other interfaces > for radio in $(wifiListRadio); do > - uci set "wireless.${radio}.channel=auto" > - > freq="$(wifiGetFreq $radio)" > uci set wireless.w${freq}ap.disabled='1' > uci set wireless.w${freq}mesh.disabled='1' > uci set wireless.w${freq}configap.disabled='1' > - uci set wireless.w${freq}sta.disabled='0' > done > > uci commit wireless > reload_config > > - wifi > - # wait a moment to start the interface > - sleep 10; > + # wait for wireless interfaces to vanish > + sleep 5; > > - if /bin/busybox wget -T15 -O "$file" > "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > - return 0 > - elif /bin/busybox wget -T15 -O "$file" > "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > - return 0 > - else > - return 1 > - fi > + > + for phy in $(ls /sys/class/ieee80211); do > + iw phy $phy interface add configsta type managed > + ip link set up configsta > + iw dev configsta connect -w config.franken.freifunk.net > 2>/dev/null > + > + 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() { > -- > 2.24.1
Hallo Adrian, könnte man, ja. Ich würde hier aber eher vorschlagen, bei "dekonfiguration" einer Hood den Standard-AP wieder zurück auf do.not.use (bzw. das neuere äquivalent) zu setzen und diesen immer direkt nach dem Versuch ein Hoodfile zu laden wieder zu aktivieren. Dann hat man zwar alle 5 Minuten mal ein paar Sekunden Verbindungsverlust, ist aber wohl immer noch besser als nichts. Gruß Fabian On 10.01.20 14:49, Adrian Schmutzler wrote: > Hallo nochmal, > > wenn die Sache mal durch ist: > > Ich gehe davon aus, dass man mit ähnlicher Syntax dann einen "Debug-AP" temporär aufmachen kann, so wie schon mal vor einiger Zeit diskutiert? > Also sprich, dass man per WLAN auf die Geräte zugreifen kann, wenn kein Gateway verfügbar ist (zum Konfigurieren, Debuggen, etc.) > > Grüße > > Adrian > >> -----Original Message----- >> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf Of >> Fabian Bläse >> Sent: Sonntag, 5. Januar 2020 22:43 >> To: franken-dev@freifunk.net >> Subject: [PATCH] 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> >> --- >> .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- >> .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- >> 2 files changed, 17 insertions(+), 40 deletions(-) >> delete mode 100644 src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff- >> wXsta >> >> diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta >> b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta >> deleted file mode 100644 >> index e9867b9..0000000 >> --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta >> +++ /dev/null >> @@ -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 >> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> index b148eca..d9119ac 100644 >> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile >> @@ -15,29 +15,33 @@ getWirelessHoodfile() { >> >> # Set channel to auto, enable wXsta, disable other interfaces >> for radio in $(wifiListRadio); do >> - uci set "wireless.${radio}.channel=auto" >> - >> freq="$(wifiGetFreq $radio)" >> uci set wireless.w${freq}ap.disabled='1' >> uci set wireless.w${freq}mesh.disabled='1' >> uci set wireless.w${freq}configap.disabled='1' >> - uci set wireless.w${freq}sta.disabled='0' >> done >> >> uci commit wireless >> reload_config >> >> - wifi >> - # wait a moment to start the interface >> - sleep 10; >> + # wait for wireless interfaces to vanish >> + sleep 5; >> >> - if /bin/busybox wget -T15 -O "$file" >> "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then >> - return 0 >> - elif /bin/busybox wget -T15 -O "$file" >> "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then >> - return 0 >> - else >> - return 1 >> - fi >> + >> + for phy in $(ls /sys/class/ieee80211); do >> + iw phy $phy interface add configsta type managed >> + ip link set up configsta >> + iw dev configsta connect -w config.franken.freifunk.net >> 2>/dev/null >> + >> + 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() { >> -- >> 2.24.1
Hallo, im Prinzip bedeutet das dann nichts anderes, als die SSID zu ändern und wXap wieder anzuschalten (oder vll. nur w2ap)? Das ist wahrscheinlich tatsächlich schlauer, da man so nicht nochmal was zusätzliches hat, das wieder Probleme machen kann. Muss ich mal in Ruhe durchdenken. Grüße Adrian > -----Original Message----- > From: Fabian Bläse [mailto:fabian@blaese.de] > Sent: Freitag, 10. Januar 2020 15:09 > To: Adrian Schmutzler <mail@adrianschmutzler.de>; franken-dev@freifunk.net > Subject: Re: [PATCH] fff-hoods: manually create wifi station interface > > Hallo Adrian, > > könnte man, ja. Ich würde hier aber eher vorschlagen, bei "dekonfiguration" > einer Hood den Standard-AP wieder zurück auf do.not.use (bzw. das neuere > äquivalent) zu setzen und diesen immer direkt nach dem Versuch ein Hoodfile zu > laden wieder zu aktivieren. > Dann hat man zwar alle 5 Minuten mal ein paar Sekunden Verbindungsverlust, ist > aber wohl immer noch besser als nichts. > > Gruß > Fabian > > On 10.01.20 14:49, Adrian Schmutzler wrote: > > Hallo nochmal, > > > > wenn die Sache mal durch ist: > > > > Ich gehe davon aus, dass man mit ähnlicher Syntax dann einen "Debug-AP" > temporär aufmachen kann, so wie schon mal vor einiger Zeit diskutiert? > > Also sprich, dass man per WLAN auf die Geräte zugreifen kann, wenn kein > Gateway verfügbar ist (zum Konfigurieren, Debuggen, etc.) > > > > Grüße > > > > Adrian > > > >> -----Original Message----- > >> From: franken-dev [mailto:franken-dev-bounces@freifunk.net] On Behalf Of > >> Fabian Bläse > >> Sent: Sonntag, 5. Januar 2020 22:43 > >> To: franken-dev@freifunk.net > >> Subject: [PATCH] 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> > >> --- > >> .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- > >> .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- > >> 2 files changed, 17 insertions(+), 40 deletions(-) > >> delete mode 100644 src/packages/fff/fff-hoods/files/etc/uci-defaults/24c- > fff- > >> wXsta > >> > >> diff --git a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > >> b/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > >> deleted file mode 100644 > >> index e9867b9..0000000 > >> --- a/src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta > >> +++ /dev/null > >> @@ -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 > >> diff --git a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> index b148eca..d9119ac 100644 > >> --- a/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> +++ b/src/packages/fff/fff-hoods/files/usr/lib/functions/fff/hoodfile > >> @@ -15,29 +15,33 @@ getWirelessHoodfile() { > >> > >> # Set channel to auto, enable wXsta, disable other interfaces > >> for radio in $(wifiListRadio); do > >> - uci set "wireless.${radio}.channel=auto" > >> - > >> freq="$(wifiGetFreq $radio)" > >> uci set wireless.w${freq}ap.disabled='1' > >> uci set wireless.w${freq}mesh.disabled='1' > >> uci set wireless.w${freq}configap.disabled='1' > >> - uci set wireless.w${freq}sta.disabled='0' > >> done > >> > >> uci commit wireless > >> reload_config > >> > >> - wifi > >> - # wait a moment to start the interface > >> - sleep 10; > >> + # wait for wireless interfaces to vanish > >> + sleep 5; > >> > >> - if /bin/busybox wget -T15 -O "$file" > >> "http://[fe80::1%w2sta]:2342/keyxchangev2data"; then > >> - return 0 > >> - elif /bin/busybox wget -T15 -O "$file" > >> "http://[fe80::1%w5sta]:2342/keyxchangev2data"; then > >> - return 0 > >> - else > >> - return 1 > >> - fi > >> + > >> + for phy in $(ls /sys/class/ieee80211); do > >> + iw phy $phy interface add configsta type managed > >> + ip link set up configsta > >> + iw dev configsta connect -w config.franken.freifunk.net > >> 2>/dev/null > >> + > >> + 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() { > >> -- > >> 2.24.1
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> --- .../files/etc/uci-defaults/24c-fff-wXsta | 27 ----------------- .../files/usr/lib/functions/fff/hoodfile | 30 +++++++++++-------- 2 files changed, 17 insertions(+), 40 deletions(-) delete mode 100644 src/packages/fff/fff-hoods/files/etc/uci-defaults/24c-fff-wXsta