Commit Graph

26992 Commits

Author SHA1 Message Date
Inseob Kim
ffa6150159 Merge "Add WithDexpreopt soong variable" am: ce0671f057 am: 0ae668f236
Original change: https://android-review.googlesource.com/c/platform/build/+/1650270

Change-Id: Ieebed2ade316b888049156d9eeaa3287f039c557
2021-03-24 07:04:02 +00:00
Yo Chiang
e936355b48 Merge changes from topic "nextgen-release-img-zip-cleanup" am: 18015cef3b am: d26db0e15e
Original change: https://android-review.googlesource.com/c/platform/build/+/1644989

Change-Id: I2653bdb677d86af340a9b8bf2e62385dfb4f669d
2021-03-24 06:44:59 +00:00
Inseob Kim
ce0671f057 Merge "Add WithDexpreopt soong variable" 2021-03-24 06:20:03 +00:00
Yi-Yo Chiang
ba959a5ff1 Add option to allow product makefiles to skip building super_empty.img
This change doesn't change the condition for building super_empty.img,
it just add a toggle PRODUCT_BUILD_SUPER_EMPTY_IMAGE that product
makefiles can use to skip building super_empty.img.
Products that don't use super_empty at all, for example GSI, can set
this option to ensure the super_empty.img is not built.

Bug: 183068624
Test: "m dist" on GSI and check the build artifacts under OUT and DIST
  directories, and check the contents of *-img-*.zip
Change-Id: I54943952873d2d297fd9d18cbe14742bc12ae9c6
2021-03-24 05:35:10 +00:00
Inseob Kim
3dfb8b8d7a Add filter to some boolean variables
add_json_bool converts non-empty string to true, and empty string to
false. But some of boolean variables are meant to be set either "true"
or "false". In that case "false" may lead to a mismatch. This adds
filter to boolean variables which are directly compared to "true", like

    ifeq ($(VAR),true)

Bug: 183483152
Test: build
Change-Id: I0dc4a05293a3233ae4958335781a19e6445a3799
2021-03-24 14:20:33 +09:00
Inseob Kim
c5d009c87f Merge "Fix SepolicySplit soong variable" am: 26c77daaa4 am: 9a9201d32c am: b649ef871c
Original change: https://android-review.googlesource.com/c/platform/build/+/1650269

Change-Id: I00549fa6d212f288c52373b0dc6d77b41bd67220
2021-03-24 01:55:22 +00:00
Inseob Kim
b649ef871c Merge "Fix SepolicySplit soong variable" am: 26c77daaa4 am: 9a9201d32c
Original change: https://android-review.googlesource.com/c/platform/build/+/1650269

Change-Id: I124f6f03f3f1f791c85701d3bc796774bee32fe8
2021-03-24 01:13:51 +00:00
Inseob Kim
26c77daaa4 Merge "Fix SepolicySplit soong variable" 2021-03-23 23:54:29 +00:00
Inseob Kim
84a8be3c52 Add WithDexpreopt soong variable
Test: m selinux_policy on sc-arc
Change-Id: Ieae24f65d74179d0604040a95f8aff4b027a2949
2021-03-23 23:21:24 +00:00
Treehugger Robot
b61e627bf1 Merge "Build module-info.json in dist" am: 9657a54894 am: a0ece52b29 am: b20d39573b
Original change: https://android-review.googlesource.com/c/platform/build/+/1648028

Change-Id: I15d16f350c40ad2d3d348be2c72ac8cc954c8658
2021-03-23 12:52:28 +00:00
Ulya Trafimovich
1a3b145803 Add PRODUCT_BROKEN_VERIFY_USES_LIBRARIES.
If set to true, it disables <uses-library> checks for a product. It is
possible to override with environment variable RELAX_USES_LIBRARY_CHECK
on the command-line.

Per product configuration is needed rather than per board configuration
(such as BUILD_BROKEN_* variables) because of the specifics of
<uses-library> checks: they depend on the product packages list, and
not on the board config.

One example of a product family that needs to disable the checks are
the SDK builds (e.g. sdk_gphone_x86_64), see b/183339664.

