From 10f7310829cf64c0badf52232442b6150dca7773 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Wed, 19 Sep 2018 14:30:36 -0700 Subject: [PATCH] max size of dynamic partitions for AB devices are halved. For example, if BOARD_SUPER_PARTITION_SIZE is 10GiB, then the sum of sizes of all dynamic partitions must be within 5GiB. Fixes: 115920069 Test: make Change-Id: I800faff28e8483c92a1c0cf5e0b3bae4d638f86d --- core/Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/Makefile b/core/Makefile index 23dc59ae71..16e1b0bc7b 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2991,13 +2991,15 @@ check_android_partition_sizes: $(call images-for-partitions,$(BOARD_SUPER_PARTIT check_android_partition_sizes: partition_size_list="$(call read-size-of-partitions,$(BOARD_SUPER_PARTITION_PARTITION_LIST))"; \ sum_sizes_expr=$$(sed -e 's/ /+/g' <<< "$${partition_size_list}"); \ - if [ $$(( $${sum_sizes_expr} )) -gt $(BOARD_SUPER_PARTITION_SIZE) ]; then \ - echo 'The sum of sizes of all logical partitions is larger than BOARD_SUPER_PARTITION_SIZE.'; \ - echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' $(BOARD_SUPER_PARTITION_SIZE); \ + max_size_tail=$(if $(filter true,$(AB_OTA_UPDATER))," / 2"); \ + max_size_expr=$(BOARD_SUPER_PARTITION_SIZE)$${max_size_tail}; \ + if [ $$(( $${sum_sizes_expr} )) -gt $$(( $${max_size_expr} )) ]; then \ + echo "The sum of sizes of all logical partitions is larger than BOARD_SUPER_PARTITION_SIZE$${max_size_tail}:"; \ + echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' $${max_size_expr} '==' $$(( $${max_size_expr} )); \ exit 1; \ else \ - echo 'The sum of sizes of all logical partitions is within BOARD_SUPER_PARTITION_SIZE:' \ - $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '<=' $(BOARD_SUPER_PARTITION_SIZE); \ + echo "The sum of sizes of all logical partitions is within BOARD_SUPER_PARTITION_SIZE$${max_size_tail}:"; \ + echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '<=' $${max_size_expr} '==' $$(( $${max_size_expr} )); \ fi endif # BOARD_SUPER_PARTITION_PARTITION_LIST