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
This commit is contained in:
Yifan Hong 2018-09-19 14:30:36 -07:00
parent c4af7d75dc
commit 10f7310829

View file

@ -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