Refactor GSI BoardConfig.mk

The patch modifies the Legacy GSI to use BoardConfigGsiCommon.mk
instead of board config treble-common*.mk, and delete these
treble-common*.mk files.

After the patch, the GSI common board configs are in single file
BoardConfigGsiCommon.mk

The patch also includes:

- Moving `TARGET_COPY_OUT_VENDOR := vendor` to
  BoardConfigGsiCommon.mk, because GSI always contains no vendor
  contents.
- Configure the binder interface bitness explicitly.
- Unify the structure of each BoardConfig.mk.

Bug: 122282239
Test: compare the out folder between with and without the patch
Test: output files are all the same
Change-Id: Ie5901446920dda317dea848e6d5a7bbcf10a32cf
This commit is contained in:
SzuWei Lin 2019-01-03 12:49:55 +08:00
parent aee5affa6d
commit 1457b3fcbf
22 changed files with 49 additions and 145 deletions

View file

@ -20,8 +20,6 @@ BUILD_QEMU_IMAGES := true
# the GLES renderer disables itself if host GL acceleration isn't available.
USE_OPENGL_RENDERER := true
TARGET_COPY_OUT_VENDOR := vendor
# ~100 MB vendor image. Please adjust system image / vendor image sizes
# when finalizing them. The partition size needs to be a multiple of image
# block size: 4096.

View file

@ -6,6 +6,9 @@
include build/make/target/board/BoardConfigMainlineCommon.mk
# Enable system property split for Treble
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
# This flag is set by mainline but isn't desired for GSI.
BOARD_USES_SYSTEM_OTHER_ODEX :=
@ -14,9 +17,17 @@ BOARD_USES_SYSTEM_OTHER_ODEX :=
# we explicit specify this need below (even though it's the current default).
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
# system.img is always ext4 with sparse option
# GSI also includes make_f2fs to support userdata parition in f2fs
# for some devices
TARGET_USERIMAGES_USE_F2FS := true
# Enable dynamic system image size and reserved 64MB in it.
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864
# Generic AOSP image always requires separate vendor.img
TARGET_COPY_OUT_VENDOR := vendor
# Android Verified Boot (AVB):
# Set AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (--flag 2) in
# vbmeta.img to disable AVB verification.

View file

@ -14,7 +14,7 @@
# limitations under the License.
#
include build/make/target/board/treble_common_64.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a

View file

@ -14,7 +14,7 @@
# limitations under the License.
#
include build/make/target/board/treble_common_64.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
@ -28,7 +28,7 @@ TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := generic
# Enable A/B update
# Enable System-as-Root
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

View file

@ -14,10 +14,13 @@
# limitations under the License.
#
include build/make/target/board/treble_common_32.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon
TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_VARIANT := generic
# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
TARGET_USES_64_BIT_BINDER := false

View file

@ -14,7 +14,7 @@
# limitations under the License.
#
include build/make/target/board/treble_common_32.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_ARCH := arm
TARGET_ARCH_VARIANT := armv7-a-neon
@ -22,7 +22,10 @@ TARGET_CPU_ABI := armeabi-v7a
TARGET_CPU_ABI2 := armeabi
TARGET_CPU_VARIANT := generic
# Enable A/B update
# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
TARGET_USES_64_BIT_BINDER := false
# Enable System-as-Root
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

View file

@ -14,7 +14,7 @@
# limitations under the License.
#
include build/make/target/board/treble_common_64.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_CPU_ABI := x86_64
TARGET_ARCH := x86_64

View file

@ -14,7 +14,7 @@
# limitations under the License.
#
include build/make/target/board/treble_common_64.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_CPU_ABI := x86_64
TARGET_ARCH := x86_64
@ -24,11 +24,11 @@ TARGET_2ND_CPU_ABI := x86
TARGET_2ND_ARCH := x86
TARGET_2ND_ARCH_VARIANT := x86_64
# Enable System-as-Root
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
# Set this to create /cache mount point for non-A/B devices that mounts /cache.
# The partition size doesn't matter, just to make build pass.
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216
# Enable A/B update
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

