Remove verity keys from info_dict

We are removing VB support from release tools. This change aims to
remove verity keys in info_dict generated by common.LOADINFODICT

Bug: 242672222
Test: atest under build/make
Change-Id: I9268cb113c2c0bd11ce85b8485e5a4605bdbdca0
This commit is contained in:
hungweichen 2022-08-19 06:35:43 +00:00
parent dd3fca09f6
commit 22e3b01d7b
2 changed files with 2 additions and 17 deletions

View file

@ -1678,23 +1678,9 @@ def _BuildBootableImage(image_name, sourcedir, fs_config_file, info_dict=None,
with open(img.name, 'ab') as f:
f.write(boot_signature_bytes)
if (info_dict.get("boot_signer") == "true" and
info_dict.get("verity_key")):
# Hard-code the path as "/boot" for two-step special recovery image (which
# will be loaded into /boot during the two-step OTA).
if two_step_image:
path = "/boot"
else:
path = "/" + partition_name
cmd = [OPTIONS.boot_signer_path]
cmd.extend(OPTIONS.boot_signer_args)
cmd.extend([path, img.name,
info_dict["verity_key"] + ".pk8",
info_dict["verity_key"] + ".x509.pem", img.name])
RunAndCheckOutput(cmd)
# Sign the image if vboot is non-empty.
elif info_dict.get("vboot"):
if info_dict.get("vboot"):
path = "/" + partition_name
img_keyblock = tempfile.NamedTemporaryFile()
# We have switched from the prebuilt futility binary to using the tool

View file

@ -1289,8 +1289,7 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
# If dm-verity is supported for the device, copy contents of care_map
# into A/B OTA package.
target_zip = zipfile.ZipFile(target_file, "r", allowZip64=True)
if (target_info.get("verity") == "true" or
target_info.get("avb_enable") == "true"):
if target_info.get("avb_enable") == "true":
care_map_list = [x for x in ["care_map.pb", "care_map.txt"] if
"META/" + x in target_zip.namelist()]