From b894d4bb6840457da78f562bb4128ba2a4d5018f Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 11 May 2020 15:53:57 +0900 Subject: [PATCH 1/2] Remove /vendor/default.prop Contents that were in /vendor/default.prop are now in /vendor/build.prop The content is placed at the top of build.prop to keep the existing order between default.prop and builld.prop. Bug: 117892318 Test: TH passes Test: inspect /vendor/build.prop and check if it has contents from the old /vendor/default.prop file Change-Id: Ifa1f1dca3b4f4a5fa87d26b8ee058ee706dc54bb --- CleanSpec.mk | 2 ++ core/Makefile | 29 ++++++----------------------- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index 97dc31f71..15fb58dae 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -722,6 +722,8 @@ $(call add-clean-step, rm -rf $(HOST_OUT)/framework/vts10-tradefed.jar) $(call add-clean-step, rm -rf $(HOST_OUT)/vts/*) $(call add-clean-step, rm -rf $(HOST_OUT)/framework/vts-tradefed.jar) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/default.prop) + # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ diff --git a/core/Makefile b/core/Makefile index d8f8a5ec4..0d4d3b747 100644 --- a/core/Makefile +++ b/core/Makefile @@ -169,9 +169,9 @@ ifeq ($(BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED), true) endif # ----------------------------------------------------------------- -# FINAL_VENDOR_DEFAULT_PROPERTIES will be installed in vendor/default.prop if +# FINAL_VENDOR_DEFAULT_PROPERTIES will be installed in vendor/build.prop if # property_overrides_split_enabled is true. Otherwise it will be installed in -# ROOT/default.prop. +# /system/etc/prop.default (which is a symlink from /default.prop) ifdef BOARD_VNDK_VERSION ifeq ($(BOARD_VNDK_VERSION),current) FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(PLATFORM_VNDK_VERSION) @@ -294,25 +294,6 @@ ifdef property_overrides_split_enabled $(hide) ln -sf system/etc/prop.default $(INSTALLED_DEFAULT_PROP_OLD_TARGET) endif -# ----------------------------------------------------------------- -# vendor default.prop -INSTALLED_VENDOR_DEFAULT_PROP_TARGET := -ifdef property_overrides_split_enabled -INSTALLED_VENDOR_DEFAULT_PROP_TARGET := $(TARGET_OUT_VENDOR)/default.prop -ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) - -$(INSTALLED_VENDOR_DEFAULT_PROP_TARGET): $(INSTALLED_DEFAULT_PROP_TARGET) $(POST_PROCESS_PROPS) - @echo Target buildinfo: $@ - @mkdir -p $(dir $@) - $(hide) echo "#" > $@; \ - echo "# ADDITIONAL VENDOR DEFAULT PROPERTIES" >> $@; \ - echo "#" >> $@; - $(hide) $(foreach line,$(FINAL_VENDOR_DEFAULT_PROPERTIES), \ - echo "$(line)" >> $@;) - $(hide) $(POST_PROCESS_PROPS) $@ - -endif # property_overrides_split_enabled - # ----------------------------------------------------------------- # build.prop INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop @@ -529,6 +510,10 @@ $(INSTALLED_VENDOR_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PRO @echo Target vendor buildinfo: $@ @mkdir -p $(dir $@) $(hide) rm -f $@ && touch $@ +ifdef property_overrides_split_enabled + $(hide) $(foreach line,$(FINAL_VENDOR_DEFAULT_PROPERTIES), \ + echo "$(line)" >> $@;) +endif ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true) $(hide) echo ro.boot.dynamic_partitions=true >> $@ endif @@ -2114,7 +2099,6 @@ endef $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \ $(INSTALLED_DEFAULT_PROP_TARGET) \ - $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) \ $(intermediate_system_build_prop) \ $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \ $(INSTALLED_ODM_BUILD_PROP_TARGET) \ @@ -2124,7 +2108,6 @@ $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \ $(hide) mkdir -p $(dir $@) $(hide) rm -f $@ $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) > $@ - $(hide) cat $(INSTALLED_VENDOR_DEFAULT_PROP_TARGET) >> $@ $(hide) cat $(intermediate_system_build_prop) >> $@ $(hide) cat $(INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@ $(hide) cat $(INSTALLED_ODM_BUILD_PROP_TARGET) >> $@ From 09153e244e8e1681b5083c102dec47934c19583d Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 11 May 2020 16:37:06 +0900 Subject: [PATCH 2/2] Remove /system/etc/prop.default Contents that were in /system/etc/prop.default are now in /system/build.prop. The content is placed at the top of build.prop to keep the existing order between the two files. Caveat: /prop.default still remains for non-Treble devices. Bug: 117892318 Test: TH passes Test: inspect /system/build.prop and check if it has contents from the old /system/etc/prop.default file Change-Id: Ibc74edb88904f953a1e5e6ceef44c461f381c9cf --- CleanSpec.mk | 1 + core/Makefile | 57 +++++++++++++++++++++++---------------------------- 2 files changed, 27 insertions(+), 31 deletions(-) diff --git a/CleanSpec.mk b/CleanSpec.mk index 15fb58dae..6352e38c9 100644 --- a/CleanSpec.mk +++ b/CleanSpec.mk @@ -723,6 +723,7 @@ $(call add-clean-step, rm -rf $(HOST_OUT)/vts/*) $(call add-clean-step, rm -rf $(HOST_OUT)/framework/vts-tradefed.jar) $(call add-clean-step, rm -rf $(PRODUCT_OUT)/vendor/default.prop) +$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/prop.default) # ************************************************ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST diff --git a/core/Makefile b/core/Makefile index 0d4d3b747..e363418ae 100644 --- a/core/Makefile +++ b/core/Makefile @@ -171,7 +171,7 @@ endif # ----------------------------------------------------------------- # FINAL_VENDOR_DEFAULT_PROPERTIES will be installed in vendor/build.prop if # property_overrides_split_enabled is true. Otherwise it will be installed in -# /system/etc/prop.default (which is a symlink from /default.prop) +# /default.prop ifdef BOARD_VNDK_VERSION ifeq ($(BOARD_VNDK_VERSION),current) FINAL_VENDOR_DEFAULT_PROPERTIES := ro.vndk.version=$(PLATFORM_VNDK_VERSION) @@ -224,9 +224,6 @@ endif FINAL_VENDOR_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ $(FINAL_VENDOR_DEFAULT_PROPERTIES),=) -# ----------------------------------------------------------------- -# prop.default - BUILDINFO_SH := build/make/tools/buildinfo.sh BUILDINFO_COMMON_SH := build/make/tools/buildinfo_common.sh POST_PROCESS_PROPS :=$= build/make/tools/post_process_props.py @@ -257,47 +254,39 @@ define generate-common-build-props-with-product-vars-set bash $(BUILDINFO_COMMON_SH) "$(1)" >> $(2) endef -ifdef property_overrides_split_enabled -INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_OUT)/etc/prop.default -INSTALLED_DEFAULT_PROP_OLD_TARGET := $(TARGET_ROOT_OUT)/default.prop -ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_OLD_TARGET) -$(INSTALLED_DEFAULT_PROP_TARGET): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_DEFAULT_PROP_OLD_TARGET) -else -# legacy path -INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop -endif -ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET) -FINAL_DEFAULT_PROPERTIES := \ - $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) \ - $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) +# Legacy (non-Treble) path ifndef property_overrides_split_enabled - FINAL_DEFAULT_PROPERTIES += \ - $(call collapse-pairs, $(FINAL_VENDOR_DEFAULT_PROPERTIES)) -endif -FINAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ - $(FINAL_DEFAULT_PROPERTIES),=) +INSTALLED_LEGACY_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop +ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_LEGACY_DEFAULT_PROP_TARGET) -intermediate_system_build_prop := $(call intermediates-dir-for,ETC,system_build_prop)/build.prop - -$(INSTALLED_DEFAULT_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(intermediate_system_build_prop) +$(INSTALLED_LEGACY_DEFAULT_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) @echo Target buildinfo: $@ @mkdir -p $(dir $@) @rm -f $@ $(hide) echo "#" > $@; \ echo "# ADDITIONAL_DEFAULT_PROPERTIES" >> $@; \ echo "#" >> $@; - $(hide) $(foreach line,$(FINAL_DEFAULT_PROPERTIES), \ + $(hide) $(foreach line,$(call uniq-pairs-by-first-component, \ + $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) \ + $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) \ + $(call collapse-pairs, $(FINAL_VENDOR_DEFAULT_PROPERTIES)),=), \ echo "$(line)" >> $@;) $(hide) $(POST_PROCESS_PROPS) $@ -ifdef property_overrides_split_enabled - $(hide) mkdir -p $(TARGET_ROOT_OUT) - $(hide) ln -sf system/etc/prop.default $(INSTALLED_DEFAULT_PROP_OLD_TARGET) endif # ----------------------------------------------------------------- # build.prop +intermediate_system_build_prop := $(call intermediates-dir-for,ETC,system_build_prop)/build.prop INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET) +# TODO(b/117892318) merge DEFAULT into BUILD +ifdef property_overrides_split_enabled +FINAL_DEFAULT_PROPERTIES := \ + $(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES)) \ + $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) +FINAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \ + $(FINAL_DEFAULT_PROPERTIES),=) +endif FINAL_BUILD_PROPERTIES := \ $(call collapse-pairs, $(ADDITIONAL_BUILD_PROPERTIES)) FINAL_BUILD_PROPERTIES := $(call uniq-pairs-by-first-component, \ @@ -411,6 +400,10 @@ $(intermediate_system_build_prop): $(BUILDINFO_SH) $(BUILDINFO_COMMON_SH) $(INTE @echo Target buildinfo: $@ @mkdir -p $(dir $@) $(hide) rm -f $@ && touch $@ +ifdef property_overrides_split_enabled + $(hide) $(foreach line,$(FINAL_DEFAULT_PROPERTIES), \ + echo "$(line)" >> $@;) +endif ifneq ($(PRODUCT_OEM_PROPERTIES),) $(hide) echo "#" >> $@; \ echo "# PRODUCT_OEM_PROPERTIES" >> $@; \ @@ -2098,7 +2091,7 @@ $(foreach prop,$(1), \ endef $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \ - $(INSTALLED_DEFAULT_PROP_TARGET) \ + $(INSTALLED_LEGACY_DEFAULT_PROP_TARGET) \ $(intermediate_system_build_prop) \ $(INSTALLED_VENDOR_BUILD_PROP_TARGET) \ $(INSTALLED_ODM_BUILD_PROP_TARGET) \ @@ -2107,7 +2100,9 @@ $(INSTALLED_RECOVERY_BUILD_PROP_TARGET): \ @echo "Target recovery buildinfo: $@" $(hide) mkdir -p $(dir $@) $(hide) rm -f $@ - $(hide) cat $(INSTALLED_DEFAULT_PROP_TARGET) > $@ +ifneq (,$(INSTALLED_LEGACY_DEFAULT_PROP_TARGET)) + $(hide) cat $(INSTALLED_LEGACY_DEFAULT_PROP_TARGET) > $@ +endif $(hide) cat $(intermediate_system_build_prop) >> $@ $(hide) cat $(INSTALLED_VENDOR_BUILD_PROP_TARGET) >> $@ $(hide) cat $(INSTALLED_ODM_BUILD_PROP_TARGET) >> $@