From cef7bc3c880b00aee417d929141ce9cb80ea2c32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Bl=C3=A4se?= Date: Fri, 15 Mar 2024 23:18:06 +0100 Subject: [PATCH] fff-wireless: add workaround for wifi configuration after update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a workaround for an OpenWrt bug on the Xiaomi Mi 4A (Gigabit Edition). After an update of the firmware, the wireless interfaces are not properly created as configured. When configuring the WiFi interfaces via uci and applying the settings using reload_config, hostapd reports errors and no WiFi interfaces are created. It seems like OpenWrt tries to dynamically reload the settings instead of restarting hostapd, but hostapd fails to properly apply them. To work around this regression until the root cause is found, restart the wifi interfaces manually after a firmware upgrade. Fixes: #319 Signed-off-by: Fabian Bläse Tested-by: ArchTux --- .../files/etc/init.d/fff-wireless-update | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 src/packages/fff/fff-wireless/files/etc/init.d/fff-wireless-update diff --git a/src/packages/fff/fff-wireless/files/etc/init.d/fff-wireless-update b/src/packages/fff/fff-wireless/files/etc/init.d/fff-wireless-update new file mode 100755 index 00000000..bd37a625 --- /dev/null +++ b/src/packages/fff/fff-wireless/files/etc/init.d/fff-wireless-update @@ -0,0 +1,21 @@ +#!/bin/sh /etc/rc.common + +START=99 + +boot() { + # first we disable the init.d + /etc/init.d/fff-wireless-update disable + # we must delete the symlink manually + rm -f /etc/rc.d/S99fff-wireless-update + + # Starting with OpenWrt 23.05, reload_config does not + # properly start the wifi access point on some devices. + # This seems to be an issue with the reloading of hostapd, + # which throws errors, but does not restart hostapd. + # see https://git.freifunk-franken.de/freifunk-franken/firmware/issues/319 + # + # workaround: manually restart wifi completely + # after any automatic post-update configuration (fff-layer3-config, ...) + sleep 20 + wifi +}