Bug: 183339664
Bug: 132357300
Test: treehugger
Change-Id: Ia58559e4e70163da94e9eb7b8a6133e0cbecd459
2021-03-23 12:36:24 +00:00
Treehugger Robot
b20d39573b Merge "Build module-info.json in dist" am: 9657a54894 am: a0ece52b29
Original change: https://android-review.googlesource.com/c/platform/build/+/1648028

Change-Id: I87abebcee079707cb1f996e62ece4d4896a8b97c
2021-03-23 12:06:52 +00:00
Inseob Kim
35f63019c9 Fix SepolicySplit soong variable
It should be "filtered" by "true" because all non-empty values become
true when using add_json_bool.

Test: m selinux_policy on sc-arc
Change-Id: I35d5881d83746230793cf8ced76885607e82334a
2021-03-23 20:47:39 +09:00
Treehugger Robot
9657a54894 Merge "Build module-info.json in dist" 2021-03-23 10:16:05 +00:00
Treehugger Robot
3abbf42446 Merge "Add PlatformSepolicyVersion to soong_config" am: fc6c0b8c67 am: fff16e2cb4 am: d2d14bfcbf
Original change: https://android-review.googlesource.com/c/platform/build/+/1648032

Change-Id: I55ba6d262ffc20eec2c1fb5a81c473110c76c511
2021-03-23 05:55:13 +00:00
Treehugger Robot
d2d14bfcbf Merge "Add PlatformSepolicyVersion to soong_config" am: fc6c0b8c67 am: fff16e2cb4
Original change: https://android-review.googlesource.com/c/platform/build/+/1648032

Change-Id: I184f03ece2b2c71210b8e743713b676ec528fb7a
2021-03-23 05:08:28 +00:00
Treehugger Robot
fc6c0b8c67 Merge "Add PlatformSepolicyVersion to soong_config" 2021-03-23 03:53:18 +00:00
Treehugger Robot
fdb4d14231 Merge "Support GKI boot.img v4 signing" am: 30f09a1a2e am: 0307dd6859 am: 9a4effb073
Original change: https://android-review.googlesource.com/c/platform/build/+/1635599

Change-Id: I49219ae63a8de3755fb3f8a6e3b0562522825777
2021-03-23 02:36:43 +00:00
Treehugger Robot
9a4effb073 Merge "Support GKI boot.img v4 signing" am: 30f09a1a2e am: 0307dd6859
Original change: https://android-review.googlesource.com/c/platform/build/+/1635599

Change-Id: Ibbca239b0fda2a5e114e54c06ee96f7b24b8c4a4
2021-03-23 01:51:46 +00:00
Treehugger Robot
30f09a1a2e Merge "Support GKI boot.img v4 signing" 2021-03-23 00:24:33 +00:00
Ryan Prichard
85a1213232 Switch platform-NDK unwinder to LLVM libunwind.a prebuilt
Link against the libunwind.a shipped with the NDK so it matches what's
linked into the NDK's libc++_shared.so.

For arm32, binary.mk and cxx_stl_setup.mk had been adding two different
versions of the LLVM unwinder to the same linker command-line. Remove
the duplicate one from cxx_stl_setup.mk.

-Wl,--exclude-libs is now unnecessary because the symbols are marked
hidden in the archive itself.

Bug: http://b/153025717
Test: device boots, manually inspect some linker command lines
Change-Id: Ie7182bd565014348b16448976dc6587d2885ba99
2021-03-22 14:00:59 -07:00
Inseob Kim
232f6ac676 Add PlatformSepolicyVersion to soong_config
PlatformSepolicyVersion and BoardSepolicyVers haven't assigned correctly
so far. Below is the reason why it hasn't been discovered yet.

DeviceConfig.PlatformSepolicyVersion() was added to support mixed
sepolicy build (setting BOARD_SEPOLICY_VERS and building vendor sepolicy
with old plat policy files). Soong compares PlatformSepolicyVersion()
and BoardSepolicyVers(), and used old vendor sources if both are
different. Back then, the only place where such logic played a role was
selinux contexts. Test codes were running as intended: after setting
BOARD_SEPOLICY_VERS the context files were built against old policies.

But there were two mistakes:

