aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYifan Hong <elsk@google.com>2018-11-29 04:41:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-11-29 04:41:16 +0000
commit2a0d148f26c464d3a715b4242b179c16d4533df9 (patch)
tree34f1d2fda4c1091632270056d7728f52c19250c0
parent7328e08efec6ef1a18a3d69d0d01c802bd078b23 (diff)
parente5d879a19319ef89f4eac6629bf9e0864dd3cfe1 (diff)
downloadbuild-2a0d148f26c464d3a715b4242b179c16d4533df9.tar.gz
Merge "Allow space in BOARD_*_SIZE variables for dynamic partitions"
-rw-r--r--core/config.mk4
-rw-r--r--core/main.mk4
-rw-r--r--core/product.mk12
3 files changed, 17 insertions, 3 deletions
diff --git a/core/config.mk b/core/config.mk
index 77f5e6b8b9..6b67e1a464 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -1006,6 +1006,7 @@ ifeq ($(PRODUCT_BUILD_SUPER_PARTITION),true)
# - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that belongs to this group.
# If empty, no partitions belong to this group, and the sum of sizes is effectively 0.
$(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \
+ $(eval BOARD_$(group)_SIZE := $(strip $(BOARD_$(group)_SIZE))) \
$(if $(BOARD_$(group)_SIZE),,$(error BOARD_$(group)_SIZE must not be empty)) \
$(eval .KATI_READONLY := BOARD_$(group)_SIZE) \
$(eval BOARD_$(group)_PARTITION_LIST ?=) \
@@ -1032,7 +1033,7 @@ BOARD_SUPER_PARTITION_PARTITION_LIST := \
$(BOARD_$(group)_PARTITION_LIST))
.KATI_READONLY := BOARD_SUPER_PARTITION_PARTITION_LIST
-ifdef BOARD_SUPER_PARTITION_SIZE
+ifneq ($(BOARD_SUPER_PARTITION_SIZE),)
ifeq ($(PRODUCT_RETROFIT_DYNAMIC_PARTITIONS),true)
# The metadata device must be specified manually for retrofitting.
@@ -1075,6 +1076,7 @@ endif # BOARD_SUPER_PARTITION_SIZE
.KATI_READONLY := BOARD_SUPER_PARTITION_METADATA_DEVICE
$(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \
+ $(eval BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE := $(strip $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))) \
$(if $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE),, \
$(error $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty))) \
$(eval .KATI_READONLY := BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))
diff --git a/core/main.mk b/core/main.mk
index add8fd98ed..9fd1c35c52 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -410,7 +410,9 @@ endif
# Typical build; include any Android.mk files we can find.
#
-
+# Before we go and include all of the module makefiles, strip values for easier
+# processing.
+$(call strip-product-vars)
# Before we go and include all of the module makefiles, mark the PRODUCT_*
# and ADDITIONAL*PROPERTIES values readonly so that they won't be modified.
$(call readonly-product-vars)
diff --git a/core/product.mk b/core/product.mk
index fbdd23754a..8497b28301 100644
--- a/core/product.mk
+++ b/core/product.mk
@@ -404,7 +404,7 @@ _product_stash_var_list += \
WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY
# Logical partitions related variables.
-_product_stash_var_list += \
+_dynamic_partitions_var_list += \
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE \
BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE \
BOARD_ODMIMAGE_PARTITION_RESERVED_SIZE \
@@ -413,6 +413,9 @@ _product_stash_var_list += \
BOARD_SUPER_PARTITION_SIZE \
BOARD_SUPER_PARTITION_GROUPS \
+_product_stash_var_list += $(_dynamic_partitions_var_list)
+_product_strip_var_list := $(_dynamic_partitions_var_list)
+
#
# Mark the variables in _product_stash_var_list as readonly
#
@@ -423,6 +426,13 @@ $(foreach v,$(_product_stash_var_list), \
)
endef
+#
+# Strip the variables in _product_strip_var_list
+#
+define strip-product-vars
+$(foreach v,$(_product_strip_var_list),$(eval $(v) := $(strip $($(v)))))
+endef
+
define add-to-product-copy-files-if-exists
$(if $(wildcard $(word 1,$(subst :, ,$(1)))),$(1))
endef