From c6a3f9002c799cf69a5d6eb9569b2408ad301235 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 19:11:47 +0200 Subject: [PATCH 01/20] Tweak the H2O viewport to make it pixel-perfect. As confirmed by checking a fb dump via fbgrab, and nickel's broken cropping of screenshots ;). --- frontend/device/kobo/device.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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: From 2fe8dc40d7d0ec0371cadaf00b1f7f7016b9ea7c Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 19:14:14 +0200 Subject: [PATCH 02/20] Fix eips centering on the KV For some strange reason, eips relies on the virtual xres on FW 5.x --- platform/kindle/libkohelper.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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. From 50dbf6b58135d0a00da44b976c6483fd3e3d0372 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 20:07:17 +0200 Subject: [PATCH 03/20] Switch a few widgets to ui refresh modes More closely matches native behavior on REAGL devices. Closing those widgets should still trigger a partial refresh though, because we usually get back to the reader, and text, so we want REAGL ;). --- frontend/apps/opdscatalog/opdscatalog.lua | 2 +- frontend/apps/reader/modules/readerbookmark.lua | 2 +- frontend/apps/reader/modules/readercropping.lua | 2 +- frontend/apps/reader/modules/readerfooter.lua | 2 +- frontend/ui/widget/button.lua | 4 ++-- frontend/ui/widget/buttondialog.lua | 2 +- frontend/ui/widget/configdialog.lua | 6 +++--- frontend/ui/widget/confirmbox.lua | 2 +- frontend/ui/widget/dictquicklookup.lua | 2 +- frontend/ui/widget/iconbutton.lua | 4 ++-- frontend/ui/widget/infomessage.lua | 2 +- frontend/ui/widget/inputdialog.lua | 2 +- frontend/ui/widget/inputtext.lua | 2 +- frontend/ui/widget/linkbox.lua | 2 +- frontend/ui/widget/menu.lua | 4 ++-- frontend/ui/widget/notification.lua | 2 +- frontend/ui/widget/toggleswitch.lua | 2 +- frontend/ui/widget/touchmenu.lua | 8 ++++---- frontend/ui/widget/virtualkeyboard.lua | 1 + 19 files changed, 27 insertions(+), 26 deletions(-) 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/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..bad95012e 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() 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..c9c3e24b3 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 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) From c847807322d195595b5ccd07ed57b5fab26c99ea Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 20:10:18 +0200 Subject: [PATCH 04/20] Turns out that also looks better as ui refreshes --- frontend/ui/widget/menu.lua | 2 +- frontend/ui/widget/touchmenu.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/ui/widget/menu.lua b/frontend/ui/widget/menu.lua index bad95012e..e7b6cbe92 100644 --- a/frontend/ui/widget/menu.lua +++ b/frontend/ui/widget/menu.lua @@ -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/touchmenu.lua b/frontend/ui/widget/touchmenu.lua index c9c3e24b3..136c8e910 100644 --- a/frontend/ui/widget/touchmenu.lua +++ b/frontend/ui/widget/touchmenu.lua @@ -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 From 6f815e2bdfd18f0b416223baede0de05bbc038d9 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 20:46:30 +0200 Subject: [PATCH 05/20] Minor pass of cleanup of the Kobo scripts. re #1503 --- platform/kobo/fmon/koreader.sh | 2 +- platform/kobo/koreader.sh | 83 ++++++++++++++++++---------------- platform/kobo/nickel.sh | 60 ++++++++++++------------ platform/kobo/suspend.sh | 6 +-- 4 files changed, 79 insertions(+), 72 deletions(-) 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..00b7d9a20 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,55 @@ 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 + # stop kobo software because is 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 +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 + 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 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 + if [ -d "/mnt/onboard/.kobo/advboot" ] ; then + # NOTE: ! pkill -0 ksmhome.sh is too drastic, it doesn't account for people running neither KSM nor advboot + #if ! pkill -0 ksmhome.sh ; then + reboot + fi fi diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 58a3baa20..5ca147398 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -4,40 +4,42 @@ 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: - -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: + +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" # 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 "/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 +) & -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 "/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 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 & + insmod "/drivers/ntx508/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 fi 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 From a736a571d221993c410da36bdcd8a1a2bde3f0fa Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 20:48:40 +0200 Subject: [PATCH 06/20] Same pkill trick as the Kobo scripts Only here to satisfy my OCD ;p --- platform/kindle/koreader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 194587368257fba7db56800a8aeed7b4ff54d4c0 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 20:51:35 +0200 Subject: [PATCH 07/20] Tweak the comment a bit --- platform/kobo/koreader.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 00b7d9a20..63cc18af6 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -76,7 +76,7 @@ if [ "${from_nickel}" == "true" ] ; then else # if we were called from advboot then we must reboot to go to the menu if [ -d "/mnt/onboard/.kobo/advboot" ] ; then - # NOTE: ! pkill -0 ksmhome.sh is too drastic, it doesn't account for people running neither KSM nor advboot + # FIXME: This is not precise enough, cf. #1503; but that alternate proposition is way too drastic, it doesn't account for people running neither KSM nor advboot #if ! pkill -0 ksmhome.sh ; then reboot fi From c2bd85bba40e4c6e741af7321c73685e32bfa555 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 22:09:14 +0200 Subject: [PATCH 08/20] More Kobo scripts tweak... Trying to figure out why nickel deadlocks on restart... --- platform/kobo/koreader.sh | 6 ++---- platform/kobo/nickel.sh | 29 +++++++++++++++++++++++------ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 63cc18af6..78f34fe32 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -72,12 +72,10 @@ fi if [ "${from_nickel}" == "true" ] ; then # start kobo software because was running before koreader - ./nickel.sh + ./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 - # FIXME: This is not precise enough, cf. #1503; but that alternate proposition is way too drastic, it doesn't account for people running neither KSM nor advboot - #if ! pkill -0 ksmhome.sh ; then + if ! pkill -0 ksmhome.sh ; then reboot fi fi diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 5ca147398..8d92bb449 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -1,17 +1,30 @@ #!/bin/sh -PATH=$PATH:/usr/sbin:/sbin +PATH="${PATH}:/usr/sbin:/sbin" + +# 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" +INTERFACE="wlan0" +WIFI_MODULE="ar6000" +if [ "${PLATFORM}" != "freescale" ] ; then + INTERFACE="eth0" + WIFI_MODULE="dhd" +fi +export INTERFACE +export WIFI_MODULE + export NICKEL_HOME="/mnt/onboard/.kobo" export LD_LIBRARY_PATH="/usr/local/Kobo" +export WIFI_MODULE_PATH="/drivers/${PLATFORM}/wifi/${WIFI_MODULE}.ko" +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) @@ -27,7 +40,7 @@ export LD_LIBRARY_PATH="/usr/local/Kobo" 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 + if [ -e "/usr/local/Kobo/plugins/gfxdrivers/libimxepd.so" ] ; then export QWS_DISPLAY="imxepd" else export QWS_DISPLAY="Transformed:imx508:Rot90" @@ -37,9 +50,13 @@ if [ ! -e "/usr/local/Kobo/platforms/libkobo.so" ] ; then /usr/local/Kobo/nickel -qws -skipFontLoad else /usr/local/Kobo/hindenburg & - insmod "/drivers/ntx508/misc/lowmem.ko" & + 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 fi + +# Rotation weirdness, part II +echo "${cur_rotate}" > "/sys/class/graphics/fb0/rotate" +cat "/sys/class/graphics/fb0/rotate" > "/sys/class/graphics/fb0/rotate" From 6c1681b595911a488bfdbcdc23f5cab2aca33fff Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 22:46:16 +0200 Subject: [PATCH 09/20] Well, go for the lesser evil. For some unknowable reason, restarting nickel on exit deadlocks on my H2O, so, do a full reboot instead, at least *that* works. I'm probably one of the only people running KO manually anyway... --- platform/kobo/koreader.sh | 9 +++++++-- platform/kobo/nickel.sh | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 78f34fe32..fe4d51468 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -71,8 +71,13 @@ fi ./reader.lua "${args}" 2> crash.log if [ "${from_nickel}" == "true" ] ; then - # start kobo software because was running before koreader - ./nickel.sh & + # start kobo software because it was running before koreader + #./nickel.sh & + + # FIXME: This appears to be horribly broken: nickel restarts, but deadlocks instantly (requiring a paperclip to reset...). + # So, eff it, and just reboot instead, that barely takes more time anyway. + # NOTE: H2O, 3.13.1 + reboot else # if we were called from advboot then we must reboot to go to the menu if ! pkill -0 ksmhome.sh ; then diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 8d92bb449..d520c28c5 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -29,7 +29,8 @@ export LANG="en_US.UTF-8" # 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 +( + /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 From 97ad4afa929614ebfbb35a533f4ed3c6da5a99fc Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 22:54:44 +0200 Subject: [PATCH 10/20] Minor comment tweak --- platform/kobo/koreader.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index fe4d51468..48abbb2dd 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -74,9 +74,9 @@ if [ "${from_nickel}" == "true" ] ; then # start kobo software because it was running before koreader #./nickel.sh & - # FIXME: This appears to be horribly broken: nickel restarts, but deadlocks instantly (requiring a paperclip to reset...). + # FIXME: This appears to be horribly broken: nickel restarts, but deadlocks instantly (requiring a paperclip to reboot...). # So, eff it, and just reboot instead, that barely takes more time anyway. - # NOTE: H2O, 3.13.1 + # NOTE: H2O, 3.12.1 reboot else # if we were called from advboot then we must reboot to go to the menu From bb6b21fe2301f72b9d935f665876ed06d262a51c Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 22:56:03 +0200 Subject: [PATCH 11/20] Update base --- base | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base b/base index fb548638a..bebfc78ed 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit fb548638a9ea6c5d498153e357f9111f338ce6fc +Subproject commit bebfc78edcc359a663aaec6dccf36530dd7b0492 From 476ae3322cf349f8c57829f4d2c8a2e1849a3e21 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 26 Apr 2015 23:42:59 +0200 Subject: [PATCH 12/20] sync before killing nickel Hopefully good enough to avoid trashing the DB --- platform/kobo/koreader.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 48abbb2dd..174766da6 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -35,7 +35,9 @@ if pkill -0 nickel ; then fi if [ "${from_nickel}" == "true" ] ; then - # stop kobo software because is running + # 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 From d4f80209d957c69ba2a7f52aad44b39708bd9679 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 00:01:44 +0200 Subject: [PATCH 13/20] Minor comment tweak --- platform/kobo/nickel.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index d520c28c5..b30b59d7d 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -31,10 +31,14 @@ export LANG="en_US.UTF-8" ( /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 + + # 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 ) & From 7db252a27eba5746074ea6128a13b7f39dbb5f3f Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 01:21:54 +0200 Subject: [PATCH 14/20] More Kobo startup scripts tweaks... --- platform/kobo/koreader.sh | 14 +++++++++++++- platform/kobo/nickel.sh | 20 +++++++++++--------- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 174766da6..29d7dfe88 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -35,6 +35,12 @@ if pkill -0 nickel ; then fi 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 + # Keep the dbus session around, and remember it for later... + #export DBUS_SESSION_BUS_ADDRESS="$(xargs -n 1 -0 < /proc/$(pidof nickel)/environ | sed -n 's/^DBUS_SESSION_BUS_ADDRESS=\(.*\)/\1/p')" + # flush disks, might help avoid trashing nickel's DB... sync # stop kobo software because it's running @@ -48,7 +54,13 @@ else args="$@" fi -# check whether PLATFORM has a value assigned by rcS +# 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 + # PLATFORM is used in koreader for the path to the WiFi drivers if [ ! -n "${PLATFORM}" ] ; then PLATFORM="freescale" diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index b30b59d7d..23460a138 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -1,5 +1,5 @@ #!/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")" @@ -9,19 +9,21 @@ cur_rotate="$(cat "/sys/class/graphics/fb0/rotate")" # environment needed by nickel, from /etc/init.d/rcS: -INTERFACE="wlan0" -WIFI_MODULE="ar6000" -if [ "${PLATFORM}" != "freescale" ] ; then - INTERFACE="eth0" - WIFI_MODULE="dhd" +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 INTERFACE -export WIFI_MODULE export NICKEL_HOME="/mnt/onboard/.kobo" export LD_LIBRARY_PATH="/usr/local/Kobo" -export WIFI_MODULE_PATH="/drivers/${PLATFORM}/wifi/${WIFI_MODULE}.ko" export LANG="en_US.UTF-8" From f259ec42595eba7041054cd3e1953dd7d05cbdf2 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 01:22:10 +0200 Subject: [PATCH 15/20] Wipe dead code --- platform/kobo/koreader.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 29d7dfe88..9b8918fd2 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -38,8 +38,6 @@ 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 - # Keep the dbus session around, and remember it for later... - #export DBUS_SESSION_BUS_ADDRESS="$(xargs -n 1 -0 < /proc/$(pidof nickel)/environ | sed -n 's/^DBUS_SESSION_BUS_ADDRESS=\(.*\)/\1/p')" # flush disks, might help avoid trashing nickel's DB... sync From 218d8b3e54cb73b5a8d4f71bc5acc1d43b9e4b20 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 01:24:24 +0200 Subject: [PATCH 16/20] More comments... --- platform/kobo/nickel.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index 23460a138..d5efe2367 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -45,6 +45,7 @@ export LANG="en_US.UTF-8" ) & if [ ! -e "/usr/local/Kobo/platforms/libkobo.so" ] ; then + # FIXME: Should we really bother with the QWS_* stuff? 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 @@ -64,6 +65,7 @@ else /usr/local/Kobo/nickel -platform kobo -skipFontLoad fi +# FIXME: Is this even reachable? (i.e., does nickel fork in the bg?) # Rotation weirdness, part II echo "${cur_rotate}" > "/sys/class/graphics/fb0/rotate" cat "/sys/class/graphics/fb0/rotate" > "/sys/class/graphics/fb0/rotate" From 7fd45c6cd3c6c9930e026ac3e963b03ac9a3ec6d Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 01:59:50 +0200 Subject: [PATCH 17/20] And even more Kobo startup script tweaks. Good news: restarting nickel doesn't deadlock anymore. Yay. --- platform/kobo/koreader.sh | 9 +++------ platform/kobo/nickel.sh | 12 ++++++------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 9b8918fd2..2d60d50e9 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -84,15 +84,12 @@ fi if [ "${from_nickel}" == "true" ] ; then # start kobo software because it was running before koreader - #./nickel.sh & - - # FIXME: This appears to be horribly broken: nickel restarts, but deadlocks instantly (requiring a paperclip to reboot...). - # So, eff it, and just reboot instead, that barely takes more time anyway. - # NOTE: H2O, 3.12.1 - reboot + ./nickel.sh & else # if we were called from advboot then we must reboot to go to the menu if ! pkill -0 ksmhome.sh ; then reboot fi fi + +return 0 diff --git a/platform/kobo/nickel.sh b/platform/kobo/nickel.sh index d5efe2367..024607631 100644 --- a/platform/kobo/nickel.sh +++ b/platform/kobo/nickel.sh @@ -45,7 +45,6 @@ export LANG="en_US.UTF-8" ) & if [ ! -e "/usr/local/Kobo/platforms/libkobo.so" ] ; then - # FIXME: Should we really bother with the QWS_* stuff? 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 @@ -54,18 +53,19 @@ if [ ! -e "/usr/local/Kobo/platforms/libkobo.so" ] ; then 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 + /usr/local/Kobo/hindenburg > /dev/null 2>&1 & + /usr/local/Kobo/nickel -qws -skipFontLoad > /dev/null 2>&1 & else - /usr/local/Kobo/hindenburg & + /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 + /usr/local/Kobo/nickel -platform kobo -skipFontLoad > /dev/null 2>&1 & fi -# FIXME: Is this even reachable? (i.e., does nickel fork in the bg?) # 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 From 2d07ec8a9da206c0eaeaeb6915b18e50a7531b36 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 02:19:04 +0200 Subject: [PATCH 18/20] Handle snapshot tarballs w/ KUAL manual update It only handled release zips so far. --- .../extensions/koreader/bin/koreader-ext.sh | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/platform/kindle/extensions/koreader/bin/koreader-ext.sh b/platform/kindle/extensions/koreader/bin/koreader-ext.sh index 6c6712cdd..69073ee84 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" -xf "${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... From 8661194b79fd9d5e2b63b881c2b32223b15494b1 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 02:21:28 +0200 Subject: [PATCH 19/20] Nice typo bro! --- platform/kindle/extensions/koreader/bin/koreader-ext.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform/kindle/extensions/koreader/bin/koreader-ext.sh b/platform/kindle/extensions/koreader/bin/koreader-ext.sh index 69073ee84..1711b30e0 100755 --- a/platform/kindle/extensions/koreader/bin/koreader-ext.sh +++ b/platform/kindle/extensions/koreader/bin/koreader-ext.sh @@ -77,7 +77,7 @@ update_koreader() # Install it! logmsg "Updating to KOReader ${koreader_pkg_ver} . . ." if [ "${koreader_pkg_type}" == "tgz" ] ; then - tar -C "/mnt/us" -xf "${found_koreader_package}" + tar -C "/mnt/us" -xzf "${found_koreader_package}" else unzip -q -o "${found_koreader_package}" -d "/mnt/us" fi From a99359fa448f04663a0c88b888fc41a8cb41cf45 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Mon, 27 Apr 2015 02:33:31 +0200 Subject: [PATCH 20/20] Add a comment to explicit the KSM check --- platform/kobo/koreader.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/kobo/koreader.sh b/platform/kobo/koreader.sh index 2d60d50e9..733db0d79 100755 --- a/platform/kobo/koreader.sh +++ b/platform/kobo/koreader.sh @@ -87,6 +87,8 @@ if [ "${from_nickel}" == "true" ] ; then ./nickel.sh & else # 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