forked from koreader/kpvbooklet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.ffs
executable file
·70 lines (57 loc) · 1.92 KB
/
install.ffs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/bin/bash
OTA=com.lab126.blanket.ota
progress()
{
lipc-send-event $OTA otaSplashProgress -i $1
local x=48
local y=11
eips 0 $y " ";
eips $((($x - $(expr length "$2")) / 2)) $y "$2"
sleep 3
}
fail()
{
lipc-send-event $OTA otaSplashError -s "${1}"
sleep 10
exit 1;
}
VERSION=`cut -d ' ' -f 2 /etc/prettyversion.txt`
[ "$VERSION" \< "5.1.2" ] && fail "Unsupported firmware version" "$VERSION"
progress 10 "Mounting r/w"
mntroot rw || fail "Unable to mount r/w"
progress 20 "Installing KPVBooklet.jar"
cp KPVBooklet.jar /opt/amazon/ebook/booklet/ || fail "Unable to copy KPVBooklet.jar"
if [ "$VERSION" == "5.1.2" ]; then
progress 30 "Installing new extractors"
export IFS=";"
dest_exts="djvu;epub;cbz;chm;doc;fb2;htm;html;pdb;rtf;tcr;xps;zip"
txt_dir="/etc/kdb/system/daemon/scanner/extractors/7"
dest_dir="/etc/kdb/system/daemon/scanner/extractors/"
i=20
for ext in $dest_exts; do
cp -rfT $txt_dir "$dest_dir$i"
sed -i "s/txt/$ext/g" "$dest_dir$i/glob"
i=`expr $i + 1`
done
fi
progress 40 "Updating appreg.db"
sqlite3 /var/local/appreg.db < mimes.install.sql
if [ "$VERSION" \> "5.6" ]; then
WHISPERTOUCH=`sqlite3 /var/local/appreg.db .dump|grep "'whisper-touch','supported'"|wc -l`
if [ "$WHISPERTOUCH" \> 0 ]; then
progress 50 "Enable whisper touch for Kindle Voyage"
sqlite3 /var/local/appreg.db < whispertouch.install.sql
fi
fi
if [ "$VERSION" \> "5.4" ]; then
progress 70 "Creating the userstore exec flag file"
touch "/MNTUS_EXEC"
fi
progress 80 "Installing KUAL Extension"
mkdir -p /mnt/us/extensions/kpvbooklet/bin
cp extensions/kpvbooklet/bin/booklet.sh /mnt/us/extensions/kpvbooklet/bin/
cp extensions/kpvbooklet/config.xml /mnt/us/extensions/kpvbooklet
cp extensions/kpvbooklet/menu.json /mnt/us/extensions/kpvbooklet || fail "Unable to copy KUAL Extension"
progress 90 "Mounting ro"
mntroot ro || fail "Unable to mount ro"
progress 100 "Installation complete."