mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
1. Make "-d" switch passed to reader.lua enable all debugging 2. Enable debugging for now (development stage) to preserve the current behaviour. But for the production release I advise to: a) disable it by not passing "-d" and b) redirect standard output (not just standard error) of reader.lua to crash.log in kpdf.sh 3. Comment out debug printf()s in pdf.c
38 lines
896 B
Bash
Executable File
38 lines
896 B
Bash
Executable File
#!/bin/sh
|
|
export LC_ALL="en_US.UTF-8"
|
|
|
|
echo unlock > /proc/keypad
|
|
echo unlock > /proc/fiveway
|
|
|
|
# we're always starting from our working directory
|
|
cd /mnt/us/kindlepdfviewer/
|
|
|
|
# bind-mount system fonts
|
|
if ! grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
|
|
mount -o bind /usr/java/lib/fonts /mnt/us/kindlepdfviewer/fonts/host
|
|
fi
|
|
|
|
# check if we are supposed to shut down the Amazon framework
|
|
if test "$1" == "--framework_stop"; then
|
|
shift 1
|
|
/etc/init.d/framework stop
|
|
fi
|
|
|
|
# stop cvm
|
|
killall -stop cvm
|
|
|
|
# finally call reader
|
|
./reader.lua -d "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log
|
|
|
|
# unmount system fonts
|
|
if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
|
|
umount /mnt/us/kindlepdfviewer/fonts/host
|
|
fi
|
|
|
|
# always try to continue cvm
|
|
killall -cont cvm || /etc/init.d/framework start
|
|
|
|
# cleanup hanging process
|
|
killall lipc-wait-event
|
|
|