This repository was archived by the owner on May 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathaeon.sh
More file actions
executable file
·296 lines (268 loc) · 5.92 KB
/
Copy pathaeon.sh
File metadata and controls
executable file
·296 lines (268 loc) · 5.92 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
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
#!/bin/bash
# Script by DAvinash97
# Feel free to use, make sure to add proper credits
clear
echo -e "What version would you like to export\n"
read n
echo "Version Choosen $n"
IMAGE=out/arch/arm64/boot/Image;
GIMAGE=$IMAGE.gz
DTS=out/arch/arm64/boot/dts;
CDTB=out/dtb;
CAIK=AIK/split_img;
NIMG='AIK/image-new.img';
NAME='AEON-Q'; #FOR ZIP_NAME
KNAME=" AEON Q v'$n' By DAvinash97"
JOBS=$(($(nproc)+1))
echo -e "\nSetting Up Environment\n"
export CROSS_COMPILE=../../toolchain/bin/aarch64-none-linux-gnu-
export CC=../../clang/bin/clang
export CLANG_TRIPLE=../../clang/bin/aarch64-linux-gnu-
export ARCH=arm64
export ANDROID_MAJOR_VERSION=q
export ANDROID_VERSION=100000
export PLATFORM_VERSION=10.0.0
export USE_CCACHE=1
if [ ! -d AIK ]; then
exit
fi
if [ ! -d AnyKernel3 ]; then
exit
fi
if [ -d Flashable ]; then
if [ -d Flashable/META-INF ]; then
if [ -d Flashable/META-INF/com ]; then
if [ -d Flashable/META-INF/com/google ]; then
if [ -d Flashable/META-INF/com/google/android ]; then
if [ -f Flashable/META-INF/com/google/android/update-binary ]; then
if [ ! -f Flashable/META-INF/com/google/android/updater-script ]; then
exit
fi
else
exit
fi
else
exit
fi
else
exit
fi
else
exit
fi
else
exit
fi
else
exit
fi
clean ()
{
if [ -f $IMAGE ]; then
rm $IMAGE
fi
if [ -f $IMAGE.lz4 ]; then
rm $IMAGE.lz4
fi
if [ -d $DTS ]; then
rm -rf $DTS
fi
if [ -f $CDTB ]; then
rm $CDTB
fi
if [ -f $NIMG ]; then
rm $NIMG
fi
if [ -f AnyKernel/*.zip ]; then
rm AnyKernel/*.zip
fi
if [ -f AnyKernel/Image ]; then
rm AnyKernel/Image
fi
if [ -f AnyKernel/dtb ]; then
rm AnyKernel/dtb
fi
if [ -f $NIMG ]; then
rm $NIMG
fi
if [ -f Flashable/*.img ]; then
rm Flashable/*.img
fi
if [ -f Flashable/*.zip ]; then
rm Flashable/*.zip
fi
if [ -f ./$CAIK/boot.img-zImage ]; then
rm ./$CAIK/boot.img-zImage
fi
if [ -f ./$CAIK/boot.img-dt ]; then
rm ./$CAIK/boot.img-dt
fi
}
if [ ! -d out ]; then
mkdir out
cp -r firmware out/firmware
fi
if [[ -f AEON*.zip ]]; then
rm AEON*.zip
fi
OTHERS="AIK AnyKernel exit"
COMPILE ()
{
select CHOICE in $OTHERS
do
case $CHOICE in
AIK)
compile_aik
break
;;
AnyKernel)
compile_anyk
break
;;
exit)
break
;;
*)
echo -e "\nError: Invalid Input\n"
;;
esac
done
}
compile_dtb ()
{
echo -e "\nCompiling DTB\n"
./tools/dtbtool $DTS/ -o out/dtb
total_time
if [ -f $IMAGE ] && [ -f out/dtb ]; then
COMPILE
fi
}
compile_kernel ()
{
if [ -d $DTS ]; then
rm -rf $DTS
fi
echo -e "\nCompiling\n"
echo -e "\nMaking $CONFIG\n"
make O=out $CONFIG
echo -e "\nMaking DTB\n"
make O=out $DTB
echo -e "\nCompiling zImage\n"
make O=out -j$(($(nproc) + 1))
if [ -f $IMAGE ] && [ ! -f out/dtb ]; then
compile_dtb
else
echo -e "\nCompilation Failed\n"
fi
}
compile_aik ()
{
echo -e "\nMaking AIK Image\n"
if [ -f $IMAGE ]; then
cp $IMAGE ./$CAIK/boot.img-zImage
cp $CDTB ./$CAIK/boot.img-dt
eval AIK/repackimg.sh
if [ -f $NIMG ]; then
cp -r $NIMG Flashable/boot.img
cd Flashable
zip -r9 $NAME-$DEVICE *
mv *.zip ../
cd ..
fi
else
echo -e "Image not found"
fi
}
compile_anyk ()
{
if [ -f $IMAGE ]; then
cp $IMAGE ./AnyKernel3/
cp $CDTB ./AnyKernel3/
if [ -f AnyKernel3/Image ]; then
cd AnyKernel3
zip -r9 $NAME-$DEVICE-AnyK *
cp *.zip ../
cd ..
fi
fi
}
total_time ()
{
END=$(date +%M)
DIFF=$(( $END - $START ))
echo -e "\nIt took $DIFF minutes"
}
LIST="J7Velte J7Xelte J6lte On7xelte Other Clean exit"
SNUM="1) J7Velte
2) J7Xelte
3) J6lte
4) On7xelte
5) Other
6) Clean Cache
7) Exit"
select DEVICE in $LIST
do
case $DEVICE in
J7Velte)
clean
START=$(date +%M)
echo -e "\nChosen $DEVICE\n"
CONFIG=j7velte_defconfig
export LOCALVERSION=$KNAME
DTB="exynos7870-j7velte_sea_open_00.dtb exynos7870-j7velte_sea_open_01.dtb exynos7870-j7velte_sea_open_03.dtb"
compile_kernel
if [ -f $IMAGE ] && [ ! -f out/dtb ]; then
compile_dtb
fi
printf "$SNUM"
;;
J7Xelte)
clean
START=$(date +%M)
echo -e "\nChosen $DEVICE\n"
CONFIG=j7xelte_defconfig
export LOCALVERSION=$KNAME
DTB="exynos7870-j7xelte_eur_open_00.dtb exynos7870-j7xelte_eur_open_01.dtb exynos7870-j7xelte_eur_open_02.dtb exynos7870-j7xelte_eur_open_03.dtb exynos7870-j7xelte_eur_open_04.dtb"
compile_kernel
printf "$SNUM"
;;
J6lte)
clean
START=$(date +%M)
echo -e "\nChosen $DEVICE\n"
CONFIG=j6lte_defconfig
export LOCALVERSION=$KNAME
DTB="exynos7870-j6lte_cis_ser_00.dtb exynos7870-j6lte_cis_ser_02.dtb"
compile_kernel
printf "$SNUM"
;;
On7xelte)
clean
START=$(date +%M)
echo -e "\nChosen $DEVICE\n"
CONFIG=on7xelte_defconfig
export LOCALVERSION=$KNAME
DTB="exynos7870-on7xelte_swa_open_00.dtb exynos7870-on7xelte_swa_open_01.dtb exynos7870-on7xelte_swa_open_02.dtb"
compile_kernel
printf "$SNUM"
;;
Other)
COMPILE
printf "$SNUM"
;;
Clean)
echo -e "\nChosen $DEVICE\n"
echo -e "\nCleaning Up Previous Build"
make O=out clean && make O=out mrproper
if [ -f AEON*.zip ]; then
rm AEON*.zip
fi
;;
exit)
break
;;
*)
echo -e "\nError: Invalid Input\n"
;;
esac
done