From 83ea783146c953d559b2913c9a90e698ab4b667a Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Wed, 11 Nov 2020 13:07:10 -0500 Subject: [PATCH] Filter out ab_partitions in source_info as well When generating a incremental partial OTA, we need to filter out partitions in ab_partitions which are not in partial list Test: Generate a partial incremental OTA Change-Id: Iff7748ce6181a9a231557de0539004211587232c --- tools/releasetools/ota_from_target_files.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/releasetools/ota_from_target_files.py b/tools/releasetools/ota_from_target_files.py index 869b713796..020e3ba760 100755 --- a/tools/releasetools/ota_from_target_files.py +++ b/tools/releasetools/ota_from_target_files.py @@ -1254,11 +1254,6 @@ def main(argv): OPTIONS.info_dict = common.LoadInfoDict(OPTIONS.extracted_input) else: OPTIONS.info_dict = ParseInfoDict(args[0]) - if OPTIONS.partial: - OPTIONS.info_dict['ab_partitions'] = \ - list( - set(OPTIONS.info_dict['ab_partitions']) & set(OPTIONS.partial) - ) if OPTIONS.downgrade: # We should only allow downgrading incrementals (as opposed to full). @@ -1284,6 +1279,17 @@ def main(argv): logger.info("--- source info ---") common.DumpInfoDict(OPTIONS.source_info_dict) + if OPTIONS.partial: + OPTIONS.info_dict['ab_partitions'] = \ + list( + set(OPTIONS.info_dict['ab_partitions']) & set(OPTIONS.partial) + ) + if OPTIONS.source_info_dict: + OPTIONS.source_info_dict['ab_partitions'] = \ + list( + set(OPTIONS.source_info_dict['ab_partitions']) & set(OPTIONS.partial) + ) + # Load OEM dicts if provided. OPTIONS.oem_dicts = _LoadOemDicts(OPTIONS.oem_source)