-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
93 lines (73 loc) · 2.27 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
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
#!/bin/bash
#set -e
clear
# auto gcc cloner/updater
echo "**** gcc Time ****"
if [ -r gcc ]; then
echo "gcc found! check for update..."
cd gcc
git config pull.rebase true
git pull
cd ..
else
echo "gcc not found!, git cloning it now...."
git clone https://github.com/MNoxx74/gcc-10.2.0.git gcc
fi
## Copy this script inside the kernel directory
KERNEL_DEFCONFIG=vendor/citrus_defconfig
ANYKERNEL3_DIR=$PWD/AnyKernel3/
FINAL_KERNEL_ZIP=PornX-11++.zip
KERNELDIR=$PWD
export CROSS_COMPILE=${KERNELDIR}/gcc/bin/aarch64-elf-
export ARCH=arm64
export SUBARCH=arm64
export KBUILD_BUILD_USER=MNoxx74
export KBUILD_BUILD_HOST=LinuxServer
# Speed up build process
MAKE="./makeparallel"
BUILD_START=$(date +"%s")
blue='\033[0;34m'
cyan='\033[0;36m'
yellow='\033[0;33m'
red='\033[0;31m'
nocol='\033[0m'
# Clean build always lol
echo "**** Cleaning ****"
rm -rfv out
mkdir -p out
make O=out clean
echo "**** Kernel defconfig is set to $KERNEL_DEFCONFIG ****"
echo -e "$blue***********************************************"
echo " BUILDING KERNEL "
echo -e "***********************************************$nocol"
make $KERNEL_DEFCONFIG O=out
#make ARCH=arm64 O=out menuconfig
make -j$(nproc --all) O=out
echo "**** Verify Image.gz-dtb ****"
if [ -f out/arch/arm64/boot/Image.gz-dtb ]; then
# Anykernel 3 time!!
echo "**** Verifying AnyKernel3 Directory ****"
ls $ANYKERNEL3_DIR
echo "**** Removing leftovers ****"
rm -rf $ANYKERNEL3_DIR/Image.gz-dtb
rm -rf $ANYKERNEL3_DIR/$FINAL_KERNEL_ZIP
echo "**** Copying Image.gz-dtb ****"
cp $PWD/out/arch/arm64/boot/Image.gz-dtb $ANYKERNEL3_DIR/
echo "**** Build Kernel Zip Files ****"
cd $ANYKERNEL3_DIR/
zip -r9 $FINAL_KERNEL_ZIP * -x README $FINAL_KERNEL_ZIP
echo "**** Upload Zip Files to gdrive ****"
gdrive upload $FINAL_KERNEL_ZIP
echo "**** Done ****"
cd ..
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_START))
echo -e "$yellow Build PornX Kernel Completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds.$nocol"
else
echo "**** Build Failed ****"
echo "**** Removing leftovers ****"
rm -rf out/
BUILD_END=$(date +"%s")
DIFF=$(($BUILD_END - $BUILD_START))
echo -e "$red mission failed we'll get em next time, Build failed in:- $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) seconds.$nocol"
fi