Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workaround to support new kobo firmwares (+4.0) without needing KSM8 #2731

Merged
merged 2 commits into from
Apr 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From KSM this actually "cause". There was some stuff about this on c2bd85b#commitcomment-12846700

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? (It does with KSM.)

case "$PRODUCT" in "dragon" | "dahlia" )
	cur_rotate="$(cat "/sys/class/graphics/fb0/rotate")"
	echo "${cur_rotate}" > "/sys/class/graphics/fb0/rotate"
	cat "/sys/class/graphics/fb0/rotate" > "/sys/class/graphics/fb0/rotate"
	;;
esac

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