Commit graph

26168 commits

Author SHA1 Message Date
Yi-Yo Chiang
1519d4351e Refactor vendor_boot v4 build logic and add more checks
Add more checks around BOARD_BOOT_HEADER_VERSION in board_config.mk.

Refactor generation logic of vendor_boot ramdisk fragments.
Consolidate initialization and validation check to its own section.
Adjust some variable names and initialization sequence so the follow-up
change can land more cleanly.
Rename variable name "dir" so that it don't collide with the Makefile
function "$(dir ...)".

Bug: 183395459
Test: Presubmit; Change should be no-op with respect to build artifacts.
Test: Modify BoardConfig of CF and m dist. Verify the vendor_boot.img
  with unpack_bootimg.
Change-Id: I8785c40dd9f87f3797a56ada93e65939d27d0e9b
2021-04-04 20:40:17 +08:00
Ryan Prichard
663b98bbab Stop linking against libatomic
The __atomic_* library functions are now part of the compiler-rt
builtins library:

https://android-review.googlesource.com/c/toolchain/llvm_android/+/1625025

Bug: http://b/153025717
Test: treehugger
Change-Id: Iebd5eaf17f8559696b6d6e2e0dd782f77b6bcab5
2021-04-02 21:05:48 -07:00
Yifan Hong
3e061bd1c8 Fix builds with enforce_vintf_kernel + !kernel
If a build has PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS
set (which is set for P+ builds) but no kernel is built,
the original code emits a warning, but it won't be able
to build target files package because it depends on
kernel_configs.txt and kernel_version.txt without any rules.

Properly clear BUILT_KERNEL_CONFIGS_FILE and BUILT_KERNEL_VERSION_FILE
so that it won't be depended on in this case.

Bug: 184128489
Test: TH + forrest

Change-Id: I4b8fbd117f114555cf606e3c3b48eb564dbe786b
2021-04-02 16:19:01 -07:00
Elliott Hughes
4ac1818cde Merge "Remove honggfuzz support." 2021-04-02 20:47:05 +00:00
Alexander Smundak
14e6f9c708 Merge "Address reviewer comments from the previous commits" 2021-04-02 18:07:47 +00:00
Elliott Hughes
a445ef6cde Remove honggfuzz support.
Everyone's on libFuzzer now.

(The "fuzz" referred to in base_system.mk was removed in Android 11, but
this reference was left lying around.)

Bug: http://b/184301511
Test: treehugger
Change-Id: I6fe0f2c37e014647802279a656d2c6c9625b7a44
2021-04-02 10:24:48 -07:00
Sasha Smundak
357e37c4d4 Address reviewer comments from the previous commits
Fixes: 170637441
Test: rbcrun build/make/tests/run.rbc
Change-Id: Ifc16fe02d96bc3a4c5562b74da8c1e7b393dc000
2021-04-01 23:07:06 -07:00
Ryan Prichard
f56f074e06 Merge "Revert^2 "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"" 2021-04-01 22:42:33 +00:00
Treehugger Robot
8a42f673ac Merge "Adding bootimage_test_harness artifact to droidcore" 2021-04-01 13:51:50 +00:00
Ryan Prichard
6d74870a67 Revert^2 "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"
This reverts commit 9cd4aff304.

Bug: http://b/153025717
Test: treehugger
Change-Id: I548ca3dd5bdddb52199b4b5e1455832ee1d28125
2021-03-31 15:33:35 -07:00
Alexander Smundak
fe5799af6b Merge changes from topic "product_config_star"
* changes:
  Product configuration in Starlark support files.
  Roboleaf product configuration runner
2021-03-31 18:28:50 +00:00
Ryan Prichard
cf5487e07f Merge "Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"" 2021-03-31 05:29:51 +00:00
Yi-Yo Chiang
f35afe97b1 Mark PRODUCT_CHECK_ELF_FILES as obsolete
Follow-up of aosp/1655468.

Bug: 149715904
Test: Presubmit
Change-Id: I3998c7356e3a41adaa00ab3d1d2c2ec66e2e37d7
2021-03-31 04:25:55 +00:00
Ryan Prichard
9cd4aff304 Revert "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt"
This reverts commit 85a1213232.

Reason for revert: b/184095989

