2011-12-08 23:11:23 +00:00
|
|
|
#!/bin/sh
|
2012-03-08 11:29:30 +00:00
|
|
|
export LC_ALL="en_US.UTF-8"
|
2012-03-08 11:23:17 +00:00
|
|
|
|
2011-11-26 15:19:38 +00:00
|
|
|
echo unlock > /proc/keypad
|
|
|
|
echo unlock > /proc/fiveway
|
2012-04-06 05:51:37 +00:00
|
|
|
|
2012-04-16 22:12:19 +00:00
|
|
|
# we're always starting from our working directory
|
2012-04-09 10:29:13 +00:00
|
|
|
cd /mnt/us/kindlepdfviewer/
|
2012-04-09 17:13:35 +00:00
|
|
|
|
2012-04-16 22:12:19 +00:00
|
|
|
# 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
|
2012-04-09 17:13:35 +00:00
|
|
|
|
2012-04-16 22:12:19 +00:00
|
|
|
# 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
|
2012-04-16 20:13:21 +00:00
|
|
|
|
2012-04-18 11:43:55 +00:00
|
|
|
# stop cvm
|
|
|
|
killall -stop cvm
|
|
|
|
|
2012-04-16 22:12:19 +00:00
|
|
|
# finally call reader
|
2012-04-13 21:53:36 +00:00
|
|
|
./reader.lua "$1" 2> /mnt/us/kindlepdfviewer/crash.log || cat /mnt/us/kindlepdfviewer/crash.log
|
2012-04-06 05:51:37 +00:00
|
|
|
|
2012-04-16 22:12:19 +00:00
|
|
|
# unmount system fonts
|
|
|
|
if grep /mnt/us/kindlepdfviewer/fonts/host /proc/mounts; then
|
|
|
|
umount /mnt/us/kindlepdfviewer/fonts/host
|
|
|
|
fi
|
2012-04-09 17:13:35 +00:00
|
|
|
|
2012-04-16 20:13:21 +00:00
|
|
|
# always try to continue cvm
|
|
|
|
killall -cont cvm || /etc/init.d/framework start
|
|
|
|
|
|
|
|
# cleanup hanging process
|
|
|
|
killall lipc-wait-event
|
|
|
|
|