Commit graph

2561 commits

Author SHA1 Message Date
Jiyong Park
7b96c59751 Stem names are used in apkcerts.txt
_apkcerts_write_line has assumed that the stem name of a package is the
same as the module of it. That assumption however breaks for
APK-in-APEX, in which case the stem name is Foo while the module name is
Foo.com.android.bar (where com.android.bar is the name of the APEX where
the APK is in).

Fixing the issue by recording the stem name and use it.

Bug: 155440232
Test: OVERRIDE_TARGET_FLATTEN_APEX=true m apkcerts-list
and check the generat4ed apkcerts txt file to see that it has
Tethering.apk instead of Tethering.com.android.tethering.apex

Exempt-From-Owner-Approval: cherry-pick from AOSP

Merged-In: I56bc55e2231eb946617a9d6f97d55c9b61f3bff7
(cherry picked from commit f58fd52b14)
Change-Id: I56bc55e2231eb946617a9d6f97d55c9b61f3bff7
2020-05-02 18:29:24 +09:00
Yifan Hong
50ea3f49c5 Merge "Adjust partition size checks for recovery resources" 2020-04-29 23:34:06 +00:00
Yifan Hong
9a3cad95a9 Adjust partition size checks for recovery resources
RECOVERY_FROM_BOOT_PATCH has been moved to vendor as per b/68319577. Hence,
the reserved size should be moved from system to vendor as well.

Bug: 68319577
Bug: 153581609
Test: m target-files-package for non-A/B devices

Change-Id: I2fd3fea10ec6dd06f19c5be753d63ddff1ec01f7
2020-04-28 16:27:24 -07:00
Dan Willemsen
f4cbafa724 Use .KATI_IMPLICIT_OUTPUTS in build/make/core/Makefile
There were still two places where we weren't using it. There may be
more, but these are the ones that come up with aosp_cf_x86_phone.

Test: m out/target/product/vsoc_x86/root/default.prop
Test: m out/target/product/vsoc_x86/obj/NOTICE_VENDOR.txt
Change-Id: I17671ca2ed60332aed2bf76aa00e42a92661b58a
2020-04-28 15:57:32 -07:00
Treehugger Robot
be01cf841e Merge changes I465ea6c9,I57b77d7c
* changes:
  generate multiple boot.img files in aosp_arm64
  create emulator_arm64 device for sdk_phone_arm64 to use
2020-04-22 03:45:49 +00:00
Treehugger Robot
dd9690162f Merge "support multiple boot.img files in release tools" 2020-04-20 08:13:36 +00:00
Steve Muckle
0959fbfd2e generate multiple boot.img files in aosp_arm64
Generate boot.img variants with different schemes for kernel compression
(gzip, lz4, none).

The boot image is removed from vbmeta for aosp_arm64 since it is
not possible currently to store the hashes of multiple variants of a
particular image. The GKI will be verified via VTS anyway.

Also remove some emulator-specific stuff from aosp_arm64.

Bug: 151094943
Change-Id: I465ea6c98d52e839284d51b246203f6b8dfb5566
2020-04-20 05:31:15 +00:00
Yo Chiang
2cbcf3bda2 Merge "Check ELF prebuilts in PRODUCT_COPY_FILES" 2020-04-17 01:06:32 +00:00
Steve Muckle
9793cf6c8a support multiple boot.img files in release tools
Support for generating multiple boot.img files is required in the
release tools to enable GKI distribution/signing.

Bug: 151094943
Change-Id: I536a286d3123f35918106a52c49b1148d746370f
2020-04-16 17:54:25 -07:00
Steve Muckle
10346271fd multi boot.img support cleanups
The kernel should not be specified in INTERNAL_RECOVERYIMAGE_ARGS, since
it is already given to mkbootimg directly.

The MKBOOTIMG_KERNEL_ARG macro is unused.

Bug: 151094943
Change-Id: Ie16a7bf7d77c0436d933abbb02c6dcb9202d5fe7
2020-04-15 14:32:39 -07:00
Steve Muckle
f84668e1da Enable non-v3 recovery image with v3 boot image
Add support for building a non-v3 recovery image along with a
v3 boot.img and vendor_boot image.