Change-Id: I4643a7bb2fea6411d7c673ec4017fdbab6070b9d
2021-03-31 03:25:26 +00:00
Bowgo Tsai
42131496c8 Adding bootimage_test_harness artifact to droidcore
Currently bootimage_test_harness is only built on a few targets
on release branches. However, we might have a last minute build
breakage on release branches as bootimage_test_harness is not
built on dev branches. Moving it to droidcore so we can have more
completed build coverage on pre-submit/post-submit builds.

Bug: 183865297
Test: `make` then check $OUT
Change-Id: I496609401a9444706726256d2f7b45c6bb69ee94
2021-03-31 03:11:14 +00:00
Dan Albert
ee90c8856e Merge "Switch platform-NDK unwinder to LLVM libunwind.a prebuilt" 2021-03-30 21:44:35 +00:00
Nicolas Geoffray
01545ef795 Merge "Preopt apps with updatable boot classpath too." 2021-03-30 13:40:57 +00:00
Yo Chiang
08b0004c9c Merge "Remove obsolete var PRODUCT_CHECK_ELF_FILES" 2021-03-30 08:54:24 +00:00
Yo Chiang
3060ba5048 Merge "Revert^2 "Add option to allow product makefiles to skip building s..."" 2021-03-30 06:29:09 +00:00
Ulya Trafimovich
03befa00fe Don't enforce <uses-library> checks if dexpreopt for apps is disabled.
Otherwise the check fails, as it depend on non-existent dexpreopt.config
files. This CL fixes broken build cf_x86_phone-userdebug_coverage.

Bug: 183931403
Bug: 132357300
Test: forrest build for cf_x86_phone-userdebug_coverage.
Change-Id: I6f977c1e0c2d2160b1813d2d1c36459f0641235e
2021-03-29 15:01:05 +01:00
Nicolas Geoffray
5bfe9267f8 Preopt apps with updatable boot classpath too.
Test: m
Test: egrep 'ethernet-service[^ ]*odex' out/soong/build.ninja \
    | grep updatable
  # is empty
  egrep 'oat-file=[^ ]*Gallery2[^ ]*odex' out/soong/build.ninja \
    | egrep -o 'Xbootclasspath:[^ ]*' \
    | sed 's/:/\n/g' \
    | grep updatable_bootjars
  # lists updatable boot jars
  egrep -o 'Xbootclasspath:[^ ]*' \
      -o `find out -name dexpreopt.sh | grep Dialer` \
    | sed 's/:/\n/g' \
    | grep updatable_bootjars
  # lists updatable boot jars
Bug: 178467404
Change-Id: Ia5d4e59bac3e32bc77f1a0ab9e1abb18768a7ee7
2021-03-29 14:03:12 +01:00
Yi-Yo Chiang
875442fde4 Remove obsolete var PRODUCT_CHECK_ELF_FILES
After aosp/1184262 is submitted, PRODUCT_CHECK_ELF_FILES is deprecated
and nobody is using this variable anymore.

Bug: 149715904
Test: Presubmit; Should be noop
Change-Id: Iaf4a6ae1fe4062684a9699b7ef999030ff483e16
2021-03-29 18:35:51 +08:00
Bowgo Tsai
bc50bb88e2 Merge "GKI: put debugging resources under fisrt_stage_ramdisk subdir." 2021-03-29 02:25:12 +00:00
Julien Desprez
c2e66a69ca Merge "Mark the unit tests module itself as its component" 2021-03-25 21:35:29 +00:00
Ulyana Trafimovich
86755e4ac0 Merge "Add config that controls if updatable BCP is included in dexpreopt." 2021-03-25 10:13:45 +00:00
Yo Chiang
e86bab474b Revert^2 "Add option to allow product makefiles to skip building s..."
This reverts commit ccfea17fb7.

Reason for revert: Original bug was resolved by updating branch config

Change-Id: I2327092261a2147fa8f2be3d878db04228e65511
2021-03-25 10:12:28 +00:00
Bowgo Tsai
099a7c40a7 GKI: put debugging resources under fisrt_stage_ramdisk subdir.
For consistency with android-11 GKI boot-debug.img, we should
put debug resources under the 'fisrt_stage_ramdisk' dir. This is
needed for devices with `androidboot.force_normal_boot=1` in the
kernel cmdline, where init will chroot into /fisrt_stage_ramdisk.

For devices without force_normal_boot, they still can use their
vendor_boot-debug.img for debugging purpose.

