Merge "Fix the order of loading OEM properties"

This commit is contained in:
Treehugger Robot
2020-11-16 09:25:18 +00:00
committed by Gerrit Code Review

View File

@@ -68,7 +68,9 @@ endef
# emitted to the output # emitted to the output
# $(4): list of variable names each of which contains name=value pairs # $(4): list of variable names each of which contains name=value pairs
# $(5): optional list of prop names to force remove from the output. Properties from both # $(5): optional list of prop names to force remove from the output. Properties from both
# $(3) and (4) are affected. # $(3) and (4) are affected
# $(6): optional list of files to append at the end. The content of each file is emitted
# to the output
define build-properties define build-properties
ALL_DEFAULT_INSTALLED_MODULES += $(2) ALL_DEFAULT_INSTALLED_MODULES += $(2)
@@ -90,7 +92,7 @@ $(if $(filter true,$(BUILD_BROKEN_DUP_SYSPROP)),\
$(eval _option := --allow-dup)\ $(eval _option := --allow-dup)\
) )
$(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3) $(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3) $(6)
$(hide) echo Building $$@ $(hide) echo Building $$@
$(hide) mkdir -p $$(dir $$@) $(hide) mkdir -p $$(dir $$@)
$(hide) rm -f $$@ && touch $$@ $(hide) rm -f $$@ && touch $$@
@@ -113,6 +115,10 @@ $(2): $(POST_PROCESS_PROPS) $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) $(3
)\ )\
) )
$(hide) $(POST_PROCESS_PROPS) $$(_option) $$@ $(5) $(hide) $(POST_PROCESS_PROPS) $$(_option) $$@ $(5)
$(hide) $(foreach file,$(strip $(6)),\
if [ -f "$(file)" ]; then\
cat $(file) >> $$@;\
fi;)
$(hide) echo "# end of file" >> $$@ $(hide) echo "# end of file" >> $$@
endef endef
@@ -265,19 +271,6 @@ $(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT)
TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \ TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \
bash $(BUILDINFO_SH) > $@ bash $(BUILDINFO_SH) > $@
ifneq ($(PRODUCT_OEM_PROPERTIES),)
import_oem_prop := $(call intermediates-dir-for,ETC,system_build_prop)/oem.prop
$(import_oem_prop):
$(hide) echo "#" >> $@; \
echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
echo "#" >> $@;
$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
echo "import /oem/oem.prop $(prop)" >> $@;)
else
import_oem_prop :=
endif
ifdef TARGET_SYSTEM_PROP ifdef TARGET_SYSTEM_PROP
system_prop_file := $(TARGET_SYSTEM_PROP) system_prop_file := $(TARGET_SYSTEM_PROP)
else else
@@ -285,7 +278,6 @@ system_prop_file := $(wildcard $(TARGET_DEVICE_DIR)/system.prop)
endif endif
_prop_files_ := \ _prop_files_ := \
$(import_oem_prop) \
$(gen_from_buildinfo_sh) \ $(gen_from_buildinfo_sh) \
$(system_prop_file) $(system_prop_file)
@@ -311,9 +303,13 @@ _blacklist_names_ := \
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
$(eval $(call build-properties,system,$(INSTALLED_BUILD_PROP_TARGET),\ $(eval $(call build-properties,\
$(_prop_files_),$(_prop_vars_),\ system,\
$(_blacklist_names_))) $(INSTALLED_BUILD_PROP_TARGET),\
$(_prop_files_),\
$(_prop_vars_),\
$(_blacklist_names_),\
$(empty)))
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# vendor/build.prop # vendor/build.prop
@@ -349,7 +345,8 @@ $(eval $(call build-properties,\
$(INSTALLED_VENDOR_BUILD_PROP_TARGET),\ $(INSTALLED_VENDOR_BUILD_PROP_TARGET),\
$(_prop_files_),\ $(_prop_files_),\
$(_prop_vars_),\ $(_prop_vars_),\
$(PRODUCT_VENDOR_PROPERTY_BLACKLIST))) $(PRODUCT_VENDOR_PROPERTY_BLACKLIST),\
$(empty)))
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# product/etc/build.prop # product/etc/build.prop
@@ -366,12 +363,29 @@ _prop_vars_ := \
PRODUCT_PRODUCT_PROPERTIES PRODUCT_PRODUCT_PROPERTIES
INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop INSTALLED_PRODUCT_BUILD_PROP_TARGET := $(TARGET_OUT_PRODUCT)/etc/build.prop
ifdef PRODUCT_OEM_PROPERTIES
import_oem_prop := $(call intermediates-dir-for,ETC,import_oem_prop)/oem.prop
$(import_oem_prop):
$(hide) echo "####################################" >> $@; \
echo "# PRODUCT_OEM_PROPERTIES" >> $@; \
echo "####################################" >> $@;
$(hide) $(foreach prop,$(PRODUCT_OEM_PROPERTIES), \
echo "import /oem/oem.prop $(prop)" >> $@;)
_footers_ := $(import_oem_prop)
else
_footers_ :=
endif
$(eval $(call build-properties,\ $(eval $(call build-properties,\
product,\ product,\
$(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\ $(INSTALLED_PRODUCT_BUILD_PROP_TARGET),\
$(_prop_files_),\ $(_prop_files_),\
$(_prop_vars_),\ $(_prop_vars_),\
$(empty))) $(empty),\
$(_footers_)))
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# odm/etc/build.prop # odm/etc/build.prop
@@ -392,6 +406,7 @@ $(eval $(call build-properties,\
$(INSTALLED_ODM_BUILD_PROP_TARGET),\ $(INSTALLED_ODM_BUILD_PROP_TARGET),\
$(_prop_files),\ $(_prop_files),\
$(_prop_vars_),\ $(_prop_vars_),\
$(empty),\
$(empty))) $(empty)))
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@@ -401,7 +416,11 @@ $(eval $(call build-properties,\
INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_VENDOR_DLKM)/etc/build.prop
$(eval $(call build-properties,\ $(eval $(call build-properties,\
vendor_dlkm,\ vendor_dlkm,\
$(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET))) $(INSTALLED_VENDOR_DLKM_BUILD_PROP_TARGET),\
$(empty),\
$(empty),\
$(empty),\
$(empty)))
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# odm_dlkm/etc/build.prop # odm_dlkm/etc/build.prop
@@ -410,7 +429,11 @@ $(eval $(call build-properties,\
INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop INSTALLED_ODM_DLKM_BUILD_PROP_TARGET := $(TARGET_OUT_ODM_DLKM)/etc/build.prop
$(eval $(call build-properties,\ $(eval $(call build-properties,\
odm_dlkm,\ odm_dlkm,\
$(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET))) $(INSTALLED_ODM_DLKM_BUILD_PROP_TARGET),\
$(empty),\
$(empty),\
$(empty),\
$(empty)))
# ----------------------------------------------------------------- # -----------------------------------------------------------------
# system_ext/etc/build.prop # system_ext/etc/build.prop
@@ -429,6 +452,7 @@ $(eval $(call build-properties,\
$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\ $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET),\
$(_prop_files_),\ $(_prop_files_),\
$(_prop_vars_),\ $(_prop_vars_),\
$(empty),\
$(empty))) $(empty)))
# ---------------------------------------------------------------- # ----------------------------------------------------------------
@@ -439,4 +463,8 @@ RAMDISK_BUILD_PROP_REL_PATH := system/etc/ramdisk/build.prop
INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH) INSTALLED_RAMDISK_BUILD_PROP_TARGET := $(TARGET_RAMDISK_OUT)/$(RAMDISK_BUILD_PROP_REL_PATH)
$(eval $(call build-properties,\ $(eval $(call build-properties,\
bootimage,\ bootimage,\
$(INSTALLED_RAMDISK_BUILD_PROP_TARGET))) $(INSTALLED_RAMDISK_BUILD_PROP_TARGET),\
$(empty),\
$(empty),\
$(empty),\
$(empty)))