Fix networkmgr on Kobo

To avoid potential issues with USBMS.
Namely, make sure CWD doesn't point to the userstore for persitent
processes.
Make sure wpa_supplicant doesn't try to use our own OpenSSL lib, which,
again, is in the userstore area.
Properly kill our dhcp client invocation on when killing WiFi

Also, some related fixes to the startup script:
Properly kill wpa_supplicant & the dhcp client when we kill
wifi before rebooting to nickel.
pull/1620/head
NiLuJe 9 years ago
parent 89e8e4297c
commit 687aba796d

@ -26,11 +26,11 @@ local function koboEnableWifi(toggle)
os.execute("sleep 2")
os.execute("ifconfig eth0 up")
os.execute("wlarm_le -i eth0 up")
os.execute("pidof wpa_supplicant >/dev/null || wpa_supplicant -s -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -C /var/run/wpa_supplicant -B")
os.execute("pidof wpa_supplicant >/dev/null || cd / && env -u LD_LIBRARY_PATH wpa_supplicant -s -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -C /var/run/wpa_supplicant -B")
os.execute("sleep 1")
os.execute("/sbin/udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -b -q >/dev/null 2>&1 &")
os.execute("cd / && env -u LD_LIBRARY_PATH /sbin/udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -b -q >/dev/null 2>&1 &")
else
os.execute("killall udhcpc wpa_supplicant 2>/dev/null")
os.execute("killall udhcpc default.script wpa_supplicant 2>/dev/null")
os.execute("wlarm_le -i eth0 down")
os.execute("ifconfig eth0 down")
os.execute("rmmod -r dhd")

@ -29,6 +29,7 @@ export LANG="en_US.UTF-8"
# Make sure we kill the WiFi first, because nickel apparently doesn't like it if it's up... (cf. #1520)
# NOTE: That check is possibly wrong on PLATFORM == freescale (because I don't know if the sdio_wifi_pwr module exists there), but we don't terribly care about that.
if lsmod | grep -q sdio_wifi_pwr ; then
killall udhcpc default.script wpa_supplicant 2>/dev/null
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.

Loading…
Cancel
Save