mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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...
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user