-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
71 lines (61 loc) · 2.49 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
#!/bin/bash
echo -e "==========================="
echo -e "= START COMPILING KERNEL ="
echo -e "==========================="
bold=$(tput bold)
normal=$(tput sgr0)
#apt update -y && apt upgrade -y && apt install nano bc bison ca-certificates curl flex gcc git libc6-dev libssl-dev openssl python-is-python3 ssh wget zip zstd sudo make clang gcc-arm-linux-gnueabi software-properties-common build-essential libarchive-tools gcc-aarch64-linux-gnu -y && apt install build-essential -y && apt install libssl-dev libffi-dev libncurses5-dev zlib1g zlib1g-dev libreadline-dev libbz2-dev libsqlite3-dev make gcc -y && apt install pigz -y && apt install python2 -y && apt install python3 -y
# Scrip option
while (( ${#} )); do
case ${1} in
"-Z"|"--zip") ZIP=true ;;
esac
shift
done
[[ -z ${ZIP} ]] && { echo "${bold}LOADING-_-....${normal}"; }
DEFCONFIG="vince_defconfig"
export KBUILD_BUILD_USER=Furina×Chiori
export TZ=Asia/Jakarta
#export KBUILD_BUILD_VERSION=1
#export KBUILD_BUILD_TIMESTAMP="Thu Jan 1 07:00:00 WIB 2023"
export KBUILD_BUILD_HOST=Fontaine-Machine-Industry-Host
export KERNELDIR="/workspaces/File_Rom/kt"
export KERNELNAME="Furina"
export SRCDIR="${KERNELDIR}"
export OUTDIR="${KERNELDIR}/out"
export ANYKERNEL="${KERNELDIR}/AnyKernel3"
export DEFCONFIG="vince_defconfig"
export ZIP_DIR="${KERNELDIR}/files"
export IMAGE="${OUTDIR}/arch/arm64/boot/Image.gz-dtb"
export ZIPNAME="${KERNELNAME}-Kernel-KSU-vince-$(date +%m%d-%H%M%S)-OC.zip"
export FINAL_ZIP="${ZIP_DIR}/${ZIPNAME}"
export TC_DIR="/workspaces/File_Rom/azure-clang"
export PATH="$TC_DIR/bin:$PATH"
if [[ $1 = "-r" || $1 = "--regen" ]]; then
make O=out ARCH=arm64 $DEFCONFIG savedefconfig
cp out/defconfig arch/arm64/configs/$DEFCONFIG
exit
fi
if [[ $1 = "-c" || $1 = "--clean" ]]; then
rm -rf out
fi
mkdir -p out
make O=out ARCH=arm64 $DEFCONFIG
make -j$(nproc --all) O=out ARCH=arm64 CC=clang LD=ld.lld HOSTCC=clang HOSTCXX=clang++ READELF=llvm-readelf HOSTAR=llvm-ar AR=llvm-ar AS=llvm-as NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip CROSS_COMPILE=aarch64-linux-gnu- CROSS_COMPILE_ARM32=arm-linux-gnueabi- 2>&1 | tee log.txt
echo -e "==========================="
echo -e " COMPILE KERNEL COMPLETE "
echo -e "==========================="
# Make ZIP using AnyKernel
# ================
rm -rf ${ZIP_DIR};
mkdir ${ZIP_DIR};
echo -e "Copying kernel image";
cp -v "${IMAGE}" "${ANYKERNEL}/";
cd -;
cd ${ANYKERNEL};
zip -r9 ${FINAL_ZIP} *;
bash ${KERNELDIR}/gf.sh ${FINAL_ZIP};
cd -;
if [[ ":v" ]]; then
exit
fi