Merge "Always use ART sources for Fuchsia."
diff --git a/core/Makefile b/core/Makefile
index ed9465d..c8b8ae9 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -800,7 +800,7 @@
endif
# $1: boot image file name
-# $2: boot image variant (boot, boot-debug)
+# $2: boot image variant (boot, boot-debug, boot-test-harness)
define get-bootimage-partition-size
$(BOARD_$(call to-upper,$(subst .img,,$(subst $(2),kernel,$(notdir $(1)))))_BOOTIMAGE_PARTITION_SIZE)
endef
@@ -2327,21 +2327,22 @@
BOARD_AVB_BOOT_TEST_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS := --algorithm SHA256_RSA2048 --key $(BOARD_AVB_BOOT_TEST_KEY_PATH)
# $(1): the bootimage to sign
+# $(2): boot image variant (boot, boot-debug, boot-test-harness)
define test-key-sign-bootimage
-$(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(call get-bootimage-partition-size,$(1),boot-debug)))
+$(call assert-max-image-size,$(1),$(call get-hash-image-max-size,$(call get-bootimage-partition-size,$(1),$(2))))
$(AVBTOOL) add_hash_footer \
--image $(1) \
- --partition_size $(call get-bootimage-partition-size,$(1),boot-debug)\
+ --partition_size $(call get-bootimage-partition-size,$(1),$(2))\
--partition_name boot $(INTERNAL_AVB_BOOT_TEST_SIGNING_ARGS) \
$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)
-$(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),boot-debug))
+$(call assert-max-image-size,$(1),$(call get-bootimage-partition-size,$(1),$(2)))
endef
# $(1): output file
define build-debug-bootimage-target
$(MKBOOTIMG) --kernel $(PRODUCT_OUT)/$(subst .img,,$(subst boot-debug,kernel,$(notdir $(1)))) \
$(INTERNAL_DEBUG_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $1
- $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$1))
+ $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$1,boot-debug))
endef
# Depends on original boot.img and ramdisk-debug.img, to build the new boot-debug.img
@@ -2510,7 +2511,7 @@
define build-boot-test-harness-target
$(MKBOOTIMG) --kernel $(PRODUCT_OUT)/$(subst .img,,$(subst boot-test-harness,kernel,$(notdir $(1)))) \
$(INTERNAL_TEST_HARNESS_BOOTIMAGE_ARGS) $(INTERNAL_MKBOOTIMG_VERSION_ARGS) $(BOARD_MKBOOTIMG_ARGS) --output $@
- $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@))
+ $(if $(BOARD_AVB_BOOT_KEY_PATH),$(call test-key-sign-bootimage,$@,boot-test-harness))
endef
# Build the new boot-test-harness.img, based on boot-debug.img and ramdisk-test-harness.img.
diff --git a/tools/releasetools/common.py b/tools/releasetools/common.py
index fc1a692..0061819 100644
--- a/tools/releasetools/common.py
+++ b/tools/releasetools/common.py
@@ -109,7 +109,9 @@
# The partitions allowed to be signed by AVB (Android Verified Boot 2.0). Note
# that system_other is not in the list because we don't want to include its
-# descriptor into vbmeta.img.
+# descriptor into vbmeta.img. When adding a new entry here, the
+# AVB_FOOTER_ARGS_BY_PARTITION in sign_target_files_apks need to be updated
+# accordingly.
AVB_PARTITIONS = ('boot', 'dtbo', 'odm', 'product', 'pvmfw', 'recovery',
'system', 'system_ext', 'vendor', 'vendor_boot',
'vendor_dlkm', 'odm_dlkm')
diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py
index 05a085b..00acd98 100755
--- a/tools/releasetools/sign_target_files_apks.py
+++ b/tools/releasetools/sign_target_files_apks.py
@@ -178,19 +178,31 @@
AVB_FOOTER_ARGS_BY_PARTITION = {
- 'boot' : 'avb_boot_add_hash_footer_args',
- 'dtbo' : 'avb_dtbo_add_hash_footer_args',
- 'recovery' : 'avb_recovery_add_hash_footer_args',
- 'system' : 'avb_system_add_hashtree_footer_args',
- 'system_other' : 'avb_system_other_add_hashtree_footer_args',
- 'vendor' : 'avb_vendor_add_hashtree_footer_args',
- 'vendor_boot' : 'avb_vendor_boot_add_hash_footer_args',
- 'vbmeta' : 'avb_vbmeta_args',
- 'vbmeta_system' : 'avb_vbmeta_system_args',
- 'vbmeta_vendor' : 'avb_vbmeta_vendor_args',
+ 'boot': 'avb_boot_add_hash_footer_args',
+ 'dtbo': 'avb_dtbo_add_hash_footer_args',
+ 'product': 'avb_product_add_hashtree_footer_args',
+ 'recovery': 'avb_recovery_add_hash_footer_args',
+ 'system': 'avb_system_add_hashtree_footer_args',
+ 'system_ext': 'avb_system_ext_add_hashtree_footer_args',
+ 'system_other': 'avb_system_other_add_hashtree_footer_args',
+ 'odm': 'avb_odm_add_hashtree_footer_args',
+ 'odm_dlkm': 'avb_odm_dlkm_add_hashtree_footer_args',
+ 'pvmfw': 'avb_pvmfw_add_hash_footer_args',
+ 'vendor': 'avb_vendor_add_hashtree_footer_args',
+ 'vendor_boot': 'avb_vendor_boot_add_hash_footer_args',
+ 'vendor_dlkm': "avb_vendor_dlkm_add_hashtree_footer_args",
+ 'vbmeta': 'avb_vbmeta_args',
+ 'vbmeta_system': 'avb_vbmeta_system_args',
+ 'vbmeta_vendor': 'avb_vbmeta_vendor_args',
}
+# Check that AVB_FOOTER_ARGS_BY_PARTITION is in sync with AVB_PARTITIONS.
+for partition in common.AVB_PARTITIONS:
+ if partition not in AVB_FOOTER_ARGS_BY_PARTITION:
+ raise RuntimeError("Missing {} in AVB_FOOTER_ARGS".format(partition))
+
+
def GetApkCerts(certmap):
# apply the key remapping to the contents of the file
for apk, cert in certmap.items():