-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsdm710.sh
executable file
·78 lines (76 loc) · 2.94 KB
/
sdm710.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
#!/usr/bin/env bash
echo "Cloning dependencies"
rm -rf AnyKernel
git clone --depth=1 https://github.com/kdrag0n/proton-clang clang
git clone --depth=1 https://github.com/App-tester-ANAGHA/AnyKernel3.git -b RMX1971 AnyKernel
git clone --depth=1 https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_aarch64_aarch64-linux-android-4.9 los-4.9-64
git clone --depth=1 https://github.com/LineageOS/android_prebuilts_gcc_linux-x86_arm_arm-linux-androideabi-4.9 los-4.9-32
echo "Done"
IMAGE=$(pwd)/out/arch/arm64/boot/Image.gz-dtb
TANGGAL=$(date +"%F-%S")
START=$(date +"%s")
KERNEL_DIR=$(pwd)
PATH="${PWD}/clang/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_HOST=NexLTS
export KBUILD_BUILD_USER="App_tester_ANAGHA"
# sticker plox
function sticker() {
curl -s -X POST "https://api.telegram.org/bot$token/sendSticker" \
-d sticker="CAACAgEAAxkBAAEnKnJfZOFzBnwC3cPwiirjZdgTMBMLRAACugEAAkVfBy-aN927wS5blhsE" \
-d chat_id=$chat_id
}
# Send info plox channel
function sendinfo() {
curl -s -X POST "https://api.telegram.org/bot$token/sendMessage" \
-d chat_id="$chat_id" \
-d "disable_web_page_preview=true" \
-d "parse_mode=html" \
-d text="<b>Test Kernel</b>%0ABuild started on <code>NexLTS</code>%0AFor device <b>Realme 5 Pro</b> (r5p)%0Abranch <code>$(git rev-parse --abbrev-ref HEAD)</code> (master)%0AUnder commit <code>$(git log --pretty=format:'"%h : %s"' -1)</code>%0AUsing compiler: <code>${KBUILD_COMPILER_STRING}</code>%0AStarted on <code>$(date)</code>%0A<b>Build Status:</b> Beta"
}
# Push kernel to channel
function push() {
cd AnyKernel
ZIP=$(echo *.zip)
curl -F document=@$ZIP "https://api.telegram.org/bot$token/sendDocument" \
-F chat_id="$chat_id" \
-F "disable_web_page_preview=true" \
-F "parse_mode=html" \
-F caption="Build took $(($DIFF / 60)) minute(s) and $(($DIFF % 60)) second(s). | For <b>Realme 5 Pro (r5p)</b> | <b>$(${GCC}gcc --version | head -n 1 | perl -pe 's/\(http.*?\)//gs' | sed -e 's/ */ /g')</b>"
}
# Fin Error
function finerr() {
curl -s -X POST "https://api.telegram.org/bot$token/sendMessage"
-d chat_id="$chat_id" \
-d "disable_web_page_preview=true" \
-d "parse_mode=markdown" \
-d text="Build throw an error(s)"
exit 1
}
# Compile plox
function compile() {
make O=out ARCH=arm64 RMX1971_defconfig
make -j$(nproc --all) O=out \
ARCH=arm64 \
CC=clang \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi-
if ! [ -a "$IMAGE" ]; then
finerr
exit 1
fi
cp out/arch/arm64/boot/Image.gz-dtb AnyKernel
}
# Zipping
function zipping() {
cd AnyKernel || exit 1
zip -r9 NexLTS-realme_sdm710-${TANGGAL}.zip *
cd ..
}
sendinfo
compile
zipping
END=$(date +"%s")
DIFF=$(($END - $START))
push