Bug: 150825361
Change-Id: I80d4e71ff09b83dd1c7f9accb4de99a30f95f4bf
2020-04-14 13:03:58 -07:00
Yo Chiang
0b49c03727 Check ELF prebuilts in PRODUCT_COPY_FILES
Add a check to ban ELF prebuilts in PRODUCT_COPY_FILES.
ELF prebuilts should be defined properly by cc_prebuilt_library_shared
and cc_prebuilt_binary so that the build system can keep track of the
file dependencies.

To opt in this check, set this option in BoardConfig.mk:
  BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := false

After all devices that have ELF prebuilts in PRODUCT_COPY_FILES are
tagged with BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true flip
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES to default false.

After a device is cleaned up, remove its
BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := true setting.

Bug: 140560012
Test: Set BUILD_BROKEN_ELF_PREBUILT_PRODUCT_COPY_FILES := false
Test: m # Should report any ELF prebuilt error in PRODUCT_COPY_FILES
Change-Id: Id75dac9417aed9baa7c5e9388430ff9369cf9b4f
2020-04-08 18:01:24 +08:00
bohu
8fd437c80a emulator: enable vendor boot image
BUG: 149826779
Test: Build x86, x86_64, armv7 and arm64
make sure x86/64 boot to home screen;
armv7/arm64 can pass disk mounting stage

Change-Id: I258b69bd0cdc4fb0a99b1a04567051e8d32c389a
2020-04-06 14:05:28 +00:00
Treehugger Robot
40ddffe600 Merge "fix boot-test-harness.img build" 2020-04-03 15:33:31 +00:00
Steve Muckle
4866bd6bff fix boot-test-harness.img build
The recently added support for multiple kernels and boot.img files
missed the boot-test-harness.img.

Bug: 152464066
Change-Id: I6e146a0702bc933e0b62f36dc34aba913e57316f
2020-04-02 12:37:04 -07:00
Luca Stefani
033c7eb82f Reland: Remove empty newline in build.prop
Before:
cat build.prop

\# begin common build properties
\# autogenerated by build/make/tools/buildinfo_common.sh

After
cat build.prop
\# begin common build properties
\# autogenerated by build/make/tools/buildinfo_common.sh

Change-Id: I8365bb59ad22a3bd9fc1dc904ff2026ddd7abe06
Test: m
2020-04-01 12:55:27 +02:00
Tianjie Xu
a3541df291 Merge "Add aftl inclusion proof" 2020-03-31 22:12:46 +00:00
Bo Hu
c969dcc0b2 Merge "Revert "Remove empty newline in build.prop"" 2020-03-31 21:27:21 +00:00
Bo Hu
76a005da8d Revert "Remove empty newline in build.prop"
This reverts commit 96a79c6f65.

Reason for revert: b/152899887
original cl leads to build.prop getting longer and longer
from 60+ to 1k+ lines and keep increasing

Exempt-From-Owner-Approval:
BUG: 152899887

Change-Id: I83ed1702009278014c77d7e7a7305756041564de
2020-03-31 21:26:58 +00:00
Bill Peckham
19c3feb2d3 Build merged apexkeys.txt/apkcerts.txt by partition.
Propagate partition tag data to apexkeys.txt and
apkcerts.txt so that merge_target_files.py can build
merged versions of these files by filtering the
framework files for framework partitions and filtering
the vendor files for vendor partitions.

Bug: 138942268
Change-Id: Ic3226728e97dae84d38ec230ccc86d1b124bea94
2020-03-30 22:33:27 +00:00
Oliver Nguyen
337f42e7d1 Merge "Export llvm-profdata for Clang coverage builds." 2020-03-30 20:38:22 +00:00
Luca Stefani
96a79c6f65 Remove empty newline in build.prop
Before:
cat build.prop

\# begin common build properties
\# autogenerated by build/make/tools/buildinfo_common.sh

After
cat build.prop
\# begin common build properties
\# autogenerated by build/make/tools/buildinfo_common.sh

Change-Id: I55a9cdc9a93e2d72ba4db97fef4c5e8c67421026
Test: m
2020-03-27 12:38:25 +00:00
Treehugger Robot
1973f86ffd Merge "support multiple kernels, boot.img output" 2020-03-25 18:23:15 +00:00
Steve Muckle
b3dda77f2a support multiple kernels, boot.img output
In order to enable the delivery of multiple kernel variants with
a platform build, add support for generating boot.img files from
multiple kernels.