View file

@ -14,8 +14,11 @@
# limitations under the License.
#
include build/make/target/board/treble_common_32.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_CPU_ABI := x86
TARGET_ARCH := x86
TARGET_ARCH_VARIANT := x86
# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
TARGET_USES_64_BIT_BINDER := false

View file

@ -14,17 +14,20 @@
# limitations under the License.
#
include build/make/target/board/treble_common_32.mk
include build/make/target/board/BoardConfigGsiCommon.mk
TARGET_CPU_ABI := x86
TARGET_ARCH := x86
TARGET_ARCH_VARIANT := x86
# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
TARGET_USES_64_BIT_BINDER := false
# Enable System-as-Root
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
# Set this to create /cache mount point for non-A/B devices that mounts /cache.
# The partition size doesn't matter, just to make build pass.
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_CACHEIMAGE_PARTITION_SIZE := 16777216
# Enable A/B update
TARGET_NO_RECOVERY := true
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true

View file

@ -1,69 +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.
#
# Common boardconfig settings for generic AOSP products targetting mobile
# (phone/table) devices.
# VNDK
BOARD_VNDK_VERSION := current
# Properties
TARGET_SYSTEM_PROP := build/make/target/board/treble_system.prop
BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true
# Bootloader, kernel and recovery are not part of generic AOSP image
TARGET_NO_BOOTLOADER := true
TARGET_NO_KERNEL := true
# system.img is always ext4 with sparse option
# GSI also includes make_f2fs to support userdata parition in f2fs
# for some devices
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false
# Enable dynamic system image size and reserved 64MB in it.
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864
# Generic AOSP image always requires separate vendor.img
TARGET_COPY_OUT_VENDOR := vendor
# Android generic system image always create metadata partition
BOARD_USES_METADATA_PARTITION := true
# Set emulator framebuffer display device buffer count to 3
NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
# Audio
USE_XML_AUDIO_POLICY_CONF := 1
# Android Verified Boot (AVB):
# 1) Sets BOARD_AVB_ENABLE to sign the GSI image.
# 2) Sets AVB_VBMETA_IMAGE_FLAGS_VERIFICATION_DISABLED (--flag 2) in
# vbmeta.img to disable AVB verification.
#
# To disable AVB for GSI, use the vbmeta.img and the GSI together.
# To enable AVB for GSI, include the GSI public key into the device-specific
# vbmeta.img.
BOARD_AVB_ENABLE := true
BOARD_AVB_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flag 2
# Enable chain partition for system.
BOARD_AVB_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
BOARD_AVB_SYSTEM_ALGORITHM := SHA256_RSA2048
BOARD_AVB_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 1

View file

@ -1,20 +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.
#
include build/make/target/board/treble_common.mk
# Legacy GSI keeps 32 bits binder for 32 bits CPU Arch
TARGET_USES_64_BIT_BINDER := false

View file

@ -1,20 +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.
#
include build/make/target/board/treble_common.mk
# Enable 64-bits binder
TARGET_USES_64_BIT_BINDER := true

View file

@ -1,8 +0,0 @@
# GSI always generate dex pre-opt in system image
ro.cp_system_other_odex=0
# GSI always disables adb authentication
ro.adb.secure=0
# TODO(b/78105955): disable privapp_permissions checking before the bug solved
ro.control_privapp_permissions=disable

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
include build/make/target/product/treble_common_64.mk

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
# aosp_arm64_ab-userdebug is a Legacy GSI for the devices with:
# - ARM 64 bits user space

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
include build/make/target/product/treble_common_32.mk

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
# aosp_arm_ab-userdebug is a Legacy GSI for the devices with:
# - ARM 32 bits user space

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
include build/make/target/product/treble_common_64.mk

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
# aosp_x86_64_ab-userdebug is a Legacy GSI for the devices with:
# - x86 64 bits user space

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
include build/make/target/product/treble_common_32.mk

View file

@ -17,7 +17,7 @@
# 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.
# gsi_system.prop.
# aosp_x86_ab-userdebug is a Legacy GSI for the devices with:
# - x86 32 bits user space