Fix WiFi on Kobo (#3891)

Regression after bdb82d09c1
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...
pull/3893/head
NiLuJe 6 years ago committed by Frans de Jonge
parent a36407080b
commit 3f92525ec7

@ -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

@ -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

Loading…
Cancel
Save