-
Notifications
You must be signed in to change notification settings - Fork 1
/
nb1.sh
executable file
·79 lines (66 loc) · 2.55 KB
/
nb1.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
#!/bin/sh
# Color Code Script
Black='\e[0;30m' # Black
Red='\e[0;31m' # Red
Green='\e[0;32m' # Green
Yellow='\e[0;33m' # Yellow
Blue='\e[0;34m' # Blue
Purple='\e[0;35m' # Purple
Cyan='\e[0;36m' # Cyan
White='\e[0;37m' # White
nocol='\033[0m' # Default
echo -e "$Red Kernel For ( HMD Global ) Nokia 8 $nocol"
if [ ! -d ~/android_kernel_wireguard ]; then
echo -e "$Cyan Cloning Wireguard Repository $nocol"
git clone https://git.zx2c4.com/android_kernel_wireguard ~/android_kernel_wireguard
echo -e "$Green Wireguard Repository Cloned $nocol"
else
echo -e "$Green Wireguard Repository Already Present $nocol"
fi
echo -e "$Blue Applying Wireguard Patch $nocol"
if grep -q 'net/wireguard/Kconfig' net/Kconfig; then
echo -e "$Green Wireguard Patches Are Already Applied $nocol"
else
. ~/android_kernel_wireguard/patch-kernel.sh $(pwd)
echo -e "$Green Wireguard Patch Applied $nocol"
fi
if [ ! -d ~/aarch64-linux-android-4.9 ]; then
echo -e "$Cyan Cloning UberTC Repository $nocol"
git clone https://bitbucket.org/matthewdalex/aarch64-linux-android-4.9 ~/aarch64-linux-android-4.9
echo -e "$Green UberTC Repository Cloned $nocol"
else
echo -e "$Green UberTC Repository Already Present $nocol"
fi
if [ ! -d ~/DragonTC-8.0 ]; then
echo -e "$Cyan Cloning DragonTC Repository $nocol"
git clone https://bitbucket.org/xanaxdroid/dragontc-8.0 ~/DragonTC-8.0
echo -e "$Green DragonTC Repository Cloned $nocol"
else
echo -e "$Green DragonTC Repository Already Present $nocol"
fi
echo -e "$Blue Setting Up Toolchain $nocol"
export CROSS_COMPILE="/home/$(whoami)/aarch64-linux-android-4.9/bin/aarch64-linux-android-"
echo -e "$Yellow Setting Up Architecture $nocol"
export ARCH=arm64 && export SUBARCH=arm64
echo -e "$Green Toolchain Path Exported $nocol"
echo -e "$Red Starting Compilation $nocol"
export KBUILD_BUILD_USER="Hmd"
export KBUILD_BUILD_HOST="Nokia"
rm -rf out/*
rm -rf out
mkdir -p out/
echo -e "$Cyan Copying dts $nocol"
mkdir -p out/arch/arm64/
cp -r arch/arm64/boot out/arch/arm64/
rm -rf out/arch/arm64/boot/dts/qcom
mkdir -p out/arch/arm64/boot/dts/qcom/
cp arch/arm64/boot/dts/qcom/*.dts* out/arch/arm64/boot/dts/qcom/
echo -e "$Green Making Clean $nocol"
make O=out/ clean
make O=out/ mrproper
echo -e "$Green Setting Up Deconfig $nocol"
make O=out/ NB1_defconfig
echo -e "$Red Compilation Started $nocol"
make -j$(nproc --all) O=out \
CC="/home/$(whoami)/DragonTC-8.0/bin/clang" \
CLANG_TRIPLE=aarch64-linux-gnu- \