Bug: 183670217
Test: `make bootimage_debug`, then use unpack_bootimg and
      `lz4 -d -c ramdisk | toybox cpio -i` to unpack the ramdisk
      for inspection.
Change-Id: I0a79440dafd091141a1203a2c2c7be5bc1bfc836
2021-03-25 14:24:09 +08:00
Tianjie Xu
4b2242de5e Merge changes from topic "revert-1644988-nextgen-release-img-zip-cleanup-KPBTKCTROS"
* changes:
  Revert "Add option to allow product makefiles to skip building s..."
  Revert "Nextgen release: Don't build super_empty.img"
2021-03-25 05:13:52 +00:00
Tianjie Xu
ccfea17fb7 Revert "Add option to allow product makefiles to skip building s..."
Revert submission 1644988-nextgen-release-img-zip-cleanup

Reason for revert: b/183654818
Reverted Changes:
I2474e5fd6:Nextgen release: Don't build super_empty.img
I549439528:Add option to allow product makefiles to skip buil...

Change-Id: I711d1c288eed17686b048144d8d41c0fdd5cd8e1
2021-03-25 05:00:12 +00:00
Treehugger Robot
9ae28a750a Merge "Add filter to some boolean variables" 2021-03-24 23:20:53 +00:00
Julien Desprez
19275640fb Mark the unit tests module itself as its component
This will help to try out code coverage reporting.

Change-Id: I52953037cb1482d88102d4bf8719ec7192dfaa97
Test: presubmit
Bug: 172962242
2021-03-24 20:11:49 +00:00
Ulyana Trafimovich
c79c96ae43 Merge "Add PRODUCT_BROKEN_VERIFY_USES_LIBRARIES." 2021-03-24 15:18:42 +00:00
Ulya Trafimovich
b9f4306adf Add config that controls if updatable BCP is included in dexpreopt.
For now the config is always set to false (updatable boot jars are
excluded), but this may change in the future.

Bug: 178467404
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: I1b45a89748e065a29130efbf8b54dddfae69e48b
2021-03-24 10:51:46 +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
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
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
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
fc6c0b8c67 Merge "Add PlatformSepolicyVersion to soong_config" 2021-03-23 03:53:18 +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
fd4844272c Merge "Reorder compatibility libraries used in class loader context." 2021-03-21 11:14:08 +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
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
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
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
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
Sasha Smundak
5c8b09b2ef Product configuration in Starlark support files.
Bug: 170637441
Test: rbcrun build/make/tests/run.rbc
Change-Id: Ie8f0c3dea66a287f2b0a3b588c446bfbb2c9a978
2021-03-18 10:52:05 -07:00
Ulya Trafimovich
78d96e8742 Add missing dependency on aapt.
The missing dependency on AAPT did not cause build failures in AOSP,
because the build order happens to be such that AAPT is always built by
the time it's needed. But this is accidental and needs to be fixed.

Bug: 183010666
Bug: 132357300
Test: treehugger
Change-Id: I170e878bf36aafbdb93e9ba54faffd455d3e33c2
Merged-In: I8c78e48345bee5b77de41af03bdac77c402d04a1
2021-03-18 12:36:15 +00:00
Po Hu
db9f6e13c8 Fix build break for Android.bp dex_import
Error message is:
'out/target/common/obj/JAVA_LIBRARIES/x_intermediates/classes.jar',
needed by 'out/target/common/obj/JAVA_LIBRARIES/x_intermediates/jav
alib.jar', missing and no known rule to make it;

Soong Android.mk generated does not define LOCAL_SOONG_CLASSES_JAR
or LOCAL_SOONG_HEADER_JAR. So don't add them to javalib.jar's
dependencies.

Bug: 144664536
Change-Id: I6b530d40c859c6484425b8ec37c0fa7112a21346
2021-03-18 08:49:02 +08:00
Yifan Hong
2b4d131e15 Merge "Add PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS to check_vintf_compatible_log" 2021-03-17 18:30:48 +00:00
Artur Satayev
398b995d74 Move allowed_deps.txt to packages/modules/common.
Bug: 179234385
Test: run update-apex-allowed-deps.sh locally
Change-Id: I6866e7a80bce03f991f5b99fb5182c91351cc311
Merged-In: I6866e7a80bce03f991f5b99fb5182c91351cc311
2021-03-17 15:49:01 +00:00
Inseob Kim
a3ae471485 Add sepolicy related variables
Bug: 33691272
Test: build
Change-Id: Ifbcd2c49d6ecf6d7e69d6b95bace168eccd17f13
2021-03-17 18:04:56 +09:00
Justin Yun
f39f080c80 Define ro.board.first_api_level property
When a device define BOARD_SHIPPING_API_LEVEL with an API level, it
sets a vendor property ro.board.first_api_level in vendor/build.prop.
This is for the GRF devices. Non-GRF devices must not define this
property.

