From 5a564d837cdf3228c016b68471fbd5e004e7c1db Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 8 Apr 2022 15:20:23 -0700 Subject: [PATCH] Add support for only starting 64 bit zygote. Added code to support a single system image that can start the 64 bit zygote only, or both the 64 bit and 32 bit zygote. By default, the system will default to 64 bit only. For this image, all abilist properties are only present in the vendor partition. All other copies of these properties are deleted. Bug: 227482437 Test: Verified that secondary doesn't start with same disk image Test: with ro.zygote set to zygote64 and abilists set appropriately. Test: Verified that secondary does not start when restarting netd. Test: with ro.zygote set to zygote64_32 and abilists set appropriately. Test: Verified that secondary does start when restarting netd. Test: Verified that a 64 bit device only starts the primary. Test: Verified that a 32 bit device only starts the primary. Change-Id: Ifc6413cecc4df8ba041699f7d0b10786d1926d64 Merged-In: Ifc6413cecc4df8ba041699f7d0b10786d1926d64 --- core/sysprop.mk | 17 +++++++++++++---- target/product/core_64_bit.mk | 4 ++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/core/sysprop.mk b/core/sysprop.mk index 61c07ba603..570702a679 100644 --- a/core/sysprop.mk +++ b/core/sysprop.mk @@ -47,10 +47,18 @@ define generate-common-build-props echo "ro.product.$(1).model=$(PRODUCT_MODEL)" >> $(2);\ echo "ro.product.$(1).name=$(TARGET_PRODUCT)" >> $(2);\ )\ - $(if $(filter system vendor odm,$(1)),\ - echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST) " >> $(2);\ - echo "ro.$(1).product.cpu.abilist32=$(TARGET_CPU_ABI_LIST_32_BIT)" >> $(2);\ - echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\ + $(if $(filter true,$(ZYGOTE_FORCE_64)),\ + $(if $(filter vendor,$(1)),\ + echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\ + echo "ro.$(1).product.cpu.abilist32=" >> $(2);\ + echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\ + )\ + ,\ + $(if $(filter system vendor odm,$(1)),\ + echo "ro.$(1).product.cpu.abilist=$(TARGET_CPU_ABI_LIST)" >> $(2);\ + echo "ro.$(1).product.cpu.abilist32=$(TARGET_CPU_ABI_LIST_32_BIT)" >> $(2);\ + echo "ro.$(1).product.cpu.abilist64=$(TARGET_CPU_ABI_LIST_64_BIT)" >> $(2);\ + )\ )\ echo "ro.$(1).build.date=`$(DATE_FROM_FILE)`" >> $(2);\ echo "ro.$(1).build.date.utc=`$(DATE_FROM_FILE) +%s`" >> $(2);\ @@ -282,6 +290,7 @@ $(gen_from_buildinfo_sh): $(INTERNAL_BUILD_ID_MAKEFILE) $(API_FINGERPRINT) | $(B TARGET_CPU_ABI_LIST_64_BIT="$(TARGET_CPU_ABI_LIST_64_BIT)" \ TARGET_CPU_ABI="$(TARGET_CPU_ABI)" \ TARGET_CPU_ABI2="$(TARGET_CPU_ABI2)" \ + ZYGOTE_FORCE_64_BIT="$(ZYGOTE_FORCE_64_BIT)" \ bash $(BUILDINFO_SH) > $@ ifdef TARGET_SYSTEM_PROP diff --git a/target/product/core_64_bit.mk b/target/product/core_64_bit.mk index 322fa80530..b9d22a6dd3 100644 --- a/target/product/core_64_bit.mk +++ b/target/product/core_64_bit.mk @@ -27,7 +27,11 @@ PRODUCT_COPY_FILES += system/core/rootdir/init.zygote64_32.rc:system/etc/init/hw # Set the zygote property to select the 64-bit primary, 32-bit secondary script # This line must be parsed before the one in core_minimal.mk +ifeq ($(ZYGOTE_FORCE_64),true) +PRODUCT_VENDOR_PROPERTIES += ro.zygote=zygote64 +else PRODUCT_VENDOR_PROPERTIES += ro.zygote=zygote64_32 +endif TARGET_SUPPORTS_32_BIT_APPS := true TARGET_SUPPORTS_64_BIT_APPS := true