From 5327e98b1adb81da169238ea2712015f803d39d3 Mon Sep 17 00:00:00 2001 From: Isaac Chen Date: Thu, 19 Apr 2018 14:18:54 +0800 Subject: [PATCH] Enable VNDK for aosp_arm(64) This is needed for the system images of aosp_arm(64) products to be used as their respective GSIs in P, and for also aosp_arm(64) products to boot with the current GSIs. Bug: 78255604 Test: Built and booted the following products to home screen $ lunch aosp_arm-userdebug; m -j; emulator $ lunch aosp_arm64-userdebug; m -j; emulator # The system image, both userdebug and user builds, of # aosp_arm64 could also boot to home screen and browse # the network on a physical device. Change-Id: I83b79fd4d4e6e522ee78c720fb8c5f6f67ee411b Merged-In: I83b79fd4d4e6e522ee78c720fb8c5f6f67ee411b (cherry picked from commit f71547079a1c9c5a175f41a8ef5fe51df57f2aa7) --- target/board/generic/BoardConfig.mk | 19 +++++++------- target/board/generic/device.mk | 10 ++++---- target/board/generic_arm64/BoardConfig.mk | 30 +++++++++++++++-------- target/board/generic_arm64/device.mk | 10 ++++---- 4 files changed, 39 insertions(+), 30 deletions(-) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 9bf3c8bed5..ac6d090c8a 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -30,15 +30,6 @@ TARGET_BOOTLOADER_BOARD_NAME := goldfish_$(TARGET_ARCH) # no hardware camera USE_CAMERA_STUB := true -# Enable dex-preoptimization to speed up the first boot sequence -# of an SDK AVD. Note that this operation only works on Linux for now -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false - endif -endif - TARGET_USES_HWC2 := true NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 @@ -51,7 +42,8 @@ BUILD_QEMU_IMAGES := true USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB +# Partition size is default 1.5GB (1536MB) for 64 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 TARGET_COPY_OUT_VENDOR := vendor # ~100 MB vendor image. Please adjust system image / vendor image sizes @@ -65,6 +57,13 @@ DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +# GSI is always userdebug and needs a couple of properties taking precedence +# over those set by the vendor. +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop +endif +BOARD_VNDK_VERSION := current + # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk index e18c1652b4..0a517dcb09 100644 --- a/target/board/generic/device.mk +++ b/target/board/generic/device.mk @@ -23,9 +23,9 @@ PRODUCT_PROPERTY_OVERRIDES := \ PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ - device/generic/goldfish/camera/media_profiles.xml:system/etc/media_profiles.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ - device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml \ + device/generic/goldfish/camera/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \ + device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index dbdec9055c..ee4103d113 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -61,15 +61,6 @@ TARGET_USES_64_BIT_BINDER := true # no hardware camera USE_CAMERA_STUB := true -# Enable dex-preoptimization to speed up the first boot sequence -# of an SDK AVD. Note that this operation only works on Linux for now -ifeq ($(HOST_OS),linux) - ifeq ($(WITH_DEXPREOPT),) - WITH_DEXPREOPT := true - WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := false - endif -endif - TARGET_USES_HWC2 := true NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 @@ -82,7 +73,8 @@ BUILD_QEMU_IMAGES := true USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2.5 GB +# Partition size is default 1.5GB (1536MB) for 64 bits projects +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 TARGET_COPY_OUT_VENDOR := vendor # ~100 MB vendor image. Please adjust system image / vendor image sizes @@ -96,6 +88,24 @@ DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +# GSI is always userdebug and needs a couple of properties taking precedence +# over those set by the vendor. +TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop +endif +BOARD_VNDK_VERSION := current + +# Emulator system image is going to be used as GSI and some vendor still hasn't +# cleaned up all device specific directories under root! + +# TODO(jiyong) These might be SoC specific. +BOARD_ROOT_EXTRA_FOLDERS += firmware firmware/radio persist +BOARD_ROOT_EXTRA_SYMLINKS := /vendor/lib/dsp:/dsp + +# TODO(b/36764215): remove this setting when the generic system image +# no longer has QCOM-specific directories under /. +BOARD_SEPOLICY_DIRS += build/target/board/generic_arm64_ab/sepolicy + # Enable A/B update TARGET_NO_RECOVERY := true BOARD_BUILD_SYSTEM_ROOT_IMAGE := true diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index ca287eb8b2..e88c5654dc 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -23,11 +23,11 @@ PRODUCT_PROPERTY_OVERRIDES := \ PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ - device/generic/goldfish/camera/media_profiles.xml:system/etc/media_profiles.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \ - frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:system/etc/media_codecs_google_video.xml \ - device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml + device/generic/goldfish/camera/media_profiles.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_profiles.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \ + frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \ + device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml # Adjust the Dalvik heap to be appropriate for a tablet. $(call inherit-product-if-exists, frameworks/base/build/tablet-dalvik-heap.mk)