From 641339049063be26bc600092ec73048bb5585018 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 21 Feb 2016 16:07:26 +0100 Subject: [PATCH 1/4] Make Amazon's additional CJK fonts available to us Should be a no-op on systems which don't have any. Fix #1802 --- platform/kindle/koreader.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index c39f1e1df..068e6be1f 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -147,6 +147,15 @@ if [ -d /mnt/us/fonts ] ; then fi fi +# bind-mount csp fonts +if [ -d /var/local/font/mnt ] ; then + mkdir -p ${KOREADER_DIR}/fonts/cspfonts + if ! grep ${KOREADER_DIR}/fonts/cspfonts /proc/mounts > /dev/null 2>&1 ; then + logmsg "Mounting cspfonts . . ." + mount -o bind /var/local/font/mnt ${KOREADER_DIR}/fonts/cspfonts + fi +fi + # bind-mount linkfonts if [ -d /mnt/us/linkfonts/fonts ] ; then mkdir -p ${KOREADER_DIR}/fonts/linkfonts @@ -235,6 +244,12 @@ if grep ${KOREADER_DIR}/fonts/altfonts /proc/mounts > /dev/null 2>&1 ; then umount ${KOREADER_DIR}/fonts/altfonts fi +# unmount cspfonts +if grep ${KOREADER_DIR}/fonts/cspfonts /proc/mounts > /dev/null 2>&1 ; then + logmsg "Unmounting cspfonts . . ." + umount ${KOREADER_DIR}/fonts/cspfonts +fi + # unmount linkfonts if grep ${KOREADER_DIR}/fonts/linkfonts /proc/mounts > /dev/null 2>&1 ; then logmsg "Unmounting linkfonts . . ." From d3333fe81d12805e8738d7b0435f232da384b536 Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 21 Feb 2016 16:18:05 +0100 Subject: [PATCH 2/4] Prevent the status bar clock from peeking out... When launched from KUAL on FW >= 5.7.2 --- platform/kindle/koreader.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 068e6be1f..42d2cf3e1 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -41,6 +41,7 @@ if [ "${INIT_TYPE}" == "upstart" ] ; then fi # Keep track of what we do with pillow... +AWESOME_STOPPED="no" PILLOW_HARD_DISABLED="no" PILLOW_SOFT_DISABLED="no" @@ -193,6 +194,12 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then logmsg "Disabling pillow . . ." lipc-set-prop com.lab126.pillow disableEnablePillow disable PILLOW_HARD_DISABLED="yes" + # NOTE: And, oh, joy, on FW >= 5.7.2, this is not enough to prevent the clock from refreshing, so, take the bull by the horns, and SIGSTOP the WM while we run... + if [ "$(printf "%.3s" $(grep '^Kindle 5' /etc/prettyversion.txt 2>&1 | sed -n -r 's/^(Kindle)([[:blank:]]*)([[:digit:].]*)(.*?)$/\3/p' | tr -d '.'))" -ge "572" ] ; then + logmsg "Stopping awesome . . ." + killall -stop awesome + AWESOME_STOPPED="yes" + fi else logmsg "Hiding the status bar . . ." # NOTE: One more great find from eureka (http://www.mobileread.com/forums/showpost.php?p=2454141&postcount=34) @@ -277,7 +284,11 @@ fi # Display chrome bar if need be (upstart & framework up only) if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then - # Depending on the FW version, we may have handled things in two different manners... + # Depending on the FW version, we may have handled things in a few different manners... + if [ "${AWESOME_STOPPED}" == "yes" ] ; then + logmsg "Resuming awesome . . ." + killall -cont awesome + fi if [ "${PILLOW_HARD_DISABLED}" == "yes" ] ; then logmsg "Enabling pillow . . ." lipc-set-prop com.lab126.pillow disableEnablePillow enable From af743d106e9337a1984c5d8f96aadf4e560030ee Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 21 Feb 2016 16:27:07 +0100 Subject: [PATCH 3/4] When started from KUAL on FW >= 5.6.5... try to refresh the screen with more useful stuff on exit. And because I forgot in my last commit, the issue was reported here: http://www.mobileread.com/forums/showpost.php?p=3258045&postcount=903 --- platform/kindle/koreader.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index 42d2cf3e1..e91526206 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -292,6 +292,8 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then if [ "${PILLOW_HARD_DISABLED}" == "yes" ] ; then logmsg "Enabling pillow . . ." lipc-set-prop com.lab126.pillow disableEnablePillow enable + # NOTE: Try to leave the user with a slightly less FB content that our own last screen... We'll be missing the menu & status bar, but it's better than the alternative... + lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home fi if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then logmsg "Restoring the status bar . . ." From 693e732a718b9375cf5ccaaaa2200b3d22ad37fb Mon Sep 17 00:00:00 2001 From: NiLuJe Date: Sun, 21 Feb 2016 16:36:05 +0100 Subject: [PATCH 4/4] Fix exit when running from KUAL on FW >= 5.6.5 Properly refresh the screen with useful stuff, instead of leaving us hanging with an unusable mix of framework and our own crap. --- platform/kindle/koreader.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/kindle/koreader.sh b/platform/kindle/koreader.sh index e91526206..61e871407 100755 --- a/platform/kindle/koreader.sh +++ b/platform/kindle/koreader.sh @@ -190,10 +190,12 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then if [ "$count" == "" -o "$count" == "0" ] ; then # NOTE: We want to disable the status bar (at the very least). Unfortunately, the soft hide/unhide method doesn't work properly anymore since FW 5.6.5... if [ "$(printf "%.3s" $(grep '^Kindle 5' /etc/prettyversion.txt 2>&1 | sed -n -r 's/^(Kindle)([[:blank:]]*)([[:digit:].]*)(.*?)$/\3/p' | tr -d '.'))" -ge "565" ] ; then + PILLOW_HARD_DISABLED="yes" + # NOTE: Dump the fb so we can restore something useful on exit... + cat /dev/fb0 > /var/tmp/koreader-fb.dump # FIXME: So we resort to killing pillow completely on FW >= 5.6.5... logmsg "Disabling pillow . . ." lipc-set-prop com.lab126.pillow disableEnablePillow disable - PILLOW_HARD_DISABLED="yes" # NOTE: And, oh, joy, on FW >= 5.7.2, this is not enough to prevent the clock from refreshing, so, take the bull by the horns, and SIGSTOP the WM while we run... if [ "$(printf "%.3s" $(grep '^Kindle 5' /etc/prettyversion.txt 2>&1 | sed -n -r 's/^(Kindle)([[:blank:]]*)([[:digit:].]*)(.*?)$/\3/p' | tr -d '.'))" -ge "572" ] ; then logmsg "Stopping awesome . . ." @@ -292,7 +294,11 @@ if [ "${STOP_FRAMEWORK}" == "no" -a "${INIT_TYPE}" == "upstart" ] ; then if [ "${PILLOW_HARD_DISABLED}" == "yes" ] ; then logmsg "Enabling pillow . . ." lipc-set-prop com.lab126.pillow disableEnablePillow enable - # NOTE: Try to leave the user with a slightly less FB content that our own last screen... We'll be missing the menu & status bar, but it's better than the alternative... + # NOTE: Try to leave the user with a slightly more useful FB content than our own last screen... + cat /var/tmp/koreader-fb.dump > /dev/fb0 + rm -f /var/tmp/koreader-fb.dump + # NOTE: In case we ever need an extra full flash refresh... + #eips -s w=${SCREEN_X_RES},h=${SCREEN_Y_RES} -f lipc-set-prop com.lab126.appmgrd start app://com.lab126.booklet.home fi if [ "${PILLOW_SOFT_DISABLED}" == "yes" ] ; then