1) PlatformSepolicyVersion() was not added to soong_config.mk, so it was
always empty.
2) BOARD_SEPOLICY_VERS was set to default in system/sepolicy/Android.mk,
which was processed after soong_config. So if BOARD_SEPOLICY_VERS was
not set in BoardConfig.mk, BoardSepolicyVers() was empty, not
PLATFORM_SEPOLICY_VERSION.

And there were no issues as Soong only checked equality.

To fix the issue correctly, this commit adds the variable
PlatformSepolicyVersion, and then handles BoardSepolicyVers correctly by
returning PlatformSepolicyVersion if it's empty.

Test: set BOARD_SEPOLICY_VERS and see vendor_file_contexts changes
Change-Id: I4e306ec1f5225094a39f0c8d94f5e7683d70d60e
2021-03-22 22:34:40 +09:00
satayev
b90b546567 Merge "Move allowed_deps.txt to packages/modules/common." 2021-03-22 10:48:45 +00:00
easoncylee
330af541eb Build module-info.json in dist
This is needed for test mapping to have module-info.json built out for
device targets so that test harness can do some checks to ensure the
test is properly configured in TEST_MAPPING files.

module-info has alreay depended on droidcore, which will be
built out in the infrastructure.

Verified in a forrest run: https://android-build.googleplex.com/builds/forrest/run/L81000000840964024

Bug: 154931418
Test: m -j droidcore
      m -j module-info
Change-Id: I76b97debe3fbd51c2dc033c91ed9c2eb73cfa8a2
2021-03-22 10:33:36 +00:00
Treehugger Robot
07b40f36a6 Merge "Reorder compatibility libraries used in class loader context." am: fd4844272c am: a7554db569 am: 62c912425e
Original change: https://android-review.googlesource.com/c/platform/build/+/1633442

Change-Id: I5b28e8607ef1c84a376395a686b30b3979788ccc
2021-03-21 14:59:36 +00:00
Treehugger Robot
62c912425e Merge "Reorder compatibility libraries used in class loader context." am: fd4844272c am: a7554db569
Original change: https://android-review.googlesource.com/c/platform/build/+/1633442

Change-Id: I27757c649dd8961f0a9287d933d707219285054e
2021-03-21 13:38:10 +00:00
Treehugger Robot
fd4844272c Merge "Reorder compatibility libraries used in class loader context." 2021-03-21 11:14:08 +00:00
Treehugger Robot
4d3aa02df6 Merge "manifest_check.py: translate library names using dexpreopt configs." am: 389f95dcbe am: 4f2133e34a am: 32afeb1bb3
Original change: https://android-review.googlesource.com/c/platform/build/+/1620976

Change-Id: I9fa951c4faa742453941361c59b8253a7fdf4517
2021-03-20 14:09:43 +00:00
Treehugger Robot
32afeb1bb3 Merge "manifest_check.py: translate library names using dexpreopt configs." am: 389f95dcbe am: 4f2133e34a
Original change: https://android-review.googlesource.com/c/platform/build/+/1620976

Change-Id: I12fb391e7d3b874752a8527ade49fa86619c369e
2021-03-20 13:26:53 +00:00
Treehugger Robot
389f95dcbe Merge "manifest_check.py: translate library names using dexpreopt configs." 2021-03-20 12:12:52 +00:00
Yifan Hong
858db9f773 Merge "Extracting kernel should not depend on system/vendor build." am: 93ccefb210 am: c47dc3d490 am: 707f1604cd
Original change: https://android-review.googlesource.com/c/platform/build/+/1643083

Change-Id: Ie40f4c28d7fda3dc475e231e4a8d6418499b7cb5
2021-03-19 23:47:51 +00:00
Yifan Hong
707f1604cd Merge "Extracting kernel should not depend on system/vendor build." am: 93ccefb210 am: c47dc3d490
Original change: https://android-review.googlesource.com/c/platform/build/+/1643083

Change-Id: I416ba046f541b14bd8cf6fefb49e97c10aa2f341
2021-03-19 23:08:23 +00:00
Yifan Hong
93ccefb210 Merge "Extracting kernel should not depend on system/vendor build." 2021-03-19 22:00:15 +00:00
Yifan Hong
c0f904e069 Extracting kernel should not depend on system/vendor build.
If system and vendor are built separately, none of the two
builds contained kernel information. The process of extracting
kernel information shouldn't depend on system and vendor
builds, but on the existance of the kernel image.

