-
Notifications
You must be signed in to change notification settings - Fork 23
/
compile_with_tc.sh
42 lines (37 loc) · 1.04 KB
/
compile_with_tc.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 cc 2023 sirnewbies
# setup color
red='\033[0;31m'
green='\e[0;32m'
white='\033[0m'
yellow='\033[0;33m'
# setup dir
WORK_DIR=$(pwd)
KERN_IMG="${WORK_DIR}/out/arch/arm64/boot/Image-gz.dtb"
KERN_IMG2="${WORK_DIR}/out/arch/arm64/boot/Image.gz"
function clean() {
echo -e "\n"
echo -e "$red << cleaning up >> \n$white"
echo -e "\n"
rm -rf out
}
function build_kernel() {
export PATH="/home/romiyusnandar/toolchains/proton-clang/bin:$PATH"
make -j$(nproc --all) O=out ARCH=arm64 <DEVICE>_defconfig
make -j$(nproc --all) ARCH=arm64 O=out \
CC=clang \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi-
if [ -e "$KERN_IMG" ] || [ -e "$KERN_IMG2" ]; then
echo -e "\n"
echo -e "$green << compile kernel success! >> \n$white"
echo -e "\n"
else
echo -e "\n"
echo -e "$red << compile kernel failed! >> \n$white"
echo -e "\n"
fi
}
# execute
clean
build_kernel