diff --git a/base b/base index fb548638a..bebfc78ed 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit fb548638a9ea6c5d498153e357f9111f338ce6fc +Subproject commit bebfc78edcc359a663aaec6dccf36530dd7b0492 diff --git a/frontend/apps/opdscatalog/opdscatalog.lua b/frontend/apps/opdscatalog/opdscatalog.lua index 6b7166b95..dec59d72b 100644 --- a/frontend/apps/opdscatalog/opdscatalog.lua +++ b/frontend/apps/opdscatalog/opdscatalog.lua @@ -66,7 +66,7 @@ end function OPDSCatalog:onShow() UIManager:setDirty(self, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) end diff --git a/frontend/apps/reader/modules/readerbookmark.lua b/frontend/apps/reader/modules/readerbookmark.lua index da9a8f20d..6ef0b3de8 100644 --- a/frontend/apps/reader/modules/readerbookmark.lua +++ b/frontend/apps/reader/modules/readerbookmark.lua @@ -133,7 +133,7 @@ function ReaderBookmark:onToggleBookmark() end self:toggleBookmark(pn_or_xp) self.view.dogear_visible = not self.view.dogear_visible - UIManager:setDirty(self.view.dialog, "partial") + UIManager:setDirty(self.view.dialog, "ui") return true end diff --git a/frontend/apps/reader/modules/readercropping.lua b/frontend/apps/reader/modules/readercropping.lua index 36c5e964e..5c87932cb 100644 --- a/frontend/apps/reader/modules/readercropping.lua +++ b/frontend/apps/reader/modules/readercropping.lua @@ -73,7 +73,7 @@ end function PageCropDialog:onShow() UIManager:setDirty(self, function() - return "partial", self[1].dimen:combine(self[2].dimen) + return "ui", self[1].dimen:combine(self[2].dimen) end) return true end diff --git a/frontend/apps/reader/modules/readerfooter.lua b/frontend/apps/reader/modules/readerfooter.lua index f1d39e231..a49399474 100644 --- a/frontend/apps/reader/modules/readerfooter.lua +++ b/frontend/apps/reader/modules/readerfooter.lua @@ -346,7 +346,7 @@ function ReaderFooter:onTapFooter(arg, ges) else self:updateFooterPos() end - UIManager:setDirty(self.view.dialog, "partial", self[1][1][1].dimen) + UIManager:setDirty(self.view.dialog, "ui", self[1][1][1].dimen) return true end diff --git a/frontend/device/kobo/device.lua b/frontend/device/kobo/device.lua index 8ccb15eb9..e2529a908 100644 --- a/frontend/device/kobo/device.lua +++ b/frontend/device/kobo/device.lua @@ -41,8 +41,8 @@ local KoboDahlia = Kobo:new{ hasFrontlight = yes, touch_phoenix_protocol = true, display_dpi = 265, - -- bezel: - viewport = Geom:new{x=0, y=10, w=1080, h=1430}, + -- the bezel covers the top 11 pixels: + viewport = Geom:new{x=0, y=11, w=1080, h=1429}, } -- Kobo Aura HD: diff --git a/frontend/ui/widget/button.lua b/frontend/ui/widget/button.lua index 08da966ff..0a6881980 100644 --- a/frontend/ui/widget/button.lua +++ b/frontend/ui/widget/button.lua @@ -168,14 +168,14 @@ function Button:onTapSelectButton() UIManager:scheduleIn(0.0, function() self[1].invert = true UIManager:setDirty(self.show_parent, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) end) UIManager:scheduleIn(0.1, function() self.callback() self[1].invert = false UIManager:setDirty(self.show_parent, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) end) elseif self.tap_input then diff --git a/frontend/ui/widget/buttondialog.lua b/frontend/ui/widget/buttondialog.lua index 02df4d6c1..0b08f8349 100644 --- a/frontend/ui/widget/buttondialog.lua +++ b/frontend/ui/widget/buttondialog.lua @@ -52,7 +52,7 @@ end function ButtonDialog:onShow() UIManager:setDirty(self, function() - return "partial", self[1][1].dimen + return "ui", self[1][1].dimen end) end diff --git a/frontend/ui/widget/configdialog.lua b/frontend/ui/widget/configdialog.lua index 3e25ab680..43ff4ad97 100644 --- a/frontend/ui/widget/configdialog.lua +++ b/frontend/ui/widget/configdialog.lua @@ -72,7 +72,7 @@ function OptionTextItem:onTapSelect() self.event, self.args, self.events, self.current_item) UIManager:setDirty(self.config, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) return true end @@ -127,7 +127,7 @@ function OptionIconItem:onTapSelect() self.event, self.args, self.events, self.current_item) UIManager:setDirty(self.config, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) return true end @@ -532,7 +532,7 @@ function ConfigDialog:onShowConfigPanel(index) local refresh_dimen = old_dimen and old_dimen:combine(self.dialog_frame.dimen) or self.dialog_frame.dimen - return "partial", refresh_dimen + return "ui", refresh_dimen end) return true end diff --git a/frontend/ui/widget/confirmbox.lua b/frontend/ui/widget/confirmbox.lua index df1589a2a..2ff70e6b0 100644 --- a/frontend/ui/widget/confirmbox.lua +++ b/frontend/ui/widget/confirmbox.lua @@ -91,7 +91,7 @@ end function ConfirmBox:onShow() UIManager:setDirty(self, function() - return "partial", self[1][1].dimen + return "ui", self[1][1].dimen end) end diff --git a/frontend/ui/widget/dictquicklookup.lua b/frontend/ui/widget/dictquicklookup.lua index 2ec2883ac..10471552f 100644 --- a/frontend/ui/widget/dictquicklookup.lua +++ b/frontend/ui/widget/dictquicklookup.lua @@ -276,7 +276,7 @@ end function DictQuickLookup:onShow() UIManager:setDirty(self, function() - return "partial", self.dict_frame.dimen + return "ui", self.dict_frame.dimen end) return true end diff --git a/frontend/ui/widget/iconbutton.lua b/frontend/ui/widget/iconbutton.lua index f67afb267..41ef0ed03 100644 --- a/frontend/ui/widget/iconbutton.lua +++ b/frontend/ui/widget/iconbutton.lua @@ -44,7 +44,7 @@ function IconButton:onTapClickButton() UIManager:scheduleIn(0.0, function() self.image.invert = true UIManager:setDirty(self.show_parent, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) end) -- make sure button reacts before doing callback @@ -52,7 +52,7 @@ function IconButton:onTapClickButton() self.callback() self.image.invert = false UIManager:setDirty(self.show_parent, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) end) return true diff --git a/frontend/ui/widget/infomessage.lua b/frontend/ui/widget/infomessage.lua index 21e722a30..6cfa628fc 100644 --- a/frontend/ui/widget/infomessage.lua +++ b/frontend/ui/widget/infomessage.lua @@ -88,7 +88,7 @@ end function InfoMessage:onShow() -- triggered by the UIManager after we got successfully shown (not yet painted) UIManager:setDirty(self, function() - return "partial", self[1][1].dimen + return "ui", self[1][1].dimen end) if self.timeout then UIManager:scheduleIn(self.timeout, function() UIManager:close(self) end) diff --git a/frontend/ui/widget/inputdialog.lua b/frontend/ui/widget/inputdialog.lua index a100773de..af2a03763 100644 --- a/frontend/ui/widget/inputdialog.lua +++ b/frontend/ui/widget/inputdialog.lua @@ -120,7 +120,7 @@ end function InputDialog:onShow() UIManager:setDirty(self, function() - return "partial", self.dialog_frame.dimen + return "ui", self.dialog_frame.dimen end) end diff --git a/frontend/ui/widget/inputtext.lua b/frontend/ui/widget/inputtext.lua index 1659a0453..6c8981abf 100644 --- a/frontend/ui/widget/inputtext.lua +++ b/frontend/ui/widget/inputtext.lua @@ -89,7 +89,7 @@ function InputText:initTextBox(text) self.dimen = self[1]:getSize() UIManager:setDirty(self.parent, function() - return "partial", self[1].dimen + return "ui", self[1].dimen end) end diff --git a/frontend/ui/widget/linkbox.lua b/frontend/ui/widget/linkbox.lua index 2c7fa0364..1b4c6829e 100644 --- a/frontend/ui/widget/linkbox.lua +++ b/frontend/ui/widget/linkbox.lua @@ -42,7 +42,7 @@ end function LinkBox:onShow() UIManager:setDirty(self, function() - return "partial", self.box + return "ui", self.box end) if self.timeout then UIManager:scheduleIn(self.timeout, function() diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index 5782e1d21..e7b6cbe92 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -284,7 +284,7 @@ function MenuItem:onTapSelect(arg, ges) local pos = self:getGesPosition(ges) self[1].invert = true local refreshfunc = function() - return "partial", self[1].dimen + return "ui", self[1].dimen end UIManager:setDirty(self.show_parent, refreshfunc) UIManager:scheduleIn(0.1, function() @@ -299,7 +299,7 @@ function MenuItem:onHoldSelect(arg, ges) local pos = self:getGesPosition(ges) self[1].invert = true local refreshfunc = function() - return "partial", self[1].dimen + return "ui", self[1].dimen end UIManager:setDirty(self.show_parent, refreshfunc) UIManager:scheduleIn(0.1, function() @@ -686,7 +686,7 @@ function Menu:updateItems(select_number) local refresh_dimen = old_dimen and old_dimen:combine(self.dimen) or self.dimen - return "partial", refresh_dimen + return "ui", refresh_dimen end) end diff --git a/frontend/ui/widget/notification.lua b/frontend/ui/widget/notification.lua index 4d5051268..d8db5dbed 100644 --- a/frontend/ui/widget/notification.lua +++ b/frontend/ui/widget/notification.lua @@ -65,7 +65,7 @@ end function Notification:onShow() -- triggered by the UIManager after we got successfully shown (not yet painted) UIManager:setDirty(self, function() - return "partial", self[1][1].dimen + return "ui", self[1][1].dimen end) if self.timeout then UIManager:scheduleIn(self.timeout, function() UIManager:close(self) end) diff --git a/frontend/ui/widget/toggleswitch.lua b/frontend/ui/widget/toggleswitch.lua index 675ebf49c..a573e4748 100644 --- a/frontend/ui/widget/toggleswitch.lua +++ b/frontend/ui/widget/toggleswitch.lua @@ -148,7 +148,7 @@ function ToggleSwitch:onTapSelect(arg, gev) self.config:onConfigChoose(self.values, self.name, self.event, self.args, self.events, self.position) UIManager:setDirty(self.config, function() - return "partial", self.dimen + return "ui", self.dimen end) return true end diff --git a/frontend/ui/widget/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index 23db7850a..136c8e910 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -98,7 +98,7 @@ function TouchMenuItem:onTapSelect(arg, ges) UIManager:scheduleIn(0.0, function() self.item_frame.invert = true UIManager:setDirty(self.show_parent, function() - return "partial", self.dimen + return "ui", self.dimen end) end) UIManager:scheduleIn(0.1, function() @@ -107,7 +107,7 @@ function TouchMenuItem:onTapSelect(arg, ges) UIManager:scheduleIn(0.5, function() self.item_frame.invert = false UIManager:setDirty(self.show_parent, function() - return "partial", self.dimen + return "ui", self.dimen end) end) return true @@ -123,7 +123,7 @@ function TouchMenuItem:onHoldSelect(arg, ges) UIManager:scheduleIn(0.0, function() self.item_frame.invert = true UIManager:setDirty(self.show_parent, function() - return "partial", self.dimen + return "ui", self.dimen end) end) UIManager:scheduleIn(0.1, function() @@ -132,7 +132,7 @@ function TouchMenuItem:onHoldSelect(arg, ges) UIManager:scheduleIn(0.5, function() self.item_frame.invert = false UIManager:setDirty(self.show_parent, function() - return "partial", self.dimen + return "ui", self.dimen end) end) return true @@ -469,7 +469,7 @@ function TouchMenu:updateItems() local refresh_dimen = old_dimen and old_dimen:combine(self.dimen) or self.dimen - return "partial", refresh_dimen + return "ui", refresh_dimen end) end diff --git a/frontend/ui/widget/virtualkeyboard.lua b/frontend/ui/widget/virtualkeyboard.lua index 55798e4fb..1384e07db 100644 --- a/frontend/ui/widget/virtualkeyboard.lua +++ b/frontend/ui/widget/virtualkeyboard.lua @@ -216,6 +216,7 @@ function VirtualKeyboard:init() end function VirtualKeyboard:_refresh() + -- TODO: Ideally, ui onShow & partial onClose UIManager:setDirty(self, function() return "partial", self[1][1].dimen end) diff --git a/platform/kindle/extensions/koreader/bin/koreader-ext.sh b/platform/kindle/extensions/koreader/bin/koreader-ext.sh index 6c6712cdd..1711b30e0 100755 --- a/platform/kindle/extensions/koreader/bin/koreader-ext.sh +++ b/platform/kindle/extensions/koreader/bin/koreader-ext.sh @@ -43,9 +43,16 @@ update_koreader() found_koreader_package="false" # Try to find a koreader package... Behavior undefined if there are multiple packages... + for file in /mnt/us/koreader-kindle-*.tar.gz ; do + if [ -f "${file}" ] ; then + found_koreader_package="${file}" + koreader_pkg_type="tgz" + fi + done for file in /mnt/us/koreader-kindle-*.zip ; do if [ -f "${file}" ] ; then found_koreader_package="${file}" + koreader_pkg_type="zip" fi done @@ -61,11 +68,19 @@ update_koreader() fi # Get the version of the package... - koreader_pkg_ver="${found_koreader_package%.*}" + if [ "${koreader_pkg_type}" == "tgz" ] ; then + koreader_pkg_ver="${found_koreader_package%.*.*}" + else + koreader_pkg_ver="${found_koreader_package%.*}" + fi koreader_pkg_ver="${koreader_pkg_ver#*-v}" # Install it! logmsg "Updating to KOReader ${koreader_pkg_ver} . . ." - unzip -q -o "${found_koreader_package}" -d "/mnt/us" + if [ "${koreader_pkg_type}" == "tgz" ] ; then + tar -C "/mnt/us" -xzf "${found_koreader_package}" + else + unzip -q -o "${found_koreader_package}" -d "/mnt/us" + fi if [ $? -eq 0 ] ; then logmsg "Update to v${koreader_pkg_ver} successful :)" # Cleanup behind us... diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index a9dd54b35..0d9362b4c 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -208,7 +208,7 @@ fi ./reader.lua "$@" 2> crash.log # clean up our own process tree in case the reader crashed (if needed, to avoid flooding KUAL's log) -if pidof reader.lua > /dev/null 2>&1 ; then +if pkill -0 reader.lua ; then logmsg "Sending a SIGTERM to stray KOreader processes . . ." killall -TERM reader.lua fi diff --git a/platform/kindle/libkohelper.sh b/platform/kindle/libkohelper.sh index 29cd035fd..da051b28e 100644 --- a/platform/kindle/libkohelper.sh +++ b/platform/kindle/libkohelper.sh @@ -24,7 +24,7 @@ case "${kmodel}" in ;; "13" | "54" | "2A" | "4F" | "52" | "53" ) # Kindle Voyage - SCREEN_X_RES=1072 + SCREEN_X_RES=1088 # NOTE: Yes, 1088, not 1072 or 1080... SCREEN_Y_RES=1448 EIPS_X_RES=16 EIPS_Y_RES=24 # Manually mesured, should be accurate. diff --git a/platform/kobo/fmon/koreader.sh b/platform/kobo/fmon/koreader.sh index e4b0011da..abd4e6933 100644 --- a/platform/kobo/fmon/koreader.sh +++ b/platform/kobo/fmon/koreader.sh @@ -1 +1 @@ -$root/.kobo/fmon/fmon $root/koreader.png $root/.kobo/koreader/koreader.sh & +${root}/.kobo/fmon/fmon "${root}/koreader.png" "${root}/.kobo/koreader/koreader.sh" & diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 186d94c98..733db0d79 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -2,21 +2,21 @@ export LC_ALL="en_US.UTF-8" # working directory of koreader -KOREADER_DIR=$(dirname $0) +KOREADER_DIR="${0%/*}" # update to new version from OTA directory NEWUPDATE="${KOREADER_DIR}/ota/koreader.updated.tar" INSTALLED="${KOREADER_DIR}/ota/koreader.installed.tar" -if [ -f $NEWUPDATE ]; then - # TODO: any graphic indication for the updating progress? - cd $(dirname $KOREADER_DIR) && tar xf $NEWUPDATE && mv $NEWUPDATE $INSTALLED +if [ -f "${NEWUPDATE}" ] ; then + # TODO: any graphic indication for the updating progress? + cd "${KOREADER_DIR%/*}" && tar xf "${NEWUPDATE}" && mv "${NEWUPDATE}" "${INSTALLED}" fi # we're always starting from our working directory -cd $KOREADER_DIR +cd "${KOREADER_DIR}" # load our own shared libraries if possible -export LD_LIBRARY_PATH=${KOREADER_DIR}/libs:$LD_LIBRARY_PATH +export LD_LIBRARY_PATH="${KOREADER_DIR}/libs:${LD_LIBRARY_PATH}" # export trained OCR data directory export TESSDATA_PREFIX="data" @@ -29,50 +29,69 @@ export EXT_FONT_DIR="/mnt/onboard/fonts" # fast and dirty way of check if we are called from nickel # through fmon, or from another launcher (KSM or advboot) -from_nickel=`pidof nickel | wc -c` - -if [ $from_nickel -ne 0 ]; then - # stop kobo software because is running - killall nickel hindenburg fmon 2>/dev/null +from_nickel="false" +if pkill -0 nickel ; then + from_nickel="true" fi -# fallback for old fmon (and advboot) users -if [ `echo $@ | wc -c` -eq 1 ]; then - args="/mnt/onboard" +if [ "${from_nickel}" == "true" ] ; then + # Siphon a few things from nickel's env... + eval "$(xargs -n 1 -0 < /proc/$(pidof nickel)/environ | grep -e DBUS_SESSION_BUS_ADDRESS -e WIFI_MODULE -e PLATFORM -e WIFI_MODULE_PATH -e INTERFACE -e PRODUCT 2>/dev/null)" + export DBUS_SESSION_BUS_ADDRESS WIFI_MODULE PLATFORM WIFI_MODULE_PATH INTERFACE PRODUCT + + # flush disks, might help avoid trashing nickel's DB... + sync + # stop kobo software because it's running + killall nickel hindenburg fmon 2>/dev/null +fi + +# fallback for old fmon (and advboot) users (-> if no args were passed to the sript, start the FM) +if [ "$#" -eq 0 ] ; then + args="/mnt/onboard" else - args=$@ + 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 +# check whether PLATFORM & PRODUCT have a value assigned by rcS +if [ ! -n "${PRODUCT}" ] ; then + PRODUCT="$(/bin/kobo_config.sh)" + [ "${PRODUCT}" != "trilogy" ] && PREFIX="${PRODUCT}-" + export PRODUCT +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 +# 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 -q "HW CONFIG" ; 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 +./reader.lua "${args}" 2> crash.log -if [ $from_nickel -ne 0 ]; then - # start kobo software because was running before koreader - ./nickel.sh +if [ "${from_nickel}" == "true" ] ; then + # start kobo software because it was running before koreader + ./nickel.sh & else - # if we were called from advboot then we must reboot to go to the menu - if [ -d /mnt/onboard/.kobo/advboot ]; then - reboot - fi + # if we were called from advboot then we must reboot to go to the menu + # NOTE: This is actually achieved by checking if KSM is running: + # This might lead to false-positives if you use neither KSM nor advboot to launch KOReader *without nickel running*. + if ! pkill -0 ksmhome.sh ; then + reboot + fi fi + +return 0 diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 58a3baa20..024607631 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -1,43 +1,71 @@ #!/bin/sh -PATH=$PATH:/usr/sbin:/sbin +PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/lib" + +# Handle the rotation weirdness on some devices +cur_rotate="$(cat "/sys/class/graphics/fb0/rotate")" # start fmon again: ( usleep 400000; /etc/init.d/on-animator.sh ) & -# 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 +# environment needed by nickel, from /etc/init.d/rcS: + +if [ ! -n "${WIFI_MODULE_PATH}" ] ; then + INTERFACE="wlan0" + WIFI_MODULE="ar6000" + if [ "${PLATFORM}" != "freescale" ] ; then + INTERFACE="eth0" + WIFI_MODULE="dhd" + fi + export INTERFACE + export WIFI_MODULE + export WIFI_MODULE_PATH="/drivers/${PLATFORM}/wifi/${WIFI_MODULE}.ko" +fi + +export NICKEL_HOME="/mnt/onboard/.kobo" +export LD_LIBRARY_PATH="/usr/local/Kobo" + +export LANG="en_US.UTF-8" + # start nickel again (from tshering's start menu v0.4), this should # cover all firmware versions from 2.6.1 to 3.4.1 (tested on a kobo # mini with 3.4.1 firmware) -( /usr/local/Kobo/pickel disable.rtc.alarm - if [ ! -e /etc/wpa_supplicant/wpa_supplicant.conf ]; then - cp /etc/wpa_supplicant/wpa_supplicant.conf.template /etc/wpa_supplicant/wpa_supplicant.conf - fi - echo 1 > /sys/devices/platform/mxc_dvfs_core.0/enable - /sbin/hwclock -s -u -) & +( + /usr/local/Kobo/pickel disable.rtc.alarm -if [ ! -e /usr/local/Kobo/platforms/libkobo.so ]; then - export QWS_KEYBOARD=imx508kbd:/dev/input/event0 - export QT_PLUGIN_PATH=/usr/local/Kobo/plugins - if [ -e /usr/local/Kobo/plugins/gfxdrivers/libimxepd.so ]; then - export QWS_DISPLAY=imxepd - else - export QWS_DISPLAY=Transformed:imx508:Rot90 - export QWS_MOUSE_PROTO="tslib_nocal:/dev/input/event1" - fi - /usr/local/Kobo/hindenburg & - /usr/local/Kobo/nickel -qws -skipFontLoad + if [ ! -e "/etc/wpa_supplicant/wpa_supplicant.conf" ] ; then + cp "/etc/wpa_supplicant/wpa_supplicant.conf.template" "/etc/wpa_supplicant/wpa_supplicant.conf" + fi + + # FWIW, that appears to be gone from recent rcS scripts. AFAICT, still harmless, though. + echo 1 > "/sys/devices/platform/mxc_dvfs_core.0/enable" + + /sbin/hwclock -s -u +) & + +if [ ! -e "/usr/local/Kobo/platforms/libkobo.so" ] ; then + export QWS_KEYBOARD="imx508kbd:/dev/input/event0" + export QT_PLUGIN_PATH="/usr/local/Kobo/plugins" + if [ -e "/usr/local/Kobo/plugins/gfxdrivers/libimxepd.so" ] ; then + export QWS_DISPLAY="imxepd" + else + export QWS_DISPLAY="Transformed:imx508:Rot90" + export QWS_MOUSE_PROTO="tslib_nocal:/dev/input/event1" + fi + /usr/local/Kobo/hindenburg > /dev/null 2>&1 & + /usr/local/Kobo/nickel -qws -skipFontLoad > /dev/null 2>&1 & else - /usr/local/Kobo/hindenburg & - 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 + /usr/local/Kobo/hindenburg > /dev/null 2>&1 & + lsmod | grep -q lowmem || insmod "/drivers/${PLATFORM}/misc/lowmem.ko" & + if grep -q "dhcpcd=true" "/mnt/onboard/.kobo/Kobo/Kobo eReader.conf" ; then + dhcpcd -d -t 10 & + fi + /usr/local/Kobo/nickel -platform kobo -skipFontLoad > /dev/null 2>&1 & fi + +# Rotation weirdness, part II +echo "${cur_rotate}" > "/sys/class/graphics/fb0/rotate" +cat "/sys/class/graphics/fb0/rotate" > "/sys/class/graphics/fb0/rotate" + +return 0 diff --git a/platform/kobo/suspend.sh b/platform/kobo/suspend.sh index 5d460b8fb..4b7f65f79 100644 --- a/platform/kobo/suspend.sh +++ b/platform/kobo/suspend.sh @@ -1,7 +1,7 @@ #!/bin/sh -export PATH=$PATH:/sbin:/usr/sbin +export PATH="${PATH}:/sbin:/usr/sbin" -#disable wifi +# disable wifi if lsmod | grep -q sdio_wifi_pwr ; then wlarm_le -i eth0 down ifconfig eth0 down @@ -9,7 +9,7 @@ if lsmod | grep -q sdio_wifi_pwr ; then rmmod -r sdio_wifi_pwr fi -#go to sleep +# go to sleep sync echo 1 > /sys/power/state-extended echo mem > /sys/power/state