forked from chips-project/msm-4.14
-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sh
executable file
·72 lines (69 loc) · 2.26 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
#!/bin/bash
echo "Cloning dependencies"
git clone https://github.com/najahiiii/AnyKernel3.git -b ginkgo-ten --depth=1 AnyKernel
mkdir .signer && curl -sLo .signer/zipsigner-3.0.jar https://raw.githubusercontent.com/najahiiii/Noob-Script/noob/bin/zipsigner-3.0.jar
echo "Done"
KERNEL_DIR=$(pwd)
IMAGE=$(pwd)/out/arch/arm64/boot/Image.gz-dtb
START3=$(date +"%s")
export ARCH=arm64
export KBUILD_BUILD_USER=s133py
export KBUILD_BUILD_HOST=Kali
export PATH="/mnt/kernels/Violet/msm-4.14/clang-llvm/bin:${PATH}"
git config --global user.email "[email protected]"
git config --global user.name "Thiviyan"
# Compile plox
function compile() {
make -j"$(nproc)" O=out vendor/nethunter_defconfig
make O=out -j$(nproc) \
CC=clang \
AR=llvm-ar \
NM=llvm-nm \
OBJCOPY=llvm-objcopy \
OBJDUMP=llvm-objdump \
STRIP=llvm-strip \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi-
make O=out -j$(nproc) \
CC=clang \
AR=llvm-ar \
NM=llvm-nm \
OBJCOPY=llvm-objcopy \
OBJDUMP=llvm-objdump \
STRIP=llvm-strip \
CROSS_COMPILE=aarch64-linux-gnu- \
CROSS_COMPILE_ARM32=arm-linux-gnueabi-\
modules_install INSTALL_MOD_PATH=modules_out
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 -r9q unsigned.zip * -x LICENSE README.md *placeholder
mv unsigned.zip ../.signer/
cd ..
}
# Signer
function signer() {
cd .signer || exit 1
TANGGAL3=$(date +'%H%M-%d%m%y')
if [ "$is_test" = true ]; then
java -jar zipsigner-3.0.jar \
unsigned.zip Team420_NH-Ginkgo-Willow-A9-Alpha-"rc${CIRCLE_BUILD_NUM}-${TANGGAL3}-${SHA}".zip
rm unsigned.zip
else
java -jar zipsigner-3.0.jar \
unsigned.zip Team420_NH-Ginkgo-Willow-A9-"${TANGGAL3}-${SHA}".zip
rm unsigned.zip
fi
cd ..
}
compile
zipping
signer
END3=$(date +"%s")
DIFF3=$(($END3 - $START3))