-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.sh
81 lines (58 loc) · 1.55 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
#!/bin/bash
# Clone Repo
echo
echo "Cloning Android Kernel Tools repo"
echo
git clone --depth=1 https://github.com/kdrag0n/proton-clang.git clang
echo
echo "AnyKernel3 Repo"
echo
git clone --depth=1 https://github.com/osm0sis/AnyKernel3.git
echo
echo "Cloning Kernel Repo"
echo
git clone --depth=1 --branch lineage-20 https://github.com/LineageOS/android_kernel_xiaomi_surya.git kernel
echo
echo "Setting up env"
echo
sudo apt-get install device-tree-compiler bc cpio ccache zip
mkdir -p out
export ZIPNAME=Surya-Kernel.zip
export ARCH=arm64
export SUBARCH=arm64
export CLANG_PATH=/home/runner/work/Kernel-Actions/Kernel-Actions/clang/bin
PATH=/usr/lib/ccache:${PATH}
export PATH=${CLANG_PATH}:${PATH}
export CLANG_TRIPLE=aarch64-linux-gnu-
export CROSS_COMPILE=$CLANG_PATH/aarch64-linux-gnu-
export CROSS_COMPILE_ARM32=$CLANG_PATH/arm-linux-gnueabi-
echo
echo "Moving to kernel dir"
echo
cp surya-docker_defconfig kernel/arch/arm64/configs/
cd kernel
echo $PWD
echo
echo "Clean Build Directory"
echo
make clean && make mrproper
echo
echo "Issue Build Commands"
echo
mkdir -p out
echo
echo "Set DEFCONFIG"
echo
make CC=clang O=out surya-docker_defconfig
echo
echo "Build The Good Stuff"
echo
make -j8 O=out CC="ccache clang" AR=llvm-ar NM=llvm-nm OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump STRIP=llvm-strip Image.gz-dtb
cd ..
ls kernel/out/arch/arm64/boot/
cp kernel/out/arch/arm64/boot/Image.gz-dtb ./AnyKernel3
cp anykernel.patch ./AnyKernel3
cd AnyKernel3
git apply anykernel.patch
rm anykernel.patch
zip "../$ZIPNAME" * -x '*.git*' README.md *placeholder