forked from dsixda/Android-Kitchen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_which_update_binary
More file actions
executable file
·124 lines (95 loc) · 2.58 KB
/
Copy pathcheck_which_update_binary
File metadata and controls
executable file
·124 lines (95 loc) · 2.58 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
############################################################################
#
# Copyright (c) 2012 - dsixda (dislam@rocketmail.com)
#
# Android Kitchen is 100% free. This script file is intended for personal
# and/or educational use only. It may not be duplicated for monetary
# benefit or any other purpose without the permission of the developer.
#
############################################################################
cd WORKING_*
working_folder=`pwd`
cd META-INF/com/google/android
update_dir=`pwd`
if [ ! -e updater-script ]
then
echo
echo "Error: No updater-script found!"
cd ../../../../..
exit 0
fi
if [ -e update-binary.orig ]
then
echo
echo "Copying original update-binary"
cp -vf update-binary.orig update-binary
elif [ -e update-binary ]
then
echo
echo "Using existing update-binary"
echo
else
cd ../../../../..
scripts/check_galaxy_s2
sgs2=$?
if [ "$sgs2" != "1" ]
then
scripts/check_galaxy_s2x
sgs2x=$?
if [ "$sgs2x" != "1" ]
then
scripts/check_galaxy_s3_common
sgs3_common=$?
if [ "$sgs3_common" != "1" ] && [ -e $working_folder/boot.img ]
then
scripts/check_mt65xx_bootimg
mt65xx=$?
fi
fi
fi
device_name=`scripts/get_device_name`
cd $update_dir
echo
echo "Copying update-binary ..."
if [ "$sgs2" == "1" ] || [ "$sgs2x" = "1" ]
then
cp -vf ../../../../../tools/update_files/sgs2-update-binary update-binary
elif [ "$sgs3_common" == "1" ]
then
cp -vf ../../../../../tools/update_files/sgs3-update-binary update-binary
elif [ "$device_name" == "GT-I9103" ]
then
cp -vf ../../../../../tools/update_files/emmc-not-neon-update-binary update-binary
else
grep_emmc=`grep -c "mount(.*,.*,.*,.*)" updater-script`
if [ $grep_emmc -gt 0 ]
then
#
# Four args for mount
#
# e.g. mount("ext3", "EMMC", "/dev/block/mmcblk0p26", "/data");
# e.g. mount("yaffs2", "MTD", "userdata", "/data");
#
if [ "$mt65xx" == "1" ]
then
cp -vf ../../../../../tools/update_files/emmc-mt65xx-update-binary update-binary
else
cp -vf ../../../../../tools/update_files/emmc-update-binary update-binary
fi
else
#
# Three args for mount, but no MTD or assert
#
# mount("ext3", "/dev/block/mmcblk0p25", "/system");
#
# OR
#
# Three arguments, can use MTD and assert
#
# e.g. mount("MTD", "userdata", "/data");
#
cp -vf ../../../../../tools/update_files/mtd-update-binary update-binary
fi
fi
fi
cd ../../../../..