From 3cba374da2ce3e151f91307479b1a66ebcb081e4 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Tue, 16 May 2017 16:27:25 -0700 Subject: [PATCH] Pack avbtool into otatools.zip. Also pack the test keys for easier testing. Bug: 38315721 Test: m otatools-package and avbtool is present in otatools.zip. Change-Id: Ieb63bf3f4bc211ef1f48ab278cb01b70845d06da --- core/Makefile | 4 +++- tools/releasetools/common.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index 7b72f19789..ac8b2f2b0e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -941,7 +941,7 @@ $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_ $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "futility=$(notdir $(FUTILITY))" >> $(1)) $(if $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT),$(hide) echo "vboot_signer_cmd=$(VBOOT_SIGNER)" >> $(1)) $(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_signing_args=$(INTERNAL_AVB_SIGNING_ARGS)" >> $(1)) -$(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_avbtool=$(AVBTOOL)" >> $(1)) +$(if $(BOARD_AVB_ENABLE),$(hide) echo "avb_avbtool=$(notdir $(AVBTOOL))" >> $(1)) $(if $(BOARD_AVB_ENABLE),$(hide) echo "system_avb_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) $(if $(BOARD_AVB_ENABLE),$(hide) echo "system_avb_add_hashtree_footer_args=$(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS)" >> $(1)) $(if $(BOARD_AVB_ENABLE),$(hide) echo "vendor_avb_hashtree_enable=$(BOARD_AVB_ENABLE)" >> $(1)) @@ -1901,6 +1901,7 @@ OTATOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \ $(HOST_OUT_EXECUTABLES)/brillo_update_payload \ $(HOST_OUT_EXECUTABLES)/lib/shflags/shflags \ $(HOST_OUT_EXECUTABLES)/delta_generator \ + $(AVBTOOL) \ $(BLK_ALLOC_TO_BASE_FS) ifeq (true,$(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SUPPORTS_VBOOT)) @@ -1946,6 +1947,7 @@ $(BUILT_OTATOOLS_PACKAGE): zip_root := $(call intermediates-dir-for,PACKAGING,ot OTATOOLS_DEPS := \ system/extras/verity/build_verity_metadata.py \ system/extras/ext4_utils/mke2fs.conf \ + external/avb/test/data/testkey_rsa4096.pem \ $(shell find build/target/product/security -type f -name \*.x509.pem -o -name \*.pk8 -o \ -name verity_key | sort) \ $(shell find device vendor -type f -name \*.pk8 -o -name verifiedboot\* -o \ diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py index 925a5231f8..c022d2441c 100644 --- a/tools/releasetools/common.py +++ b/tools/releasetools/common.py @@ -491,7 +491,7 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None, # AVB: if enabled, calculate and add hash to boot.img. if info_dict.get("board_avb_enable", None) == "true": - avbtool = os.getenv('AVBTOOL') or "avbtool" + avbtool = os.getenv('AVBTOOL') or OPTIONS.info_dict["avb_avbtool"] part_size = info_dict.get("boot_size", None) cmd = [avbtool, "add_hash_footer", "--image", img.name, "--partition_size", str(part_size), "--partition_name", "boot"]