-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
42 lines (38 loc) · 1.08 KB
/
build.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
#!/bin/bash
#
# Copyright © 2018-2019, "DarkAngelGR" <[email protected]>
# Thanks to Vipul Jha for zip creator
# Android Kernel Compilation Script
#
tput reset
echo -e "==============================================="
echo " Compiling Olympian Kernel "
echo -e "==============================================="
LC_ALL=C date +%Y-%m-%d
date=`date +"%Y%m%d-%H%M"`
BUILD_START=$(date +"%s")
KERNEL_DIR=$PWD
REPACK_DIR=$KERNEL_DIR/zip
OUT=$KERNEL_DIR/out
VERSION="zeus"
export ARCH=arm64 && export SUBARCH=arm64
export CROSS_COMPILE=~/Toolchain/bin/aarch64-linux-android-
rm -rf out
mkdir -p out
make mrproper
make O=out clean
make O=out mrproper
make O=out olympian_defconfig
make O=out -j$(nproc --all)
cd $REPACK_DIR
cp $KERNEL_DIR/out/arch/arm64/boot/Image.gz-dtb $REPACK_DIR/
FINAL_ZIP="OlympianKernel-${VERSION}-$(date +"%Y-%m-%d").zip"
zip -r9 "${FINAL_ZIP}" *
cp *.zip $OUT
rm *.zip
cd $KERNEL_DIR
rm zip/Image.gz-dtb
cd out
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_START))
echo -e "Build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds."