Commit graph

3213 commits

Author SHA1 Message Date
Victor Hsieh
be1029af71 Add missing dependencies of fs-verity manifest APK
Otheriwse, the build complains about missing files when
PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA is enabled (aosp/1937717).

Bug: 206326351
Test: clobber, set PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA := true, build
Change-Id: I11d18914d63cab0b84ae711f2334747cb26ca234
2022-01-07 11:07:52 -08:00
Yi-yo Chiang
5709c4a93f Merge "Unconditionally copy the system build.prop into target_files archive" 2022-01-07 05:27:35 +00:00
Inseob Kim
135c1f144f Move fsverity metadata generation to Makefile
build_image.py has been handling fsverity metadata generation in the
packing step, but it can cause issues because the metadata files are
missing in the $OUT directory, and they only exist in result system.img.
This change moves the generation logic into Makefile, and makes the
metadata tracked by ninja graph.

Bug: 206326351
Test: PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA := true and build
Change-Id: I1f910d8ac6e2cc3c54f35916871733c632f18e44
2022-01-07 09:16:42 +09:00
Yi-Yo Chiang
9b2584170e Unconditionally copy the system build.prop into target_files archive
releasetools preconditions requires build metadata defined in
SYSTEM/build.prop even when building a system.img-less product.
Copy the SYSTEM/build.prop into the build artifact archive whenever
possible to make add_img_to_target_files happy.

Bug: 212486689
Bug: 213028932
Test: Dist build a system.img-less product. Product properties are
  read from SYSTEM/build.prop and no build error occurred.
Change-Id: I2ce7f8b8ae981eaf06e2d8d2485b55b4e975caa9
2022-01-07 03:29:14 +08:00
Treehugger Robot
e33e7e518c Merge "Fix build error on empty root folder" 2022-01-06 13:54:27 +00:00
Jacky Liu
bff997fd1f Merge "Add PRODUCT_EXTRA_OTA_KEYS to add extra ota keys in otacerts.zip" 2022-01-06 06:31:37 +00:00
Treehugger Robot
99bec02344 Merge "Calls check-and-set-avb-args() when the system.img exists" 2022-01-06 03:58:08 +00:00
Devin Moore
1c33419ed0 Merge "Add prebuilt init_boot.img to PREBUILT_IMAGES/" 2022-01-05 17:22:17 +00:00
Treehugger Robot
5203f2b1e0 Merge "Remove GKI_SIGNING args from recovery & debug boot image build rules" 2022-01-05 17:00:26 +00:00
Jacky Liu
beb0b6927c Add PRODUCT_EXTRA_OTA_KEYS to add extra ota keys in otacerts.zip
Equivalent to PRODUCT_EXTRA_RECOVERY_KEYS but for A/B OTA.

Bug: 211848136
Test: set PRODUCT_EXTRA_OTA_KEYS and check otacerts.zip
Change-Id: I81e27d12a22b405f6227b09c01ed684dfcede19e
2022-01-05 17:54:40 +08:00
Yi-Yo Chiang
cd6de3d8bb Remove GKI_SIGNING args from recovery & debug boot image build rules
These options are for certifying official GKI release, so they should
never be added to build command of recovery.img and boot-debug.img.

Also define gki_signing_signature_args in misc_info.txt iff.
BOARD_GKI_SIGNING_KEY_PATH is defined, so there's one less conditional.
We need to define it even if BOARD_GKI_SIGNING_SIGNATURE_ARGS is empty,
so that sign_target_files_apks.py can modify the option during image
signing.

Bug: 210367929
Test: Presubmit
Change-Id: I9546fcda796586d97af244955e15c1b8dc9f6d92
2022-01-05 02:59:45 +00:00
Devin Moore
cda41f0709 Add prebuilt init_boot.img to PREBUILT_IMAGES/
It was incorrectly being added to IMAGES/

Bug: 203698939
Test: m
Change-Id: I3c4ae46388a7f043c7bb22b78795277868422a01
2022-01-05 00:22:55 +00:00
Bowgo Tsai
e691aef7b1 Calls check-and-set-avb-args() when the system.img exists
Some targets, e.g., the newly added `gki_arm64`:
https://r.android.com/1935340, have no system.img.

To avoid the build error when making the vbmeta.img on a no-system-image
target, only sets system.img's AVB settings when it exists,.

Bug: 212486689
Test: `lunch gki_arm64-userdebug; make` with BOARD_AVB_ENABLE := true
Change-Id: I5e3c531e74116e421506a86ffce83848e7a9d6ea
2022-01-04 17:41:01 +08:00
Bowgo Tsai
4f62aa0899 Fix images-for-partitions() for 'init_boot'
Macro images-for-partitions() returns $(INSTALLED_INIT_BOOTIMAGE_TARGET)
for the 'init_boot' partition, which is empty. It should return
$(INSTALLED_INIT_BOOT_IMAGE_TARGET) instead.

