From 626d5949526e32307a21e5fba9e66df965d147e5 Mon Sep 17 00:00:00 2001 From: Arturo Buzarra Date: Mon, 18 Mar 2019 18:36:33 +0100 Subject: [PATCH] bridgeifupdown: fix bridge initialization timing issue with wireless interface This script introduces a minor delay when the own script launch the wpa_supplicant daemon, however this minor delay is needed in the boot process when the wireless interface is loaded, if not the bridge mechanism throws an unexpected error trying to add the interface to the bridge before the wireless is ready to use. Signed-off-by: Arturo Buzarra --- .../recipes-core/busybox/busybox/bridgeifupdown | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox/bridgeifupdown b/meta-digi-dey/recipes-core/busybox/busybox/bridgeifupdown index cbf5e3acb..3ac741f64 100644 --- a/meta-digi-dey/recipes-core/busybox/busybox/bridgeifupdown +++ b/meta-digi-dey/recipes-core/busybox/busybox/bridgeifupdown @@ -23,9 +23,6 @@ start_stop_wpa_supplicant() { start-stop-daemon --start --quiet \ --name ${WPA_SUP_PNAME} --startas ${WPA_SUP_BIN} --pidfile ${WPA_SUP_PIDFILE} \ -- ${WPA_SUP_OPTIONS} -c ${IF_BRIDGE_WPA_CONF} -D ${IF_BRIDGE_WPA_DRIVER} -b ${IFACE} - - # Wait for wireless to be ready - sleep 0.5 ;; stop) if [ "${VERBOSITY}" = "1" ]; then @@ -57,9 +54,14 @@ if [ "$MODE" = "start" ] && [ ! -d /sys/class/net/$IFACE ]; then # For all the interfaces in bridge ports, attach to the bridge and remove ip for port in $INTERFACES; do - if [ -d "/sys/class/net/${port}/wireless" ] && [ -n "${IF_BRIDGE_WPA_CONF}" ]; then - # Launch wpa_supplicant with bridge support - start_stop_wpa_supplicant ${port} + if [ -d "/sys/class/net/${port}/wireless" ]; then + if [ -n "${IF_BRIDGE_WPA_CONF}" ]; then + # Launch wpa_supplicant with bridge support + start_stop_wpa_supplicant ${port} + fi + + # Wait for wireless to be ready + sleep 0.5 fi # Turn up the interface and include in the bridge