The BOARD_KERNEL_BINARIES macro may be defined as a list of kernel
binaries to be used (if not, the original behavior and assumption of a
single kernel binary is preserved). Each kernel binary filename
must begin with "kernel". Any extra text in the filename is appended
to the boot.img name, so "kernel-gz" would generate "boot-gz.img".

Bug: 151094943
Change-Id: Icbbf227e9561f4aa11ce10db8d7aa81c7a81eb5b
2020-03-24 11:27:57 -07:00
Tianjie Xu
eaed60c1a1 Add aftl inclusion proof
The otatools should talk to the aftl server and append the inclusion
proofs when building the vbmeta image. We should only do this during the
signing process when the network is always available.

Also the inclusion proof doesn't impact the final vbmeta image size on
coral, where the final size is 8192 after padding. This is below the
physical image of 65536.

Bug: 147870995
Test: unit tests pass, run sign_target_file_apks
Change-Id: If84c6bf5198c9b05f5e0c16ae6335971915f47e3
2020-03-18 13:11:41 -07:00
Yifan Hong
69430e65fe Also check empty SKU if SKUS are not defined
In the case when both ODM_MANIFEST_SKUS and ODM_MANIFEST_FILE are
both empty, also checks VINTF compatibility for empty SKU case.

Same for device manifest. Although right now, DEVICE_MANIFEST_FILE and
DEVICE_MANIFEST_SKUS cannot be both empty (because libvintf requires
vendor manifest exists barring manifest fragments), let libvintf throws
an error for this case. In the build system, simply handle vendor manifest
the same way as ODM manifest.

Bug: 148601741
Test: manual
Change-Id: Ia0655fd4d37f6286b164a3221ec4b2716f29147d
2020-03-17 20:27:32 -07:00
Yifan Hong
28ffd73591 Proper checks for vendor and ODM SKUs
If DEVICE_MANIFEST_FILE / ODM_MANIFEST_FILES is set, also include check
for empty vendor / odm SKU, respectively. Then, do cross product of
vendor SKUs and ODM skus, and check each possible combination.

Test: build with and without vendor skus
Test: m check-vintf-all
Bug: 148601741

Change-Id: I23cc81998e7afc36c43540bf6d615b4d4b288447
2020-03-13 18:32:07 -07:00
Aurimas Liutikas
cd80e3b9eb Remove unnecessary dependency.
This dependency is now defined in ALL_SDK_FILES.

Test: lunch sdk; make sdk
Change-Id: Ia740466e493d745d83039ba9991547a6c2d3bd2c
2020-03-12 16:12:27 -07:00
Oliver Nguyen
b02f7dbaa4 Export llvm-profdata for Clang coverage builds.
This tool must match the one used to compile the source code for
compatibility.

Bug: 143977934
Test: m CLANG_COVERAGE=true dist
Change-Id: I71e0e7afb05dedd5f6a09d5e4099387c6262387f
2020-03-10 17:07:58 -07:00
Dan Willemsen
395358edae Trim down dont_bother_goals
This had caused the nodeps targets to break when I added the
auto-cleanup feature, as we wrote out smaller lists of what was
installed. The functionality of dont_bother_goals is also being fixed in
https://android-review.googlesource.com/c/platform/build/+/1250929/

But there's also no reason to have all of these targets in
dont_bother_goals, as they can just re-use the cached kati build graph.

Bug: 149460609
Test: m systemimage && m snod    <did not delete everything>
Test: m snod    <still see warning>
Test: codesearch for uses of MAKECMDGOALS and these targets
Change-Id: Ib8e7ba67e5ad980be4bdcf521c5156eea7941f97
2020-03-05 00:21:25 +00:00
Bob Badour
4b25c90e52 Partition the targets for notice files.
Partition the targets into those appearing in system images, those
appearing somewhere unreadable by the Settings UI, whose notices
must appear in a readable system image, and those not appearing
on the device thus not needing notices. Assert no other targets
appear under $(PRODUCT_OUT).

Test: manually built and tested phone image

Change-Id: If82cb36f98f8e6066d1c67bb4d15976be433d403
2020-02-26 16:49:28 -08:00
Treehugger Robot
733ad20963 Merge "do not clear output kernel module directory" 2020-02-21 01:02:09 +00:00
Steve Muckle
5e0ff33d0f do not clear output kernel module directory
When using an archive to provide kernel modules, the archive is directly
expanded into the output directory. The output directory is currently
removed prior to that to ensure no stale modules are present if they
were removed as part of a change in an incremental build.

