From 164eed2e7d84162421ba873358be5d854bd8b641 Mon Sep 17 00:00:00 2001 From: Isaac Chen Date: Thu, 29 Mar 2018 18:47:19 +0800 Subject: [PATCH] Make aosp_$arch system images closer to GSIs This change modifies aosp_$arch product makefiles so their system images can be closer to their respective GSIs. The added contents in this CL are based on treble_common*.mk. Contents specific to GSI are in aosp_$arch.mk. Contents common to all devices are moved to full_base.mk. Contents related to specific device are moved to device.mk. BoardConfig related makefiles will be changed in another CL. Bug: 70772101 Test: The following products can boot to home screen: $ lunch aosp_x86-userdebug; m -j; emulator $ lunch aosp_x86_64-userdebug; m -j; emulator $ lunch aosp_arm-userdebug; m -j; emulator $ lunch aosp_arm64-userdebug; m -j; emulator Change-Id: I225a13dd74b3e748cc5d1705e1a453348b01d43f --- target/board/generic/device.mk | 17 +++++++++++++++++ target/board/generic_arm64/device.mk | 17 +++++++++++++++++ target/board/generic_x86/device.mk | 17 +++++++++++++++++ target/board/generic_x86_64/device.mk | 17 +++++++++++++++++ target/product/aosp_arm64.mk | 8 ++++++++ target/product/aosp_x86_64.mk | 8 ++++++++ target/product/full_base.mk | 14 ++++++++++++++ 7 files changed, 98 insertions(+) diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk index e18c1652b..f3ad03be7 100644 --- a/target/board/generic/device.mk +++ b/target/board/generic/device.mk @@ -29,3 +29,20 @@ PRODUCT_COPY_FILES := \ 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 \ hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf + +# minimal configuration for audio policy. +PRODUCT_COPY_FILES += \ + frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ + +# NFC: +# Provide default libnfc-nci.conf file for devices that does not have one in +# vendor/etc because aosp system image (of aosp_$arch products) is going to +# be used as GSI. +# May need to remove the following for newly launched devices in P since this +# NFC configuration file should be in vendor/etc, instead of system/etc +PRODUCT_COPY_FILES += \ + device/generic/common/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index ca287eb8b..4e33d3b9b 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -29,6 +29,23 @@ PRODUCT_COPY_FILES := \ 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 +# minimal configuration for audio policy. +PRODUCT_COPY_FILES += \ + frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ + +# NFC: +# Provide default libnfc-nci.conf file for devices that does not have one in +# vendor/etc because aosp system image (of aosp_$arch products) is going to +# be used as GSI. +# May need to remove the following for newly launched devices in P since this +# NFC configuration file should be in vendor/etc, instead of system/etc +PRODUCT_COPY_FILES += \ + device/generic/common/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf + # Adjust the Dalvik heap to be appropriate for a tablet. $(call inherit-product-if-exists, frameworks/base/build/tablet-dalvik-heap.mk) $(call inherit-product-if-exists, frameworks/native/build/tablet-dalvik-heap.mk) diff --git a/target/board/generic_x86/device.mk b/target/board/generic_x86/device.mk index 24c39a5cc..7b6fa3ce8 100644 --- a/target/board/generic_x86/device.mk +++ b/target/board/generic_x86/device.mk @@ -29,6 +29,23 @@ PRODUCT_COPY_FILES := \ 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 +# minimal configuration for audio policy. +PRODUCT_COPY_FILES += \ + frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ + +# NFC: +# Provide default libnfc-nci.conf file for devices that does not have one in +# vendor/etc because aosp system image (of aosp_$arch products) is going to +# be used as GSI. +# May need to remove the following for newly launched devices in P since this +# NFC configuration file should be in vendor/etc, instead of system/etc +PRODUCT_COPY_FILES += \ + device/generic/common/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf + PRODUCT_PACKAGES := \ audio.primary.goldfish \ vibrator.goldfish diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk index 24c39a5cc..7b6fa3ce8 100755 --- a/target/board/generic_x86_64/device.mk +++ b/target/board/generic_x86_64/device.mk @@ -29,6 +29,23 @@ PRODUCT_COPY_FILES := \ 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 +# minimal configuration for audio policy. +PRODUCT_COPY_FILES += \ + frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \ + frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \ + frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \ + +# NFC: +# Provide default libnfc-nci.conf file for devices that does not have one in +# vendor/etc because aosp system image (of aosp_$arch products) is going to +# be used as GSI. +# May need to remove the following for newly launched devices in P since this +# NFC configuration file should be in vendor/etc, instead of system/etc +PRODUCT_COPY_FILES += \ + device/generic/common/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf + PRODUCT_PACKAGES := \ audio.primary.goldfish \ vibrator.goldfish diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index 123160918..e7378d598 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -30,6 +30,14 @@ PRODUCT_COPY_FILES += \ prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \ device/generic/goldfish/fstab.ranchu.arm:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu +# Copy different zygote settings for vendor.img to select by setting property +# ro.zygote=zygote64_32 or ro.zygote=zygote32_64: +# 1. 64-bit primary, 32-bit secondary OR +# 2. 32-bit primary, 64-bit secondary +# init.zygote64_32.rc is in the core_64_bit.mk below +PRODUCT_COPY_FILES += \ + system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 086a76fb6..b1ed44e73 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -27,6 +27,14 @@ PRODUCT_COPY_FILES += \ device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ prebuilts/qemu-kernel/x86_64/4.4/kernel-qemu2:kernel-ranchu +# Copy different zygote settings for vendor.img to select by setting property +# ro.zygote=zygote64_32 or ro.zygote=zygote32_64: +# 1. 64-bit primary, 32-bit secondary OR +# 2. 32-bit primary, 64-bit secondary +# init.zygote64_32.rc is in the core_64_bit.mk below +PRODUCT_COPY_FILES += \ + system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk) diff --git a/target/product/full_base.mk b/target/product/full_base.mk index 5dc3c3fca..b7fdb3fd7 100644 --- a/target/product/full_base.mk +++ b/target/product/full_base.mk @@ -37,6 +37,20 @@ PRODUCT_PACKAGES += \ PhaseBeam \ PhotoTable +# Bluetooth: +# audio.a2dp.default is a system module. Generic system image includes +# audio.a2dp.default to support A2DP if board has the capability. +PRODUCT_PACKAGES += \ + audio.a2dp.default + +# Net: +# Vendors can use the platform-provided network configuration utilities (ip, +# iptable, etc.) to configure the Linux networking stack, but these utilities +# do not yet include a HIDL interface wrapper. This is a solution on +# Android O. +PRODUCT_PACKAGES += \ + netutils-wrapper-1.0 + # Additional settings used in all AOSP builds PRODUCT_PROPERTY_OVERRIDES := \ ro.config.ringtone=Ring_Synth_04.ogg \