Merge pull request #740 from pazos/master

Add wifi toggle for kobos
pull/744/head v2014.07.20-nightly
Huang Xin 10 years ago
commit 72cb163a0c

@ -126,6 +126,7 @@ koboupdate: all
cp kobo/koreader.sh $(INSTALL_DIR)/koreader
cp kobo/suspend.sh $(INSTALL_DIR)/koreader
cp kobo/nickel.sh $(INSTALL_DIR)/koreader
cp kobo/wifi.sh $(INSTALL_DIR)/koreader
# create new package
cd $(INSTALL_DIR) && \
zip -9 -r \

@ -22,7 +22,7 @@ function NetworkMgr:turnOnWifi()
if Device:isKindle() then
kindleEnableWifi(1)
elseif Device:isKobo() then
-- TODO: turn on wifi on kobo?
os.execute("./wifi.sh on")
end
end
@ -30,7 +30,7 @@ function NetworkMgr:turnOffWifi()
if Device:isKindle() then
kindleEnableWifi(0)
elseif Device:isKobo() then
-- TODO: turn off wifi on kobo?
os.execute("./wifi.sh off")
end
end

@ -4,25 +4,11 @@ PATH=$PATH:/usr/sbin:/sbin
# start fmon again:
( usleep 400000; /etc/init.d/on-animator.sh ) &
# environment needed by nickel, from /etc/init.d/rcS:
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 2>/dev/null`
PLATFORM=$CPU-ntx
fi
if [ $PLATFORM != freescale ]; then
INTERFACE=eth0
WIFI_MODULE=dhd
else
INTERFACE=wlan0
WIFI_MODULE=ar6000
fi
export PLATFORM
export INTERFACE
export WIFI_MODULE
export WIFI_MODULE_PATH=/drivers/$PLATFORM/wifi/$WIFI_MODULE.ko
# environment needed by nickel, from /etc/init.d/rcS:
export INTERFACE=eth0
export WIFI_MODULE=dhd
export WIFI_MODULE_PATH=/drivers/ntx508/wifi/$WIFI_MODULE.ko
export NICKEL_HOME=/mnt/onboard/.kobo
export LD_LIBRARY_PATH=/usr/local/Kobo
@ -51,7 +37,7 @@ if [ ! -e /usr/local/Kobo/platforms/libkobo.so ]; then
/usr/local/Kobo/nickel -qws -skipFontLoad
else
/usr/local/Kobo/hindenburg &
insmod /drivers/$PLATFORM/misc/lowmem.ko &
insmod /drivers/ntx508/misc/lowmem.ko &
[ `cat /mnt/onboard/.kobo/Kobo/Kobo\ eReader.conf | grep -c dhcpcd=true` == 1 ] && dhcpcd -d -t 10 &
/usr/local/Kobo/nickel -platform kobo -skipFontLoad
fi

@ -5,8 +5,8 @@ export PATH=$PATH:/sbin:/usr/sbin
if lsmod | grep -q sdio_wifi_pwr ; then
wlarm_le -i eth0 down
ifconfig eth0 down
/sbin/rmmod -r dhd
/sbin/rmmod -r sdio_wifi_pwr
rmmod -r dhd
rmmod -r sdio_wifi_pwr
fi
#go to sleep

@ -0,0 +1,23 @@
#!/bin/sh
export PATH=$PATH:/sbin:/usr/sbin
case $1 in
on )
for mod in sdio_wifi_pwr dhd; do
insmod /drivers/ntx508/wifi/${mod}.ko 2>/dev/null
done
sleep 1
ifconfig eth0 up
wlarm_le -i eth0 up
wpa_supplicant -s -i eth0 -c /etc/wpa_supplicant/wpa_supplicant.conf -C /var/run/wpa_supplicant -B
sleep 1
udhcpc -S -i eth0 -s /etc/udhcpc.d/default.script -t15 -T10 -A3 -b -q >/dev/null 2>&1 &
;;
off )
killall wpa_supplicant 2>/dev/null
wlarm_le -i eth0 down
ifconfig eth0 down
rmmod -r dhd
rmmod -r sdio_wifi_pwr
;;
esac
Loading…
Cancel
Save