forked from desalesouche/tr-be-script
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tr-be-script.sh
290 lines (248 loc) · 7.17 KB
/
tr-be-script.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
#!/bin/bash
export JOBS=`nproc`;
if [[ ${1} = "--auto" ]]; then
export PARAM=-y
export SKIP=1
else
export PARAM=""
export SKIP=0
fi
clear
echo
echo " > [T E A M R A D I U M] <"
echo
echo " Build Environment Setup Script"
echo
echo " Script for automatically obtaining all required dependencies "
echo " for all kinds of Android Developing (kernel compilation/mutation,"
echo " rom compilation/mutation, reverse engineering and theming)"
echo
echo " The argument '--auto' can be used for assuming yes on most queries"
echo
echo " Visit us at:"
echo " - https://github.com/TeamRadium"
echo
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Entering SCRIPT FILE'S DOWNLOAD Directory"
echo
if [ ! -d ~/tr-be-script ]; then
mkdir -p ~/tr-be-script
fi
cd ~/tr-be-script
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Installing Python!"
echo
sudo apt-get install build-essential gcc $PARAM
wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tgz
tar -xvzf Python-3.3.2.tgz
cd ~/tr-be-script/Python-3.3.2
./configure --prefix=/usr/local/python3.3
make -j${JOBS}
sudo make install -j${JOBS}
sudo ln -s /usr/local/python3.3/bin/python /usr/bin/python3.3
cd ~/tr-be-script
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Installing CCache!"
echo
wget http://www.samba.org/ftp/ccache/ccache-3.1.9.tar.gz
tar -xvzf ccache-3.1.9.tar.gz
cd ~/tr-be-script/ccache-3.1.9
./configure
make -j${JOBS}
sudo make install -j${JOBS}
echo "export USE_CCACHE=1" >> ~/.bashrc
ccache -M 25G
cd ~/tr-be-script
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Installing JDK 6!"
echo
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
java -version
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Installing GNU Make!"
echo
cd ~/tr-be-script
wget http://ftp.gnu.org/gnu/make/make-3.82.tar.gz
tar -xvzf make-3.82.tar.gz
cd ~/tr-be-script/make-3.82
./configure
sudo make install -j${JOBS}
cd ~/
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Installing Required Packages!"
echo
sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl zlib1g-dev libc6-dev libncurses5-dev x11proto-core-dev \
libx11-dev libreadline6-dev libgl1-mesa-dev tofrodos python-markdown \
libxml2-utils xsltproc pngcrush gcc-multilib lib32z1 schedtool \
libqt4-dev lib32stdc++6 libx11-dev:i386 g++-multilib lib32z1-dev \
lib32ncurses5-dev ia32-libs mingw32 lib32z-dev
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Add terminal to The mouse right button shortcut!"
echo
sudo apt-get install nautilus-open-terminal $PARAM
nautilus -q
echo
echo "Installing GIT!"
echo
sudo apt-get install git $PARAM
echo
echo "Installing Repo"
echo
if [ ! -d ~/bin ]; then
mkdir -p ~/bin
fi
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo
echo "Installing ADB Drivers!"
echo
wget http://www.broodplank.net/51-android.rules
sudo mv -f 51-android.rules /etc/udev/rules.d/51-android.rules
sudo chmod 644 /etc/udev/rules.d/51-android.rules
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Downloading and Configuring Android SDK!!"
echo "Making sure unzip is installed"
echo
sudo apt-get install unzip $PARAM
if [ `getconf LONG_BIT` = "64" ]
then
echo
echo "Downloading SDK for 64bit Linux System"
wget http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20131030.zip
echo "Download Complete!!"
echo "Extracting"
mkdir ~/adt-bundle
mv adt-bundle-linux-x86_64-20131030.zip ~/adt-bundle/adt_x64.zip
cd ~/adt-bundle
unzip adt_x64.zip
mv -f adt-bundle-linux-x86_64-20131030/* .
echo "Configuring environment"
echo -e '\n# Android tools\nexport PATH=${PATH}:~/adt-bundle/sdk/tools\nexport PATH=${PATH}:~/adt-bundle/sdk/platform-tools\nexport PATH=${PATH}:~/bin' >> ~/.bashrc
echo -e '\nPATH="$HOME/adt-bundle/sdk/tools:$HOME/adt-bundle/sdk/platform-tools:$PATH"' >> ~/.profile
echo "Placing desktop shortcuts"
ln -s ~/adt-bundle/eclipse/eclipse ~/Desktop/Eclipse
ln -s ~/adt-bundle/sdk/tools/android ~/Desktop/SDK-Manager
echo "Done!!"
else
echo
echo "Downloading SDK for 32bit Linux System"
wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20131030.zip
echo "Download Complete!!"
echo "Extracting"
mkdir ~/adt-bundle
mv adt-bundle-linux-x86-20131030.zip ~/adt-bundle/adt_x86.zip
cd ~/adt-bundle
unzip adt_x86.zip
mv -f adt-bundle-linux-x86_64-20131030/* .
echo "Configuring environment"
echo -e '\n# Android tools\nexport PATH=${PATH}:~/adt-bundle/sdk/tools\nexport PATH=${PATH}:~/adt-bundle/sdk/platform-tools\nexport PATH=${PATH}:~/bin' >> ~/.bashrc
echo -e '\nPATH="$HOME/adt-bundle/sdk/tools:$HOME/adt-bundle/sdk/platform-tools:$PATH"' >> ~/.profile
echo "Placing desktop shortcuts"
ln -s ~/adt-bundle/eclipse/eclipse ~/Desktop/Eclipse
ln -s ~/adt-bundle/sdk/tools/android ~/Desktop/SDK-Manager
echo "Done!!"
fi
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Installing DSIXDA's Android Kitchen"
echo
cd ~/tr-be-script
wget https://github.com/dsixda/Android-Kitchen/archive/master.zip
unzip master.zip
mv -f Android-Kitchen-master ~/Android-Kitchen
echo -e '\n#!/bin/bash\ncd ~/Android-Kitchen\n./menu' >> ~/Android-Kitchen/kitchen
chmod 755 ~/Android-Kitchen/kitchen
ln -s ~/Android-Kitchen/kitchen ~/bin/kitchen
ln -s ~/Android-Kitchen/kitchen ~/Desktop/Android-Kitchen
if [ ${SKIP} = 1 ]; then
echo "Unattended installation. skipping pause..."
else
read -p "Press [Enter] key to continue..."
fi
clear
echo
echo "Cleaning up temporary files..."
echo
rm -f ~/tr-be-script/Python-3.3.2.tgz
sudo rm -rf ~/tr-be-script/Python-3.3.2
rm -f ~/tr-be-script/make-3.82.tar.gz
rm -rf ~/tr-be-script/make-3.82
rm -f ~/tr-be-script/ccache-3.1.9.tar.gz
rm -rf ~/tr-be-script/ccache-3.1.9
rm -rf ~/adt-bundle/adt-bundle-linux-x86_64-20131030
rm -rf ~/adt-bundle/adt-bundle-linux-x86-20131030
rm -f ~/adt-bundle/adt_x64.zip
rm -f ~/adt-bundle/adt_x86.zip
rm -f ~/tr-be-script/master.zip
clear
echo
echo "Done!"
echo
echo "Cheers!"
echo
echo "Thanks for using this script!"
echo "Now, Enjoy compiling roms/kernels :)"
echo
echo "Credits:"
echo
echo "Script created by:"
echo "> [T E A M R A D I U M] <"
echo
read -p "Press [Enter] key to exit..."
exit