forked from DevZillion/android_kernel_samsung_a31
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildKernel.sh
More file actions
executable file
·56 lines (44 loc) · 1.47 KB
/
Copy pathbuildKernel.sh
File metadata and controls
executable file
·56 lines (44 loc) · 1.47 KB
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
#!/bin/bash
# Written by Hakalle (Velosh) <hakalle@proton.me>.
# Clone GCC & Proton Clang.
[[ -d "$(pwd)/gcc/" ]] || git clone https://github.com/VH-Devices/toolchains -b gcc-10.3.0 gcc --depth 1 >> /dev/null 2> /dev/null
[[ -d "$(pwd)/clang/" ]] || git clone https://github.com/kdrag0n/proton-clang clang --depth 1 >> /dev/null 2> /dev/null
# Clone KernelSU
# patch -p1 < kernelsu.patch
curl -LSs "https://raw.githubusercontent.com/tiann/KernelSU/954e06bbcced365807cc23d8f1174ebfa193babb/kernel/setup.sh" | bash -
# Export KBUILD_BUILD_{USER,HOST} flags.
export KBUILD_BUILD_USER="zyzoh"
export KBUILD_BUILD_HOST="zyzoh"
# Export ARCH/SUBARCH flags.
export ARCH="arm64"
export SUBARCH="arm64"
# Export CCACHE
export CCACHE_EXEC="$(which ccache)"
export CCACHE="${CCACHE_EXEC}"
export CCACHE_COMPRESS="1"
export USE_CCACHE="1"
$CCACHE -M 50G
# Export toolchain/clang/llvm flags
export CROSS_COMPILE="$(pwd)/gcc/bin/aarch64-buildroot-linux-gnu-"
export CLANG_TRIPLE="aarch64-linux-gnu-"
export CC="$(pwd)/clang/bin/clang"
# Export if/else outdir var
export WITH_OUTDIR=true
# Clear the console
clear
# Remove out dir folder and clean the source
if [ "${WITH_OUTDIR}" == true ]; then
if [ -d "$(pwd)/a31" ]; then
rm -rf a31
fi
fi
# Build time
if [ "${WITH_OUTDIR}" == true ]; then
if [ ! -d "$(pwd)/a31" ]; then
mkdir a31
fi
fi
if [ "${WITH_OUTDIR}" == true ]; then
"${CCACHE}" make O="$(pwd)/a31" a31_ksu_defconfig
"${CCACHE}" make -j`nproc` O="$(pwd)/a31"
fi