Bug: 203698939
Test: `make` without chaining 'init_boot' partition
Change-Id: I387813283dfad7e1b2f762a5fa4065775977caf7
2022-01-04 17:29:03 +08:00
SzuWei Lin
c230b0b0c9 Fix build error on empty root folder
If a build target does not contain system image, it doesn't
output anything to root folder. The patch fix the build error for
the case the root folder is empty.

Bug: 212486689
Test: make bootimage dist
Test: Build pass
Change-Id: I4f1376eb7e615f48171ed9c3057c5a78074abaa6
2021-12-30 13:48:01 +08:00
Devin Moore
6363a04e79 Merge changes from topic "init_boot_img"
* changes:
  Update releasetools for new init_boot.img
  Build a new init_boot.img that contains the boot ramdisk
2021-12-22 23:21:17 +00:00
Devin Moore
380d9e445c Build a new init_boot.img that contains the boot ramdisk
This ramdisk used to be in boot.img, and is now placed into this new
init_boot.img instead.
This new image is used for a new init parition to seperate Android
platform artifacts from the kernel artifacts in boot.img.

Test: boot Cuttlefish
Bug: 203698939

Change-Id: Iaaf82486259979ab728730ce72a4e847ae005c18
2021-12-20 20:54:14 +00:00
Ramji Jiyani
f9ce357613 Add symlink for system_dlkm modules
Create symlinks for system_dlkm on devices with a
system_dlkm partition:

/system/lib/modules -> /system_dlkm/lib/modules

Bug: 200082547
Test: Manual boot with CF
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I8ddf340425cf92aa234f93f6b31bfd51cfa9c3f3
2021-12-20 19:52:40 +00:00
Treehugger Robot
1f9408b2b2 Merge "Explicitly set EROFS compression parameter" 2021-12-09 00:40:36 +00:00
Treehugger Robot
1295bc5138 Merge "Add missing apksigner dependency" 2021-12-07 11:43:06 +00:00
Kelvin Zhang
37d4929586 Explicitly set EROFS compression parameter
OTA will need to know the compression parameter used to construct EROFS
images. Currently, mkfs.erofs uses lz4hc,9 if the user didn't specify
one. But mkfs's default behavior is subject to change in future
versions. Therefore, explicitly specify the compression parameters so
OTA tooling can properly encode/decode erofs images.

Test: th
Change-Id: Ibbf67502827ee79437b766349be289048e685759
2021-12-01 14:21:24 -08:00
Kelvin Zhang
c06f0627c3 Embed zucchini version info in target_files
external/zucchini/version_info.h contains version info for zucchini
diffing algorithm. OTA tools will use these version info to check for
compatibility and determine if zucchini can be used safely. Owners of
zucchini agreed to keep the format of version_info.h stable so it's
parser friendly.

Bug: 194237829
Test: m dist
Change-Id: If8e37533933b346d3f03adab9263679910ab328c
2021-11-30 12:38:39 -08:00
Yifan Hong
351cd2e489 Merge changes from topic "servicemanager-recovery"
* changes:
  Add servicemanager.recovery to base_vendor.mk.
  Add recovery service_contexts.
2021-11-18 04:39:14 +00:00
Inseob Kim
c1d4512e02 Add missing apksigner dependency
Test: build after removing apksigner
Change-Id: I1ed7f13395bf7d5fe5f06a6bc3280809b5038636
2021-11-15 11:26:57 +09:00
Yifan Hong
276b8c0230 Add recovery service_contexts.
This allows servicemanager to run in recovery.

Test: manual
Bug: 170338625
Change-Id: I60671af0bcaf13fd545b2f286243fee474caace5
2021-11-13 00:28:05 -08:00
Inseob Kim
f69346e0a8 Add fsverity digest manifest
fsverity digest manifest stores a map from files to fsverity digests.
The manifest is installed as a serialized protobuf file, to a signed apk
system/etc/security/fsverity/BuildManifest.apk.

Bug: 193113311
Test: build with PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA := true
Change-Id: I55fc10400206b8ce0d5f198faea08fe3930b362c
2021-11-11 11:19:44 +00:00
Inseob Kim
9cda397948 Implement fsverity metadata generator
Using fsverity tool, fsverity metadata for specific artifacts in system
mage can be generated. Users can do that by setting a makefile variable
PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA to true.

If set to true, the following artifacts will be signed.

