forked from TwistedUmbrella/proprietary_vendor_twisted
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_twisted.sh
executable file
·314 lines (288 loc) · 11.3 KB
/
build_twisted.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
# Copyright (C) 2011 Twisted Playground
# This script is designed to compliment .bash_profile code to automate the build process by adding a typical shell command such as:
# function buildTwist { cd /Volumes/android/github-aosp_source/proprietary_vendor_twisted; ./build_twisted.sh $1 $2 $3; }
# This script is designed by Twisted Playground for use on MacOSX 10.7 but can be modified for other distributions of Mac and Linux
if cat /etc/issue | grep Ubuntu; then
HANDLE=twistedumbrella
ANDROIDREPO=~/Twisted-Playground
DROIDGITHUB=~/Twisted-Playground.git
BUILDDIR=~/android-tzb_ics4.0.1
CCACHEBIN=prebuilt/linux-x86/ccache/ccache
MECHASPEC=~/leanKernel-tbolt-ics
SPADESPEC=~/htc-kernel-msm7x30
SHOOTRSPEC=~/cayniarb-8660-kernel
USERLOCAL=/home/$HANDLE
else
HANDLE=TwistedZero
ANDROIDREPO=/Volumes/android/Twisted-Playground
DROIDGITHUB=TwistedUmbrella/Twisted-Playground.git
BUILDDIR=/Volumes/android/android-tzb_ics4.0.1
CCACHEBIN=prebuilt/darwin-x86/ccache/ccache
MECHASPEC=/Volumes/android/leanKernel-tbolt-ics
SPADESPEC=/Volumes/android/htc-kernel-msm7x30
SHOOTRSPEC=/Volumes/android/cayniarb-8660-kernel
USERLOCAL=/Users/$HANDLE
DROPBOX=/Users/$HANDLE/Dropbox/IceCreamSammy
fi
cd $ANDROIDREPO
git checkout gh-pages
cd $BUILDDIR
specKernel() {
echo $PROPER "Kernel (y/n)? "
read kernel
if [ "$kernel" == "y" ]; then
TIMESTAMP=$ANDROIDREPO/$PROPER/TimeStamp.html
if [ "$SELECTION" == "mecha" ]; then
cd $MECHASPEC
./buildKernel.sh 1 $SELECTION
if [ -e arch/arm/boot/zImage ]; then
echo '<p></p>' >> $TIMESTAMP
echo '<center>' >> $TIMESTAMP
echo "Kernel Compile Success." >> $TIMESTAMP
echo '</center>' >> $TIMESTAMP
echo '<p></p>' >> $TIMESTAMP
fi
fi
if [ "$SELECTION" == "ace" ]; then
cd $SPADESPEC
./buildKernel.sh 1 $SELECTION
if [ -e arch/arm/boot/zImage ]; then
echo '<p></p>' >> $TIMESTAMP
echo '<center>' >> $TIMESTAMP
echo "Kernel Compile Success." >> $TIMESTAMP
echo '</center>' >> $TIMESTAMP
echo '<p></p>' >> $TIMESTAMP
fi
fi
if [ "$SELECTION" == "shooter" ]; then
cd $SHOOTRSPEC
./buildKernel.sh 1 $SELECTION
if [ -e arch/arm/boot/zImage ]; then
echo '<p></p>' >> $TIMESTAMP
echo '<center>' >> $TIMESTAMP
echo "Kernel Compile Success." >> $TIMESTAMP
echo '</center>' >> $TIMESTAMP
echo '<p></p>' >> $TIMESTAMP
fi
fi
cd $BUILDDIR
fi
}
specDevice() {
HANDLE=TwistedZero
PRODUCT=htc_$DEVICE
TIMESTAMP=$ANDROIDREPO/$PROPER/TimeStamp.html
TEMPSTAMP=$ANDROIDREPO/$PROPER/TempStamp
BACKSTAMP=$ANDROIDREPO/$PROPER/BackStamp
source build/envsetup.sh
export USE_CCACHE=1
export CCACHE_DIR=$USERLOCAL/.ccache-$DEVICE
$CCACHEBIN -M 40G
COMPILED=`date`
make otapackage -j4 TARGET_PRODUCT=$PRODUCT TARGET_BUILD_VARIANT=userdebug
rm -R $CCACHE_DIR/*
if [ -e $BUILDDIR/out/target/product/$DEVICE/$PRODUCT-ota-eng.$HANDLE.zip ]; then
MD5STRING=`md5 /Volumes/android/android-tzb_ics4.0.1/out/target/product/$DEVICE/$PRODUCT-ota-eng.$HANDLE.zip | awk {'print $4'}`
cp -R $BUILDDIR/out/target/product/$DEVICE/$PRODUCT-ota-eng.$HANDLE.zip $DROPBOX/$PRODUCT-ota-eng.$HANDLE.zip
rm -R $TIMESTAMP
echo '<html>' > $TIMESTAMP
echo '<head>' >> $TIMESTAMP
echo '<META http-equiv="Pragma" content="no-cache">' >> $TIMESTAMP
echo '<META http-equiv="Cache-Control" content="no-cache">' >> $TIMESTAMP
echo '<META http-equiv="Pragma-directive" content="no-cache">' >> $TIMESTAMP
echo '<META http-equiv="Cache-Directive" content="no-cache">' >> $TIMESTAMP
echo '<META http-equiv="Expires" content="0">' >> $TIMESTAMP
echo '<link rel="apple-touch-icon" href="../Modules/images/iphone.png" />' >> $TIMESTAMP
echo '<link rel="shortcut icon" href="../Modules/images/favicon.ico" />' >> $TIMESTAMP
echo '<meta name="HandheldFriendly" content="True">' >> $TIMESTAMP
echo '<meta name="MobileOptimized" content="320">' >> $TIMESTAMP
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">' >> $TIMESTAMP
echo '<meta http-equiv="cleartype" content="on">' >> $TIMESTAMP
echo '<script type="text/javascript">' >> $TIMESTAMP
echo 'window.scrollTo(0, window.innerHeight)' >> $TIMESTAMP
echo '</script>' >> $TIMESTAMP
echo '<meta charset="UTF-8">' >> $TIMESTAMP
echo '<title>'${PROPER}' TimeStamp - The Playground</title>' >> $TIMESTAMP
echo '<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />' >> $TIMESTAMP
echo '<link rel="stylesheet" type="text/css" href="../Modules/css/accordion.css">' >> $TIMESTAMP
echo '<script src="../Modules/js/libs/modernizr.custom.min.js"></script>'>> $TIMESTAMP
echo '</head>'>> $TIMESTAMP
echo '<body>' >> $TIMESTAMP
echo '<div data-role="page" id="release-'$DEVICE'" data-cache="never">' >> $TIMESTAMP
echo '<div data-role="header" data-position="fixed" data-theme="b">' >> $TIMESTAMP
echo '<img src="../Modules/images/banner.png" id="banner">' >> $TIMESTAMP
echo '</div>' >> $TIMESTAMP
echo '<div data-role="content">' >> $TIMESTAMP
echo '<center><h2>' >> $TIMESTAMP
echo "Latest Build Compiled:" >> $TIMESTAMP
echo '<br>' >> $TIMESTAMP
echo $COMPILED >> $TIMESTAMP
echo '<p></p>' >> $TIMESTAMP
echo "Notes About The Compile" >> $TIMESTAMP
echo '<br>' >> $TIMESTAMP
echo $changes >> $TIMESTAMP
if [ "$kernel" == "y" ]; then
if [ -e arch/arm/boot/zImage ]; then
echo "Updated Prebuilt Device Kernel" >> $TIMESTAMP
echo '<p></p>' >> $TIMESTAMP
fi
fi
echo '<p></p>' >> $TIMESTAMP
echo 'MD5: '$MD5STRING >> $TIMESTAMP
echo '</h2></center>' >> $TIMESTAMP
echo '</div>' >> $TIMESTAMP
echo '<div data-role="footer" data-position="fixed" data-theme="b">' >> $TIMESTAMP
echo '<h1><a href="http://twistedplayground.info" target="_blank"><img src="../Modules/images/webdesign.png" id="webdesign" width="200" height="30"/></a></h1>' >> $TIMESTAMP
echo '</div>' >> $TIMESTAMP
echo '</div>' >> $TIMESTAMP
echo '<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>' >> $TIMESTAMP
echo '<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>' >> $TIMESTAMP
echo '<script src="http://cdn.jquerytools.org/1.2.6/all/jquery.tools.min.js"></script>' >> $TIMESTAMP
echo '<script src="../Modules/js/libs/data-cache-never-min.js"></script>' >> $TIMESTAMP
echo '</body>' >> $TIMESTAMP
echo '</html>' >> $TIMESTAMP
cd $ANDROIDREPO
git push [email protected]:$DROIDGITHUB HEAD:gh-pages -f
cd $BUILDDIR
fi
}
if [ "$1" != "" ]; then
SELECTION=`echo $1 | awk '{print tolower($0)}'`
export PROPER=`echo $SELECTION | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
if [ "$SELECTION" != "kernel" ]; then
syncup=$2
thing=$3
fi
else
echo "1. Shooter"
echo "2. Ace"
echo "3. Mecha"
echo "4. Shared"
echo "5. Kernel"
echo "Please Choose: "
read profile
case $profile in
1)
SELECTION="shooter"
;;
2)
SELECTION="ace"
;;
3)
SELECTION="mecha"
;;
4)
SELECTION="shared"
;;
5)
SELECTION="kernel"
;;
*)
SELECTION="invalid"
;;
esac
export PROPER=`echo $SELECTION | sed 's/\([a-z]\)\([a-zA-Z0-9]*\)/\u\1\2/g'`
if [ "$SELECTION" != "kernel" ]; then
echo "Sync Sources (y/n): "
read syncup
echo "Clobberin Time (y/n): "
read thing
fi
fi
if [ "$SELECTION" != "kernel" ]; then
echo "Build Notes: "
read changes
fi
if [ "$SELECTION" == "kernel" ]; then
echo "Prebuilt (y/n): "
read prebuilt
echo "1. Shooter"
echo "2. Ace"
echo "3. Mecha"
echo "4. Shared"
echo "Please Choose: "
read devicesel
case $devicesel in
1)
kernel="shooter"
;;
2)
kernel="ace"
;;
3)
kernel="mecha"
;;
4)
kernel="shared"
;;
esac
if [ "$kernel" == "shooter" ]; then
cd $SHOOTRSPEC
if [ "$prebuilt" == "y" ]; then
./buildKernel.sh 1 shooter
else
./buildKernel.sh 0 shooter
fi
elif [ "$kernel" == "mecha" ]; then
cd $MECHASPEC
if [ "$prebuilt" == "y" ]; then
./buildKernel.sh 1 mecha
else
./buildKernel.sh 0 mecha
fi
elif [ "$kernel" == "ace" ]; then
cd $SPADESPEC
if [ "$prebuilt" == "y" ]; then
./buildKernel.sh 1 ace
else
./buildKernel.sh 0 ace
fi
elif [ "$kernel" == "shared" ]; then
if [ "$prebuilt" == "y" ]; then
cd $SHOOTRSPEC
./buildKernel.sh 1 shooter
cd $MECHASPEC
./buildKernel.sh 1 mecha
cd $SPADESPEC
./buildKernel.sh 1 ace
else
cd $SHOOTRSPEC
./buildKernel.sh 0 shooter
cd $MECHASPEC
./buildKernel.sh 0 mecha
cd $SPADESPEC
./buildKernel.sh 0 ace
fi
fi
cd $BUILDDIR
elif [ "$SELECTION" != "invalid" ]; then
specKernel
else
echo "Available Device NOT Selected"
echo "Sync Only Procedure Initiated"
repo sync
exit 1
fi
if [ "$SELECTION" != "kernel" ]; then
if [ "$syncup" != "n" ]; then
repo sync
fi
if [ "$thing" == "y" ]; then
export USE_CCACHE=1
export CCACHE_DIR=$USERLOCAL/.ccache-$SELECTION
$CCACHEBIN -M 40G
make clobber -j8
rm -R $CCACHE_DIR/*
fi
if [ "$SELECTION" != "shared" ]; then
DEVICE=$SELECTION
specDevice
else
DEVICE="shooter"
specDevice
DEVICE="mecha"
specDevice
DEVICE="ace"
specDevice
fi
fi