[Cervantes]: wifi fix & misc improvements. (#4341)

* remove unused setting 'internal_storage_mount_point

use filemanagerutil.getDefaultDir() instead
https://github.com/koreader/koreader/blob/master/frontend/apps/filemanager/filemanagerutil.lua#L15

* more info about device frontlight/naturalLight capabilities

* make stock reader fonts available in KOReader

* remove restore-wifi-async leftovers

* wireless: fix wpa_supplicant configuration:

make it compatible w/ debian wheezy binaries
don't try to run enable-wifi.sh more than once
pull/4343/head
Martín Fernández 6 years ago committed by Frans de Jonge
parent 32ccada2c4
commit 6a844136cf

@ -30,39 +30,40 @@ local Cervantes = Generic:new{
touch_switch_xy = true,
touch_mirrored_x = true,
touch_probe_ev_epoch_time = true,
hasNaturalLight = no,
hasOTAUpdates = yes,
hasKeys = yes,
internal_storage_mount_point = "/mnt/public/",
-- all devices, except the original Cervantes Touch, have frontlight
hasFrontlight = yes,
-- currently only Cervantes 4 has coloured frontlight
hasNaturalLight = no,
}
-- Cervantes Touch
local CervantesTouch = Cervantes:new{
model = "CervantesTouch",
display_dpi = 167,
hasFrontlight = no,
}
-- Cervantes TouchLight / Fnac Touch Plus
local CervantesTouchLight = Cervantes:new{
model = "CervantesTouchLight",
display_dpi = 167,
hasFrontlight = yes,
}
-- Cervantes 2013 / Fnac Touch Light
local Cervantes2013 = Cervantes:new{
model = "Cervantes2013",
display_dpi = 212,
hasFrontlight = yes,
}
-- Cervantes 3 / Fnac Touch Light 2
local Cervantes3 = Cervantes:new{
model = "Cervantes3",
display_dpi = 300,
hasFrontlight = yes,
}
-- Cervantes 4
local Cervantes4 = Cervantes:new{
model = "Cervantes4",
display_dpi = 300,
hasFrontlight = yes,
hasNaturalLight = yes,
frontlight_settings = {
frontlight_white = "/sys/class/backlight/lm3630a_ledb",
@ -169,7 +170,6 @@ function Cervantes:initNetworkManager(NetworkMgr)
os.execute("./release-ip.sh")
end
function NetworkMgr:restoreWifiAsync()
os.execute("./restore-wifi-async.sh")
end
function NetworkMgr:isWifiOn()
return 1 == isConnected()

@ -1,9 +1,6 @@
#!/bin/sh
# disable wifi and remove all modules
killall udhcpc default-script wpa_supplicant 2>/dev/null
ifconfig eth0 down
if lsmod | grep -q 8189fs; then
modprobe -r 8189fs
fi
killall udhcpc wpa_supplicant 2>/dev/null
ifconfig eth0 down 2>/dev/null
modprobe -r 8189fs 2>/dev/null

@ -1,13 +1,12 @@
#!/bin/sh
WPA_SUPPLICANT_CONF="/mnt/private/koreader/wpa_supplicant.conf"
CTRL_INTERFACE="/var/run/wpa_supplicant"
# create a new configuration if neccesary.
if [ ! -f "$WPA_SUPPLICANT_CONF" ]; then
echo "ctrl_interface=${CTRL_INTERFACE}" >"$WPA_SUPPLICANT_CONF"
echo "update_config=1" >>"$WPA_SUPPLICANT_CONF"
sync
fi
# Debian Wheezy ships an old wpa_supplicant binary (1.0.3). Please refer to
# https://manpages.debian.org/wheezy/wpasupplicant/wpa_supplicant.8.en.html
# to see which command line options are available.
# Do not run this script twice (ie: when no wireless is available or wireless
# association to ap failed.
./disable-wifi.sh
if ! lsmod | grep -q 8189fs; then
modprobe 8189fs
@ -17,5 +16,4 @@ fi
ifconfig eth0 up
sleep 1
pidof wpa_supplicant >/dev/null \
|| wpa_supplicant -i eth0 -s -O "$CTRL_INTERFACE" -c "$WPA_SUPPLICANT_CONF" -B -D wext 2>/dev/null
wpa_supplicant -i eth0 -C /var/run/wpa_supplicant -B -D wext 2>/dev/null

@ -61,6 +61,9 @@ export TESSDATA_PREFIX="data"
# export dict directory
export STARDICT_DATA_DIR="data/dict"
# export external font directory
export EXT_FONT_DIR="/usr/lib/fonts"
# we keep at most 500k worth of crash log
if [ -e crash.log ]; then
tail -c 500000 crash.log >crash.log.new

@ -1,10 +0,0 @@
#!/bin/sh
RestoreWifi() {
echo "[$(date)] restore-wifi-async.sh: Restarting WiFi"
./enable-wifi.sh
./obtain-ip.sh
echo "[$(date)] restore-wifi-async.sh: Restarted WiFi"
}
RestoreWifi &
Loading…
Cancel
Save