Add support for Koreader's WiFi manager
This commit is contained in:
parent
97b56e6857
commit
b8fcc58715
20
build.sh
20
build.sh
@ -126,14 +126,18 @@ compile_koreader() {
|
||||
mkdir opt
|
||||
cd opt
|
||||
tar xf ../../koreader/koreader-kobo-arm-linux-gnueabihf*.targz
|
||||
|
||||
echo "#!/bin/bash" > koreader/okreader.sh
|
||||
echo "cd /opt/koreader" >> koreader/okreader.sh
|
||||
echo "while true; do" >> koreader/okreader.sh
|
||||
echo " ./luajit ./reader.lua /mnt" >> koreader/okreader.sh
|
||||
echo "done" >> koreader/okreader.sh
|
||||
chmod +x koreader/okreader.sh
|
||||
|
||||
|
||||
cp ../../../files/okreader.sh koreader/
|
||||
cp ../../../files/disable-wifi.sh koreader/
|
||||
cp ../../../files/enable-wifi.sh koreader/
|
||||
cp ../../../files/obtain-ip.sh koreader/
|
||||
cp ../../../files/release-ip.sh koreader/
|
||||
chmod +x koreader/disable-wifi.sh
|
||||
chmod +x koreader/enable-wifi.sh
|
||||
chmod +x koreader/obtain-ip.sh
|
||||
chmod +x koreader/release-ip.sh
|
||||
chmod +x koreader/restore-wifi-async.sh
|
||||
|
||||
cp ../../../files/defaults.persistent.lua koreader/
|
||||
|
||||
cd ../../
|
||||
|
@ -87,7 +87,7 @@ config_rootfs() {
|
||||
install_packages() {
|
||||
cp src/linux-okreader-modules_2.6.35.3-1_armhf.deb rootfs/
|
||||
cp src/firmware-okreader_1.0-1_armhf.deb rootfs/
|
||||
cp src/koreader_2017.03-1_armhf.deb rootfs/
|
||||
cp src/koreader_2017.03-2_armhf.deb rootfs/
|
||||
cp src/kobo_hwconfig/kobo-hwconfig_1.0-1_armhf.deb rootfs/
|
||||
|
||||
chroot rootfs/ bash -c "dpkg -i /*.deb"
|
||||
|
16
files/disable-wifi.sh
Executable file
16
files/disable-wifi.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Disable wifi, and remove all modules.
|
||||
|
||||
killall dhcpcd default.script wpa_supplicant 2>/dev/null
|
||||
|
||||
ifconfig wlan0 down
|
||||
|
||||
# Some sleep in between may avoid system getting hung
|
||||
# (we test if a module is actually loaded to avoid unneeded sleeps)
|
||||
if lsmod | grep -q $WIFI_MODULE ; then
|
||||
rmmod $WIFI_MODULE
|
||||
fi
|
||||
if lsmod | grep -q sdio_wifi_pwr ; then
|
||||
rmmod sdio_wifi_pwr
|
||||
fi
|
12
files/enable-wifi.sh
Executable file
12
files/enable-wifi.sh
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Load wifi modules and enable wifi.
|
||||
lsmod | grep -q $WIFI_MODULE || modprobe $WIFI_MODULE
|
||||
lsmod | grep -q sdio_wifi_pwr || modprobe sdio_wifi_pwr
|
||||
sleep 1
|
||||
|
||||
ifconfig wlan0 up
|
||||
|
||||
pidof wpa_supplicant >/dev/null || \
|
||||
( wpa_supplicant -D wext -iwlan0 -C /var/run/wpa_supplicant -B; \
|
||||
ln -s /var/run/wpa_supplicant/wlan0 /var/run/wpa_supplicant/eth0 )
|
5
files/obtain-ip.sh
Executable file
5
files/obtain-ip.sh
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
./release-ip.sh
|
||||
|
||||
dhcpcd wlan0
|
8
files/okreader.sh
Executable file
8
files/okreader.sh
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
export WIFI_MODULE=brcmfmac
|
||||
|
||||
cd /opt/koreader
|
||||
while true; do
|
||||
./luajit ./reader.lua /mnt
|
||||
done
|
3
files/release-ip.sh
Executable file
3
files/release-ip.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
pkill -9 -f 'dhcpcd'
|
@ -1,5 +1,5 @@
|
||||
Package: koreader
|
||||
Version: 2017.03-1
|
||||
Version: 2017.03-2
|
||||
Maintainer: Cosmin Gorgovan <okreader@linux-geek.org>
|
||||
Architecture: armhf
|
||||
Description: An ebook viewer application.
|
||||
|
Loading…
Reference in New Issue
Block a user