Bug: 176950752
Test: getprop ro.board.first_api_level
Change-Id: I6921d7fe6acca3f73a5fd0fbaa3d4f1e9394541b
2021-03-17 15:00:23 +09:00
android-build-team Robot
3de8fdaece Version bump to RQ2A.210405.006 [core/build_id.mk]
Change-Id: I43ab54e5794231f0bbdc1406fbe655dedb6af341
2021-03-17 03:55:53 +00:00
Justin DeMartino
0f05976472 Merge "Allow extending of the list of directories to be scanned for VSDK" 2021-03-16 15:12:17 +00:00
Ulyana Trafimovich
d3109e2514 Merge "Reimplement verify_uses_libraries.sh in manifest_check.py." 2021-03-16 13:37:03 +00:00
Mitch Phillips
82a4cfb397 Merge "Add MTE ELF note to makefile-generated native tests." 2021-03-15 21:33:07 +00:00
Mitch Phillips
1a8405f827 Add MTE ELF note to makefile-generated native tests.
The MTE ELF note is intended to be added to all aarch64 test binaries.
This is already implemented for cc_test in soong, but we should also add
it to makefile-generated tests.

Bug: 156029370
Bug: 181133973

Test: atest CtsBionicTestCases on QEMU+MTE, observe previously-failing
      tests will now succeed.
Test: m camera_client_test; readelf -t <snip>/camera_client_test | grep
      memtag, make sure there's the elf note.

Change-Id: I2e7c4d1379ccdef04f05dd7aff675e6834d4799b
2021-03-15 10:45:05 -07:00
Ulya Trafimovich
a2404510af Reimplement verify_uses_libraries.sh in manifest_check.py.
Previously there were two different scripts that did similar things:
1) build/soong/scripts/manifest_check.py
2) build/make/core/verify_uses_libraries.sh

Both scripts extracted <uses-library> tags and `targetSdkVersion` from
the manifests of Java modules, but 1) worked for XML manifests, and 2)
worked for APKs. This CL reimplements the functionality from 2) in 1),
so that one script can handle both XML manifests and APKs.

Bug: 132357300

Test: lunch 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: I386aa1a37699182cdf6f3f94ef8aa7b96a4017d3
2021-03-15 13:50:57 +00:00
Justin Yun
69f7191d5d Define __ANDROID_VENDOR__ and __ANDROID_PRODUCT__
__ANDROID_VNDK__ is defined for the modules that are able to use the
VNDK libraries. As both product and vendor variants define
__ANDROID_VNDK__, we don't know if a module is built for vendor or
product on build time.

__ANDROID_VENDOR__ and __ANDROID_PRODUCT__ macros can be used to
specify the image-variant-dependent codes.

Bug: 180646847
Test: m nothing
Change-Id: I9a37607b1e1e4e16eab02fb6c96d1a92158c96b8
2021-03-15 18:17:35 +09:00
Devin Moore
a74a5a19bf Merge "Add bootconfig to kernel cmdline when BOARD_BOOTCONFIG not empty" 2021-03-12 22:57:58 +00:00
Justin DeMartino
f15053ee39 Allow extending of the list of directories to be scanned for VSDK
Bug: 180925851
Test: m nothing, manually
Change-Id: I499f084f04e45eb719882be97e3a581ff868cc98
2021-03-12 19:38:14 +00:00
Cindy Zhou
e48dccaa83 Merge "Enable cfi for 32bit arch" 2021-03-12 12:41:39 +00:00
Treehugger Robot
c2643ead16 Merge "check_all_partition_sizes_log -> .log" 2021-03-12 06:57:08 +00:00
Yifan Hong
d11953c3b7 check_all_partition_sizes_log -> .log
So that it can be viewed directly in the web browser.
Test: pass

