From 06533fef4ae77758ae94464040b8a1d49d53349c Mon Sep 17 00:00:00 2001 From: Bowgo Tsai Date: Mon, 2 Sep 2019 18:17:02 +0800 Subject: [PATCH] Moving GSI-specific properties to /system_ext We're now adding a core CSI system.img that is common across different targets. So GSI-specific things should be moved to /system_ext. Also renaming various generic*/system.prop to generic*/system_ext.prop. This is to put the customization into /system_ext/build.prop instead of /system/build.prop. Bug: 137711197 Test: boot a GSI on crosshatch, and checks the value of those properties Change-Id: Id344124280d5f4a6c10d390a9e8a4a50cc7f28fb --- core/Makefile | 18 +++++++++++++++++- target/board/BoardConfigGsiCommon.mk | 4 ++-- .../generic/{system.prop => system_ext.prop} | 0 .../{system.prop => system_ext.prop} | 0 .../{system.prop => system_ext.prop} | 0 .../{system.prop => system_ext.prop} | 0 .../{system.prop => system_ext.prop} | 0 .../{gsi_system.prop => gsi_system_ext.prop} | 0 ...stem_user.prop => gsi_system_ext_user.prop} | 0 9 files changed, 19 insertions(+), 3 deletions(-) rename target/board/generic/{system.prop => system_ext.prop} (100%) rename target/board/generic_arm64/{system.prop => system_ext.prop} (100%) rename target/board/generic_x86/{system.prop => system_ext.prop} (100%) rename target/board/generic_x86_64/{system.prop => system_ext.prop} (100%) rename target/board/generic_x86_arm/{system.prop => system_ext.prop} (100%) rename target/board/{gsi_system.prop => gsi_system_ext.prop} (100%) rename target/board/{gsi_system_user.prop => gsi_system_ext_user.prop} (100%) diff --git a/core/Makefile b/core/Makefile index c9b8cd11fb..6c90b51fcb 100644 --- a/core/Makefile +++ b/core/Makefile @@ -597,16 +597,32 @@ $(INSTALLED_ODM_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET := $(TARGET_OUT_SYSTEM_EXT)/build.prop ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET) +ifdef TARGET_SYSTEM_EXT_PROP +system_ext_prop_files := $(TARGET_SYSTEM_EXT_PROP) +else +system_ext_prop_files := $(wildcard $(TARGET_DEVICE_DIR)/system_ext.prop) +endif + FINAL_SYSTEM_EXT_PROPERTIES += \ $(call collapse-pairs, $(PRODUCT_SYSTEM_EXT_PROPERTIES)) FINAL_SYSTEM_EXT_PROPERTIES := $(call uniq-pairs-by-first-component, \ $(FINAL_SYSTEM_EXT_PROPERTIES),=) -$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) +$(INSTALLED_SYSTEM_EXT_BUILD_PROP_TARGET): $(BUILDINFO_COMMON_SH) $(POST_PROCESS_PROPS) $(system_ext_prop_files) @echo Target system_ext buildinfo: $@ @mkdir -p $(dir $@) $(hide) echo > $@ $(hide) $(call generate-common-build-props,system_ext,$@) + $(hide) $(foreach file,$(system_ext_prop_files), \ + if [ -f "$(file)" ]; then \ + echo Target system_ext properties from: "$(file)"; \ + echo "" >> $@; \ + echo "#" >> $@; \ + echo "# from $(file)" >> $@; \ + echo "#" >> $@; \ + cat $(file) >> $@; \ + echo "# end of $(file)" >> $@; \ + fi;) $(hide) echo "#" >> $@; \ echo "# ADDITIONAL SYSTEM_EXT BUILD PROPERTIES" >> $@; \ echo "#" >> $@; diff --git a/target/board/BoardConfigGsiCommon.mk b/target/board/BoardConfigGsiCommon.mk index 31d0bdf215..4c783c0f3a 100644 --- a/target/board/BoardConfigGsiCommon.mk +++ b/target/board/BoardConfigGsiCommon.mk @@ -41,9 +41,9 @@ BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 1 # GSI specific System Properties ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) -TARGET_SYSTEM_PROP := build/make/target/board/gsi_system.prop +TARGET_SYSTEM_EXT_PROP := build/make/target/board/gsi_system_ext.prop else -TARGET_SYSTEM_PROP := build/make/target/board/gsi_system_user.prop +TARGET_SYSTEM_EXT_PROP := build/make/target/board/gsi_system_ext_user.prop endif # Set this to create /cache mount point for non-A/B devices that mounts /cache. diff --git a/target/board/generic/system.prop b/target/board/generic/system_ext.prop similarity index 100% rename from target/board/generic/system.prop rename to target/board/generic/system_ext.prop diff --git a/target/board/generic_arm64/system.prop b/target/board/generic_arm64/system_ext.prop similarity index 100% rename from target/board/generic_arm64/system.prop rename to target/board/generic_arm64/system_ext.prop diff --git a/target/board/generic_x86/system.prop b/target/board/generic_x86/system_ext.prop similarity index 100% rename from target/board/generic_x86/system.prop rename to target/board/generic_x86/system_ext.prop diff --git a/target/board/generic_x86_64/system.prop b/target/board/generic_x86_64/system_ext.prop similarity index 100% rename from target/board/generic_x86_64/system.prop rename to target/board/generic_x86_64/system_ext.prop diff --git a/target/board/generic_x86_arm/system.prop b/target/board/generic_x86_arm/system_ext.prop similarity index 100% rename from target/board/generic_x86_arm/system.prop rename to target/board/generic_x86_arm/system_ext.prop diff --git a/target/board/gsi_system.prop b/target/board/gsi_system_ext.prop similarity index 100% rename from target/board/gsi_system.prop rename to target/board/gsi_system_ext.prop diff --git a/target/board/gsi_system_user.prop b/target/board/gsi_system_ext_user.prop similarity index 100% rename from target/board/gsi_system_user.prop rename to target/board/gsi_system_ext_user.prop