diff options
author | Tianjie Xu <xunchang@google.com> | 2021-06-02 21:53:36 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-06-02 21:53:36 +0000 |
commit | b195f48ce981b7e95dcaca91f50019d149feae45 (patch) | |
tree | f557cea352119e97abcef2b1ae4c23aa02975d3c /tools | |
parent | 83ecfb5073951d5df05fd1d0ff033a3ce7191328 (diff) | |
parent | 16bcac122f4cf80b808372f3a6c146ed276dfc6e (diff) |
Merge "Check super size for factory OTA at build time" into sc-dev
Diffstat (limited to 'tools')
-rw-r--r-- | tools/releasetools/check_partition_sizes.py | 12 | ||||
-rw-r--r-- | tools/releasetools/test_check_partition_sizes.py | 11 |
2 files changed, 20 insertions, 3 deletions
diff --git a/tools/releasetools/check_partition_sizes.py b/tools/releasetools/check_partition_sizes.py index 3047ddb7cc..eaed07e877 100644 --- a/tools/releasetools/check_partition_sizes.py +++ b/tools/releasetools/check_partition_sizes.py @@ -223,9 +223,15 @@ class DynamicPartitionSizeChecker(object): error_limit = Expression( "BOARD_SUPER_PARTITION_ERROR_LIMIT{}".format(size_limit_suffix), int(info_dict["super_partition_error_limit"]) // num_slots) - self._CheckSumOfPartitionSizes( - max_size, info_dict["dynamic_partition_list"].strip().split(), - warn_limit, error_limit) + partitions_in_super = info_dict["dynamic_partition_list"].strip().split() + # In the vab case, factory OTA will allocate space on super to install + # the system_other partition. So add system_other to the partition list. + if DeviceType.Get(self.info_dict) == DeviceType.VAB and ( + "system_other_image" in info_dict or + "system_other_image_size" in info_dict): + partitions_in_super.append("system_other") + self._CheckSumOfPartitionSizes(max_size, partitions_in_super, + warn_limit, error_limit) groups = info_dict.get("super_partition_groups", "").strip().split() diff --git a/tools/releasetools/test_check_partition_sizes.py b/tools/releasetools/test_check_partition_sizes.py index 073d2290eb..88cf60f6da 100644 --- a/tools/releasetools/test_check_partition_sizes.py +++ b/tools/releasetools/test_check_partition_sizes.py @@ -33,6 +33,7 @@ class CheckPartitionSizesTest(test_utils.ReleaseToolsTestCase): system_image_size=50 vendor_image_size=20 product_image_size=20 + system_other_image_size=10 """.split("\n")) def test_ab(self): @@ -126,3 +127,13 @@ class CheckPartitionSizesTest(test_utils.ReleaseToolsTestCase): """.split("\n"))) with self.assertRaises(RuntimeError): CheckPartitionSizes(self.info_dict) + + def test_vab_too_big_with_system_other(self): + self.info_dict.update(common.LoadDictionaryFromLines(""" + virtual_ab=true + system_other_image_size=20 + super_partition_size=101 + super_super_device_size=101 + """.split("\n"))) + with self.assertRaises(RuntimeError): + CheckPartitionSizes(self.info_dict) |