From 5dd2fe0faec4f302f4105fe3e84dacc45554996e Mon Sep 17 00:00:00 2001 From: Markismus Date: Sun, 8 Feb 2015 18:28:28 +0100 Subject: [PATCH 1/4] Update networkmgr.lua Change from the commands from `wifi.sh` to those from `wifi_enable_dhcp.sh` from Tshering's Start Menu. See Issue #939. Should resolve hanging of Kobo Aura H2O. --- frontend/ui/networkmgr.lua | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/ui/networkmgr.lua b/frontend/ui/networkmgr.lua index b9adcee08..6da300051 100644 --- a/frontend/ui/networkmgr.lua +++ b/frontend/ui/networkmgr.lua @@ -21,14 +21,14 @@ end local function koboEnableWifi(toggle) if toggle == 1 then - local path = "/etc/wpa_supplicant/wpa_supplicant.conf" - os.execute("insmod /drivers/ntx508/wifi/sdio_wifi_pwr.ko 2>/dev/null") - os.execute("insmod /drivers/ntx508/wifi/dhd.ko") - os.execute("sleep 1") + os.execute("lsmod | grep -q sdio_wifi_pwr || insmod /drivers/$PLATFORM/wifi/sdio_wifi_pwr.ko") + os.execute("lsmod | grep -q dhd || insmod /drivers/$PLATFORM/wifi/dhd.ko") + os.execute("sleep 2") os.execute("ifconfig eth0 up") os.execute("wlarm_le -i eth0 up") - os.execute("wpa_supplicant -s -i eth0 -c "..path.." -C /var/run/wpa_supplicant -B") - os.execute("udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -b -q >/dev/null 2>&1") + 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("sleep 1") + os.execute("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("wlarm_le -i eth0 down") From a32c3b3879e18fb304786dfe2ee7fa5911ed1e7b Mon Sep 17 00:00:00 2001 From: Markismus Date: Mon, 9 Feb 2015 16:01:30 +0100 Subject: [PATCH 2/4] Update networkmgr.lua Corrected a typo. --- frontend/ui/networkmgr.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/ui/networkmgr.lua b/frontend/ui/networkmgr.lua index 6da300051..a6ed5f283 100644 --- a/frontend/ui/networkmgr.lua +++ b/frontend/ui/networkmgr.lua @@ -28,7 +28,7 @@ local function koboEnableWifi(toggle) 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("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("/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("wlarm_le -i eth0 down") From 40202fbc6b3faf49b21b11e889fc24495e35ea25 Mon Sep 17 00:00:00 2001 From: Markismus Date: Mon, 9 Feb 2015 16:13:07 +0100 Subject: [PATCH 3/4] Update koreader.sh The commands in networkmgr.lua rely on an assigned value of PLATFORM. As discussed in #1423 this is only the case for child processes of rcS. This seems to be a fine place to check the value of PLATFORM. --- platform/kobo/koreader.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index b9f49d34f..543e7134a 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -37,6 +37,27 @@ else args=$@ fi +# check whether PLATFORM has a value assigned by rcS +# PLATFORM is used in koreader for the path to the WiFi drivers +if [ -n "$PLATFORM" ]; then + PLATFORM=freescale + if [ `dd if=/dev/mmcblk0 bs=512 skip=1024 count=1 | grep -c "HW CONFIG"` == 1 ]; then + CPU=`ntx_hwconfig -s -p /dev/mmcblk0 CPU` + PLATFORM=$CPU-ntx + fi + + if [ $PLATFORM == freescale ]; then + if [ ! -s /lib/firmware/imx/epdc_E60_V220.fw ]; then + mkdir -p /lib/firmware/imx + dd if=/dev/mmcblk0 bs=512K skip=10 count=1 | zcat > /lib/firmware/imx/epdc_E60_V220.fw + sync + fi + elif [ ! -e /etc/u-boot/$PLATFORM/u-boot.mmc ]; then + PLATFORM=ntx508 + fi +fi +# end of value check of PLATFORM + ./reader.lua $args 2> crash.log if [ $from_nickel -ne 0 ]; then From 6e95673d80ff6c5201a564a899d592a30175ccd1 Mon Sep 17 00:00:00 2001 From: Markismus Date: Mon, 9 Feb 2015 16:19:27 +0100 Subject: [PATCH 4/4] Update koreader.sh Forgot the export PLATFORM --- platform/kobo/koreader.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 543e7134a..9ee0fbfa9 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -55,6 +55,7 @@ if [ -n "$PLATFORM" ]; then elif [ ! -e /etc/u-boot/$PLATFORM/u-boot.mmc ]; then PLATFORM=ntx508 fi + export PLATFORM fi # end of value check of PLATFORM