This repository has been archived by the owner on May 28, 2023. It is now read-only.
forked from tanish2k09/Venom-A7k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
normal_daredevil.sh
116 lines (100 loc) · 3.06 KB
/
normal_daredevil.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
#!/bin/bash
#
# Copyright © 2017, Rohan Taneja @ xda-developers
#
# This is a build script for building Daredevil Kernel builds
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
clear
VAR="S"
BUILD_DATE=$(date +"%Y%m%d")
TREE=$PWD
AK="$TREE/AnyKernel2"
IMAGE=$TREE/arch/arm64/boot/Image.gz-dtb
OUTPUTDIR=$TREE/output
# shell script colors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[0;33m'
blue='\033[0;34m'
defcol='\033[0m'
# fixed settings
export ARCH=arm64
export SUBARCH=arm64
export CONFIG_NO_ERROR_ON_MISMATCH=y
export CROSS_COMPILE=aarch64-linux-android-
JOBS=-j$(nproc)
# Make changes as per the user
export PATH=/media/tanish2k09/Tanish/Tanish/compiling/aarch64-linux-android-6.x/bin:$PATH
export KBUILD_BUILD_USER="tanish2k09"
export KBUILD_BUILD_HOST="PYTHON"
DEVICE="aio_row"
CONFIG="daredevil_normal_defconfig"
#export CONFIG_DEBUG_SECTION_MISMATCH=y
# Function declaration
dd_clean() {
cd $AK
rm -rf Image.gz-dtb
cd ..
make clean mrproper
rm -rf $OUTPUTDIR/*
}
dd_compile() {
echo "$red *******************************"
echo "$green* Compilation in Progress *"
echo "$blue *******************************$defcol"
BUILD_BEGIN=$(date +"%s")
make $CONFIG
make $JOBS
BUILD_TIME=$(date +"%H%M")
if ![ -e "$IMAGE" ]; then
echo "$red Error 404: Kernel not compiled."
echo "Fix the compilation errors! $defcol"
exit 1; fi;
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_BEGIN))
echo "$yellow Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."
cp -i $IMAGE $AK/Image.gz-dtb
}
dd_zip() {
cd $AK
BUILD_TIME=$(date +"%H%M")
zip -r Venom-Normal-$VAR-$BUILD_DATE-$BUILD_TIME-$DEVICE.zip *
if ! [ -d "$OUTPUTDIR" ]; then
mkdir $OUTPUTDIR
fi;
mv Venom-*.zip $OUTPUTDIR
cd $TREE
}
# Script Menu
while true;
clear
echo "$red Welcome$green to$blue Daredevil$yellow Build Script$defcol"
echo "Make a choice to proceed further"
echo "$red(1) Clean kernel source tree"
echo "$green(2) Compile VENOM-S normal build"
echo "$blue(3) Generate Flashable Zip"
echo "$yellow(4) Exit the script$defcol"
read -p "Enter your choice (1-4):" ch
do
case "$ch" in
1) dd_clean
;;
2) dd_compile
;;
3) dd_zip
;;
4) exit 1
;;
esac
done