dynamic partitions: round partitions to BOARD_SUPER_PARTITION_ALIGNMENT

For the worst minimum_io_size for the BOM for the flash device on
the products, set BOARD_SUPER_PARTITION_ALIGNMENT so that we can
in advance get a summary from the build that the update may fail.

Test: build
Bug: 122328872
Change-Id: I95515e58e5308b7a1e637fc8c8791c0fc61e81f2
This commit is contained in:
Mark Salyzyn 2019-01-29 09:08:21 -08:00
parent c683233b64
commit 1d8d3bef47
1 changed files with 16 additions and 2 deletions

View File

@ -3126,6 +3126,18 @@ define read-size-of-partitions
$(foreach p,$(1),$(call read-image-prop-dictionary,$($(p)image_intermediates)/generated_$(p)_image_info.txt,$(p)_size))
endef
# round result to BOARD_SUPER_PARTITION_ALIGNMENT
#$(1): the calculated size
ifeq (,$(BOARD_SUPER_PARTITION_ALIGNMENT))
define round-partition-size
$(1)
endef
else
define round-partition-size
$$((($(1)+$(BOARD_SUPER_PARTITION_ALIGNMENT)-1)/$(BOARD_SUPER_PARTITION_ALIGNMENT)*$(BOARD_SUPER_PARTITION_ALIGNMENT)))
endef
endif
define super-slot-suffix
$(if $(filter true,$(AB_OTA_UPDATER)),$(if $(filter true,$(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS)),,_a))
endef
@ -3159,8 +3171,10 @@ endif
# $(2): max size expression
# $(3): list of partition names
define check-sum-of-partition-sizes
partition_size_list="$(call read-size-of-partitions,$(3))"; \
sum_sizes_expr=$$(sed -e 's/ /+/g' <<< "$${partition_size_list}"); \
partition_size_list="$$(for i in $(call read-size-of-partitions,$(3)); do \
echo $(call round-partition-size,$${i}); \
done)"; \
sum_sizes_expr=$$(tr '\n' '+' <<< "$${partition_size_list}" | sed 's/+$$//'); \
if [ $$(( $${sum_sizes_expr} )) -gt $$(( $(2) )) ]; then \
echo "The sum of sizes of [$(strip $(3))] is larger than $(strip $(1)):"; \
echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' "$(2)" '==' $$(( $(2) )); \