Merge "Remove three board_avb_* args from META/misc_info.txt." am: 401b1d2509
am: 6466063839
am: 26912a3a57
am: f6737d7506
Change-Id: If0c59cc150e6b8dfa90548a39ce7e5bb5ac53c7b
This commit is contained in:
commit
6d1b2bc139
|
@ -2302,10 +2302,7 @@ endif
|
||||||
ifeq ($(BOARD_AVB_ENABLE),true)
|
ifeq ($(BOARD_AVB_ENABLE),true)
|
||||||
$(hide) echo "board_avb_enable=true" >> $(zip_root)/META/misc_info.txt
|
$(hide) echo "board_avb_enable=true" >> $(zip_root)/META/misc_info.txt
|
||||||
$(hide) echo "board_avb_rollback_index=$(BOARD_AVB_ROLLBACK_INDEX)" >> $(zip_root)/META/misc_info.txt
|
$(hide) echo "board_avb_rollback_index=$(BOARD_AVB_ROLLBACK_INDEX)" >> $(zip_root)/META/misc_info.txt
|
||||||
$(hide) echo "board_avb_key_path=$(BOARD_AVB_KEY_PATH)" >> $(zip_root)/META/misc_info.txt
|
|
||||||
$(hide) echo "board_avb_algorithm=$(BOARD_AVB_ALGORITHM)" >> $(zip_root)/META/misc_info.txt
|
|
||||||
$(hide) echo "board_avb_boot_add_hash_footer_args=$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)" >> $(zip_root)/META/misc_info.txt
|
$(hide) echo "board_avb_boot_add_hash_footer_args=$(BOARD_AVB_BOOT_ADD_HASH_FOOTER_ARGS)" >> $(zip_root)/META/misc_info.txt
|
||||||
$(hide) echo "board_avb_system_add_hashtree_footer_args=$(BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS)" >> $(zip_root)/META/misc_info.txt
|
|
||||||
$(hide) echo "board_avb_make_vbmeta_image_args=$(BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS)" >> $(zip_root)/META/misc_info.txt
|
$(hide) echo "board_avb_make_vbmeta_image_args=$(BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS)" >> $(zip_root)/META/misc_info.txt
|
||||||
endif
|
endif
|
||||||
ifdef BOARD_BPT_INPUT_FILES
|
ifdef BOARD_BPT_INPUT_FILES
|
||||||
|
|
|
@ -194,11 +194,11 @@ def AddDtbo(output_zip, prefix="IMAGES/"):
|
||||||
# AVB-sign the image as needed.
|
# AVB-sign the image as needed.
|
||||||
if OPTIONS.info_dict.get("board_avb_enable") == "true":
|
if OPTIONS.info_dict.get("board_avb_enable") == "true":
|
||||||
avbtool = os.getenv('AVBTOOL') or OPTIONS.info_dict["avb_avbtool"]
|
avbtool = os.getenv('AVBTOOL') or OPTIONS.info_dict["avb_avbtool"]
|
||||||
part_size = OPTIONS.info_dict.get("dtbo_size")
|
part_size = OPTIONS.info_dict["dtbo_size"]
|
||||||
# The AVB hash footer will be replaced if already present.
|
# The AVB hash footer will be replaced if already present.
|
||||||
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
||||||
"--partition_size", str(part_size), "--partition_name", "dtbo"]
|
"--partition_size", str(part_size), "--partition_name", "dtbo"]
|
||||||
common.AppendAVBSigningArgs(cmd)
|
cmd.extend(shlex.split(OPTIONS.info_dict["avb_signing_args"]))
|
||||||
args = OPTIONS.info_dict.get("board_avb_dtbo_add_hash_footer_args")
|
args = OPTIONS.info_dict.get("board_avb_dtbo_add_hash_footer_args")
|
||||||
if args and args.strip():
|
if args and args.strip():
|
||||||
cmd.extend(shlex.split(args))
|
cmd.extend(shlex.split(args))
|
||||||
|
@ -349,7 +349,7 @@ def AddVBMeta(output_zip, boot_img_path, system_img_path, vendor_img_path,
|
||||||
cmd.extend(["--include_descriptors_from_image", dtbo_img_path])
|
cmd.extend(["--include_descriptors_from_image", dtbo_img_path])
|
||||||
if OPTIONS.info_dict.get("system_root_image") == "true":
|
if OPTIONS.info_dict.get("system_root_image") == "true":
|
||||||
cmd.extend(["--setup_rootfs_from_kernel", system_img_path])
|
cmd.extend(["--setup_rootfs_from_kernel", system_img_path])
|
||||||
common.AppendAVBSigningArgs(cmd)
|
cmd.extend(shlex.split(OPTIONS.info_dict["avb_signing_args"]))
|
||||||
args = OPTIONS.info_dict.get("board_avb_make_vbmeta_image_args")
|
args = OPTIONS.info_dict.get("board_avb_make_vbmeta_image_args")
|
||||||
if args and args.strip():
|
if args and args.strip():
|
||||||
cmd.extend(shlex.split(args))
|
cmd.extend(shlex.split(args))
|
||||||
|
|
|
@ -345,16 +345,6 @@ def DumpInfoDict(d):
|
||||||
print("%-25s = (%s) %s" % (k, type(v).__name__, v))
|
print("%-25s = (%s) %s" % (k, type(v).__name__, v))
|
||||||
|
|
||||||
|
|
||||||
def AppendAVBSigningArgs(cmd):
|
|
||||||
"""Append signing arguments for avbtool."""
|
|
||||||
keypath = OPTIONS.info_dict.get("board_avb_key_path", None)
|
|
||||||
algorithm = OPTIONS.info_dict.get("board_avb_algorithm", None)
|
|
||||||
if not keypath or not algorithm:
|
|
||||||
algorithm = "SHA256_RSA4096"
|
|
||||||
keypath = "external/avb/test/data/testkey_rsa4096.pem"
|
|
||||||
cmd.extend(["--key", keypath, "--algorithm", algorithm])
|
|
||||||
|
|
||||||
|
|
||||||
def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None,
|
def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None,
|
||||||
has_ramdisk=False, two_step_image=False):
|
has_ramdisk=False, two_step_image=False):
|
||||||
"""Build a bootable image from the specified sourcedir.
|
"""Build a bootable image from the specified sourcedir.
|
||||||
|
@ -491,12 +481,12 @@ def _BuildBootableImage(sourcedir, fs_config_file, info_dict=None,
|
||||||
|
|
||||||
# AVB: if enabled, calculate and add hash to boot.img.
|
# AVB: if enabled, calculate and add hash to boot.img.
|
||||||
if info_dict.get("board_avb_enable", None) == "true":
|
if info_dict.get("board_avb_enable", None) == "true":
|
||||||
avbtool = os.getenv('AVBTOOL') or OPTIONS.info_dict["avb_avbtool"]
|
avbtool = os.getenv('AVBTOOL') or info_dict["avb_avbtool"]
|
||||||
part_size = info_dict.get("boot_size", None)
|
part_size = info_dict["boot_size"]
|
||||||
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
cmd = [avbtool, "add_hash_footer", "--image", img.name,
|
||||||
"--partition_size", str(part_size), "--partition_name", "boot"]
|
"--partition_size", str(part_size), "--partition_name", "boot"]
|
||||||
AppendAVBSigningArgs(cmd)
|
cmd.extend(shlex.split(info_dict["avb_signing_args"]))
|
||||||
args = info_dict.get("board_avb_boot_add_hash_footer_args", None)
|
args = info_dict.get("board_avb_boot_add_hash_footer_args")
|
||||||
if args and args.strip():
|
if args and args.strip():
|
||||||
cmd.extend(shlex.split(args))
|
cmd.extend(shlex.split(args))
|
||||||
p = Run(cmd, stdout=subprocess.PIPE)
|
p = Run(cmd, stdout=subprocess.PIPE)
|
||||||
|
|
Loading…
Reference in New Issue