forked from OlegKyiashko/RK29kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
batchImgRepack.sh
executable file
·99 lines (80 loc) · 1.65 KB
/
batchImgRepack.sh
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
#set -vx
#settings for auto fix
mymodel="CUBE U9GT 2"
myopt="quiet"
mysystem=400
mysystemfs="ext3"
mycache=64
myuserdata=2048
usage(){
echo Usage:
echo $0 path_to_image/file.img
}
if [ "x$1" == "x" ]
then
usage
exit 1
fi
BASEDIR=`dirname $0`
pushd "$BASEDIR"
BASEDIR=`pwd`
popd
WORKDIR=`dirname $1`
pushd "$WORKDIR"
WORKDIR=`pwd`"/"
popd
BINDIR="${BASEDIR}/bin"
LOGFILE="${BASEDIR}/log"
PLUGINS="${BASEDIR}/plugins"
PATH="${BINDIR}":$PATH
export BASEDIR WORKDIR BINDIR LOGFILE PATH PLUGINS
trap "rm -f $tempfile" 0 1 2 5 15
declare MENUITEM
declare FUNCTION
rm "${LOGFILE}"
touch "${LOGFILE}"
chmod +x "${BINDIR}/"*
for file in `ls -1 "${PLUGINS}"/[0-9][0-9]\.*\.sh`
do
chmod +x $file
source $file
done
cd "${WORKDIR}"
workdir_Test
if [ ${WORKTYPE} -ne 4 ]
then
usage
exit 1
fi
#unpack img
extractImage_ExtractImgFile $1
#parse && edit parameter file
PARAMFILE="parameter"
parameter_Parse
if [ ${PARAMFILEPARSED} -ne 1 ]
then
return
fi
parameter_Edit "$mymodel" "$myopt" $mysystem $mycache $myuserdata
parameter_Make
resizeSystem_Process $[$mysystem-1] "$mysystemfs"
installApps_SU
installApps_BB
installApps_RemoveAllApk
installApps_InstallAllApk
SetBuildProp "persist.sys.timezone" "Europe/Kiev"
SetBuildProp "ro.product.locale.language" "uk"
SetBuildProp "ro.product.locale.region" "UA"
SetBuildProp "ro.com.android.dateformat" "yyyy/MM/dd"
SetBuildProp "wifi.supplicant_scan_interval" "300"
SetBuildProp "gsm.sim.operator.numeric" "131020"
echo You can make changes manually now.
echo -n Make update.img y/n [y]?
read a
case "$a" in
"y"|"Y"|"")
makeUpdateImage_Process
;;
esac
#WORKDIR="../work/"