diff --git a/frontend/device/cervantes/device.lua b/frontend/device/cervantes/device.lua index eabf004e7..80175937d 100644 --- a/frontend/device/cervantes/device.lua +++ b/frontend/device/cervantes/device.lua @@ -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() diff --git a/platform/cervantes/disable-wifi.sh b/platform/cervantes/disable-wifi.sh index e1d73b26e..3004185f8 100755 --- a/platform/cervantes/disable-wifi.sh +++ b/platform/cervantes/disable-wifi.sh @@ -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 diff --git a/platform/cervantes/enable-wifi.sh b/platform/cervantes/enable-wifi.sh index b3ff3bcd1..440852927 100755 --- a/platform/cervantes/enable-wifi.sh +++ b/platform/cervantes/enable-wifi.sh @@ -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 diff --git a/platform/cervantes/koreader.sh b/platform/cervantes/koreader.sh index 6308dfe08..91970aa16 100755 --- a/platform/cervantes/koreader.sh +++ b/platform/cervantes/koreader.sh @@ -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 diff --git a/platform/cervantes/restore-wifi-async.sh b/platform/cervantes/restore-wifi-async.sh deleted file mode 100755 index 9e45bd53b..000000000 --- a/platform/cervantes/restore-wifi-async.sh +++ /dev/null @@ -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 &