forked from ThunderStorms21th/Galaxy-S10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ts-build-arter97.sh
executable file
·315 lines (295 loc) · 10 KB
/
ts-build-arter97.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#!/bin/bash
#
# Kernel Build Script v1.0 by ThunderStorms Team
#
LOG=compile_build.log
RDIR=$(pwd)
export K_VERSION="v2.6"
export K_NAME="ThundeRStormS-Kernel"
export K_BASE="FUE6"
export ANDROID_VERSION=110000
export PLATFORM_VERSION=11
export ANDROID_MAJOR_VERSION=r
export CURRENT_ANDROID_MAJOR_VERSION=r
export BUILD_PLATFORM_VERSION=11
ANDROID=OneUI-R
# export BUILD_CROSS_COMPILE=/home/nalas/kernel/AiO-S10-TS/toolchain/gcc-cfp/gcc-cfp-jopp-only/aarch64-linux-android-4.9/bin/aarch64-linux-android-
# export CROSS_COMPILE=$BUILD_CROSS_COMPILE
OUTDIR=$RDIR/arch/arm64/boot
DTSDIR=$RDIR/arch/arm64/boot/dts/exynos
DTBDIR=$OUTDIR/dtb
DTBTOOL=$RDIR/tools/dtb
DTCTOOL=$RDIR/scripts/dtc/dtc
INCDIR=$RDIR/include
PAGE_SIZE=2048
DTB_PADDING=0
# MAIN PROGRAM
# ------------
MAIN()
{
(
## COPY BACK CAMERA FILES FOR OneUI 3.x
cp -rf /home/nalas/kernel/AiO-S10-TS/builds/camera-oneui3/. /home/nalas/kernel/AiO-S10-TS/drivers/media/platform/exynos/fimc-is2
START_TIME=`date +%T`
if [ $MODEL = "G970F" ]; then
./build mkimg model=G970F name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G970N" ]; then
./build mkimg model=G970N name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G973F" ]; then
./build mkimg model=G973F name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G973N" ]; then
./build mkimg model=G973N name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G975F" ]; then
./build mkimg model=G975F name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G975N" ]; then
./build mkimg model=G975N name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G977B" ]; then
./build mkimg model=G977B name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "G977N" ]; then
./build mkimg model=G977N name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "N970F" ]; then
./build mkimg model=N970F name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "N971N" ]; then
./build mkimg model=N971N name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "N975F" ]; then
./build mkimg model=N975F name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "N976N" ]; then
./build mkimg model=N976N name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
elif [ $MODEL = "N976B" ]; then
./build mkimg model=N976B name="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION" toolchain=arter97 +dtb
fi
END_TIME=`date +%T`
echo "Start compile time is $START_TIME"
echo "End compile time is $END_TIME"
echo ""
echo "Your flasheable release can be found in the builds folder with name :"
echo "$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION-`date +%Y-%m-%d`.img"
echo ""
) 2>&1 | tee -a ./$LOG
}
BUILD_FLASHABLES()
{
cd $RDIR/builds
mkdir temp2
cp -rf zip-OneUIR/common/. temp2
cp -rf *.img temp2/
cd temp2
echo ""
echo "Compressing kernels..."
tar cv *.img | xz -9 > kernel.tar.xz
echo "Copying kernels to ts folder..."
mv kernel.tar.xz ts/
# mv *.img ts/
rm -rf *.img
zip -9 -r ../$ZIP_NAME *
cd ..
rm -rf temp2
}
RUN_PROGRAM()
{
MAIN
# BUILD_DTBO
# BUILD_DTB
cp -f boot-$MODEL.img builds/$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION.img
cp -f $MODEL-dtb.img builds/zip-OneUIR/common/ts/dtb/$MODEL-dtb.img
cp -f $MODEL-dtbo.img builds/zip-OneUIR/common/ts/dtb/$MODEL-dtbo.img
}
RUN_PROGRAM2()
{
MAIN
# BUILD_DTBO
# BUILD_DTB
cp -f boot-$MODEL.img builds/$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION.img
cp -f $MODEL-dtb.img builds/zip-OneUIR/common/ts/dtb/$MODEL-dtb.img
cp -f $MODEL-dtbo.img builds/zip-OneUIR/common/ts/dtb/$MODEL-dtbo.img
}
BUILD_DTBO()
{
python tools/dtbo/mkdtboimg.py create /home/nalas/kernel/AiO-S10-TS/arch/arm64/boot/dts/samsung/dtbo.img /home/nalas/kernel/AiO-S10-TS/arch/arm64/boot/dts/samsung/*.dtbo
}
BUILD_DTB()
{
echo "Processing dts files."
for dts in $DTSFILES; do
echo "=> Processing: ${dts}.dts"
"${CROSS_COMPILE}cpp" -nostdinc -undef -x assembler-with-cpp -I "$INCDIR" "$DTSDIR/${dts}.dts" > "$DTBDIR/${dts}.dts"
echo "=> Generating: ${dts}.dtb"
$DTCTOOL -p $DTB_PADDING -i "$DTSDIR" -O dtb -o "$DTBDIR/${dts}.dtb" "$DTBDIR/${dts}.dts"
# dtc -p $DTB_PADDING -i "$DTSDIR" -O dtb -o "$DTBDIR/${dts}.dtb" "$DTBDIR/${dts}.dts"
done
echo "Generating dtb.img."
tools/dtbo/mkdtboimg.py create /home/nalas/kernel/AiO-S10-TS/arch/arm64/boot/dtb/exynos9820.img --id=0 --rev=0 --custom1=0xff000000 arch/arm64/boot/dts/exynos/exynos9820.dtb
echo "Done."
}
# RUN PROGRAM
# -----------
# PROGRAM START
# -------------
clear
echo "*****************************************"
echo "* ThunderStorms Kernel Build Script *"
echo "*****************************************"
echo ""
echo " CUSTOMIZABLE STOCK SAMSUNG KERNEL"
echo " Arter 97"
echo " Build Kernel for"
echo "-----------------------------------------"
echo "| S10 / N10 family for OneUI Q ROMs |"
echo "-----------------------------------------"
echo "(1) SM-G970F"
echo "(2) SM-G970N"
echo "(3) SM-G973F/N"
echo "(4) SM-G975F/N"
echo "(5) SM-G977B/N"
echo "(6) SM-N970F"
echo "(7) SM-N971N"
echo "(8) SM-N975F"
echo "(9) SM-N976N"
echo "(10) SM-N976B"
echo "(11) All variants"
echo ""
read -p "Select an option to compile the kernel: " prompt
if [ $prompt = "1" ]; then
MODEL=G970F
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G970F Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "2" ]; then
MODEL=G970N
ZIP_DATE=`date +%Y%m%d`
#ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G973N Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "3" ]; then
MODEL=G973F
ZIP_DATE=`date +%Y%m%d`
# ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G973F Selected"
RUN_PROGRAM
MODEL=G973N
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-F-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G973N Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "4" ]; then
MODEL=G975F
ZIP_DATE=`date +%Y%m%d`
# ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G975F Selected"
RUN_PROGRAM
MODEL=G975N
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-F-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G975N Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "5" ]; then
MODEL=G977B
ZIP_DATE=`date +%Y%m%d`
# ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G977B Selected"
RUN_PROGRAM
MODEL=G977N
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-F-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-G977N Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "6" ]; then
MODEL=N970F
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-N970F Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "7" ]; then
MODEL=N971N
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-N971N Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "8" ]; then
MODEL=N975F
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-N975F Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "9" ]; then
MODEL=N976N
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-N976N Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "10" ]; then
MODEL=N976B
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-$MODEL-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "SM-N976B Selected"
RUN_PROGRAM
BUILD_FLASHABLES
elif [ $prompt = "11" ]; then
ZIP_DATE=`date +%Y%m%d`
ZIP_NAME=$K_NAME-S10-N10-$ANDROID-$K_VERSION-ARTER97-$ZIP_DATE.zip
export KERNEL_VERSION="$K_NAME-$K_BASE-$ANDROID-$MODEL-$K_VERSION"
echo "All variants Selected"
MODEL=G970F
echo "Compiling SM-G970F ..."
RUN_PROGRAM2
MODEL=G973F
echo "Compiling SM-G973F ..."
RUN_PROGRAM2
MODEL=G975F
echo "Compiling SM-G975F ..."
RUN_PROGRAM2
MODEL=G975N
echo "Compiling SM-G975N ..."
RUN_PROGRAM2
MODEL=G970N
echo "Compiling SM-G970N ..."
RUN_PROGRAM2
MODEL=G973N
echo "Compiling SM-G973N ..."
RUN_PROGRAM2
MODEL=G977N
echo "Compiling SM-G977N ..."
RUN_PROGRAM2
MODEL=G977B
echo "Compiling SM-G977B ..."
RUN_PROGRAM2
MODEL=N970F
echo "Compiling SM-N970F ..."
RUN_PROGRAM2
MODEL=N975F
echo "Compiling SM-N975F ..."
RUN_PROGRAM2
MODEL=N971N
echo "Compiling SM-N971N ..."
RUN_PROGRAM2
MODEL=N976N
echo "Compiling SM-N976N ..."
RUN_PROGRAM2
MODEL=N976B
echo "Compiling SM-N976B ..."
RUN_PROGRAM2
BUILD_FLASHABLES
fi