Merge pull request #1423 from Markismus/master

Update networkmgr.lua
pull/1425/head
Huang Xin 9 years ago
commit b56c01c382

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

@ -40,6 +40,28 @@ 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
export PLATFORM
fi
# end of value check of PLATFORM
./reader.lua $args 2> crash.log
if [ $from_nickel -ne 0 ]; then

Loading…
Cancel
Save