Skip to content

Commit

Permalink
Merge 88ec089 into 1461574
Browse files Browse the repository at this point in the history
  • Loading branch information
pazos committed Apr 6, 2017
2 parents 1461574 + 88ec089 commit 006478d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions platform/kobo/koreader.sh
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,20 @@ fi
# we keep maximum 500K worth of crash log
cat crash.log 2> /dev/null | tail -c 500000 > crash.log.new
mv -f crash.log.new crash.log

# TODO: add support for 32bit framebuffer in koreader. This is a workaround
# to run koreader in 16bpp. Useful since FW 4.0
FB_BPP=$(cat /sys/class/graphics/fb0/bits_per_pixel)
[ "$FB_BPP" -gt 16 ] && /usr/sbin/fbset -depth 16
# fix rotation issues on Kobo Aura HD (dragon) and Kobo Aura H2O (dahlia)
case "$PRODUCT" in "dragon" | "dahlia" ) cat /sys/class/graphics/fb0/rotate > /sys/class/graphics/fb0/rotate ;; esac

./reader.lua "${args}" >> crash.log 2>&1
RESULT=$?

# back to default depth in framebuffer.
[ "$FB_BPP" -gt 16 ] && /usr/sbin/fbset -depth "$FB_BPP"

if [ "${FROM_NICKEL}" = "true" ] ; then
if [ "${FROM_KFMON}" != "true" ] ; then
# start kobo software because it was running before koreader
Expand All @@ -128,15 +139,15 @@ if [ "${FROM_NICKEL}" = "true" ] ; then
else
# By default, if we were called from KFMon, just reboot, because there might be a chance Nickel will get its panties in a serious twist on restore for one reason or another...
# And at best, we'd still restart with slightly broken suspend behavior anyway...
reboot
/sbin/reboot
fi
fi
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 or a KSM-related script is running:
# This might lead to false-positives if you use neither KSM nor advboot to launch KOReader *without nickel running*.
if ! pgrep -f kbmenu > /dev/null 2>&1 ; then
reboot
/sbin/reboot
fi
fi

Expand Down

0 comments on commit 006478d

Please sign in to comment.