-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (27 loc) · 1.05 KB
/
build.sh
File metadata and controls
executable file
·36 lines (27 loc) · 1.05 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
#!/bin/bash
set -o errexit
DEVICE=$1
if [[ $DEVICE != sargo && $DEVICE != bonito ]]; then
exit 1
fi
TOP=$(realpath ../../..)
export KBUILD_BUILD_USER=grapheneos
export KBUILD_BUILD_HOST=grapheneos
PATH="$TOP/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin:$PATH"
PATH="$TOP/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9/bin:$PATH"
PATH="$TOP/prebuilts/clang/host/linux-x86/clang-4393122/bin:$PATH"
PATH="$TOP/prebuilts/misc/linux-x86/lz4:$PATH"
PATH="$TOP/prebuilts/misc/linux-x86/dtc:$PATH"
PATH="$TOP/prebuilts/misc/linux-x86/libufdt:$PATH"
export LD_LIBRARY_PATH="$TOP/prebuilts/clang/host/linux-x86/clang-4393122/lib64:$LD_LIBRARY_PATH"
make O=out ARCH=arm64 ${DEVICE}_defconfig
make -j$(nproc) \
O=out \
ARCH=arm64 \
CC=clang \
CLANG_TRIPLE=aarch64-linux-gnu- \
CROSS_COMPILE=aarch64-linux-android- \
CROSS_COMPILE_ARM32=arm-linux-androideabi-
rm -rf "$TOP/device/google/$DEVICE-kernel"
mkdir -p "$TOP/device/google/$DEVICE-kernel"
cp out/arch/arm64/boot/{dtbo.img,Image.lz4-dtb} "$TOP/device/google/$DEVICE-kernel"