From 54ea4b763a0f65ffa71e8c5bbef4babcaf329183 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Thu, 31 Jan 2019 22:36:15 +0800 Subject: [PATCH 1/4] Whilelist system/product_services in gsi_common.mk GSI could include system/product_services to override the content in product_services partition, so whitelist the folder. Bug: 119747870 Test: build a build target has prodcut_services and Test: inherit gsi_common.mk Change-Id: Ied201aad88d75ef85258c24e8a2a4952b968ff3f --- target/product/gsi_common.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/product/gsi_common.mk b/target/product/gsi_common.mk index 0006e62cf..cff3aad24 100644 --- a/target/product/gsi_common.mk +++ b/target/product/gsi_common.mk @@ -52,9 +52,10 @@ PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ system/etc/init/config/skip_mount.cfg \ system/etc/init/init.gsi.rc \ -# Exclude all files under system/product +# Exclude all files under system/product and system/product_services PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ - system/product/% + system/product/% \ + system/product_services/% # Split selinux policy From f6f5d8ad099a06900bf4a5b18477cec042f23a78 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 18 Jan 2019 17:55:10 +0800 Subject: [PATCH 2/4] Change Legacy GSI to inherit from gsi_common.mk The patch change Legacy GSI (aosp_$arch_(a|b)) to inherit from gsi_common.mk instead of treble_common.mk It does not inherit from gsi_common.mk directy. The patch adds legacy_gsi_common.mk to extend gsi_common.mk, and all Legacy GSI inherit from legcay_gsi_common.mk. The patch also removed treble_common*.mk. Bug: 119747870 Test: flash aosp_arm64_ab-userdebug on blueline P Test: flash aosp_arm64_ab-userdebug on walleye O-MR1 Change-Id: If54760484cc0937719c1336f1a4caac8468d2009 --- target/product/aosp_arm64_a.mk | 15 ++++++- target/product/aosp_arm64_ab.mk | 20 +++++---- target/product/aosp_arm_a.mk | 2 +- target/product/aosp_arm_ab.mk | 9 +---- target/product/aosp_x86_64_a.mk | 15 ++++++- target/product/aosp_x86_64_ab.mk | 20 +++++---- target/product/aosp_x86_a.mk | 2 +- target/product/aosp_x86_ab.mk | 9 +---- target/product/legacy_gsi_common.mk | 37 +++++++++++++++++ target/product/treble_common.mk | 63 ----------------------------- target/product/treble_common_32.mk | 22 ---------- target/product/treble_common_64.mk | 37 ----------------- 12 files changed, 95 insertions(+), 156 deletions(-) create mode 100644 target/product/legacy_gsi_common.mk delete mode 100644 target/product/treble_common.mk delete mode 100644 target/product/treble_common_32.mk delete mode 100644 target/product/treble_common_64.mk diff --git a/target/product/aosp_arm64_a.mk b/target/product/aosp_arm64_a.mk index b1c4b7dba..3f31a19d7 100644 --- a/target/product/aosp_arm64_a.mk +++ b/target/product/aosp_arm64_a.mk @@ -19,7 +19,20 @@ # on the generic system image, place them in build/make/target/board/ # gsi_system.prop. -include build/make/target/product/treble_common_64.mk +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + root/init.zygote32_64.rc \ + root/init.zygote64_32.rc \ + +# 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 PRODUCT_NAME := aosp_arm64_a PRODUCT_DEVICE := generic_arm64_a diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk index 92f50553a..b201bb11a 100644 --- a/target/product/aosp_arm64_ab.mk +++ b/target/product/aosp_arm64_ab.mk @@ -24,14 +24,20 @@ # - 64 bits binder interface # - system-as-root -include build/make/target/product/treble_common_64.mk +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + root/init.zygote32_64.rc \ + root/init.zygote64_32.rc \ + +# 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 PRODUCT_NAME := aosp_arm64_ab PRODUCT_DEVICE := generic_arm64_ab diff --git a/target/product/aosp_arm_a.mk b/target/product/aosp_arm_a.mk index d89a326c9..fc160e82a 100644 --- a/target/product/aosp_arm_a.mk +++ b/target/product/aosp_arm_a.mk @@ -19,7 +19,7 @@ # on the generic system image, place them in build/make/target/board/ # gsi_system.prop. -include build/make/target/product/treble_common_32.mk +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) PRODUCT_NAME := aosp_arm_a PRODUCT_DEVICE := generic_arm_a diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk index b35e51775..75b9c1086 100644 --- a/target/product/aosp_arm_ab.mk +++ b/target/product/aosp_arm_ab.mk @@ -24,14 +24,7 @@ # - 32 bits binder interface # - system-as-root -include build/make/target/product/treble_common_32.mk - -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) PRODUCT_NAME := aosp_arm_ab PRODUCT_DEVICE := generic_arm_ab diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk index 6b6785a49..2917f3812 100644 --- a/target/product/aosp_x86_64_a.mk +++ b/target/product/aosp_x86_64_a.mk @@ -19,7 +19,20 @@ # on the generic system image, place them in build/make/target/board/ # gsi_system.prop. -include build/make/target/product/treble_common_64.mk +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + root/init.zygote32_64.rc \ + root/init.zygote64_32.rc \ + +# 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 PRODUCT_NAME := aosp_x86_64_a PRODUCT_DEVICE := generic_x86_64_a diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk index 35bf61a1f..45080f999 100644 --- a/target/product/aosp_x86_64_ab.mk +++ b/target/product/aosp_x86_64_ab.mk @@ -24,14 +24,20 @@ # - 64 bits binder interface # - system-as-root -include build/make/target/product/treble_common_64.mk +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + root/init.zygote32_64.rc \ + root/init.zygote64_32.rc \ + +# 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 PRODUCT_NAME := aosp_x86_64_ab PRODUCT_DEVICE := generic_x86_64_ab diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk index 99ed7e441..2f0fe0ad5 100644 --- a/target/product/aosp_x86_a.mk +++ b/target/product/aosp_x86_a.mk @@ -19,7 +19,7 @@ # on the generic system image, place them in build/make/target/board/ # gsi_system.prop. -include build/make/target/product/treble_common_32.mk +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) PRODUCT_NAME := aosp_x86_a PRODUCT_DEVICE := generic_x86_a diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk index 185e2f0a3..55cd16efd 100644 --- a/target/product/aosp_x86_ab.mk +++ b/target/product/aosp_x86_ab.mk @@ -24,14 +24,7 @@ # - 32 bits binder interface # - system-as-root -include build/make/target/product/treble_common_32.mk - -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier +$(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) PRODUCT_NAME := aosp_x86_ab PRODUCT_DEVICE := generic_x86_ab diff --git a/target/product/legacy_gsi_common.mk b/target/product/legacy_gsi_common.mk new file mode 100644 index 000000000..fdae6eb16 --- /dev/null +++ b/target/product/legacy_gsi_common.mk @@ -0,0 +1,37 @@ +# +# Copyright (C) 2019 The Android Open-Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +include $(SRC_TARGET_DIR)/product/gsi_common.mk + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + system/etc/init/init.legacy-gsi.rc \ + system/etc/init/gsi/init.vndk-27.rc \ + system/etc/ld.config.vndk_lite.txt \ + +# Legacy GSI support addtional O-MR1 interface +PRODUCT_EXTRA_VNDK_VERSIONS += 27 + +# Support for the O-MR1 devices +PRODUCT_COPY_FILES += \ + build/make/target/product/gsi/init.legacy-gsi.rc:system/etc/init/init.legacy-gsi.rc \ + build/make/target/product/gsi/init.vndk-27.rc:system/etc/init/gsi/init.vndk-27.rc + +# Name space configuration file for non-enforcing VNDK +PRODUCT_PACKAGES += \ + ld.config.vndk_lite.txt + +# Legacy GSI relax the compatible property checking +PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := false diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk deleted file mode 100644 index 7e4a98e98..000000000 --- a/target/product/treble_common.mk +++ /dev/null @@ -1,63 +0,0 @@ -# -# Copyright (C) 2017 The Android Open-Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at -# /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/ -# treble_system.prop. - -# Generic system image inherits from AOSP with telephony -$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base.mk) -$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony.mk) - -# Enable dynamic partition size -PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true - -# Split selinux policy -PRODUCT_FULL_TREBLE_OVERRIDE := true - -# The Messaging app: -# Needed for android.telecom.cts.ExtendedInCallServiceTest#testOnCannedTextResponsesLoaded -PRODUCT_PACKAGES += \ - messaging - -# Telephony: -# Provide a default APN configuration -PRODUCT_COPY_FILES += \ - device/sample/etc/apns-full-conf.xml:system/etc/apns-conf.xml - -# NFC: -# Provide default libnfc-nci.conf file for devices that does not have one in -# vendor/etc -PRODUCT_COPY_FILES += \ - device/generic/common/nfc/libnfc-nci.conf:system/etc/libnfc-nci.conf - -# GSI specific tasks on boot -PRODUCT_COPY_FILES += \ - build/make/target/product/gsi/skip_mount.cfg:system/etc/init/config/skip_mount.cfg \ - build/make/target/product/gsi/init.gsi.rc:system/etc/init/init.gsi.rc \ - -# Support for the O-MR1 devices -PRODUCT_COPY_FILES += \ - build/make/target/product/gsi/init.legacy-gsi.rc:system/etc/init/init.legacy-gsi.rc \ - build/make/target/product/gsi/init.vndk-27.rc:system/etc/init/gsi/init.vndk-27.rc - -# Name space configuration file for non-enforcing VNDK -PRODUCT_PACKAGES += \ - ld.config.vndk_lite.txt - -# Support addtional O-MR1 and P vendor interface -PRODUCT_EXTRA_VNDK_VERSIONS := 27 28 diff --git a/target/product/treble_common_32.mk b/target/product/treble_common_32.mk deleted file mode 100644 index 0023c3b6e..000000000 --- a/target/product/treble_common_32.mk +++ /dev/null @@ -1,22 +0,0 @@ -# -# Copyright (C) 2017 The Android Open-Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at -# /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/ -# treble_system.prop. - -include build/make/target/product/treble_common.mk diff --git a/target/product/treble_common_64.mk b/target/product/treble_common_64.mk deleted file mode 100644 index fc3c16f8c..000000000 --- a/target/product/treble_common_64.mk +++ /dev/null @@ -1,37 +0,0 @@ -# -# Copyright (C) 2017 The Android Open-Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at -# /vendor/[build|default].prop when build split is on. In order to have sysprops -# on the generic system image, place them in build/make/target/board/ -# treble_system.prop. - -include build/make/target/product/treble_common.mk - -# For now this will allow 64-bit apps, but still compile all apps with JNI -# for 32-bit only. - -# 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 -# 3. 64-bit only is currently forbidden (b/64280459#comment6) -PRODUCT_COPY_FILES += \ - system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc \ - system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc - -TARGET_SUPPORTS_32_BIT_APPS := true -TARGET_SUPPORTS_64_BIT_APPS := true From ce1fdb2f553b7cf0a9a6402472a5ea34ae7753bb Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 25 Jan 2019 13:12:55 +0800 Subject: [PATCH 3/4] Change aosp_$arch.mk to inherit from gsi_common.mk The patch changes GSI (aosp_$arch) to inherit from gsi_common.mk instead of aosp_base_telephony.mk. The patch also clones the emulator_vendor.mk from emulator.mk to include all vendor modules. Bug: 119747870 Test: boot aosp_arm64-userdebug on a blueline device on master/P Test: boot aosp_x86-userdebug on the emulator Test: boot aosp_x86_64-userdebug on the emulator Test: compare the out folder with/without the patch, only more content Change-Id: Ibd398d4f93d2a964813e05ccd434975435d25adc --- target/board/generic_arm64/device.mk | 9 ---- target/board/generic_x86/device.mk | 16 +++--- target/board/generic_x86_64/device.mk | 16 +++--- target/product/aosp_arm.mk | 32 ++++-------- target/product/aosp_arm64.mk | 41 +++++----------- target/product/aosp_x86.mk | 32 ++++-------- target/product/aosp_x86_64.mk | 51 +++++-------------- target/product/emulator_vendor.mk | 70 +++++++++++++++++++++++++++ 8 files changed, 130 insertions(+), 137 deletions(-) create mode 100644 target/product/emulator_vendor.mk diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index 2004624ca..e5d8e61d0 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -14,15 +14,6 @@ # limitations under the License. # -# 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 0a3241511..a31058dd3 100644 --- a/target/board/generic_x86/device.mk +++ b/target/board/generic_x86/device.mk @@ -14,11 +14,11 @@ # limitations under the License. # -# 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 +ifdef NET_ETH0_STARTONBOOT + PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1 +endif + +# Ensure we package the BIOS files too. +PRODUCT_PACKAGES += \ + bios.bin \ + vgabios-cirrus.bin \ diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk index 0a3241511..a31058dd3 100755 --- a/target/board/generic_x86_64/device.mk +++ b/target/board/generic_x86_64/device.mk @@ -14,11 +14,11 @@ # limitations under the License. # -# 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 +ifdef NET_ETH0_STARTONBOOT + PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1 +endif + +# Ensure we package the BIOS files too. +PRODUCT_PACKAGES += \ + bios.bin \ + vgabios-cirrus.bin \ diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index 98114c15a..cfcae6682 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -21,29 +21,15 @@ # - VNDK enforcement # - compatible property override enabled --include device/generic/goldfish/arm32-vendor.mk +# GSI for system/product +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_common.mk) -include $(SRC_TARGET_DIR)/product/full.mk - -# Enable dynamic partition size -PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true - -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier - -# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI -PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true - -# GSI specific tasks on boot -PRODUCT_COPY_FILES += \ - build/make/target/product/gsi/skip_mount.cfg:system/etc/init/config/skip_mount.cfg \ - build/make/target/product/gsi/init.gsi.rc:system/etc/init/init.gsi.rc \ - -# Support addtional P vendor interface -PRODUCT_EXTRA_VNDK_VERSIONS := 28 +# Emulator for vendor +$(call inherit-product-if-exists, device/generic/goldfish/arm32-vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk) PRODUCT_NAME := aosp_arm +PRODUCT_DEVICE := generic +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on ARM32 diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index 87e14d7c2..a7110a690 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -26,7 +26,18 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. --include device/generic/goldfish/arm64-vendor.mk +# GSI for system/product +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_common.mk) + +# Emulator for vendor +$(call inherit-product-if-exists, device/generic/goldfish/arm64-vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + root/init.zygote32_64.rc \ + root/init.zygote64_32.rc \ # Copy different zygote settings for vendor.img to select by setting property # ro.zygote=zygote64_32 or ro.zygote=zygote32_64: @@ -36,33 +47,7 @@ PRODUCT_COPY_FILES += \ system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc -$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator.mk) -$(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) - -# Enable dynamic partition size -PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true - -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier - -# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI -PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true - -# GSI specific tasks on boot -PRODUCT_COPY_FILES += \ - build/make/target/product/gsi/skip_mount.cfg:system/etc/init/config/skip_mount.cfg \ - build/make/target/product/gsi/init.gsi.rc:system/etc/init/init.gsi.rc \ - -# Support addtional P vendor interface -PRODUCT_EXTRA_VNDK_VERSIONS := 28 - PRODUCT_NAME := aosp_arm64 PRODUCT_DEVICE := generic_arm64 PRODUCT_BRAND := Android -PRODUCT_MODEL := AOSP on ARM arm64 Emulator +PRODUCT_MODEL := AOSP on ARM64 diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index 50d735556..0fbe1e4ca 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -21,29 +21,15 @@ # - VNDK enforcement # - compatible property override enabled --include device/generic/goldfish/x86-vendor.mk +# GSI for system/product +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_common.mk) -include $(SRC_TARGET_DIR)/product/full_x86.mk - -# Enable dynamic partition size -PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true - -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier - -# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI -PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true - -# GSI specific tasks on boot -PRODUCT_COPY_FILES += \ - build/make/target/product/gsi/skip_mount.cfg:system/etc/init/config/skip_mount.cfg \ - build/make/target/product/gsi/init.gsi.rc:system/etc/init/init.gsi.rc \ - -# Support addtional P vendor interface -PRODUCT_EXTRA_VNDK_VERSIONS := 28 +# Emulator for vendor +$(call inherit-product-if-exists, device/generic/goldfish/x86-vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk) PRODUCT_NAME := aosp_x86 +PRODUCT_DEVICE := generic_x86 +PRODUCT_BRAND := Android +PRODUCT_MODEL := AOSP on x86 diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 499831b3c..16be37398 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -26,7 +26,18 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. --include device/generic/goldfish/x86_64-vendor.mk +# GSI for system/product +$(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_common.mk) + +# Emulator for vendor +$(call inherit-product-if-exists, device/generic/goldfish/x86_64-vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk) + +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ + root/init.zygote32_64.rc \ + root/init.zygote64_32.rc \ # Copy different zygote settings for vendor.img to select by setting property # ro.zygote=zygote64_32 or ro.zygote=zygote32_64: @@ -36,43 +47,7 @@ PRODUCT_COPY_FILES += \ system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc -$(call inherit-product, $(SRC_TARGET_DIR)/product/emulator.mk) -$(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) - -# Enable dynamic partition size -PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true - -# Enable A/B update -AB_OTA_UPDATER := true -AB_OTA_PARTITIONS := system -PRODUCT_PACKAGES += \ - update_engine \ - update_verifier - -# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI -PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true - -# GSI specific tasks on boot -PRODUCT_COPY_FILES += \ - build/make/target/product/gsi/skip_mount.cfg:system/etc/init/config/skip_mount.cfg \ - build/make/target/product/gsi/init.gsi.rc:system/etc/init/init.gsi.rc \ - -# Support addtional P vendor interface -PRODUCT_EXTRA_VNDK_VERSIONS := 28 - -ifdef NET_ETH0_STARTONBOOT - PRODUCT_PROPERTY_OVERRIDES += net.eth0.startonboot=1 -endif - -# Ensure we package the BIOS files too. -PRODUCT_PACKAGES += \ - bios.bin \ - vgabios-cirrus.bin \ - -# Overrides PRODUCT_NAME := aosp_x86_64 PRODUCT_DEVICE := generic_x86_64 PRODUCT_BRAND := Android -PRODUCT_MODEL := AOSP on IA x86_64 Emulator +PRODUCT_MODEL := AOSP on x86_64 diff --git a/target/product/emulator_vendor.mk b/target/product/emulator_vendor.mk new file mode 100644 index 000000000..f0a535480 --- /dev/null +++ b/target/product/emulator_vendor.mk @@ -0,0 +1,70 @@ +# +# Copyright (C) 2012 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# +# This file is included by other product makefiles to add all the +# emulator-related modules to PRODUCT_PACKAGES. +# + +$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_vendor.mk) +$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_vendor.mk) + +# TODO(b/123495142): these files should be clean up +PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := \ + system/bin/vintf \ + system/etc/permissions/android.software.verified_boot.xml \ + system/etc/permissions/privapp-permissions-goldfish.xml \ + system/lib/egl/libGLES_android.so \ + system/lib64/egl/libGLES_android.so \ + system/priv-app/SdkSetup/SdkSetup.apk \ + +# Device modules +PRODUCT_PACKAGES += \ + libGLES_android \ + vintf \ + +# need this for gles libraries to load properly +# after moving to /vendor/lib/ +PRODUCT_PACKAGES += \ + vndk-sp + +PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay + +PRODUCT_CHARACTERISTICS := emulator + +PRODUCT_FULL_TREBLE_OVERRIDE := true + +# goldfish vendor partition configurations +$(call inherit-product-if-exists, device/generic/goldfish/vendor.mk) + +#watchdog tiggers reboot because location service is not +#responding, disble it for now. +#still keep it on internal master as it is still working +#once it is fixed in aosp, remove this block of comment. +#PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \ +#config.disable_location=true + +# Enable Perfetto traced +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + persist.traced.enable=1 + +# enable Google-specific location features, +# like NetworkLocationProvider and LocationCollector +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + ro.com.google.locationfeatures=1 + +# disable setupwizard +PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \ + ro.setupwizard.mode=DISABLED From 323be83a6606ee06d5f637b122586d3633844dfc Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 1 Feb 2019 12:44:30 +0800 Subject: [PATCH 4/4] Enable mainline checking for all GSI targets There are some makefile inherit from aosp_$arch*.mk. This patch change to only enable mainline checking on excat GSI targets, such as aosp_$arch or aosp_$arch_(a|ab), and does not apply on the child targets. This patch also add some more whitelist items to gsi_common.mk Bug: 123613261 Test: aosp_arm64-userdebug build pass Test: remove some whitelist items and aosp_arm64-userdebug build fail Test: sdk_phone_arm64-eng build pass Test: gsi_arm64-userdebug build pass Change-Id: I1772a55ab823a0312b9f215f0d2c3b0c727c8e4b --- target/product/aosp_arm.mk | 5 +++++ target/product/aosp_arm64.mk | 5 +++++ target/product/aosp_arm64_a.mk | 5 +++++ target/product/aosp_arm64_ab.mk | 5 +++++ target/product/aosp_arm_a.mk | 5 +++++ target/product/aosp_arm_ab.mk | 5 +++++ target/product/aosp_x86.mk | 5 +++++ target/product/aosp_x86_64.mk | 5 +++++ target/product/aosp_x86_64_a.mk | 5 +++++ target/product/aosp_x86_64_ab.mk | 5 +++++ target/product/aosp_x86_a.mk | 5 +++++ target/product/aosp_x86_ab.mk | 5 +++++ target/product/gsi_arm64.mk | 3 ++- target/product/gsi_common.mk | 6 +++--- 14 files changed, 65 insertions(+), 4 deletions(-) diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index cfcae6682..400fa6abf 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -24,6 +24,11 @@ # GSI for system/product $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_arm,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + # Emulator for vendor $(call inherit-product-if-exists, device/generic/goldfish/arm32-vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index a7110a690..aa6ec4d0d 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -35,6 +35,11 @@ $(call inherit-product-if-exists, device/generic/goldfish/arm64-vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_arm64,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ diff --git a/target/product/aosp_arm64_a.mk b/target/product/aosp_arm64_a.mk index 3f31a19d7..e45229d08 100644 --- a/target/product/aosp_arm64_a.mk +++ b/target/product/aosp_arm64_a.mk @@ -22,6 +22,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_arm64_a,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ diff --git a/target/product/aosp_arm64_ab.mk b/target/product/aosp_arm64_ab.mk index b201bb11a..f707a39dd 100644 --- a/target/product/aosp_arm64_ab.mk +++ b/target/product/aosp_arm64_ab.mk @@ -27,6 +27,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_arm64_ab,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ diff --git a/target/product/aosp_arm_a.mk b/target/product/aosp_arm_a.mk index fc160e82a..249ad2c40 100644 --- a/target/product/aosp_arm_a.mk +++ b/target/product/aosp_arm_a.mk @@ -21,6 +21,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_arm_a,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_NAME := aosp_arm_a PRODUCT_DEVICE := generic_arm_a PRODUCT_BRAND := Android diff --git a/target/product/aosp_arm_ab.mk b/target/product/aosp_arm_ab.mk index 75b9c1086..e76093267 100644 --- a/target/product/aosp_arm_ab.mk +++ b/target/product/aosp_arm_ab.mk @@ -26,6 +26,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_arm_ab,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_NAME := aosp_arm_ab PRODUCT_DEVICE := generic_arm_ab PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index 0fbe1e4ca..b16b5edde 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -29,6 +29,11 @@ $(call inherit-product-if-exists, device/generic/goldfish/x86-vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86/device.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_x86,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_NAME := aosp_x86 PRODUCT_DEVICE := generic_x86 PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 16be37398..f7e205691 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -35,6 +35,11 @@ $(call inherit-product-if-exists, device/generic/goldfish/x86_64-vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/emulator_vendor.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_x86_64,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ diff --git a/target/product/aosp_x86_64_a.mk b/target/product/aosp_x86_64_a.mk index 2917f3812..f40b9a900 100644 --- a/target/product/aosp_x86_64_a.mk +++ b/target/product/aosp_x86_64_a.mk @@ -22,6 +22,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_x86_64_a,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ diff --git a/target/product/aosp_x86_64_ab.mk b/target/product/aosp_x86_64_ab.mk index 45080f999..dfb7b49ff 100644 --- a/target/product/aosp_x86_64_ab.mk +++ b/target/product/aosp_x86_64_ab.mk @@ -27,6 +27,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_x86_64_ab,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ diff --git a/target/product/aosp_x86_a.mk b/target/product/aosp_x86_a.mk index 2f0fe0ad5..743e0b9bc 100644 --- a/target/product/aosp_x86_a.mk +++ b/target/product/aosp_x86_a.mk @@ -21,6 +21,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_x86_a,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_NAME := aosp_x86_a PRODUCT_DEVICE := generic_x86_a PRODUCT_BRAND := Android diff --git a/target/product/aosp_x86_ab.mk b/target/product/aosp_x86_ab.mk index 55cd16efd..d07351cca 100644 --- a/target/product/aosp_x86_ab.mk +++ b/target/product/aosp_x86_ab.mk @@ -26,6 +26,11 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/legacy_gsi_common.mk) +# Enable mainline checking for excat this product name +ifeq (aosp_x86_ab,$(TARGET_PRODUCT)) +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +endif + PRODUCT_NAME := aosp_x86_ab PRODUCT_DEVICE := generic_x86_ab PRODUCT_BRAND := Android diff --git a/target/product/gsi_arm64.mk b/target/product/gsi_arm64.mk index cf4babadb..b711d88c0 100644 --- a/target/product/gsi_arm64.mk +++ b/target/product/gsi_arm64.mk @@ -17,6 +17,8 @@ $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_common.mk) +# Enable mainline checking +PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST += \ root/init.zygote32_64.rc \ root/init.zygote64_32.rc \ @@ -33,4 +35,3 @@ PRODUCT_NAME := gsi_arm64 PRODUCT_DEVICE := gsi_arm64 PRODUCT_BRAND := generic PRODUCT_MODEL := GSI on ARM64 - diff --git a/target/product/gsi_common.mk b/target/product/gsi_common.mk index cff3aad24..e87309bf1 100644 --- a/target/product/gsi_common.mk +++ b/target/product/gsi_common.mk @@ -28,15 +28,15 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.config.ringtone=Ring_Synth_04.ogg \ ro.config.notification_sound=pixiedust.ogg - -# Enable mainline checking and the whitelist for GSI -PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := relaxed +# The mainline checking whitelist, should be clean up PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := \ system/app/messaging/messaging.apk \ system/app/PhotoTable/PhotoTable.apk \ system/app/WAPPushManager/WAPPushManager.apk \ system/bin/healthd \ system/etc/init/healthd.rc \ + system/etc/seccomp_policy/crash_dump.%.policy \ + system/etc/seccomp_policy/mediacodec.policy \ system/etc/vintf/manifest/manifest_healthd.xml \ system/lib/libframesequence.so \ system/lib/libgiftranscode.so \