6
6
#
7
7
# The versions are:
8
8
# 5.0: 21 (tested at NDK r13b)
9
- # 5.1: 22 (tested at NDK r21d, unused DT entry warnings )
10
- # 6.0: 23
9
+ # 5.1: 22 (tested at NDK r21d, unused DT)
10
+ # 6.0: 23 (tested at NDK r21d, unused DT)
11
11
# 7.0: 24
12
12
# 7.1: 25
13
13
# 8.0: 26
@@ -28,7 +28,7 @@ main() {
28
28
local arch=" ${1} "
29
29
local version=" ${ANDROID_VERSION} "
30
30
local major_version=" ${version// .*/ } "
31
- export ANDROID_TAG =" android-${version} "
31
+ local tag =" android-${version} "
32
32
33
33
if [[ " ${ANDROID_SYSTEM_COMPLETE} " != " 1" ]] && [[ " ${major_version} " -ge " 12" ]]; then
34
34
echo " Only minimal Android builds for versions 11 or lower are supported" 1>&2
76
76
xz-utils
77
77
purge_list+=(default-jre)
78
78
79
- # curl --retry 3 -sSfL https://storage.googleapis.com/git-repo-downloads/repo -O
80
- # chmod +x repo
81
- #
82
- # # TODO(ahuszagh) Add --depth 1
83
- # python3 ./repo init -u "https://android.googlesource.com/platform/manifest" -b "android-${version}"
79
+ curl --retry 3 -sSfL https://storage.googleapis.com/git-repo-downloads/repo -O
80
+ chmod +x repo
81
+ python3 ./repo init -u https://android.googlesource.com/platform/manifest -b " ${tag} "
84
82
85
83
local tools=(
86
84
cat chmod chown cmp cp ctrlaltdel date df dmesg du hd id ifconfig
97
95
android_repo_v5 " ${arch} "
98
96
tools+=(dd getevent getprop grep newfs_msdos)
99
97
;;
100
- # 6)
101
- # #android_repo_v6 "${arch}"
102
- # # TODO(ahuszagh) Here.
103
- # ;;
98
+ 6)
99
+ android_repo_v6 " ${arch} "
100
+ ;;
104
101
# 7)
105
102
# #android_repo_v7 "${arch}"
106
103
# # TODO(ahuszagh) Here.
@@ -162,25 +159,20 @@ build_android() {
162
159
# FIXME: Currently failing on Android 10 with:
163
160
# FAILED: ninja: 'out/soong/missing', needed by 'out/soong/generic_arm64/dex_bootjars_input/android.test.base.jar', missing and no known rule to make it
164
161
# 23:31:18 ninja failed with: exit status 1
165
- mmma system/apex/
162
+ mmma art/build/apex
166
163
fi
167
164
168
165
set -u
169
166
}
170
167
171
168
install_android () {
172
169
local arch=" ${1} "
173
- local srcdir=
174
170
shift
175
171
176
172
if [[ " ${arch} " = " arm" ]]; then
177
- srcdir= out/target/product/generic
173
+ mv out/target/product/generic/system/ /
178
174
else
179
- srcdir=" out/target/product/generic_${arch} "
180
- fi
181
- mv " ${srcdir} /system" /
182
- if [[ " ${major_version} " -ge 10 ]]; then
183
- mv " ${srcdir} /apex" /
175
+ mv " out/target/product/generic_${arch} /system" / /
184
176
fi
185
177
186
178
# list from https://elinux.org/Android_toolbox
@@ -197,19 +189,12 @@ install_android() {
197
189
# set of modules required for each android version, starting with
198
190
# a minimal number of dependencies.
199
191
200
- sync () {
201
- local path=" ${1} "
202
- local url=https://android.googlesource.com/platform
203
- mkdir -p " ${path} "
204
- git clone " ${url} /${path} " " ${path} " --branch " ${ANDROID_TAG} " --depth 1
205
- # python3 ./repo sync -c --no-clone-bundle "${@}"
206
- }
207
-
208
192
android_repo_complete () {
209
- sync
193
+ python3 ./repo sync -c
210
194
}
211
195
212
196
# tested on 5.0.0_r1 (SDK 21)
197
+ # tested on 5.1.1_r38 (SDK 22)
213
198
android_repo_v5 () {
214
199
local arch=" ${1} "
215
200
@@ -252,14 +237,71 @@ android_repo_v5() {
252
237
sed -i -e ' s/if (!kernel_supplied_AT_SECURE)/if (false)/g' bionic/linker/linker_environ.cpp
253
238
}
254
239
240
+ # tested on 6.0.1_r81 (SDK 23)
241
+ android_repo_v6 () {
242
+ local arch=" ${1} "
243
+
244
+ sync bionic
245
+ sync build
246
+ sync external/compiler-rt
247
+ sync external/libcxx
248
+ sync external/libcxxabi
249
+ sync external/elfutils
250
+ sync external/jemalloc
251
+ sync external/mksh
252
+ sync external/safe-iop
253
+ sync external/zlib
254
+ sync libnativehelper
255
+ sync prebuilts/clang/linux-x86/host/3.6
256
+ sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
257
+ sync prebuilts/misc
258
+ sync system/core
259
+
260
+ case " ${arch} " in
261
+ arm)
262
+ sync prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
263
+ ;;
264
+ arm64)
265
+ sync prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9
266
+ sync prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9
267
+ ;;
268
+ x86)
269
+ sync prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
270
+ ;;
271
+ x86_64)
272
+ sync prebuilts/gcc/linux-x86/x86/x86_64-linux-android-4.9
273
+ ;;
274
+ esac
275
+
276
+ # avoid build tests
277
+ rm bionic/linker/tests/Android.mk
278
+ rm bionic/tests/Android.mk
279
+ rm bionic/benchmarks/Android.mk
280
+ # we don't need the relocation packer, and removing
281
+ # the unittests from it is a bit of work.
282
+ rm bionic/tools/relocation_packer/Android.mk
283
+ }
284
+
285
+ # TODO
286
+ android_repo_v7 () {
287
+ # TODO(ahuszagh) This is the first one using the soong build system
288
+ local arch=" ${1} "
289
+
290
+ sync bionic
291
+ sync build
292
+ sync prebuilts/clang/linux-x86/host/3.6
293
+ # TODO(ahuszagh) Here...
294
+ # TODO(ahuszagh) Having issues rn with using git directly.
295
+ }
296
+
255
297
# tested on 9.0.0_r1 (SDK 28)
256
298
android_repo_v9 () {
257
299
local arch=" ${1} "
258
300
259
301
sync art
260
302
sync bionic
261
- sync build/blueprint
262
303
sync build/make
304
+ sync build/blueprint
263
305
sync build/soong
264
306
sync external/clang
265
307
sync external/compiler-rt
@@ -280,8 +322,8 @@ android_repo_v9() {
280
322
sync hardware/interfaces
281
323
sync libnativehelper
282
324
sync prebuilts/build-tools
283
- sync prebuilts/clang-tools
284
325
sync prebuilts/clang/host/linux-x86
326
+ sync prebuilts/clang-tools
285
327
sync prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.15-4.8
286
328
sync prebuilts/go/linux-x86
287
329
sync prebuilts/misc
@@ -327,17 +369,9 @@ android_repo_v10() {
327
369
sync build/make
328
370
sync build/blueprint
329
371
sync build/soong
330
- sync external/apache-xml
331
- sync external/avb
332
- sync external/boringssl
333
- sync external/bouncycastle
334
372
sync external/clang
335
373
sync external/compiler-rt
336
- sync external/conscrypt
337
- sync external/e2fsprogs
338
374
sync external/elfutils
339
- sync external/expat
340
- sync external/icu
341
375
sync external/jemalloc
342
376
sync external/jemalloc_new
343
377
sync external/libcxx
@@ -347,24 +381,12 @@ android_repo_v10() {
347
381
sync external/llvm
348
382
sync external/lzma
349
383
sync external/mksh
350
- sync external/pcre
351
- sync external/protobuf
352
- sync external/python/cpython2
353
- sync external/python/six
354
- sync external/robolectric-shadows
355
- sync external/selinux
356
- sync external/sqlite
357
384
sync external/turbine
358
385
sync external/vixl
359
386
sync external/zlib
360
- sync external/zopfli
361
- sync prebuilts/jdk/jdk8
362
387
sync prebuilts/jdk/jdk9
363
388
sync external/golang-protobuf
364
- sync frameworks/base
365
389
sync frameworks/hardware/interfaces
366
- sync frameworks/opt/setupwizard
367
- sync libcore
368
390
sync libnativehelper
369
391
sync prebuilts/go/linux-x86
370
392
sync prebuilts/build-tools
@@ -381,9 +403,6 @@ android_repo_v10() {
381
403
sync system/libhidl
382
404
sync system/tools/aidl
383
405
sync system/tools/hidl
384
- sync system/tools/xsdc
385
- sync tools/apksig
386
- sync tools/metalava
387
406
388
407
case " ${arch} " in
389
408
arm)
@@ -411,15 +430,11 @@ android_repo_v10() {
411
430
rm bionic/tests/headers/Android.bp
412
431
rm bionic/tests/headers/posix/Android.bp
413
432
414
- # rm frameworks/base/core/xsd/vts/Android.mk
415
- # rm frameworks/base/packages/SettingsLib/tests/robotests/Android.mk
416
- # include test/vts/tools/build/Android.host_config.mk
417
-
418
433
python3 /remove_soong_tests.py
419
- sed -i -z -e ' s/include test\/vts\/tools\/build\/Android.host_config\.mk//g ' frameworks/base/services/core/xsd/vts/Android.mk
420
- # sed -i -z -e 's/cc_test {.*}//g' bionic/libc/malloc_debug/Android.bp
421
- # sed -i -z -e 's/cc_test {.*}//g' bionic/libc/malloc_hooks/Android.bp
422
- # sed -i -z -e 's/cc_test {.*}//g' bionic/linker/Android.bp
434
+ }
435
+
436
+ sync () {
437
+ python3 ./repo sync -c --no-clone-bundle " ${1} "
423
438
}
424
439
425
440
# TODO(ahuszagh) Remove this
0 commit comments