From 285083e47555ca1042502e8e15da806bea39ecf3 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 27 Jul 2018 13:28:47 -0700 Subject: [PATCH 1/2] Fix collapse-pairs for last empty property If the last token in the argument for collapse-pairs is key=, then the following lines were written: key = This patch fixes it so that key= is written instead. Test: specify ro.boot.logical_partitions= at the end of ADDITIONAL_PRODUCT_PROPERTIES and `cat $OUT/product/build.prop` shows: ro.boot.logical_partitions= Change-Id: I33a0efb59871f0e36a93c8fae0d75f2735994301 --- core/definitions.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/definitions.mk b/core/definitions.mk index 155020618..351259817 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -796,8 +796,8 @@ endef define collapse-pairs $(eval _cpSEP := $(strip $(if $(2),$(2),=)))\ -$(subst $(space)$(_cpSEP)$(space),$(_cpSEP),$(strip \ - $(subst $(_cpSEP), $(_cpSEP) ,$(1)))) +$(strip $(subst $(space)$(_cpSEP)$(space),$(_cpSEP),$(strip \ + $(subst $(_cpSEP), $(_cpSEP) ,$(1)))$(space))) endef ########################################################### From af9e7f04c328504f0e4c7ac5ec0cf365894621b6 Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 27 Jul 2018 13:11:50 -0700 Subject: [PATCH 2/2] ro.boot.logical_partitions moved to product image Test: m productimage -j && cat $OUT/product/build.prop Bug: 111909365 Change-Id: I62abd5602f6b2fe7eead9d636ffb7708df23fd02 --- core/Makefile | 2 +- core/main.mk | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/core/Makefile b/core/Makefile index 9c26b8ba5..5f13ec827 100644 --- a/core/Makefile +++ b/core/Makefile @@ -443,7 +443,7 @@ INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/build.prop ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_PRODUCT_BUILD_PROP_TARGET) FINAL_PRODUCT_PROPERTIES += \ - $(call collapse-pairs, $(PRODUCT_PRODUCT_PROPERTIES)) + $(call collapse-pairs, $(PRODUCT_PRODUCT_PROPERTIES) $(ADDITIONAL_PRODUCT_PROPERTIES)) FINAL_PRODUCT_PROPERTIES := $(call uniq-pairs-by-first-component, \ $(FINAL_PRODUCT_PROPERTIES),=) diff --git a/core/main.mk b/core/main.mk index a991d8858..d902bf7ef 100644 --- a/core/main.mk +++ b/core/main.mk @@ -144,6 +144,15 @@ endif ADDITIONAL_BUILD_PROPERTIES := +# +# ----------------------------------------------------------------- +# Validate ADDITIONAL_PRODUCT_PROPERTIES. +ifneq ($(ADDITIONAL_PRODUCT_PROPERTIES),) +$(error ADDITIONAL_PRODUCT_PROPERTIES must not be set before here: $(ADDITIONAL_PRODUCT_PROPERTIES)) +endif + +ADDITIONAL_PRODUCT_PROPERTIES := + # # ----------------------------------------------------------------- # Add the product-defined properties to the build properties. @@ -231,7 +240,7 @@ else ADDITIONAL_DEFAULT_PROPERTIES += ro.actionable_compatible_property.enabled=${PRODUCT_COMPATIBLE_PROPERTY} endif -ADDITIONAL_BUILD_PROPERTIES += ro.boot.logical_partitions=${USE_LOGICAL_PARTITIONS} +ADDITIONAL_PRODUCT_PROPERTIES += ro.boot.logical_partitions=${USE_LOGICAL_PARTITIONS} # ----------------------------------------------------------------- ### @@ -402,6 +411,8 @@ ADDITIONAL_DEFAULT_PROPERTIES := $(strip $(ADDITIONAL_DEFAULT_PROPERTIES)) .KATI_READONLY := ADDITIONAL_DEFAULT_PROPERTIES ADDITIONAL_BUILD_PROPERTIES := $(strip $(ADDITIONAL_BUILD_PROPERTIES)) .KATI_READONLY := ADDITIONAL_BUILD_PROPERTIES +ADDITIONAL_PRODUCT_PROPERTIES := $(strip $(ADDITIONAL_PRODUCT_PROPERTIES)) +.KATI_READONLY := ADDITIONAL_PRODUCT_PROPERTIES ifneq ($(PRODUCT_ENFORCE_RRO_TARGETS),) ENFORCE_RRO_SOURCES :=