platform_build/tools
Bowgo Tsai f636a80888 AVB: support chain partition signing
Current build system will include AVB metadata from each partition and
store them into /vbmeta partiton when BOARD_AVB_ENABLE is set, which makes
each partition tightly-coupled.

Add the support for 'chain partition':
  - The vbmeta of each partition is stored on the same partition itself.
  - The public key used to verify each partition is stored in /vbmeta.

For example, the following build variables are required to enable chain
partition for system partition:
  - BOARD_AVB_SYSTEM_KEY_PATH := path/to/system_private_key
  - BOARD_AVB_SYSTEM_ALGORITHM := SHA512_RSA8192
  - BOARD_AVB_SYSTEM_ROLLBACK_INDEX := 1
  - BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 2

The corresponding settings will be added into META/misc_info.txt for
build_image.py and/or add_img_to_target_files.py:
  - avb_system_key_path=path/to/system_private_key
  - avb_system_algorithm=SHA512_RSA8192
  - avb_system_add_hashtree_footer_args=--rollback_index 1
  - avb_system_rollback_index_location=2

To enable chain partition for other partitions, just replace SYSTEM with
BOOT, VENDOR and/or DTBO in the build variables.

Also switch from  `avbtool make_vbmeta_image --setup_rootfs_from_kernel system.img ...`
to `avbtool add_hashtree_footer --image system.img --setup_as_rootfs_from_kernel...`
when BOARD_BUILD_SYSTEM_ROOT_IMAGE is true. This works for both chained
and no-chained:
  - chained: `avbtool add_hashtree_footer --setup_as_rootfs_from_kernel` will
    add dm-verity kernel cmdline descriptor to system.img
  - no-chained: `avbtool make_vbmeta_image --include_descriptors_from_image
    system.img` will include the kernel cmdline descriptor from system.img into
    vbmeta.img

Bug: 38399657
Test: `make` pass, flash images from $OUT and boot device without chain partitions
Test: `make` pass, flash images from $OUT and boot device with chain partitions
Test: `make dist` pass, flash images from TF.zip and boot device without chain partitions
Test: `make dist` pass, flash images from TF.zip and boot device with chain partitions
Test: follow the same steps in
      https://android-review.googlesource.com/#/c/407572/

Change-Id: I344f79290743d7d47b5e7441b3a21df812a69099
Merged-In: I344f79290743d7d47b5e7441b3a21df812a69099
(cherry picked from commit 3e599ead66)
2017-06-21 10:22:38 +08:00
..
acp Switch some build tools to Soong 2016-06-06 14:51:52 -07:00
apicheck
atree Fix clang-tidy performance warnings. 2016-07-27 10:28:33 -07:00
droiddoc Delete all of templates-sdk/. 2017-03-27 17:23:36 +00:00
fs_config Android.mk: clear variable at end of use 2017-05-19 20:14:27 +00:00
fs_get_stats
ijar Use more prebuilt build-tools 2016-06-14 13:50:38 -07:00
libhost Merge \\\\"Remove build/libs\\\\" am: fcb8a89c3b am: 3c48705b9b am: 947c5715f8 2016-06-17 18:23:07 +00:00
makeparallel Wait for children to exit in makeparallel 2017-02-21 17:53:35 -08:00
releasetools AVB: support chain partition signing 2017-06-21 10:22:38 +08:00
signapk Don't include the dev-key on IOT products. 2017-04-03 15:04:35 -07:00
signtos
zipalign fallout of cleaning-up libutils includes 2017-03-03 12:37:34 -08:00
ziptime Switch some build tools to Soong 2016-06-06 14:51:52 -07:00
adbs
Android.mk
brillo-clang-format
buildinfo.sh Split board-specific system properties into vendor partition 2017-02-27 13:35:37 +09:00
check_builds.sh
check_link_type.py Fix link_type checking 2016-09-15 14:40:39 -07:00
check_radio_versions.py
checkowners.py Encode special characters in email addresses. 2017-04-05 14:16:49 -07:00
compare_fileslist.py
dump-package-stats
event_log_tags.py
fat16copy.py fat16copy: Allow to copy files to an existing directory. 2017-02-13 16:00:07 +00:00
fileslist_util.py build: tools: Add json collection of installed files with hashes. 2016-10-20 10:07:13 -07:00
filter-product-graph.py
findleaves.py findleaves.py: prevent recursion into symlink loops 2016-11-03 14:29:40 -07:00
fixlinebreaks.sh
generate-enforce-rro-android-manifest.py Enforce RROs for all the build-time ROs 2017-03-30 10:43:38 +09:00
generate-notice-files.py Split vendor license notices into vendor partition 2017-05-01 22:07:50 +00:00
java-event-log-tags.py
java-layers.py
merge-event-log-tags.py
mktarball.sh
normalize_path.py
parsedeps.py
post_process_props.py Merge "There's no longer a limit on property names." am: dda91dbef8 am: daac92eb51 2017-02-28 20:22:56 +00:00
print_module_licenses.sh
product_debug.py
soong_to_convert.py Remove DBus support. 2017-03-02 18:00:21 -08:00
vendor_buildinfo.sh Split board-specific system properties into vendor partition 2017-02-27 13:35:37 +09:00
warn.py Recognize new clang and make warnings. 2017-05-18 14:29:59 -07:00