From b31b9bad6697cf81647703332ebd844c743fd241 Mon Sep 17 00:00:00 2001 From: Jaekyun Seok Date: Fri, 3 Nov 2017 15:18:55 +0900 Subject: [PATCH 1/2] Add PRODUCT_SYSTEM_DEFAULT_PROPERTIES PRODUCT_SYSTEM_DEFAULT_PROPERTIES will be used to define system default properties which should be installed in system partition. Bug: 64661857 Test: confirmed that ART default properties are stored in /system/etc/prop.default when they were defined in PRODUCT_SYSTEM_DEFAULT_PROPERTIES. Change-Id: Ia08c25d0c5805381c6e3fe63dd1d171e8d195b90 --- core/Makefile | 3 ++- core/product-graph.mk | 1 + core/product.mk | 1 + core/product_config.mk | 7 +++++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index 7fed9685a..4cbf8a94f 100644 --- a/core/Makefile +++ b/core/Makefile @@ -110,7 +110,8 @@ 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, $(ADDITIONAL_DEFAULT_PROPERTIES)) \ + $(call collapse-pairs, $(PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) ifndef property_overrides_split_enabled FINAL_DEFAULT_PROPERTIES += \ $(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) diff --git a/core/product-graph.mk b/core/product-graph.mk index 633ac37ac..268688a2d 100644 --- a/core/product-graph.mk +++ b/core/product-graph.mk @@ -103,6 +103,7 @@ $(OUT_DIR)/products/$(strip $(1)).txt: $(this_makefile) $(hide) echo 'PRODUCT_MANUFACTURER=$$(PRODUCTS.$(strip $(1)).PRODUCT_MANUFACTURER)' >> $$@ $(hide) echo 'PRODUCT_PROPERTY_OVERRIDES=$$(PRODUCTS.$(strip $(1)).PRODUCT_PROPERTY_OVERRIDES)' >> $$@ $(hide) echo 'PRODUCT_DEFAULT_PROPERTY_OVERRIDES=$$(PRODUCTS.$(strip $(1)).PRODUCT_DEFAULT_PROPERTY_OVERRIDES)' >> $$@ + $(hide) echo 'PRODUCT_SYSTEM_DEFAULT_PROPERTIES=$$(PRODUCTS.$(strip $(1)).PRODUCT_SYSTEM_DEFAULT_PROPERTIES)' >> $$@ $(hide) echo 'PRODUCT_CHARACTERISTICS=$$(PRODUCTS.$(strip $(1)).PRODUCT_CHARACTERISTICS)' >> $$@ $(hide) echo 'PRODUCT_COPY_FILES=$$(PRODUCTS.$(strip $(1)).PRODUCT_COPY_FILES)' >> $$@ $(hide) echo 'PRODUCT_OTA_PUBLIC_KEYS=$$(PRODUCTS.$(strip $(1)).PRODUCT_OTA_PUBLIC_KEYS)' >> $$@ diff --git a/core/product.mk b/core/product.mk index 1819293cc..1541cff94 100644 --- a/core/product.mk +++ b/core/product.mk @@ -112,6 +112,7 @@ _product_var_list := \ PRODUCT_SUPPORTS_VERITY \ PRODUCT_SUPPORTS_VERITY_FEC \ PRODUCT_OEM_PROPERTIES \ + PRODUCT_SYSTEM_DEFAULT_PROPERTIES \ PRODUCT_SYSTEM_PROPERTY_BLACKLIST \ PRODUCT_SYSTEM_SERVER_APPS \ PRODUCT_SYSTEM_SERVER_JARS \ diff --git a/core/product_config.mk b/core/product_config.mk index 777c29dbe..ff56c0ebe 100644 --- a/core/product_config.mk +++ b/core/product_config.mk @@ -358,6 +358,13 @@ PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEFAULT_PROPERTY_OVERRIDES)) .KATI_READONLY := PRODUCT_DEFAULT_PROPERTY_OVERRIDES +# A list of property assignments, like "key = value", with zero or more +# whitespace characters on either side of the '='. +# used for adding properties to default.prop of system partition +PRODUCT_SYSTEM_DEFAULT_PROPERTIES := \ + $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_SYSTEM_DEFAULT_PROPERTIES)) +.KATI_READONLY := PRODUCT_SYSTEM_DEFAULT_PROPERTIES + # Should we use the default resources or add any product specific overlays PRODUCT_PACKAGE_OVERLAYS := \ $(strip $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_PACKAGE_OVERLAYS)) From 5fb6a3eb9f20be7b7c263bb931ed1a40c333a501 Mon Sep 17 00:00:00 2001 From: Jaekyun Seok Date: Fri, 3 Nov 2017 15:33:10 +0900 Subject: [PATCH 2/2] Move ART default properties into system partition Bug: 64661857 Bug: 68755013 Test: confirmed that ART default properties were stored in /system/etc/prop.default on sailfish device Change-Id: Ie07d3049de5ac395cfb9105e208fe7825080fa15 --- core/dex_preopt_libart.mk | 4 +++- target/product/runtime_libart.mk | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk index de34d888e..79e72c15f 100644 --- a/core/dex_preopt_libart.mk +++ b/core/dex_preopt_libart.mk @@ -26,7 +26,9 @@ DIRTY_IMAGE_OBJECTS := $(call word-colon,1,$(firstword \ $(filter %system/etc/dirty-image-objects,$(PRODUCT_COPY_FILES)))) define get-product-default-property -$(strip $(patsubst $(1)=%,%,$(filter $(1)=%,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES)))) +$(strip \ + $(eval _prop := $(patsubst $(1)=%,%,$(filter $(1)=%,$(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))))\ + $(if $(_prop),$(_prop),$(patsubst $(1)=%,%,$(filter $(1)=%,$(PRODUCT_SYSTEM_DEFAULT_PROPERTIES))))) endef DEX2OAT_IMAGE_XMS := $(call get-product-default-property,dalvik.vm.image-dex2oat-Xms) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 829601caa..b9703039d 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -56,7 +56,7 @@ PRODUCT_PACKAGES += art-tools PRODUCT_PACKAGES += \ cacerts \ -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ dalvik.vm.image-dex2oat-Xms=64m \ dalvik.vm.image-dex2oat-Xmx=64m \ dalvik.vm.dex2oat-Xms=64m \ @@ -72,16 +72,16 @@ PRODUCT_PROPERTY_OVERRIDES += \ # Different dexopt types for different package update/install times. # On eng builds, make "boot" reasons only extract for faster turnaround. ifeq (eng,$(TARGET_BUILD_VARIANT)) - PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ + PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ pm.dexopt.first-boot=extract \ pm.dexopt.boot=extract else - PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ + PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ pm.dexopt.first-boot=quicken \ pm.dexopt.boot=verify endif -PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ pm.dexopt.install=quicken \ pm.dexopt.bg-dexopt=speed-profile \ pm.dexopt.ab-ota=speed-profile \