-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
63 lines (47 loc) · 1.45 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
#!/bin/bash
set -o errexit
[[ $# -eq 1 ]] || exit 1
DEVICE=$1
if [[ $DEVICE != X00P ]]; then
echo invalid device codename
exit 1
fi
TOP=$(realpath ../)
export KBUILD_BUILD_USER=Flamefusion
export KBUILD_BUILD_HOST=linux
PATH="$TOP/tools/build-tools/linux-x86/bin:$PATH"
PATH="$TOP/tools/build-tools/path/linux-x86:$PATH"
PATH="$TOP/tools/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:$PATH"
PATH="$TOP/tools/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:$PATH"
PATH="$TOP/tools/clang/host/linux-x86/clang-r353983c/bin:$PATH"
PATH="$TOP/tools/misc/linux-x86/lz4:$PATH"
PATH="$TOP/tools/misc/linux-x86/dtc:$PATH"
PATH="$TOP/tools/misc/linux-x86/libufdt:$PATH"
export LD_LIBRARY_PATH="$TOP/tools/clang/host/linux-x86/clang-r353983c/lib64:$LD_LIBRARY_PATH"
make \
clean \
mrproper \
O=out \
ARCH=arm64 \
SUBARCH=ARM64 \
CC=clang \
HOSTCC=clang \
HOSTCXX=clang++ \
CLANG_TRIPLE=aarch64-linux-gnu- \
CROSS_COMPILE=aarch64-linux-android- \
CROSS_COMPILE_ARM32=arm-linux-androideabi- \
${DEVICE}_defconfig
make \
-j$(nproc) \
O=out \
ARCH=arm64 \
SUBARCH=ARM64 \
CC=clang \
HOSTCC=clang \
HOSTCXX=clang++ \
CLANG_TRIPLE=aarch64-linux-gnu- \
CROSS_COMPILE=aarch64-linux-android- \
CROSS_COMPILE_ARM32=arm-linux-androideabi-
rm -rf "$TOP/Output/$DEVICE-kernel"
mkdir -p "$TOP/Output/$DEVICE-kernel"
cp out/arch/arm64/boot/Image.gz-dtb "$TOP/Output/$DEVICE-kernel"