With this change, one of system or vendor build may have
INSTALLED_KERNEL_IMAGE defined and the other has
PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS defined. The one
with INSTALLED_KERNEL_IMAGE defined will contain kernel information
in target files.

After target files are merged, check_target_files_vintf will kick
in to do the checks properly.

Test: forrest
Bug: 180475190
Change-Id: I8d887dd94e1171ab277f02f25534caf098e3faae
2021-03-19 12:50:38 -07:00
Treehugger Robot
5627355fba Merge "Consolidate manifest_check for different module types." am: 98dba54385 am: edfd79a2f2 am: 6bc98e76eb
Original change: https://android-review.googlesource.com/c/platform/build/+/1640259

Change-Id: I3fee1f58c4cb342cd76c5510f2f34c2c6abd7f44
2021-03-19 18:43:30 +00:00
Treehugger Robot
6bc98e76eb Merge "Consolidate manifest_check for different module types." am: 98dba54385 am: edfd79a2f2
Original change: https://android-review.googlesource.com/c/platform/build/+/1640259

Change-Id: I784e0bf289855a5c5ac29dd30af75da26f5c01e9
2021-03-19 18:01:18 +00:00
Ulya Trafimovich
413be716ab Reorder compatibility libraries used in class loader context.
Compatibility library "android.hidl.manager-V1.0-java" should go
before "android.hidl.base-V1.0-java" in class loader context for
dexpreopt, because this is the order used by PackageManager when it
constructs class loader context on device.

This allows to avoid "ClassLoaderContext classpath element mismatch"
errors on first boot for Calendar and messaging apps, which have old
enough targetSdkVersion to need HIDL compatibility libraries. Previously
the errors were masked because these apps used the deprecated
&-classpath hack.

Bug: 132357300

Test: lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd \
      adb wait-for-device && adb root && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
      # empty grep output, no errors
Change-Id: Ibde9a4578cd86b85a9e7f11d8752716b6567e51e
2021-03-19 11:01:53 +00:00
Ulya Trafimovich
928fc2c1ef manifest_check.py: translate library names using dexpreopt configs.
Java modules that are defined in makefiles are not processed in
topological order, so it is necessary to communicate information from
dependencies via dexpreopt.config files. This has already been done in
make/core/dex_preopt_config_merger.py, and now manifest_check.py also
needs to get library names from their dexpreopt.config files.

This is to accommodate Java libraries which name differs from their
modules name. Soong properties `uses_libs`/`optional_uses_libs` and
makefile vars `LOCAL_USES_LIBRARIES`/`LOCAL_OPTIONAL_USES_LIBRARIES`
contain module names, not library names, so it is necessary to translate
them when comparing against library names in the manifest.

Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m
Change-Id: I769b508a927d87a5ffbabf9aa45eebfb954b8bd2
2021-03-19 11:01:39 +00:00
Ulya Trafimovich
2bf587713b Consolidate manifest_check for different module types.
Move manifest_check (a.k.a. verify_uses_libraries check) from makefiles
for specific module types to common makefile dex_preopt_odex_install.mk,
which is included by all Java modules that may require dexpreopt. If a
modules locally disables dexpreopt, it still goes through manifest_check
(unless dexpreopt is globally disabled or the module has no Java code).

This CL allows to have manifest_check and dexpreopt in the same makefile
(which is needed for a follow-up CL that will reuse dexpreopt variables
for manifest_check).

Bug: 132357300
Test: lunch cf_x86_64_phone-userdebug && m
Change-Id: Ia217cfc247ae43d8fc716bfc1fe9dcce1d00aa7f
2021-03-19 11:00:51 +00:00
Treehugger Robot
a04ff5da40 Merge "Define ro.board.first_api_level property" am: 5dcd959a90 am: ea649248ca am: 98de12b000
Original change: https://android-review.googlesource.com/c/platform/build/+/1640362

