-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.sh
85 lines (74 loc) · 2.13 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
#!/usr/bin/env bash
# clone repo
git clone --depth=1 https://gitlab.com/No1really/ThunderstormReborn-RM6785.git -b Reborn-BT
cd ThunderstormReborn-RM6785
# Dependencies
deps() {
echo "Cloning dependencies"
if [ ! -d "clang" ]; then
mkdir clang && cd clang
wget https://raw.githubusercontent.com/Neutron-Toolchains/antman/main/antman
chmod 744 antman && ./antman -S && cd ../
KBUILD_COMPILER_STRING="Neutron Clang 16"
fi
echo "Done"
}
IMAGE=$(pwd)/out/arch/arm64/boot/Image.gz-dtb
DATE=$(date +"%Y%m%d-%H%M")
START=$(date +"%s")
KERNEL_DIR=$(pwd)
CACHE=1
export CACHE
PATH="${PWD}/clang/bin:${PATH}"
export KBUILD_COMPILER_STRING
ARCH=arm64
export ARCH
KBUILD_BUILD_HOST=MrMnml
export KBUILD_BUILD_HOST
KBUILD_BUILD_USER="edith.brownie"
export KBUILD_BUILD_USER
DEFCONFIG="RM6785_defconfig"
export DEFCONFIG
PROCS=$(nproc --all)
export PROCS
source "${HOME}"/.bashrc && source "${HOME}"/.profile
# Compile plox
compile() {
if [ -d "out" ]; then
rm -rf out && mkdir -p out
fi
make O=out ARCH="${ARCH}" "${DEFCONFIG}"
make -j"${PROCS}" O=out \
ARCH=$ARCH \
CC="clang" \
LD=ld.lld \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi- \
AR=llvm-ar \
NM=llvm-nm \
OBJCOPY=llvm-objcopy \
OBJDUMP=llvm-objdump \
STRIP=llvm-strip
CONFIG_NO_ERROR_ON_MISMATCH=y 2>&1 | tee error.log
if ! [ -a "$IMAGE" ]; then
exit 1
fi
git clone --depth=1 https://github.com/anupamroy777/AnyKernel33.git AnyKernel
cp out/arch/arm64/boot/Image.gz-dtb AnyKernel
}
# Zipping
zipping() {
cd AnyKernel || exit 1
zip -r9 ThunderStorm-Reborn-OSS-KERNEL-"${CODENAME}"-"${DATE}".zip ./*
curl -sL https://git.io/file-transfer | sh
./transfer wet ThunderStorm-Reborn-Test-KERNEL-"${CODENAME}"-"${DATE}".zip
cd ..
}
deps
compile
zipping
END=$(date +"%s")
DIFF=$(($END - $START))
~
~
~