Unfortunately if kernel modules are also provided via the regular
BOARD_*_KERNEL_MODULES macros, the removal of the output kernel module
directory will race with the copying of kernel modules in
BOARD_*_KERNEL_MODULES, resulting in some of those kernel modules not
being present in the output.

Kernel modules removed from BOARD_*_KERNEL_MODULES do not currently get
removed from the output directory in an incremental build anyway. So in
order to support using BOARD_*_KERNEL_MODULES and
BOARD_*_KERNEL_MODULES_ARCHIVE conurrently, take out the removal of the
output directory prior to archive expansion.

Bug: 149866863
Change-Id: Ib373650ddcb0fb5782a13d68a8869a9117e42ccc
2020-02-20 10:19:06 -08:00
Treehugger Robot
31d4a5aed7 Merge "Adding vendor_boot-debug.img" 2020-02-20 03:56:58 +00:00
Treehugger Robot
62eee30f34 Merge "Support empty jacoco-report-classes.jar" 2020-02-19 20:30:46 +00:00
Kyriakos Ispoglou
54839bb77e Merge "Add a new make target called haiku-line-coverage" 2020-02-19 19:07:20 +00:00
Treehugger Robot
6ed2deb9d5 Merge "build: Add vendor.prop and odm.prop capability" 2020-02-18 21:45:08 +00:00
Bowgo Tsai
6a68367e6e Adding vendor_boot-debug.img
Commit I30137c3caef91805d9143d404e5e4d06c0fccc30 adds boot-debug.img
to allow adb root with an user build GSI image.

  https://source.android.com/compatibility/vts/vts-on-gsi

Another commit I5b005097b73f59857c3a2f92d693b3e67ee8424e adds
vendor_boot.img to pair with a generic kernel image, the GKI boot.img.

To allow adb root for devices using a GKI, vendor_boot-debug.img is
introduced. The image combination used in VTS will be:

    Old devices without GKI:
      GSI system.img + boot-debug.img + vendor.img, etc.

    New devices with GKI:
      GSI system.img + GKI boot.img + vendor_boot-debug.img + vendor.img, etc.

Note that boot-debug.img still can be used on new devices for
non-compliance scenario.

Bug: 147849477
Test: lunch aosp_cf_x86_64_phone-userdebug; make vendorbootimage_debug
Test: `make dist`, checks that both vendor_boot-debug.img and
      vendor-ramdisk-debug.cpio.gz are in $OUT/ and out/dist.
Test: `make dist`, checks that installed-files-vendor-ramdisk-debug.{json,txt} are
       in $OUT/ and out/dist.
Change-Id: I66b662d8b1e5c619ed7bb81e40233fe9df363b27
2020-02-18 13:46:17 +08:00
Kyriakos Ispoglou
f00a0dbffc Add a new make target called haiku-line-coverage
This CL adds a new make target for line coverage, That is, by running
`make haiku-line-coverage` you can get a set of all profile (*.gcno) files
for all fuzz targets and for all critical components of Android,
packed into a zip called `line_coverage_profiles.zip`. Furthermore the set of
all fuzz targets are instrumented with line coverage and packed into
another zip called `line_coverage_fuzz_targets.zip`

To properly run the make target enable NATIVE_LINE_COVERAGE first:
NATIVE_LINE_COVERAGE=true NATIVE_COVERAGE=true COVERAGE_PATHS=* make haiku-line-coverage

Bug: b/148234755
Test: Make target buils successfully on master/aosp. Binaries tested on taimen
devices.

Change-Id: I6a1e11068119337628c2ae5ee3baf2fc394add05
2020-02-17 11:18:11 -08:00
Colin Cross
d81f4b3461 Support empty jacoco-report-classes.jar
If EMMA_INSTRUMENT is turned on but no APKs were built the rule to
collect jacoco-report-classes.jar would error with missing directories
and an empty zip file.  Switch to soong_zip, which doesn't error
on empty zip files, and hide the errors if $(TARGET_COMMON_OUT_ROOT)
or $(HOST_COMMON_OUT_ROOT) don't exist.