Change-Id: I8ae464ad8e29a5f03e03787b9330dad1012e0637
2021-03-19 10:50:38 +00:00
Treehugger Robot
98de12b000 Merge "Define ro.board.first_api_level property" am: 5dcd959a90 am: ea649248ca
Original change: https://android-review.googlesource.com/c/platform/build/+/1640362

Change-Id: I1bddf76775de6c97cb7821783aca6c3fe58d958d
2021-03-19 09:58:46 +00:00
Bowgo Tsai
27c39b0af2 Support GKI boot.img v4 signing
Commit I9967d06bde0e18a12b84b5b0b568db09765fe305 supports adding a
generic boot_signature into boot.img v4. This change allows replacing
the boot_signture signing key with a release key during the release
process.

The default GKI signing key can be specified in a BoardConfig.mk via:

  BOARD_GKI_SIGNING_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
  BOARD_GKI_SIGNING_ALGORITHM := SHA256_RSA2048
  BOARD_GKI_SIGNING_SIGNATURE_ARGS := --prop foo:bar

The release signing key/algorithm can be specified by the following options
when invoking sign_target_files_apks:

  --gki_signing_key=external/avb/test/data/testkey_rsa4096.pem
  --gki_signing_algorithm=SHA256_RSA4096

Additional arguments for generating the GKI signature can be
specified as below:

  --gki_signing_extra_args="--prop gki:prop1 --prop gki:prop2"

Bug: 177862434
Test: make dist
Test: sign_target_files_apks \
        --gki_signing_key=external/avb/test/data/testkey_rsa4096.pem \
        --gki_signing_algorithm=SHA256_RSA4096 \
        --gki_signing_extra_args="--prop gki:prop1 --prop gki:prop2" \
        ./out/dist/*-target_files-eng.*.zip signed.zip
Test: Checks GKI boot_signature is expected after signing:
      `unzip signed.zip IMAGES/boot.img`
      `unpack_bootimg --boot_img IMAGES/boot.img --out unpack`
      `avbtool info_image --image unpack/boot_signature`
Test: unit test: releasetools_test and releasetools_py3_test

Change-Id: I61dadbc242360e4cab3dc70295931b4a5b9422a9
2021-03-19 17:11:04 +08:00
Treehugger Robot
5dcd959a90 Merge "Define ro.board.first_api_level property" 2021-03-19 08:50:36 +00:00
Inseob Kim
7765ac18c7 Merge "Add sepolicy related variables" am: 19b0ef8949 am: 5104227657 am: 17420f18c6
Original change: https://android-review.googlesource.com/c/platform/build/+/1641839

Change-Id: Iec561ef2ebbebc3cde7a38b9a7804fc800c9158e
2021-03-19 01:51:12 +00:00
Justin Yun
50ef9b2d7d Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" am: 25dc5ea096 am: b9957b6fdc am: f6df531e1c
Original change: https://android-review.googlesource.com/c/platform/build/+/1622663

Change-Id: I0f1dabd86b62b3b33cd150aa181fb1cb2f3bc31a
2021-03-19 01:50:55 +00:00
Inseob Kim
17420f18c6 Merge "Add sepolicy related variables" am: 19b0ef8949 am: 5104227657
Original change: https://android-review.googlesource.com/c/platform/build/+/1641839

Change-Id: I362adb60e51e42fcf2e402c70818d2174edd6f70
2021-03-19 01:07:25 +00:00
Justin Yun
f6df531e1c Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" am: 25dc5ea096 am: b9957b6fdc
Original change: https://android-review.googlesource.com/c/platform/build/+/1622663

Change-Id: Icf8b5843116d2d542215e75a88819f4787953c3d
2021-03-19 01:07:17 +00:00
Inseob Kim
19b0ef8949 Merge "Add sepolicy related variables" 2021-03-19 00:07:58 +00:00
Justin Yun
25dc5ea096 Merge "Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__" 2021-03-18 23:33:43 +00:00
Paul Scovanner
9fca386e05 Update Security String to 2021-05-05
resolve merge conflicts of 12002c3c3b to sc-dev

Bug: 182937985
Change-Id: I52ce0e28a8a1452f7b43c555d1a0959880003721
2021-03-18 22:50:49 +00:00