-
Notifications
You must be signed in to change notification settings - Fork 5
/
build_kernel.sh
executable file
·766 lines (765 loc) · 30.3 KB
/
build_kernel.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
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
#!/bin/bash
#
# Serenity Kernel Build Script
# Coded by BlackMesa @2018
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
clear
# Init Fields
S_VERSION=v1.5
S_BUILD=BQK5
S_DATE=$(date +%Y%m%d)
S_TOOLCHAIN=/home/updeshsr/Toolchain/arm-eabi-4.9/bin/arm-eabi-
S_JOBS=`grep processor /proc/cpuinfo|wc -l`
S_DIR=$(pwd)
# Init Methods
CLEAN_SOURCE()
{
make clean
make mrproper
rm -r -f $S_DIR/output
}
BUILD_ZIMAGE()
{
echo "----------------------------------------------"
echo "Building zImage for $S_VARIANT..."
echo " "
export ARCH=arm
export CROSS_COMPILE=$S_TOOLCHAIN
export LOCALVERSION=-Serenity_Kernel-$S_VERSION-$S_VARIANT-$S_DATE
mkdir output
make -C $S_DIR -j$S_JOBS O=output serenity_msm8916_defconfig VARIANT_DEFCONFIG=$S_DEFCON SELINUX_DEFCONFIG=serenity_selinux_defconfig
make -C $S_DIR -j$S_JOBS O=output
echo " "
}
BUILD_DTB()
{
echo "----------------------------------------------"
echo "Building dtb for $S_VARIANT..."
echo " "
$S_DIR/tools/dtbTool -o $S_DIR/serenity/dtb.img $S_DIR/output/arch/arm/boot/dts/
echo " "
}
PACK_COMMON_IMG()
{
echo "----------------------------------------------"
echo "Packing boot.img for $S_VARIANT..."
echo " "
mkdir -p $S_DIR/serenity/tools/aik/ramdisk
mkdir -p $S_DIR/serenity/tools/aik/split_img
cp -rf $S_DIR/serenity/ramdisk/common/ramdisk/* $S_DIR/serenity/tools/aik/ramdisk
cp -rf $S_DIR/serenity/ramdisk/common/split_img/* $S_DIR/serenity/tools/aik/split_img
mv $S_DIR/output/arch/arm/boot/zImage $S_DIR/serenity/tools/aik/split_img/boot.img-zImage
mv $S_DIR/serenity/dtb.img $S_DIR/serenity/tools/aik/split_img/boot.img-dtb
$S_DIR/serenity/tools/aik/repackimg.sh
mv $S_DIR/serenity/tools/aik/image-new.img $S_DIR/serenity/build/boot-$S_VARIANT-$S_DATE.img
$S_DIR/serenity/tools/aik/cleanup.sh
}
PACK_VARIANT_IMG()
{
echo "----------------------------------------------"
echo "Packing boot.img for $S_VARIANT..."
echo " "
mkdir -p $S_DIR/serenity/tools/aik/ramdisk
mkdir -p $S_DIR/serenity/tools/aik/split_img
cp -rf $S_DIR/serenity/ramdisk/common/ramdisk/* $S_DIR/serenity/tools/aik/ramdisk
cp -rf $S_DIR/serenity/ramdisk/common/split_img/* $S_DIR/serenity/tools/aik/split_img
cp -rf $S_DIR/serenity/ramdisk/$S_VARIANT/ramdisk/* $S_DIR/serenity/tools/aik/ramdisk
mv $S_DIR/output/arch/arm/boot/zImage $S_DIR/serenity/tools/aik/split_img/boot.img-zImage
mv $S_DIR/serenity/dtb.img $S_DIR/serenity/tools/aik/split_img/boot.img-dtb
$S_DIR/serenity/tools/aik/repackimg.sh
mv $S_DIR/serenity/tools/aik/image-new.img $S_DIR/serenity/build/boot-$S_VARIANT-$S_DATE.img
$S_DIR/serenity/tools/aik/cleanup.sh
}
PACK_A35_ZIP()
{
echo "----------------------------------------------"
echo "Packing flashable zip for A3 2015 kernels..."
echo " "
mkdir -p $S_DIR/serenity/work
mkdir -p $S_DIR/serenity/work/META-INF/com/google/android
mkdir -p $S_DIR/serenity/work/serenity/a3ulte
cp -f $S_DIR/serenity/tools/flashable/binary $S_DIR/serenity/work/META-INF/com/google/android/update-binary
cp -f $S_DIR/serenity/tools/flashable/a35 $S_DIR/serenity/work/META-INF/com/google/android/updater-script
sed -i s'/QSVER/v1.6-fix/'g $S_DIR/serenity/work/META-INF/com/google/android/updater-script
cp -f $S_DIR/serenity/tools/flashable/pronto $S_DIR/serenity/work/serenity/pronto
cp -f $S_DIR/serenity/tools/flashable/wpsw $S_DIR/serenity/work/serenity/wpsw
mv $S_DIR/serenity/build/boot-a3ulte-$S_DATE.img $S_DIR/serenity/work/serenity/a3ulte/boot.img
cd $S_DIR/serenity/work
$S_DIR/serenity/tools/flashable/zip -r -9 - * > $S_DIR/serenity/build/Serenity_Kernel-$S_VERSION-$S_BUILD-A35.zip
cd $S_DIR
rm -r -f $S_DIR/serenity/work
}
PACK_A55_ZIP()
{
echo "----------------------------------------------"
echo "Packing flashable zip for A5 2015 kernels..."
echo " "
mkdir -p $S_DIR/serenity/work
mkdir -p $S_DIR/serenity/work/META-INF/com/google/android
mkdir -p $S_DIR/serenity/work/serenity/a53g
mkdir -p $S_DIR/serenity/work/serenity/a5lte
mkdir -p $S_DIR/serenity/work/serenity/a5ltechn
mkdir -p $S_DIR/serenity/work/serenity/a5ulte
mkdir -p $S_DIR/serenity/work/serenity/a5ulte_can
mkdir -p $S_DIR/serenity/work/serenity/a5ulte_kor
cp -rf $S_DIR/serenity/tools/aik $S_DIR/serenity/work/serenity/a5ulte
cp -f $S_DIR/serenity/tools/flashable/binary $S_DIR/serenity/work/META-INF/com/google/android/update-binary
cp -f $S_DIR/serenity/tools/flashable/a55 $S_DIR/serenity/work/META-INF/com/google/android/updater-script
sed -i s'/QSVER/v1.6-fix/'g $S_DIR/serenity/work/META-INF/com/google/android/updater-script
cp -f $S_DIR/serenity/tools/flashable/pronto $S_DIR/serenity/work/serenity/pronto
cp -f $S_DIR/serenity/tools/flashable/wpsw $S_DIR/serenity/work/serenity/wpsw
mv $S_DIR/serenity/build/boot-a53g-$S_DATE.img $S_DIR/serenity/work/serenity/a53g/boot.img
mv $S_DIR/serenity/build/boot-a5lte-$S_DATE.img $S_DIR/serenity/work/serenity/a5lte/boot.img
mv $S_DIR/serenity/build/boot-a5ltechn-$S_DATE.img $S_DIR/serenity/work/serenity/a5ltechn/boot.img
mv $S_DIR/serenity/build/boot-a5ulte-$S_DATE.img $S_DIR/serenity/work/serenity/a5ulte/boot.img
cp -f $S_DIR/serenity/tools/flashable/dtb $S_DIR/serenity/work/serenity/a5ulte/magic.sh
mv $S_DIR/serenity/dtb-can $S_DIR/serenity/work/serenity/a5ulte_can/boot.img-dtb
mv $S_DIR/serenity/dtb-kor $S_DIR/serenity/work/serenity/a5ulte_kor/boot.img-dtb
cd $S_DIR/serenity/work
$S_DIR/serenity/tools/flashable/zip -r -9 - * > $S_DIR/serenity/build/Serenity_Kernel-$S_VERSION-$S_BUILD-A55.zip
cd $S_DIR
rm -r -f $S_DIR/serenity/work
}
PACK_J55_ZIP()
{
echo "----------------------------------------------"
echo "Packing flashable zip for J5 2015 kernels..."
echo " "
mkdir -p $S_DIR/serenity/work
mkdir -p $S_DIR/serenity/work/META-INF/com/google/android
mkdir -p $S_DIR/serenity/work/serenity/j53g
mkdir -p $S_DIR/serenity/work/serenity/j5lte
mkdir -p $S_DIR/serenity/work/serenity/j5nlte
mkdir -p $S_DIR/serenity/work/serenity/j5ylte
cp -f $S_DIR/serenity/tools/flashable/binary $S_DIR/serenity/work/META-INF/com/google/android/update-binary
cp -f $S_DIR/serenity/tools/flashable/j55 $S_DIR/serenity/work/META-INF/com/google/android/updater-script
sed -i s'/QSVER/v1.6-fix/'g $S_DIR/serenity/work/META-INF/com/google/android/updater-script
cp -f $S_DIR/serenity/tools/flashable/pronto $S_DIR/serenity/work/serenity/pronto
cp -f $S_DIR/serenity/tools/flashable/wpsw $S_DIR/serenity/work/serenity/wpsw
mv $S_DIR/serenity/build/boot-j53g-$S_DATE.img $S_DIR/serenity/work/serenity/j53g/boot.img
mv $S_DIR/serenity/build/boot-j5lte-$S_DATE.img $S_DIR/serenity/work/serenity/j5lte/boot.img
mv $S_DIR/serenity/build/boot-j5nlte-$S_DATE.img $S_DIR/serenity/work/serenity/j5nlte/boot.img
mv $S_DIR/serenity/build/boot-j5ylte-$S_DATE.img $S_DIR/serenity/work/serenity/j5ylte/boot.img
cd $S_DIR/serenity/work
$S_DIR/serenity/tools/flashable/zip -r -9 - * > $S_DIR/serenity/build/Serenity_Kernel-$S_VERSION-$S_BUILD-J55.zip
cd $S_DIR
rm -r -f $S_DIR/serenity/work
}
PACK_J56_ZIP()
{
echo "----------------------------------------------"
echo "Packing flashable zip for J5 2016 kernels..."
echo " "
mkdir -p $S_DIR/serenity/work
mkdir -p $S_DIR/serenity/work/META-INF/com/google/android
mkdir -p $S_DIR/serenity/work/serenity/j5x3g
mkdir -p $S_DIR/serenity/work/serenity/j5xlte
cp -f $S_DIR/serenity/tools/flashable/binary $S_DIR/serenity/work/META-INF/com/google/android/update-binary
cp -f $S_DIR/serenity/tools/flashable/j56 $S_DIR/serenity/work/META-INF/com/google/android/updater-script
sed -i s'/QSVER/v1.6-fix/'g $S_DIR/serenity/work/META-INF/com/google/android/updater-script
cp -f $S_DIR/serenity/tools/flashable/pronto $S_DIR/serenity/work/serenity/pronto
cp -f $S_DIR/serenity/tools/flashable/wpsw $S_DIR/serenity/work/serenity/wpsw
mv $S_DIR/serenity/build/boot-j5x3g-$S_DATE.img $S_DIR/serenity/work/serenity/j5x3g/boot.img
mv $S_DIR/serenity/build/boot-j5xlte-$S_DATE.img $S_DIR/serenity/work/serenity/j5xlte/boot.img
cd $S_DIR/serenity/work
$S_DIR/serenity/tools/flashable/zip -r -9 - * > $S_DIR/serenity/build/Serenity_Kernel-$S_VERSION-$S_BUILD-J56.zip
cd $S_DIR
rm -r -f $S_DIR/serenity/work
}
# Main Menu
clear
echo "----------------------------------------------"
echo "SerenityKernel $S_VERSION Build Script"
echo "Coded by BlackMesa"
echo "----------------------------------------------"
PS3='Please select your option (1-18): '
menuvar=("A3 2015 (build all)" "a3ulte" "A5 2015 (build all)" "a53g" "a5lte" "a5ltechn" "a5ulte" "a5ulte_can" "a5ulte_kor" "J5 2015 (build all)" "j53g" "j5lte" "j5nlte" "j5ylte" "J5 2016 (build all)" "j5x3g" "j5xlte" "Exit")
select menuvar in "${menuvar[@]}"
do
case $menuvar in
"A3 2015 (build all)")
clear
echo "----------------------------------------------"
echo "Starting build for all the A3 2015 variants."
echo "Please be patient..."
# a3ulte
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a3ulte kernel build..."
S_VARIANT=a3ulte
S_DEFCON=serenity_msm8916_a3ulte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a3ulte kernel build finished."
PACK_A35_ZIP
echo " "
echo "----------------------------------------------"
echo "A3 2015 kernels build finished."
echo "Flashable zip is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a3ulte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a3ulte kernel build..."
S_VARIANT=a3ulte
S_DEFCON=serenity_msm8916_a3ulte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a3ulte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"A5 2015 (build all)")
clear
echo "----------------------------------------------"
echo "Starting build for all the A5 2015 variants."
echo "Please be patient..."
# a53g
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a53g kernel build..."
S_VARIANT=a53g
S_DEFCON=serenity_msm8916_a53g_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a53g kernel build finished."
# a5lte
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5lte kernel build..."
S_VARIANT=a5lte
S_DEFCON=serenity_msm8916_a5lte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5lte kernel build finished."
# a5ltechn
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ltechn kernel build..."
S_VARIANT=a5ltechn
S_DEFCON=serenity_msm8916_a5ltechn_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5ltechn kernel build finished."
# a5ulte
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ulte kernel build..."
S_VARIANT=a5ulte
S_DEFCON=serenity_msm8916_a5ulte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5ulte kernel build finished."
# Since here we need just dtb.
# a5ulte_can
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ulte_can kernel build..."
S_VARIANT=a5ulte_can
S_DEFCON=serenity_msm8916_a5ulte_can_defconfig
BUILD_ZIMAGE
BUILD_DTB
mv $S_DIR/serenity/dtb.img $S_DIR/serenity/dtb-can
echo " "
echo "----------------------------------------------"
echo "a5ulte_can kernel build finished."
# a5ulte_kor
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ulte_kor kernel build..."
S_VARIANT=a5ulte_kor
S_DEFCON=serenity_msm8916_a5ulte_kor_defconfig
BUILD_ZIMAGE
BUILD_DTB
mv $S_DIR/serenity/dtb.img $S_DIR/serenity/dtb-kor
echo " "
echo "----------------------------------------------"
echo "a5ulte_kor kernel build finished."
PACK_A55_ZIP
echo " "
echo "----------------------------------------------"
echo "A5 2015 kernels build finished."
echo "Flashable zip is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a53g")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a53g kernel build..."
S_VARIANT=a53g
S_DEFCON=serenity_msm8916_a53g_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a53g kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a5lte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5lte kernel build..."
S_VARIANT=a5lte
S_DEFCON=serenity_msm8916_a5lte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5lte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a5ltechn")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ltechn kernel build..."
S_VARIANT=a5ltechn
S_DEFCON=serenity_msm8916_a5ltechn_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5ltechn kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a5ulte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ulte kernel build..."
S_VARIANT=a5ulte
S_DEFCON=serenity_msm8916_a5ulte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5ulte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a5ulte_can")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ulte_can kernel build..."
S_VARIANT=a5ulte_can
S_DEFCON=serenity_msm8916_a5ulte_can_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5ulte_can kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"a5ulte_kor")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting a5ulte_kor kernel build..."
S_VARIANT=a5ulte_kor
S_DEFCON=serenity_msm8916_a5ulte_kor_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "a5ulte_kor kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"J5 2015 (build all)")
clear
echo "----------------------------------------------"
echo "Starting build for all the J5 2015 variants."
echo "Please be patient..."
# j53g
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j53g kernel build..."
S_VARIANT=j53g
S_DEFCON=serenity_msm8916_j53g_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j53g kernel build finished."
# j5lte
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5lte kernel build..."
S_VARIANT=j5lte
S_DEFCON=serenity_msm8916_j5lte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5lte kernel build finished."
# j5nlte
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5nlte kernel build..."
S_VARIANT=j5nlte
S_DEFCON=serenity_msm8916_j5nlte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5nlte kernel build finished."
# j5ylte
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5ylte kernel build..."
S_VARIANT=j5ylte
S_DEFCON=serenity_msm8916_j5ylte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5ylte kernel build finished."
PACK_J55_ZIP
echo " "
echo "----------------------------------------------"
echo "J5 2015 kernels build finished."
echo "Flashable zip is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"j53g")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j53g kernel build..."
S_VARIANT=j53g
S_DEFCON=serenity_msm8916_j53g_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j53g kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"j5lte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5lte kernel build..."
S_VARIANT=j5lte
S_DEFCON=serenity_msm8916_j5lte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_COMMON_IMG
echo " "
echo "----------------------------------------------"
echo "j5lte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"j5nlte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5nlte kernel build..."
S_VARIANT=j5nlte
S_DEFCON=serenity_msm8916_j5nlte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5nlte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"j5ylte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5ylte kernel build..."
S_VARIANT=j5ylte
S_DEFCON=serenity_msm8916_j5ylte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5ylte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"J5 2016 (build all)")
clear
echo "----------------------------------------------"
echo "Starting build for all the J5 2016 variants."
echo "Please be patient..."
# j5x3g
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5x3g kernel build..."
S_VARIANT=j5x3g
S_DEFCON=serenity_msm8916_j5x3g_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5x3g kernel build finished."
# j5xlte
echo "----------------------------------------------"
echo "Preparing for next build..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5xlte kernel build..."
S_VARIANT=j5xlte
S_DEFCON=serenity_msm8916_j5xlte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5xlte kernel build finished."
PACK_J56_ZIP
echo " "
echo "----------------------------------------------"
echo "J5 2016 kernels build finished."
echo "Flashable zip is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"j5x3g")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5x3g kernel build..."
S_VARIANT=j5x3g
S_DEFCON=serenity_msm8916_j5x3g_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5x3g kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"j5xlte")
clear
echo "----------------------------------------------"
echo "Cleaning up source..."
echo " "
CLEAN_SOURCE
echo " "
echo "----------------------------------------------"
echo "Starting j5xlte kernel build..."
S_VARIANT=j5xlte
S_DEFCON=serenity_msm8916_j5xlte_defconfig
BUILD_ZIMAGE
BUILD_DTB
PACK_VARIANT_IMG
echo " "
echo "----------------------------------------------"
echo "j5xlte kernel build finished."
echo "boot.img is located into serenity/build."
echo "Press any key for end the script."
echo "----------------------------------------------"
read -n1 -r key
break
;;
"Exit")
break
;;
*) echo Invalid option.;;
esac
done