From dea57a49e2fca53e6fb68dc6f2fd86b12c6d7399 Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Fri, 14 May 2021 17:25:12 +0800 Subject: [PATCH 1/5] Move GKI common settings to BoardConfigGkiCommon.mk There are GKI arm64 and x86_64 now. The patch restructures the GKI common settings to a new common BoardConfig file "BoardConfigGkiCommon.mk". It includes the ramdisk and boot image settings for GKI. The patch also removes obsolete TARGET_PRELINK_MODULE. Bug: 177859525 Bug: 181277965 Test: lunch gsi_arm64-userdebug ; make dist Test: lunch gsi_x86_64-userdebug ; make dist Change-Id: I204c8937d97140cc3c6ed3473d494f03f534ed75 Merged-In: I204c8937d97140cc3c6ed3473d494f03f534ed75 --- target/board/BoardConfigGkiCommon.mk | 44 ++++++++++++++++++++++ target/board/BoardConfigGsiCommon.mk | 8 ---- target/board/generic_arm64/BoardConfig.mk | 23 +---------- target/board/generic_x86/BoardConfig.mk | 3 +- target/board/generic_x86_64/BoardConfig.mk | 2 +- 5 files changed, 47 insertions(+), 33 deletions(-) create mode 100644 target/board/BoardConfigGkiCommon.mk diff --git a/target/board/BoardConfigGkiCommon.mk b/target/board/BoardConfigGkiCommon.mk new file mode 100644 index 000000000..1a8c6b1bb --- /dev/null +++ b/target/board/BoardConfigGkiCommon.mk @@ -0,0 +1,44 @@ +# Copyright (C) 2021 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. +# + +# Enable GKI 2.0 signing. +BOARD_GKI_SIGNING_KEY_PATH := build/make/target/product/gsi/testkey_rsa2048.pem +BOARD_GKI_SIGNING_ALGORITHM := SHA256_RSA2048 + +# The following is needed to allow release signing process appends more extra +# args, e.g., passing --signing_helper_with_files from mkbootimg to avbtool. +# See b/178559811 for more details. +BOARD_GKI_SIGNING_SIGNATURE_ARGS := --prop foo:bar + +# Boot image with ramdisk and kernel +BOARD_RAMDISK_USE_LZ4 := true +BOARD_BOOT_HEADER_VERSION := 4 +BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) +BOARD_USES_RECOVERY_AS_BOOT := +TARGET_NO_KERNEL := false +BOARD_USES_GENERIC_KERNEL_IMAGE := true +BOARD_KERNEL_MODULE_INTERFACE_VERSIONS := \ + 5.4-android12-unstable \ + 5.10-android12-unstable \ + +# Copy boot image in $OUT to target files. This is defined for targets where +# the installed GKI APEXes are built from source. +BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES := true + +# No vendor_boot +BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := + +# No recovery +BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := diff --git a/target/board/BoardConfigGsiCommon.mk b/target/board/BoardConfigGsiCommon.mk index 95ba1d042..c577870de 100644 --- a/target/board/BoardConfigGsiCommon.mk +++ b/target/board/BoardConfigGsiCommon.mk @@ -30,14 +30,6 @@ BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := # the devices with metadata parition BOARD_USES_METADATA_PARTITION := true -# Enable GKI 2.0 signing. -BOARD_GKI_SIGNING_KEY_PATH := build/make/target/product/gsi/testkey_rsa2048.pem -BOARD_GKI_SIGNING_ALGORITHM := SHA256_RSA2048 -# The following is needed to allow release signing process appends more extra -# args, e.g., passing --signing_helper_with_files from mkbootimg to avbtool. -# See b/178559811 for more details. -BOARD_GKI_SIGNING_SIGNATURE_ARGS := --prop foo:bar - # Android Verified Boot (AVB): # Set the rollback index to zero, to prevent the device bootloader from # updating the last seen rollback index in the tamper-evident storage. diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 1dbce1e8e..21b406548 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -53,6 +53,7 @@ TARGET_2ND_CPU_VARIANT := generic endif include build/make/target/board/BoardConfigGsiCommon.mk +include build/make/target/board/BoardConfigGkiCommon.mk BOARD_KERNEL-4.19-GZ_BOOTIMAGE_PARTITION_SIZE := 47185920 BOARD_KERNEL-5.4_BOOTIMAGE_PARTITION_SIZE := 67108864 @@ -73,10 +74,6 @@ BOARD_KERNEL-MAINLINE-LZ4_BOOTIMAGE_PARTITION_SIZE := 53477376 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 -BOARD_RAMDISK_USE_LZ4 := true -BOARD_BOOT_HEADER_VERSION := 4 -BOARD_MKBOOTIMG_ARGS += --header_version $(BOARD_BOOT_HEADER_VERSION) - BOARD_KERNEL_BINARIES := \ kernel-4.19-gz \ kernel-5.4 kernel-5.4-gz kernel-5.4-lz4 \ @@ -90,24 +87,6 @@ BOARD_KERNEL_BINARIES += \ endif -# Boot image -BOARD_USES_RECOVERY_AS_BOOT := -TARGET_NO_KERNEL := false -BOARD_USES_GENERIC_KERNEL_IMAGE := true -BOARD_KERNEL_MODULE_INTERFACE_VERSIONS := \ - 5.4-android12-unstable \ - 5.10-android12-unstable \ - -# Copy boot image in $OUT to target files. This is defined for targets where -# the installed GKI APEXes are built from source. -BOARD_COPY_BOOT_IMAGE_TO_TARGET_FILES := true - -# No vendor_boot -BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := - -# No recovery -BOARD_EXCLUDE_KERNEL_FROM_RECOVERY_IMAGE := - # Some vendors still haven't cleaned up all device specific directories under # root! diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index c40c15b23..47fd384c2 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -18,9 +18,8 @@ TARGET_CPU_ABI := x86 TARGET_ARCH := x86 TARGET_ARCH_VARIANT := x86 -TARGET_PRELINK_MODULE := false - include build/make/target/board/BoardConfigGsiCommon.mk + ifndef BUILDING_GSI include build/make/target/board/BoardConfigEmuCommon.mk diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 660ec6e7f..2d29241e5 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -22,8 +22,8 @@ TARGET_2ND_CPU_ABI := x86 TARGET_2ND_ARCH := x86 TARGET_2ND_ARCH_VARIANT := x86_64 -TARGET_PRELINK_MODULE := false include build/make/target/board/BoardConfigGsiCommon.mk + ifndef BUILDING_GSI include build/make/target/board/BoardConfigEmuCommon.mk From 6968d4dc9c10aace40349d35d7d3e753d3539c9f Mon Sep 17 00:00:00 2001 From: Hsin-Yi Chen Date: Sat, 8 May 2021 15:23:44 +0800 Subject: [PATCH 2/5] Add GKI to generic x86_64 board - Remove emulator configurations from generic_x86_64/device.mk. - Add GKI configurations to generic_x86_64/device.mk. Test: lunch gsi_x86_64-userdebug ; make dist Bug: 181277965 Change-Id: I43c8005afcaeec6ed70648b5f74eeed1d46f9228 Merged-In: I43c8005afcaeec6ed70648b5f74eeed1d46f9228 (cherry picked from commit b212b0a92abf8d00e83cff1975e580033a06db33) --- target/board/generic_x86_64/BoardConfig.mk | 26 ++++++++++++++++++++-- target/board/generic_x86_64/README.txt | 7 +++--- target/board/generic_x86_64/device.mk | 23 ++++++++++++------- 3 files changed, 42 insertions(+), 14 deletions(-) diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 2d29241e5..bdc862e32 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -24,7 +24,28 @@ TARGET_2ND_ARCH_VARIANT := x86_64 include build/make/target/board/BoardConfigGsiCommon.mk -ifndef BUILDING_GSI +ifdef BUILDING_GSI +include build/make/target/board/BoardConfigGkiCommon.mk + +BOARD_KERNEL-5.4_BOOTIMAGE_PARTITION_SIZE := 67108864 +BOARD_KERNEL-5.4-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864 +BOARD_KERNEL-5.10_BOOTIMAGE_PARTITION_SIZE := 67108864 +BOARD_KERNEL-5.10-ALLSYMS_BOOTIMAGE_PARTITION_SIZE := 67108864 + +BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 + +BOARD_KERNEL_BINARIES := \ + kernel-5.4 \ + kernel-5.10 \ + +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +BOARD_KERNEL_BINARIES += \ + kernel-5.4-allsyms \ + kernel-5.10-allsyms \ + +endif + +else # BUILDING_GSI include build/make/target/board/BoardConfigEmuCommon.mk BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 @@ -41,4 +62,5 @@ WPA_SUPPLICANT_VERSION := VER_0_8_X WIFI_DRIVER_FW_PATH_PARAM := "/dev/null" WIFI_DRIVER_FW_PATH_STA := "/dev/null" WIFI_DRIVER_FW_PATH_AP := "/dev/null" -endif + +endif # BUILDING_GSI diff --git a/target/board/generic_x86_64/README.txt b/target/board/generic_x86_64/README.txt index 46b015bc3..8e515c436 100644 --- a/target/board/generic_x86_64/README.txt +++ b/target/board/generic_x86_64/README.txt @@ -1,8 +1,7 @@ -The "generic_x86_64" product defines a non-hardware-specific IA target -without a kernel or bootloader. +The "generic_x86_64" product defines a non-hardware-specific x86_64 target +without a bootloader. -It can be used to build the entire user-level system, and -will work with the IA version of the emulator, +It is also the target to build the generic kernel image (GKI). It is not a product "base class"; no other products inherit from it or use it in any way. diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk index 5ad008f11..e195bd3fa 100755 --- a/target/board/generic_x86_64/device.mk +++ b/target/board/generic_x86_64/device.mk @@ -14,14 +14,21 @@ # limitations under the License. # -PRODUCT_SOONG_NAMESPACES += device/generic/goldfish # for libwifi-hal-emu -PRODUCT_SOONG_NAMESPACES += device/generic/goldfish-opengl # for goldfish deps. +PRODUCT_COPY_FILES += \ + kernel/prebuilts/5.4/x86_64/kernel-5.4:kernel-5.4 \ + kernel/prebuilts/5.10/x86_64/kernel-5.10:kernel-5.10 \ + +$(call dist-for-goals, dist_files, kernel/prebuilts/5.4/x86_64/prebuilt-info.txt:kernel/5.4/prebuilt-info.txt) +$(call dist-for-goals, dist_files, kernel/prebuilts/5.10/x86_64/prebuilt-info.txt:kernel/5.10/prebuilt-info.txt) + +ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT))) +PRODUCT_COPY_FILES += \ + kernel/prebuilts/5.4/x86_64/kernel-5.4:kernel-5.4-allsyms \ + kernel/prebuilts/5.10/x86_64/kernel-5.10:kernel-5.10-allsyms \ -ifdef NET_ETH0_STARTONBOOT - PRODUCT_VENDOR_PROPERTIES += net.eth0.startonboot=1 endif -# Ensure we package the BIOS files too. -PRODUCT_HOST_PACKAGES += \ - bios.bin \ - vgabios-cirrus.bin \ +PRODUCT_BUILD_VENDOR_BOOT_IMAGE := false +PRODUCT_BUILD_RECOVERY_IMAGE := false + +$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_ramdisk.mk) From da5c795604c6f3f1c9276e61e1b78f6b1d2f26ac Mon Sep 17 00:00:00 2001 From: Ulya Trafimovich Date: Wed, 19 May 2021 17:59:39 +0100 Subject: [PATCH 3/5] Disable checks for more tests (to fix MTS builds). Bug: 132357300 Bug: 188648210 Fixes: 188907662 Test: lunch aosp_cf_x86_64_phone-userdebug && m mts && m gts Change-Id: Iae0ecac076b351b2da929bb455f00f03ece130bd (cherry picked from commit d5e6a7c6200c0bafad3ea5d1f6c62f37420b86db) --- core/dex_preopt_odex_install.mk | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk index bcbce8d7a..f365347f1 100644 --- a/core/dex_preopt_odex_install.mk +++ b/core/dex_preopt_odex_install.mk @@ -210,6 +210,9 @@ endif ifneq (,$(filter $(LOCAL_MODULE_TAGS),tests)) LOCAL_ENFORCE_USES_LIBRARIES := false endif +ifneq (,$(LOCAL_COMPATIBILITY_SUITE)) + LOCAL_ENFORCE_USES_LIBRARIES := false +endif # Disable the check if the app contains no java code. ifeq (,$(strip $(built_dex)$(my_prebuilt_src_file)$(LOCAL_SOONG_DEX_JAR))) From 2a3110cd73300a14e537078fb895e318e2527073 Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Tue, 18 May 2021 08:36:36 -0700 Subject: [PATCH 4/5] Add pm.dexopt.cmdline mapping in product config Test: boot Bug: 188655918 Merged-In: I527a71d0acec0ba6593b2da1fd13818cba3b4832 (cherry picked from commit ccb4cdc7f6c0b2037250f1ec488a4f86c54bd9e1) Change-Id: Iaf4d76c44e7bd46f78fd507cd5d6af26d691a7f1 --- target/product/runtime_libart.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/target/product/runtime_libart.mk b/target/product/runtime_libart.mk index 4f14ddd40..d65f180d7 100644 --- a/target/product/runtime_libart.mk +++ b/target/product/runtime_libart.mk @@ -99,6 +99,9 @@ endif # The install filter is speed-profile in order to enable the use of # profiles from the dex metadata files. Note that if a profile is not provided # or if it is empty speed-profile is equivalent to (quicken + empty app image). +# Note that `cmdline` is not strictly needed but it simplifies the management +# of compilation reason in the platform (as we have a unified, single path, +# without exceptions). PRODUCT_SYSTEM_PROPERTIES += \ pm.dexopt.post-boot?=extract \ pm.dexopt.install?=speed-profile \ @@ -110,6 +113,7 @@ PRODUCT_SYSTEM_PROPERTIES += \ pm.dexopt.bg-dexopt?=speed-profile \ pm.dexopt.ab-ota?=speed-profile \ pm.dexopt.inactive?=verify \ + pm.dexopt.cmdline?=verify \ pm.dexopt.shared?=speed # Pass file with the list of updatable boot class path packages to dex2oat. From 58a82ce77fefa2e4ec84030bf1b2e5343587b604 Mon Sep 17 00:00:00 2001 From: Chris Wailes Date: Tue, 18 May 2021 14:28:03 -0700 Subject: [PATCH 5/5] RESTRICT AUTOMERGE: Revert "Add the service-art JAR to the System Server classpath." This reverts commit efe5ca180cf4e8a5fb81d170e5e4934f03b571b7. Test: m Bug: 184281926 Change-Id: Ibbea99fe93010c52f7cdf601b1e361ce2076b83c Merged-In: Ibbea99fe93010c52f7cdf601b1e361ce2076b83c --- target/product/media_system.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/target/product/media_system.mk b/target/product/media_system.mk index 8160df295..15a6b598f 100644 --- a/target/product/media_system.mk +++ b/target/product/media_system.mk @@ -58,7 +58,6 @@ PRODUCT_SYSTEM_SERVER_JARS := \ # The values should be of the format : PRODUCT_UPDATABLE_SYSTEM_SERVER_JARS := \ com.android.appsearch:service-appsearch \ - com.android.art:service-art \ com.android.media:service-media-s \ com.android.permission:service-permission \ com.android.geotz:geotz \