Generate partition timestamps in ota_from_target_files

Test: make an OTA package
Bug: 162553432
Change-Id: I17b9f1b24307255b1e5115de12fa516126b32365
This commit is contained in:
Kelvin Zhang
2020-08-17 11:04:25 -04:00
parent 27ca29a3c7
commit 39aea44a96
4 changed files with 124 additions and 86 deletions

View File

@@ -118,7 +118,7 @@ AVB_PARTITIONS = ('boot', 'dtbo', 'odm', 'product', 'recovery', 'system',
AVB_VBMETA_PARTITIONS = ('vbmeta_system', 'vbmeta_vendor')
# Partitions that should have their care_map added to META/care_map.pb
PARTITIONS_WITH_CARE_MAP = (
PARTITIONS_WITH_CARE_MAP = [
'system',
'vendor',
'product',
@@ -126,7 +126,7 @@ PARTITIONS_WITH_CARE_MAP = (
'odm',
'vendor_dlkm',
'odm_dlkm',
)
]
class ErrorCode(object):
@@ -729,10 +729,14 @@ def LoadInfoDict(input_file, repacking=False):
fingerprint = build_info.GetPartitionFingerprint(partition)
if fingerprint:
d["avb_{}_salt".format(partition)] = sha256(fingerprint.encode()).hexdigest()
try:
d["ab_partitions"] = read_helper("META/ab_partitions.txt").split("\n")
except KeyError:
logger.warning("Can't find META/ab_partitions.txt")
return d
def LoadListFromFile(file_path):
with open(file_path) as f:
return f.read().splitlines()