-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.sh
More file actions
executable file
·61 lines (61 loc) · 1.75 KB
/
kernel.sh
File metadata and controls
executable file
·61 lines (61 loc) · 1.75 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
echo "Clean build? (1/0)"
read cleanbuild
usellvm=1
if [ $cleanbuild = 1 ]
then
echo "Cleaning..."
make clean O=out
make mrproper O=out
rm -rf out
mkdir out
fi
rm -rf AnyKernel3
echo "Cloning Repos..."
git clone https://github.com/ShivamKumar2002/M4ST3R-Clang-11 m4st3r-clang --depth=1
git clone https://github.com/ShivamKumar2002/AnyKernel3 AnyKernel3 --depth=1
git clone https://android.googlesource.com/platform/system/libufdt scripts/ufdt/libufdt
build_start=$(date +"%s")
export PATH=$(pwd)/m4st3r-clang/bin:$PATH
export ARCH=arm64
export SUBARCH=arm64
export KBUILD_BUILD_HOST="m4st3r_host"
export KBUILD_BUILD_USER="ShivamKumar2002"
echo "Making Config..."
make vendor/violet-perf_defconfig ARCH=arm64 O=out
if [ $usellvm = 1 ]
then
makecommands+=(
AR=llvm-ar \
NM=llvm-nm \
OBJCOPY=llvm-objcopy \
OBJDUMP=llvm-objdump \
STRIP=llvm-strip \
READOBJ=llvm-readobj \
READELF=llvm-readelf
)
fi
makecommands+=(
O=out \
ARCH=arm64 \
CC=clang \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi-
)
echo "Starting Compilation..."
make -j$(nproc --all) "${makecommands[@]}" | tee full.log
if [ ! -f out/arch/arm64/boot/Image.gz-dtb ]
then
echo "Compilation Failed. Check full.log"
exit
fi
cp out/arch/arm64/boot/Image.gz-dtb AnyKernel3/
echo "Making DTBO..."
python2 scripts/ufdt/libufdt/utils/src/mkdtboimg.py create out/arch/arm64/boot/dtbo.img --page_size=4096 out/arch/arm64/boot/dts/qcom/sm6150-idp-overlay.dtbo
echo "Making Zip..."
cp out/arch/arm64/boot/dtbo.img AnyKernel3/
cd AnyKernel3
zip -r9 "m4st3rkernel-violet-dtbo-$(TZ=Asia/Kolkata date +'%M%H-%d%m%Y').zip" *
build_complete=$(date +"%s")
elapsed=$((build_complete-build_start))
echo "Completed Successfully in $elapsed Seconds."
echo "Zip is Ready. Go Flash and Enjoy Bootloop."