-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.sh
executable file
·99 lines (77 loc) · 1.67 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
94
95
96
97
98
99
#!/bin/bash
rm .version
# Bash Color
green='\033[01;32m'
red='\033[01;31m'
blink_red='\033[05;31m'
restore='\033[0m'
clear
# Resources
export CLANG_PATH=~/jose/pixelos/prebuilts/clang/host/linux-x86/clang-r530567/bin
export PATH=${CLANG_PATH}:${PATH}
export CROSS_COMPILE=${CLANG_PATH}/aarch64-linux-gnu-
export CROSS_COMPILE_ARM32=${CLANG_PATH}/arm-linux-gnueabi-
DEFCONFIG="cepheus_defconfig"
# Kernel Details
VER=""
# Paths
KERNEL_DIR=`pwd`
REPACK_DIR=~/anykernel
ZIP_MOVE=~/TREES
# Functions
function clean_all {
rm -rf $REPACK_DIR/Image*
cd $KERNEL_DIR
echo
make clean && make mrproper
}
function make_kernel {
echo
make LLVM=1 LLVM_IAS=1 $DEFCONFIG
make LLVM=1 LLVM_IAS=1 -j$(grep -c ^processor /proc/cpuinfo)
}
function make_boot {
cp out/arch/arm64/boot/Image.gz-dtb $REPACK_DIR
}
function make_zip {
cd $REPACK_DIR
zip -r9 `echo $ZIP_NAME`.zip *
mv `echo $ZIP_NAME`*.zip $ZIP_MOVE
cd $KERNEL_DIR
}
DATE_START=$(date +"%s")
echo -e "${green}"
echo "Making Kernel:"
echo -e "${restore}"
# Vars
BASE_AK_VER="REVUELTO-MI9-"
DATE=`date +"%Y%m%d-%H%M"`
AK_VER="$BASE_AK_VER$VER"
ZIP_NAME="$AK_VER"-"$DATE"
#export LOCALVERSION=~`echo $AK_VER`
#export LOCALVERSION=~`echo $AK_VER`
export ARCH=arm64
export SUBARCH=arm64
export KBUILD_BUILD_USER=balgxmr
export KBUILD_BUILD_HOST=balgxmr
echo
echo Starting cleaning...
echo
clean_all
echo
echo All cleaned.
echo
echo Building kernel...
echo
make_kernel
make_boot
make_zip
DATE_END=$(date +"%s")
DIFF=$(($DATE_END - $DATE_START))
echo
find $ZIP_MOVE -type f -mmin -5 -mmin +0
echo
echo -e "${green}"
echo "### build completed in $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) second(s)!"
echo -e "${restore}"
echo