From 3f92525ec79a5df09912af24d90f011be6103261 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Wed, 18 Apr 2018 09:09:58 +0200 Subject: [PATCH] Fix WiFi on Kobo (#3891) Regression after bdb82d09c176bcb46197d9286a193748c5ce3e2e TL;DR: That thing is race-y as hell. The more I play with Kobos, the more it feels like the whole thing's held together by pieces of fraying strings... --- platform/kobo/enable-wifi.sh | 6 ++---- platform/kobo/nickel.sh | 3 ++- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/platform/kobo/enable-wifi.sh b/platform/kobo/enable-wifi.sh index e296fb6eb..d9e685a63 100755 --- a/platform/kobo/enable-wifi.sh +++ b/platform/kobo/enable-wifi.sh @@ -5,10 +5,8 @@ lsmod | grep -q sdio_wifi_pwr || insmod "/drivers/${PLATFORM}/wifi/sdio_wifi_pwr.ko" # WIFI_MODULE_PATH = /drivers/$PLATFORM/wifi/$WIFI_MODULE.ko lsmod | grep -q "${WIFI_MODULE}" || insmod "${WIFI_MODULE_PATH}" - -while [ ! -e /sys/class/net/eth0 ]; do - usleep 200000 -done +# Race-y as hell, don't try to optimize this! +sleep 1 ifconfig eth0 up [ "$WIFI_MODULE" != "8189fs" ] && wlarm_le -i eth0 up diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 9a65391aa..d4bdfb68f 100755 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -19,9 +19,10 @@ if lsmod | grep -q sdio_wifi_pwr; then [ "${WIFI_MODULE}" != "8189fs" ] && wlarm_le -i "${INTERFACE}" down ifconfig "${INTERFACE}" down # NOTE: Kobo's busybox build is weird. rmmod appears to be modprobe in disguise, defaulting to the -r flag. If re-specifying -r starts to fail one day, switch to rmmod without args, or modprobe -r. - rmmod -r "${WIFI_MODULE}" # c.f., #2394? usleep 200000 + rmmod -r "${WIFI_MODULE}" + usleep 200000 rmmod -r sdio_wifi_pwr fi