Add care_map to target_files package
Generate a new file containing care_data of system (and vendor) partition, and add it under META/ of target file package. For A/B update, copy this file to OTA package for later use by update_verifier. Bug: 27175949 Change-Id: I90bb972703afaeb94bc3efe718fd81b1cfbcabcc
This commit is contained in:
@@ -1314,6 +1314,19 @@ def WriteABOTAPackageWithBrilloScript(target_file, output_file,
|
||||
compress_type=zipfile.ZIP_STORED)
|
||||
WriteMetadata(metadata, output_zip)
|
||||
|
||||
# If dm-verity is supported for the device, copy contents of care_map
|
||||
# into A/B OTA package.
|
||||
if OPTIONS.info_dict.get("verity") == "true":
|
||||
target_zip = zipfile.ZipFile(target_file, "r")
|
||||
care_map_path = "META/care_map.txt"
|
||||
namelist = target_zip.namelist()
|
||||
if care_map_path in namelist:
|
||||
care_map_data = target_zip.read(care_map_path)
|
||||
common.ZipWriteStr(output_zip, "care_map.txt", care_map_data)
|
||||
else:
|
||||
print "Warning: cannot find care map file in target_file package"
|
||||
common.ZipClose(target_zip)
|
||||
|
||||
# Sign the whole package to comply with the Android OTA package format.
|
||||
common.ZipClose(output_zip)
|
||||
SignOutput(temp_zip_file.name, output_file)
|
||||
|
Reference in New Issue
Block a user