-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sh
executable file
·58 lines (49 loc) · 1.64 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
#!/bin/bash
echo "Cloning dependencies"
git clone --depth=1 https://github.com/kdrag0n/proton-clang clang
git clone --depth=1 https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 gcc
git clone --depth=1 https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9 gcc32
git clone https://github.com/2e-dev/AnyKernel3.git --depth=1 AnyKernel
echo "Done"
KERNEL_DIR=$(pwd)
IMAGE="${KERNEL_DIR}/out/arch/arm64/boot/Image.gz-dtb"
TANGGAL=$(date +"%Y%m%d-%H")
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
PATH="${KERNEL_DIR}/clang/bin:${KERNEL_DIR}/gcc/bin:${KERNEL_DIR}/gcc32/bin:${PATH}"
export KBUILD_COMPILER_STRING="$(${KERNEL_DIR}/clang/bin/clang --version | head -n 1 | perl -pe 's/\(http.*?\)//gs' | sed -e 's/ */ /g')"
export ARCH=arm64
export KBUILD_BUILD_USER=teracube
export KBUILD_BUILD_HOST=teracube
make O=out ARCH=arm64 2e_defconfig
# Compile plox
compile() {
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- $1 $2 $3
}
module() {
[ -d "modules" ] && rm -rf modules || mkdir -p modules
compile \
INSTALL_MOD_PATH=../modules \
INSTALL_MOD_STRIP=1 \
modules_install
}
# Zipping
zipping() {
cd AnyKernel || exit 1
cp ../out/arch/arm64/boot/Image.gz-dtb .
zip -r9 Styx-2e-BETA-${TANGGAL}.zip *
cd ..
}
# Upload
upload() {
cd AnyKernel && curl -sL https://git.io/file-transfer | sh && ./transfer wet *.zip
cd ..
}
compile
module
zipping
upload