forked from openkylin/platform_build
Merge "Fail build when sum of sizes of logical partitions exceeds OEM-set limit"
am: acfbc544e6
Change-Id: Id2af75f3fdacddae343da59bb85f6ab71c80e1ca
This commit is contained in:
commit
a7f33ab8d9
|
@ -3429,6 +3429,10 @@ ifndef BOARD_SUPER_PARTITION_WARN_LIMIT
|
||||||
BOARD_SUPER_PARTITION_WARN_LIMIT := $$(($(BOARD_SUPER_PARTITION_SIZE) * 95 / 100))
|
BOARD_SUPER_PARTITION_WARN_LIMIT := $$(($(BOARD_SUPER_PARTITION_SIZE) * 95 / 100))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef BOARD_SUPER_PARTITION_ERROR_LIMIT
|
||||||
|
BOARD_SUPER_PARTITION_ERROR_LIMIT := $(BOARD_SUPER_PARTITION_SIZE)
|
||||||
|
endif
|
||||||
|
|
||||||
droid_targets: check-all-partition-sizes
|
droid_targets: check-all-partition-sizes
|
||||||
|
|
||||||
.PHONY: check-all-partition-sizes check-all-partition-sizes-nodeps
|
.PHONY: check-all-partition-sizes check-all-partition-sizes-nodeps
|
||||||
|
@ -3465,6 +3469,8 @@ endif
|
||||||
# $(3): list of partition names
|
# $(3): list of partition names
|
||||||
# $(4): human-readable warn size string
|
# $(4): human-readable warn size string
|
||||||
# $(5): warn size expression
|
# $(5): warn size expression
|
||||||
|
# $(6): human readable error size string
|
||||||
|
# $(7): error size expression
|
||||||
define check-sum-of-partition-sizes
|
define check-sum-of-partition-sizes
|
||||||
partition_size_list="$$(for i in $(call read-size-of-partitions,$(3)); do \
|
partition_size_list="$$(for i in $(call read-size-of-partitions,$(3)); do \
|
||||||
echo $(call round-partition-size,$${i}); \
|
echo $(call round-partition-size,$${i}); \
|
||||||
|
@ -3475,6 +3481,12 @@ define check-sum-of-partition-sizes
|
||||||
echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' "$(2)" '==' $$(( $(2) )); \
|
echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' "$(2)" '==' $$(( $(2) )); \
|
||||||
exit 1; \
|
exit 1; \
|
||||||
else \
|
else \
|
||||||
|
if [[ ! -z "$(7)" ]] && [ $$(( $${sum_sizes_expr} )) -gt $$(( $(7) )) ]; then \
|
||||||
|
echo "!!!! ERROR !!!! The sum of sizes of [$(strip $(3))] is larger than $(strip $(6)):"; \
|
||||||
|
echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' "$(7)" '==' $$(( $(7) )); \
|
||||||
|
echo "Super partition is" $$(( $$(( $$(( $${sum_sizes_expr} )) * 100)) / $$(( $(2) )) )) "percent occupied!"; \
|
||||||
|
exit 1; \
|
||||||
|
fi; \
|
||||||
if [[ ! -z "$(5)" ]] && [ $$(( $${sum_sizes_expr} )) -gt $$(( $(5) )) ]; then \
|
if [[ ! -z "$(5)" ]] && [ $$(( $${sum_sizes_expr} )) -gt $$(( $(5) )) ]; then \
|
||||||
echo "!!!! WARNING !!!! The sum of sizes of [$(strip $(3))] is larger than $(strip $(4)):"; \
|
echo "!!!! WARNING !!!! The sum of sizes of [$(strip $(3))] is larger than $(strip $(4)):"; \
|
||||||
echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' "$(5)" '==' $$(( $(5) )); \
|
echo $${sum_sizes_expr} '==' $$(( $${sum_sizes_expr} )) '>' "$(5)" '==' $$(( $(5) )); \
|
||||||
|
@ -3491,7 +3503,9 @@ define check-all-partition-sizes-target
|
||||||
$(call check-sum-of-partition-sizes,BOARD_SUPER_PARTITION_SIZE$(if $(call super-slot-suffix), / 2), \
|
$(call check-sum-of-partition-sizes,BOARD_SUPER_PARTITION_SIZE$(if $(call super-slot-suffix), / 2), \
|
||||||
$(BOARD_SUPER_PARTITION_SIZE)$(if $(call super-slot-suffix), / 2),$(BOARD_SUPER_PARTITION_PARTITION_LIST), \
|
$(BOARD_SUPER_PARTITION_SIZE)$(if $(call super-slot-suffix), / 2),$(BOARD_SUPER_PARTITION_PARTITION_LIST), \
|
||||||
BOARD_SUPER_PARTITION_WARN_LIMIT$(if $(call super-slot-suffix), / 2), \
|
BOARD_SUPER_PARTITION_WARN_LIMIT$(if $(call super-slot-suffix), / 2), \
|
||||||
$(BOARD_SUPER_PARTITION_WARN_LIMIT)$(if $(call super-slot-suffix), / 2)) \
|
$(BOARD_SUPER_PARTITION_WARN_LIMIT)$(if $(call super-slot-suffix), / 2), \
|
||||||
|
BOARD_SUPER_PARTITION_ERROR_LIMIT$(if $(call super-slot-suffix), / 2), \
|
||||||
|
$(BOARD_SUPER_PARTITION_ERROR_LIMIT)$(if $(call super-slot-suffix), / 2)) \
|
||||||
))
|
))
|
||||||
|
|
||||||
# For each group, check sum(partitions in group) <= group size
|
# For each group, check sum(partitions in group) <= group size
|
||||||
|
|
Loading…
Reference in New Issue