Adding better AVB error message
Also removing the requirement of BOARD_BOOTIMAGE_PARTITION_SIZE when BOARD_AVB_ENABLE is set. Some targets (e.g., emulator) doesn't build boot.img when AVB is enabled. Bug: 112293933 Test: build a failure case and checks the error output is expected Change-Id: I290c707719193ddaedcd9fd0b31de566ad17078c
This commit is contained in:
@@ -2636,10 +2636,6 @@ BOARD_AVB_ALGORITHM := SHA256_RSA4096
|
|||||||
BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
|
BOARD_AVB_KEY_PATH := external/avb/test/data/testkey_rsa4096.pem
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef BOARD_BOOTIMAGE_PARTITION_SIZE
|
|
||||||
$(error BOARD_BOOTIMAGE_PARTITION_SIZE must be set for BOARD_AVB_ENABLE)
|
|
||||||
endif
|
|
||||||
|
|
||||||
BOOT_FOOTER_ARGS := BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS
|
BOOT_FOOTER_ARGS := BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS
|
||||||
DTBO_FOOTER_ARGS := BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS
|
DTBO_FOOTER_ARGS := BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS
|
||||||
SYSTEM_FOOTER_ARGS := BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS
|
SYSTEM_FOOTER_ARGS := BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS
|
||||||
|
@@ -197,8 +197,11 @@ def AVBAddFooter(image_path, avbtool, footer_type, partition_size,
|
|||||||
|
|
||||||
cmd.extend(shlex.split(additional_args))
|
cmd.extend(shlex.split(additional_args))
|
||||||
|
|
||||||
(_, exit_code) = RunCommand(cmd)
|
output, exit_code = RunCommand(cmd)
|
||||||
return exit_code == 0
|
if exit_code != 0:
|
||||||
|
print("Failed to add AVB footer! Error: %s" % output)
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def AdjustPartitionSizeForVerity(partition_size, fec_supported):
|
def AdjustPartitionSizeForVerity(partition_size, fec_supported):
|
||||||
@@ -587,7 +590,8 @@ def BuildImage(in_dir, prop_dict, out_file, target_out=None):
|
|||||||
additional_args = prop_dict["avb_add_" + avb_footer_type + "_footer_args"]
|
additional_args = prop_dict["avb_add_" + avb_footer_type + "_footer_args"]
|
||||||
max_image_size = AVBCalcMaxImageSize(avbtool, avb_footer_type,
|
max_image_size = AVBCalcMaxImageSize(avbtool, avb_footer_type,
|
||||||
partition_size, additional_args)
|
partition_size, additional_args)
|
||||||
if max_image_size == 0:
|
if max_image_size <= 0:
|
||||||
|
print("AVBCalcMaxImageSize is <= 0: %d" % max_image_size)
|
||||||
return False
|
return False
|
||||||
prop_dict["partition_size"] = str(max_image_size)
|
prop_dict["partition_size"] = str(max_image_size)
|
||||||
prop_dict["original_partition_size"] = partition_size
|
prop_dict["original_partition_size"] = partition_size
|
||||||
|
Reference in New Issue
Block a user