- system/framework/*.jar
- system/framework/oat/<arch>/*.{oat,vdex,art}
- system/etc/boot-image.prof
- system/etc/dirty-image-objects

One fsverity metadata container file per one input file will be
generated in system.img, with a suffix ".fsv_meta". e.g. a container
file for "system/framework/foo.jar" will be
"system/framework/foo.jar.fsv_meta".

Bug: 193113311
Test: build with PRODUCT_SYSTEM_FSVERITY_GENERATE_METADATA := true
Change-Id: Ib70d591a72d23286b5debcb05fbad799dfd79b94
2021-11-11 17:30:19 +09:00
Eric Miao
1d0fd2cb91 Add oatdump and dexdump to dexpreopt_tools.zip
Change-Id: If7615e1da24bcb819f595adb88060b164499a598
2021-11-09 18:53:39 +00:00
Bob Badour
879cfa867d Add macros for non-module license metadata and deps
Gets rid of .meta_module files and instead defers emitting rules until
after all the non-module targets have been processed. Allows direct
dependency on .meta_lic files, which in turn depend on license text
files.

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Test: m systemlicense
Test: m reportmissinglicenses

Change-Id: I2c467feac6e13a9366ff66f924889f1dbd48c3f1
2021-11-03 00:52:25 +00:00
Jooyung Han
8caba5e14e Support custom APEX signing tool
When an APEX specifies its custom signing tool (custom_sign_tool:),
apexkeys.txt contains the info and sign_target_files_apks pass the value
to apex_util.

For now the Virt APEX has its own custom signing tool (sign_virt_apex),
which is added to OTATOOLS.

Bug: 193504286
Test: sign_target_files_apks invokes sign_virt_apex
Change-Id: Iba845723fe3e18f542963324b9c58cd00914c5ba
2021-10-27 16:56:22 +09:00
Yi-Yo Chiang
09f68abca7 Merge "Revert "Renames boot-debug-*.img in GSI targets"" 2021-10-21 07:22:03 +00:00
Yi-Yo Chiang
ffb366ee99 Revert "Renames boot-debug-*.img in GSI targets"
This reverts commit a2a5db4466.

Reason for revert: original change was obsoleted by
  I3161e42b00a93177a1a4cb3b22da2218d294b7a7

Bug: 202129499
Test: Presubmit; change should be noop
Change-Id: Ib7be1ed73dbf08758276666f8ce35ed9cbf18a36
2021-10-18 06:33:51 +00:00
Dan Willemsen
53c98f7f6d Remove sdk-linux-x86.atree as well
I missed this one in my last change.

Bug: 187222815
Change-Id: Ibdbde80fe531d53ce9e89136211bdf85932c058c
2021-10-16 16:49:41 -07:00
Treehugger Robot
7deaa8102e Merge "Remove old build-tools/platform-tools SDK implementation" 2021-10-16 20:20:33 +00:00
Treehugger Robot
d8f17b1fc4 Merge "Add pcluster and deduplication support for erofs images." 2021-10-16 01:56:43 +00:00
Treehugger Robot
093f8dcfc9 Merge "Re-enable disable_sparse properties." 2021-10-15 21:44:14 +00:00
Dan Willemsen
39b81cdc7a Remove old build-tools/platform-tools SDK implementation
Since those were the only components of the Windows SDK, this removes a
lot of special casing around that as well.

Bug: 187222815
Change-Id: I2690aadcf78e9ccad43314c8475893e81a2e2735
2021-10-15 14:22:07 -07:00
Pierre-Clément Tosi
88cceca4c5 Merge "Introduce BOARD_PVMFWIMAGE_PARTITION_SIZE" 2021-10-15 06:44:04 +00:00
Pierre-Clément Tosi
85da2d3713 Merge "Add pvmfw.img to IMAGES for BUILT_TARGET_FILES_PKG" 2021-10-14 09:11:33 +00:00
Yi-Yo Chiang
5ba458f71d Merge "Cleanup dependencies of debug boot images" 2021-10-13 09:58:23 +00:00
David Anderson
64b351b882 Add pcluster and deduplication support for erofs images.
This adds BOARD_xIMAGE_EROFS_PCLUSTER_SIZE and
BOARD_EROFS_PCLUSTER_SIZE, which set the "pcluster size" of erofs images
for individual images or all erofs images respectively. The pcluster
size affects the maximum size of a physical compressed block.

This also adds BOARD_EROFS_SHARE_DUP_BLOCKS, which turns on chunk
support in EROFS.

Bug: 201685920
Test: manual test
Change-Id: I27ec0899f89890562796dd9fa567fc74182fbefb
2021-10-13 01:03:10 -07:00
David Anderson
5f4aa6c057 Re-enable disable_sparse properties.
This accidentally got omitted in the recent refactoring of
generate-image-prop-dictionary.

Bug: N/A
Test: build, system.img is not sparsed
Change-Id: Ie2e095aff08e937111f5c7ffc06e38e87c2d7d43
2021-10-08 17:21:43 -07:00
Pierre-Clément Tosi
d8248af3c8 Add pvmfw.img to IMAGES for BUILT_TARGET_FILES_PKG
Package the image even if it was built (previously, only the pre-built
version was being included).

Bug: 199717422
Test: m ${ANDROID_PRODUCT_OUT}/pvmfw.img
Change-Id: Ifb68ad571be78434f815307a5e4939222a28e7b7
2021-10-07 12:18:17 +02:00
Yi-Yo Chiang
9942f4e51e Cleanup dependencies of debug boot images
Remove redundant dependencies and adjust build rule, so that
  ramdisk-debug.img is built iff. boot-debug.img is built
same adjustment for vendor_boot-debug.img, boot-test-harness.img,
vendor_boot-test-harness.img.

Also remove "rsync" build rule in test harness ramdisk.

Bug: 201753847
Test: PRODUCT_BUILD_DEBUG_BOOT_IMAGE=true \
  PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE=false \
  => ramdisk-debug.img is built; vendor_ramdisk-debug.img is not
Test: PRODUCT_BUILD_DEBUG_BOOT_IMAGE=false \
  PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE=true \
  => ramdisk-debug.img is not built; vendor_ramdisk-debug.img is
Test: PRODUCT_BUILD_DEBUG_BOOT_IMAGE=true \
  PRODUCT_BUILD_DEBUG_VENDOR_BOOT_IMAGE=true \
  => ramdisk-debug.img is built; so do vendor_ramdisk-debug.img
Change-Id: I33f526bd3c50b9c4010f46e490cab778fcb23371
2021-10-06 16:17:50 +08:00
Pierre-Clément Tosi
ab1d0dc36e Merge changes from topic "default-pvmfw-image" am: b3be181687
Original change: https://android-review.googlesource.com/c/platform/build/+/1832464

Change-Id: I92a002aa926d8d48637e35b26c41ef65026e8eed
2021-10-06 07:43:22 +00:00
Pierre-Clément Tosi
b3be181687 Merge changes from topic "default-pvmfw-image"
* changes:
  Add generic board-agnostic pre-built pvmfw.img
  Add framework for building the pvmfw.img partition
  Stop assuming that pvmfw.img can only be pre-built
2021-10-06 07:25:01 +00:00
Pierre-Clément Tosi
592a3ca91b Introduce BOARD_PVMFWIMAGE_PARTITION_SIZE
Rename the BOARD_PVMFWIMG_PARTITION_SIZE variable to follow the format
used by all other partitions: BOARD_$(name)IMAGE_PARTITION_SIZE. Note
that all boards using that variable should have been updated to also
define the new version, by now.

Define the new variable as board read-only, as done for other
partitions.

Bug: 199717422
Test: m ${ANDROID_PRODUCT_OUT}/pvmfw.img
Change-Id: I5664c903db6388458e906e996115b695220932ca
2021-10-04 14:20:49 +02:00
Yi-Yo Chiang
f93950ae53 Merge changes If929bcf9,I9fb5c7fc am: 747a0c12eb
Original change: https://android-review.googlesource.com/c/platform/build/+/1842716

Change-Id: I0f9bc530c3e2e83b14efcad778870bc0d7795888
2021-10-04 10:00:49 +00:00
Pierre-Clément Tosi
3bda0d6992 Add generic board-agnostic pre-built pvmfw.img
Make use of the pvmfw.img-building AOSP framework to provide a common
default image instead of requiring boards to necessarily provide their
own but allow over-writing it through BOARD_PREBUILT_PVMFWIMAGE, if
desired.

Note: The Android Virtualization Framework requires the pvmfw partition.

Bug: 199717422
Test: m ${ANDROID_PRODUCT_OUT}/pvmfw.img
Change-Id: I5e06f08d6e22178e45254b7ab63acd3855d99a38
2021-10-04 11:56:56 +02:00
Pierre-Clément Tosi
fa8193c0e9 Add framework for building the pvmfw.img partition
Adapt the variables necessary for building pvmfw.img by following what
was done for other Android partitions and introducing:

 - PRODUCT_BUILD_PVMFW_IMAGE
 - BUILDING_PVMFW_IMAGE
 - BUILT_PVMFWIMAGE_TARGET

Replace the manual 'cp' by the more common 'copy-one-file'.

Bug: 199831815
Test: m ${ANDROID_PRODUCT_OUT}/pvmfw.img # with TARGET_PKVM_ENABLED=true
Change-Id: I5e4bbcbdbf4b96281ee54631938f097e9744883c
2021-10-04 11:41:34 +02:00