Test: m EMMA_INSTRUMENT=true TARGET_BUILD_APPS=Camera2
Change-Id: I09e30e37dc38f32f55b3f91bfc4d12c9e753083f
2020-02-14 10:36:47 -08:00
Tamas Petz
89418f058e core/Makefile: pass value of PRODUCT_USE_DYNAMIC_PARTITION_SIZE
Regardless of the value of PRODUCT_USE_DYNAMIC_PARTITION_SIZE
"use_dynamic_partition_size=true" is passed to build_image.sh.
Pass the value of PRODUCT_USE_DYNAMIC_PARTITION_SIZE just like it is
done for other properties.

Test: 1. build a target with fixed partition sizes and
         "PRODUCT_USE_DYNAMIC_PARTITION_SIZE := false".
      2. check the value of "use_dynamic_partition_size" in the
         corresponding system_image_info.txt.
      3. repeat steps 1 and 2 with this fix and see the difference.

Change-Id: Ia121d3d67f554f8ae4e211ad4e2c381a43409f01
2020-02-10 11:34:48 +01:00
Rashed Abdel-Tawab
194ed8e88d build: Add vendor.prop and odm.prop capability
This replicates the longtime existing handling of system.prop,
as well as the recently added handling of product.prop.

Change-Id: I8ab2b29bd0b5f0f2bcc0928d6a2a871c40582d3f
2020-02-01 22:53:52 +00:00
Baligh Uddin
6a8234bf43 Add mke2fs.conf to otatools
BUG: 148452817
2020-01-29 17:42:59 -08:00
Yifan Hong
67f58406ee Merge "Disallow VINTF metadata for PRODUCT_COPY_FILES" 2020-01-30 00:50:59 +00:00
Baligh Uddin
0434412bcd Merge "Add explicitly merge_zips to otatools package" 2020-01-29 06:16:16 +00:00
Tianjie Xu
a25d76f2c8 Add explicitly merge_zips to otatools package
Since it's under soong/out/host, we need to explicitly copy it into the
otatools.zip

Bug: 146508800
Test: build and check otatools.zip
Change-Id: I83e201601cf03b6eb01ead912a78f22f750aa4be
2020-01-28 19:17:35 -08:00
Daniel Rosenberg
dac25a96df Merge "Add build properties to enable casefold and prj_quota" 2020-01-28 23:53:25 +00:00
Daniel Rosenberg
6cc2c81f4d Add build properties to enable casefold and prj_quota
This adds the ability to format f2fs and ext4 in a way that supports
casefolding and project quotas. Project quotas require wider inodes, and
thus cannot be enable apart from at build time. Casefolding can be
configured with f2fs.fsck/tune2fs later.

Both features are enabled via inheriting emulated_storage.mk in the
device.mk

Bug: 138322712
Bug: 138321217
Test: Enable on device with related patches, view fs configuration on /data
Change-Id: Ib1ab0589006ff1b3fb7478b7e9b0a8aad71e4b09
2020-01-27 12:45:47 -08:00
Tianjie Xu
eb8a0a0036 Add apexer and dependencies to otatools
We need them to extract and repack the apex file when signing
the apex.

Bug: 146508800
Test: build
Change-Id: Ib38055eac24f28ac59610d03275de05b77d3eeb0
2020-01-27 11:05:54 -08:00
Yifan Hong
5e57a778cd Disallow VINTF metadata for PRODUCT_COPY_FILES
VINTF metadata must be checked by defining
DEVICE_MANIFEST_FILE and friends, instead of being
copied with PRODUCT_COPY_FILES directly.

This can be worked arond with BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES.

Test: Add the following and see errors:

PRODUCT_COPY_FILES += \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/vintf/manifest.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/vintf/manifest/foo.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/vintf/compatibility_matrix.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/vintf/manifest.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/vintf/manifest/foo.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_SYSTEM_EXT)/etc/vintf/compatibility_matrix.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/etc/vintf/manifest.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/etc/vintf/compatibility_matrix.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/compatibility_matrix.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_ODM)/etc/manifest.xml \
    device/XXX/manifest.xml:$(TARGET_COPY_OUT_ODM)/etc/vintf/manifest.xml \

Test: test again with BUILD_BROKEN_VINTF_PRODUCT_COPY_FILES := true

Bug: 147506249

Change-Id: Id75a9690b3c71fdc9a4e1b4e9be2caa63183cf7c
2020-01-24 15:07:35 -08:00