package/wpa_supplicant: fixing "Invalid configuration line"
PATCH v3 1/3 package/wpa_supplicant: fixing "Invalid configuration line"
Default configuration file is wrong for the default compiling options.
Fixes:
Successfully initialized wpa_supplicant
Line 1: unknown global field 'ctrl_interface=/var/run/wpa_supplicant'. Line 1: Invalid configuration line 'ctrl_interface=/var/run/wpa_supplicant'.
Failed to read or parse configuration '/etc/wpa_supplicant.conf'.
--- package/wpa_supplicant/wpa_supplicant.conf | 1 - 1 file changed, 1 deletion(-)
package/wpa_supplicant/wpa_supplicant.conf +0 -1
@@ -1,4 +1,3 @@ -ctrl_interface=/var/run/wpa_supplicant ap_scan=1 network={
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 2/3 package/wpa_supplicant: adding ifupdown support
Actually, configuring a wifi interface as per "interfaces" man:
auto wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant.conf
doesn't work on buildroot because the line wpa-conf is ignored due to the lack of a proper ifupdown script to handle the wpa_supplicant initialization.
---
v1 -> v2:
* Simplify script to the minimum to have the service started (Thomas, Nicolas)
v2 -> v3:
* Move IF_WPA_CONF check early (Nicolas)
package/wpa_supplicant/ifupdown.sh | 49 ++++++++++++++++++++++++ package/wpa_supplicant/wpa_supplicant.mk | 9 +++++ 2 files changed, 58 insertions(+) create mode 100755 package/wpa_supplicant/ifupdown.sh
package/wpa_supplicant/ifupdown.sh new file +49 -0
@@ -0,0 +1,49 @@ +#!/bin/sh + +# This file is executed by ifupdown in pre-up, post-up, pre-down and +# post-down phases of network interface configuration. + +WPA_SUP_BIN="/usr/sbin/wpa_supplicant" + +# run this script only for interfaces which have wpa-conf option +[ -z "$IF_WPA_CONF" ] && exit 0 + +# Allow wpa_supplicant interface to be specified via wpa-iface +# useful for starting wpa_supplicant on one interface of a bridge +if [ -n "$IF_WPA_IFACE" ]; then + WPA_IFACE="$IF_WPA_IFACE" +else + WPA_IFACE="$IFACE" +fi + +WPA_SUP_PIDFILE="/run/wpa_supplicant.${WPA_IFACE}.pid" + +do_start () { + if [ ! -s "$IF_WPA_CONF" ]; then + echo "cannot read contents of $IF_WPA_CONF" + exit 1 + fi + WPA_SUP_CONF="-c $IF_WPA_CONF" +} + +case "$MODE" in + start) + do_start + case "$PHASE" in + post-up) + start-stop-daemon -S -q -x ${WPA_SUP_BIN} \ + -- -B -i ${WPA_IFACE} ${WPA_SUP_CONF} -P ${WPA_SUP_PIDFILE} + ;; + esac + ;; + + stop) + case "$PHASE" in + pre-down) + start-stop-daemon -K -p ${WPA_SUP_PIDFILE} + ;; + esac + ;; +esac + +exit 0
package/wpa_supplicant/wpa_supplicant.mk +9 -0
@@ -250,6 +250,14 @@ define WPA_SUPPLICANT_INSTALL_STAGING_CMDS $(WPA_SUPPLICANT_INSTALL_STAGING_WPA_CLIENT_SO) endef +ifeq ($(BR2_PACKAGE_IFUPDOWN_SCRIPTS),y) +define WPA_SUPPLICANT_INSTALL_IFUP_SCRIPTS + $(INSTALL) -m 0755 -D package/wpa_supplicant/ifupdown.sh \ + $(TARGET_DIR)/etc/network/if-up.d/wpasupplicant + ln -sf ../if-up.d/wpasupplicant $(TARGET_DIR)/etc/network/if-down.d/wpasupplicant +endef +endif + define WPA_SUPPLICANT_INSTALL_TARGET_CMDS $(INSTALL) -m 0755 -D $(@D)/$(WPA_SUPPLICANT_SUBDIR)/wpa_supplicant \ $(TARGET_DIR)/usr/sbin/wpa_supplicant
@@ -259,6 +267,7 @@ define WPA_SUPPLICANT_INSTALL_TARGET_CMDS $(WPA_SUPPLICANT_INSTALL_PASSPHRASE) $(WPA_SUPPLICANT_INSTALL_DBUS) $(WPA_SUPPLICANT_INSTALL_WPA_CLIENT_SO) + $(WPA_SUPPLICANT_INSTALL_IFUP_SCRIPTS) endef define WPA_SUPPLICANT_INSTALL_INIT_SYSTEMD
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Re: [Buildroot] [PATCH v3 2/3] package/wpa_supplicant: adding ifupdown support
Quoted 11 lines · Angelo Compagnucci
Actually, configuring a wifi interface as per "interfaces" man:
auto wlan0
iface wlan0 inet dhcp
wpa-conf/etc/wpa_supplicant.confdoesn't work on buildroot because the line wpa-conf is ignored due to the lack of a proper ifupdown script to handle the
wpa_supplicantinitialization.Signed-off-by Angelo Compagnucci <[email protected]>
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
PATCH v3 3/3 package/busybox: make udhcp discover faster
In reply to Angelo CompagnucciInstead of waiting almost 10 seconds foreground (3 discovery packets for 3 seconds retry delay) at each boot, make only one request then fork to background. This way, the behavior is the same for working interfaces, but it's way faster for interfaces where the address cannot be obtained straight away.
--- package/busybox/busybox.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
package/busybox/busybox.config +1 -1
@@ -1022,7 +1022,7 @@ CONFIG_UDHCP_DEBUG=0 CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 CONFIG_FEATURE_UDHCP_RFC3397=y CONFIG_FEATURE_UDHCP_8021Q=y -CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-b -R -O search" +CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-t1 -b -R -O search" # # Print Utilities
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot