From 687aba796dc268fc7fae5742a1b2620a5f6fd421 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Fri, 4 Sep 2015 23:14:17 +0200 Subject: [PATCH] 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. --- frontend/ui/networkmgr.lua | 6 +++--- platform/kobo/nickel.sh | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/ui/networkmgr.lua b/frontend/ui/networkmgr.lua index 81f4d578e..ea879bc2d 100644 --- a/frontend/ui/networkmgr.lua +++ b/frontend/ui/networkmgr.lua @@ -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") diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 6096c220f..ca1c9d01b 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -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.