Change-Id: Ic90a5d1511153a74726f1bdee5d9a058756f2d19
2021-03-11 14:47:59 -08:00
Petri Gynther
3296b3136e Merge changes I899810c7,If73b15d7
* changes:
  Add vendor_dlkm, odm, odm_dlkm to dynamic partition filter
  Fix typo: DLKIMMAGE
2021-03-11 20:00:25 +00:00
Petri Gynther
345294f459 Merge changes Ibac6424f,Ief572e30
* changes:
  Copy vendor_ramdisk[-debug].img to out/dist
  Add support for building vendor_ramdisk-debug.img
2021-03-11 19:55:02 +00:00
Bob Badour
a8cf0e040e [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  core/tasks/tools/package-modules.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m nothing

Exempt-From-Owner-Approval: janitorial work
Change-Id: I751a3d65c9791c5397e1bcdb89342c0b61647411
2021-03-10 23:31:03 -08:00
Petri Gynther
09865a4911 Add vendor_dlkm, odm, odm_dlkm to dynamic partition filter
When building images in -without-vendor clients, we need to filter out:
vendor, vendor_dlkm, odm, odm_dlkm

from the dynamic partitions list for the OTA image build to succeed.

Bug: 173653839
Bug: 182319837
Test: add vendor_dlkm, odm, odm_dlkm to dynamic partitions + make dist
Change-Id: I899810c7f46e40730280d89b94047779705b6e2f
2021-03-10 21:34:07 -08:00
Petri Gynther
689e11a7ce Fix typo: DLKIMMAGE
Fix two typos in Makefile.

It turns out that BOARD_ODM_VENDOR_DLKMIMAGE is not correct.
Need to replace it with BOARD_PREBUILT_ODM_DLKMIMAGE.

Test: use grep to check usage
Change-Id: If73b15d7abb7504aa313d616f6cef2d80d76705d
2021-03-10 21:07:41 -08:00
Yifan Hong
80ab21490b Add PRODUCT_OTA_ENFORCE_VINTF_KERNEL_REQUIREMENTS to check_vintf_compatible_log
If kernel checks are missing, this can tell
us explicitly that the flag was disabled.

Test: pass
Change-Id: If5de88edbf352c163bc725c3e02a8cd29312e7f5
2021-03-10 18:10:13 -08:00
Treehugger Robot
3eca99ee7a Merge "VINTF logs ends in .log suffix." 2021-03-11 02:07:23 +00:00
Cindy Zhou
5d793fb740 Enable cfi for 32bit arch
Enabling cfi for 32-bit arch; b/35157333 seems to have been resolved in b/67507331.

Bug: 158010610

Test: manual interaction with Wimbley device: youtube video, chrome
navigations, gmail
MPTS testing on Sargo

Change-Id: I79eeb7e880ea09d857f8339901b67f77243a575c
2021-03-10 17:10:21 -08:00
Devin Moore
d6eab6f827 Add bootconfig to kernel cmdline when BOARD_BOOTCONFIG not empty
The 'bootconfig' kernel cmdline parameter needs to exist for the kernel
to search for bootconfig.
If BOARD_BOOTCONFIG contains anything, then add the parameter to the
kernel cmdline.

Test: Boot cuttlefish and verify /proc/cmdline has 'bootconfig' after
removing it from cuttlefish BoardConfig.mk
Bug: 173815685

Change-Id: I112a2a8e02ba7265c5547d9244298e07f26985ba
2021-03-10 16:28:49 -08:00
Devin Moore
b6840067c4 Merge "Throw an error if androidboot.hardware is used for bootconfig" 2021-03-10 22:42:12 +00:00
Petri Gynther
1426cab468 Copy vendor_ramdisk[-debug].img to out/dist
Test: make
Change-Id: Ibac6424f600b77d222585c17a91d59fb6985df26
2021-03-10 13:22:29 -08:00
Petri Gynther
d7946d13f0 Add support for building vendor_ramdisk-debug.img
Existing BoardConfig.mk variable:
BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true

generates:
out/target/product/<name>/vendor_ramdisk.img

Extend the above to additionally generate:
out/target/product/<name>/vendor_ramdisk-debug.img

as the two ramdisks should be built together.

Test: make
Change-Id: Ief572e30c9225d0f5569e9ff89096c69accafc7f
2021-03-10 13:22:29 -08:00
Treehugger Robot
40ea7379a8 Merge "Workaround for existing packages check failure when the generic product is used with ART prebuilts." 2021-03-10 19:13:43 +00:00
Devin Moore
2e43e34d53 Throw an error if androidboot.hardware is used for bootconfig
Bootconfig does not allow the keys to have values and subkeys at the
same time.
"androidboot.hardware" and "androidboot.hardware.*" subkeys have existed as
kernel cmdline parameters. We want to throw an error at build time when
"androidboot.hardware" is use in bootconfig because it may be a common
occurence while migrating to bootconfig.
"hardware" should be used instead, without the "androidboot" prefix.

Test: build with and without "androidboot.hardware=test" in
BOARD_BOOTCONFIG
Bug: 173815685

Change-Id: Ic62a86cb23c9d79dbdbacd18eed3449210566ce7
2021-03-09 16:59:33 -08:00
Colin Cross
6023b1944d Merge "Fix kati regen due to build_number.txt" 2021-03-10 00:50:47 +00:00
Yifan Hong
fd150d3dcc VINTF logs ends in .log suffix.
This is so that it can be viewed in the web
browser directly.

Test: pass
Change-Id: Ib35a93ab6beac550a593ec46814100ff851f32a5
2021-03-09 12:19:33 -08:00
Martin Stjernholm
e564ec3502 Workaround for existing packages check failure when the generic
product is used with ART prebuilts.

The prebuilt packages in packages/modules/ArtPrebuilt don't get
Android.mk entries in the `generic` product (as opposed to e.g.
`aosp_arm`), so the enforce-product-packages-exist check fails there.

Exclude the ART APEX modules from the check as a workaround. It's also
necessary to remove the check for superfluous allow list entries, since
which modules are actually missing depends on many other variables (see
runtime_libart.mk).

Test: m nothing TARGET_PRODUCT=generic \
      SOONG_CONFIG_art_module_source_build=false
Bug: 172480615
Bug: 182105280
Change-Id: Id67278615f3e7c64c7658bbf1b2aa71ed6b381da
2021-03-09 12:49:06 +00:00
Ulyana Trafimovich
d534e22d10 Merge "Disable verify_uses_libraries check if dexpreopt is globally disabled." 2021-03-09 08:40:23 +00:00
Po Hu
6e64c14ce9 Fix kati regen due to build_number.txt
Do NOT touch build_number.txt if BUILD_NUMBER is explicitly set
but not changed from last build.

Bug: 182221512
Test: BUILD_NUMBER=123 m nothing
Change-Id: Ic88f6e0d2b9767d84e1ec5c826018d1ea08c0fc0
2021-03-09 14:11:05 +08:00
Petri Gynther
728e0bd468 Cleanup: fileslist target commands
Remove unnecessary @ and $(hide) from fileslist target commands.
Keep @echo to print that line with a progress bar [ x% x/y ].

Test: make
Change-Id: I65c0c3c9c045cc7ca2c2801ee6b3b0c996be59a9
2021-03-08 14:12:35 -08:00
Petri Gynther
4c063e33c8 Cleanup: ram disk -> ramdisk
Test: make
Change-Id: I61740a309c6637c10b935806f7b379cfaf3ae855
2021-03-07 00:52:46 -08:00
Petri Gynther
6a6d6217d7 Cleanup: internal vendor ramdisk targets
Test: make
Change-Id: I356e82ab9b32164ff734567f489faf31021dfc4b
2021-03-07 00:51:40 -08:00
Petri Gynther
828828ba07 Add support for building vendor_ramdisk.img
Allow BoardConfig.mk to set:
BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true

to build:
out/target/product/<name>/vendor_ramdisk.img

This is done to support GKI device kernel development.

Kernel developers build vmlinux + DTB + GKI kernel modules locally
and then use kernel build tools to output:

* vmlinux + ramdisk.img => boot.img
* GKI kernel modules + DTB + vendor_ramdisk.img => vendor_boot.img

In other words, kernel developers use ramdisk.img and vendor_ramdisk.img
as prebuilts for building flashable boot.img and vendor_boot.img
directly from the kernel development environment.

Test: make vendorramdisk with BOARD_BUILD_VENDOR_RAMDISK_IMAGE := true
Test: make vendorramdisk with BOARD_BUILD_VENDOR_RAMDISK_IMAGE omitted
Change-Id: Id67839887b6bf608f4a5f13384c551c12ee9fdbd
2021-03-05 17:45:03 -08:00