This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.sh
234 lines (203 loc) · 6.62 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
#!/bin/bash
#
# Copyright (C) 2020 RB INTERNATIONAL NETWORK
#
# An Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# colours
BOLD='\033[1m'
GRN='\033[01;32m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
RED='\033[01;31m'
RST='\033[0m'
echo "Cloning dependencies if they don't exist...."
# colours
rm -rf CPH1859
rm -rf RMX1831
mkdir CPH1859
mkdir RMX1831
cd CPH1859 && mkdir final
cd ../RMX1831 && mkdir final
cd ..
if [ ! -d clang ]
then
git clone --depth=1 https://github.com/kardebayan/android_prebuilts_clang_host_linux-x86_clang-5696680 clang
fi
if [ ! -d gcc32 ]
then
git clone --depth=1 https://github.com/KudProject/arm-linux-androideabi-4.9 gcc32
fi
if [ ! -d gcc ]
then
git clone --depth=1 https://github.com/KudProject/aarch64-linux-android-4.9 gcc
fi
git clone https://gitlab.com/CyberJalagam/AnyKernel3 -b rm1 --depth=1 CPH1859/AnyKernel
git clone https://gitlab.com/CyberJalagam/AnyKernel3 -b rmu1 --depth=1 RMX1831/AnyKernel
echo "Env 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=jaishnav
export KBUILD_BUILD_HOST=rbinternational
#
# BEGIN REALME 1
#
# Start configs for Realme 1
function compile() {
echo -e "${CYAN}"
make -j$(nproc) O=out ARCH=arm64 oppo6771_17065_defconfig
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-
echo -e "${RST}"
SUCCESS=$?
if [ $SUCCESS -eq 0 ]
then
echo -e "${GRN}"
echo "------------------------------------------------------------"
echo "Compilation successful, Aliens invaded"
echo "Image.gz-dt can be found at out/arch/arm64/boot/Image.gz-dtb"
cp out/arch/arm64/boot/Image.gz-dtb CPH1859/AnyKernel
echo "------------------------------------------------------------"
echo -e "${RST}"
else
echo -e "${RED}"
echo "------------------------------------------------------------"
echo "Compilation failed, Earth is safe!"
echo "------------------------------------------------------------"
echo -e "${RST}"
fi
}
# Zipping
function zipping-fast() {
echo -e "${YELLOW}"
echo "Alien invasion in progress... "
cd CPH1859/AnyKernel || exit 1
zip -r9 AlienKernel™️-v3.0-CPH1859-fastcharge-${TANGGAL}.zip * > /dev/null 2>&1
cp -v AlienKernel™️-v3.0-CPH1859-fastcharge-${TANGGAL}.zip ../final
cd ../..
echo "Aliens stored at CPH1859/final/AlienKernel™️-v3.0-CPH1859-fastcharge-${TANGGAL}.zip"
echo -e "${RST}"
}
# Zipping
function zipping-normal() {
echo -e "${YELLOW}"
echo "Alien invasion in progress... "
cd CPH1859/AnyKernel || exit 1
zip -r9 AlienKernel™️-v3.0-CPH1859-${TANGGAL}.zip * > /dev/null 2>&1
cp -v AlienKernel™️-v3.0-CPH1859-${TANGGAL}.zip ../final
cd ../..
echo "Aliens stored at CPH1859/final/AlienKernel™️-v3.0-CPH1859-${TANGGAL}.zip"
echo -e "${RST}"
}
# End configs for Realme 1
# Compile for CPH1859 (fast charge)
compile
zipping-fast
# Clean
rm -rf out
rm -rf CPH1859/AnyKernel
git clone https://gitlab.com/CyberJalagam/AnyKernel3 -b rm1 --depth=1 CPH1859/AnyKernel
# Nuke fast charging
wget https://github.com/CyberJalagam/kernel_oppo_mt6771/commit/0610a4fe15ffaac96e546fb0b7401536bbf5178c.patch
git am 0610a4fe15ffaac96e546fb0b7401536bbf5178c.patch
rm 0610a4fe15ffaac96e546fb0b7401536bbf5178c.patch
# Compile for CPH1859 (normal)
compile
zipping-normal
# Clean
rm -rf out
#
# END REALME 1
#
#
# BEGIN REALME U1
#
export OPPO_18611=1
# Compile plox
function compile-u1() {
echo -e "${CYAN}"
make -j$(nproc) O=out ARCH=arm64 oppo6771_18611_defconfig
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-
echo -e "${RST}"
SUCCESS=$?
if [ $SUCCESS -eq 0 ]
then
echo -e "${GRN}"
echo "------------------------------------------------------------"
echo "Compilation successful, Aliens invaded"
echo "Image.gz-dt can be found at out/arch/arm64/boot/Image.gz-dtb"
cp out/arch/arm64/boot/Image.gz-dtb RMX1831/AnyKernel
echo "------------------------------------------------------------"
echo -e "${RST}"
else
echo -e "${RED}"
echo "------------------------------------------------------------"
echo "Compilation failed, Earth is safe!"
echo "------------------------------------------------------------"
echo -e "${RST}"
fi
}
# Zipping
function zipping-u1-fast() {
echo -e "${YELLOW}"
echo "Alien invasion in progress... "
cd RMX1831/AnyKernel || exit 1
zip -r9 AlienKernel™️-v1.0-RMX1831-fastcharge-${TANGGAL}.zip * > /dev/null 2>&1
cp -v AlienKernel™️-v1.0-RMX1831-fastcharge-${TANGGAL}.zip ../final
cd ../..
echo "Aliens stored at RMX1831/final/AlienKernel™️-v1.0-RMX1831-fastcharge-${TANGGAL}.zip"
echo -e "${RST}"
}
}
# Zipping
function zipping-u1() {
echo -e "${YELLOW}"
echo "Alien invasion in progress... "
cd RMX1831/AnyKernel || exit 1
zip -r9 AlienKernel™️-v1.0-RMX1831-${TANGGAL}.zip * > /dev/null 2>&1
cp -v AlienKernel™️-v1.0-RMX1831-${TANGGAL}.zip ../final
cd ../..
echo "Aliens stored at RMX1831/final/AlienKernel™️-v1.0-RMX1831-${TANGGAL}.zip"
echo -e "${RST}"
}
# Compile for realme u1 (normal)
compile-u1
zipping-u1
# Clean
rm -rf out
rm -rf RMX1831/AnyKernel
git clone https://gitlab.com/CyberJalagam/AnyKernel3 -b rmu1 --depth=1 RMX1831/AnyKernel
# Add fast charging
git reset --hard HEAD~1
# Compile for realme u1 (fast charging)
compile-u1
zipping-u1-fast
#
# END REALME U1
#