forked from openkylin/platform_build
emulator: support dynamic partitions
BUG: 125540538 Change-Id: I9d486f57ac4ec11b1bbe9ab97890d12441c3054e Merged-In: I9d486f57ac4ec11b1bbe9ab97890d12441c3054e
This commit is contained in:
parent
669a9dbd99
commit
c73e9b70dc
|
@ -4619,13 +4619,20 @@ dalvikfiles: $(INTERNAL_DALVIK_MODULES)
|
||||||
|
|
||||||
ifeq ($(BUILD_QEMU_IMAGES),true)
|
ifeq ($(BUILD_QEMU_IMAGES),true)
|
||||||
MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh
|
MK_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_qemu_image.sh
|
||||||
|
MK_COMBINE_QEMU_IMAGE_SH := device/generic/goldfish/tools/mk_combined_img.py
|
||||||
SGDISK_HOST := $(HOST_OUT_EXECUTABLES)/sgdisk
|
SGDISK_HOST := $(HOST_OUT_EXECUTABLES)/sgdisk
|
||||||
|
|
||||||
ifdef INSTALLED_SYSTEMIMAGE_TARGET
|
ifdef INSTALLED_SYSTEMIMAGE_TARGET
|
||||||
INSTALLED_QEMU_SYSTEMIMAGE := $(PRODUCT_OUT)/system-qemu.img
|
INSTALLED_QEMU_SYSTEMIMAGE := $(PRODUCT_OUT)/system-qemu.img
|
||||||
$(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_SYSTEMIMAGE_TARGET) $(MK_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG)
|
INSTALLED_SYSTEM_QEMU_CONFIG := $(PRODUCT_OUT)/system-qemu-config.txt
|
||||||
@echo Create system-qemu.img
|
$(INSTALLED_SYSTEM_QEMU_CONFIG): $(INSTALLED_SUPERIMAGE_TARGET) $(INSTALLED_VBMETAIMAGE_TARGET)
|
||||||
(export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); $(MK_QEMU_IMAGE_SH) $(INSTALLED_SYSTEMIMAGE_TARGET))
|
@echo "$(PRODUCT_OUT)/vbmeta.img vbmeta 1" > $@
|
||||||
|
@echo "$(INSTALLED_SUPERIMAGE_TARGET) super 2" >> $@
|
||||||
|
$(INSTALLED_QEMU_SYSTEMIMAGE): $(INSTALLED_VBMETAIMAGE_TARGET) $(MK_COMBINE_QEMU_IMAGE_SH) $(SGDISK_HOST) $(SIMG2IMG) \
|
||||||
|
$(INSTALLED_SUPERIMAGE_TARGET) $(INSTALLED_SYSTEM_QEMU_CONFIG)
|
||||||
|
@echo Create system-qemu.img now
|
||||||
|
(export SGDISK=$(SGDISK_HOST) SIMG2IMG=$(SIMG2IMG); \
|
||||||
|
$(MK_COMBINE_QEMU_IMAGE_SH) -i $(INSTALLED_SYSTEM_QEMU_CONFIG) -o $@)
|
||||||
|
|
||||||
systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE)
|
systemimage: $(INSTALLED_QEMU_SYSTEMIMAGE)
|
||||||
droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE)
|
droidcore: $(INSTALLED_QEMU_SYSTEMIMAGE)
|
||||||
|
@ -4667,17 +4674,17 @@ odmimage: $(INSTALLED_QEMU_ODMIMAGE)
|
||||||
droidcore: $(INSTALLED_QEMU_ODMIMAGE)
|
droidcore: $(INSTALLED_QEMU_ODMIMAGE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BOARD_AVB_ENABLE),true)
|
|
||||||
QEMU_VERIFIED_BOOT_PARAMS := $(PRODUCT_OUT)/VerifiedBootParams.textproto
|
QEMU_VERIFIED_BOOT_PARAMS := $(PRODUCT_OUT)/VerifiedBootParams.textproto
|
||||||
MK_VERIFIED_BOOT_KERNEL_CMDLINE_SH := device/generic/goldfish/tools/mk_verified_boot_params.sh
|
MK_VBMETA_BOOT_KERNEL_CMDLINE_SH := device/generic/goldfish/tools/mk_vbmeta_boot_params.sh
|
||||||
$(QEMU_VERIFIED_BOOT_PARAMS): $(INSTALLED_QEMU_SYSTEMIMAGE) $(MK_VERIFIED_BOOT_KERNEL_CMDLINE_SH) $(INSTALLED_VBMETAIMAGE_TARGET) $(SGDISK_HOST) $(AVBTOOL)
|
$(QEMU_VERIFIED_BOOT_PARAMS): $(INSTALLED_VBMETAIMAGE_TARGET) $(INSTALLED_SYSTEMIMAGE_TARGET) \
|
||||||
|
$(MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $(AVBTOOL)
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
(export SGDISK=$(SGDISK_HOST) AVBTOOL=$(AVBTOOL); $(MK_VERIFIED_BOOT_KERNEL_CMDLINE_SH) $(INSTALLED_VBMETAIMAGE_TARGET) $(INSTALLED_QEMU_SYSTEMIMAGE) $(QEMU_VERIFIED_BOOT_PARAMS))
|
(export AVBTOOL=$(AVBTOOL); $(MK_VBMETA_BOOT_KERNEL_CMDLINE_SH) $(INSTALLED_VBMETAIMAGE_TARGET) \
|
||||||
|
$(INSTALLED_SYSTEMIMAGE_TARGET) $(QEMU_VERIFIED_BOOT_PARAMS))
|
||||||
|
|
||||||
systemimage: $(QEMU_VERIFIED_BOOT_PARAMS)
|
systemimage: $(QEMU_VERIFIED_BOOT_PARAMS)
|
||||||
droidcore: $(QEMU_VERIFIED_BOOT_PARAMS)
|
droidcore: $(QEMU_VERIFIED_BOOT_PARAMS)
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
# -----------------------------------------------------------------
|
# -----------------------------------------------------------------
|
||||||
# The emulator package
|
# The emulator package
|
||||||
|
|
|
@ -23,15 +23,35 @@ USE_OPENGL_RENDERER := true
|
||||||
# Emulator doesn't support sparse image format.
|
# Emulator doesn't support sparse image format.
|
||||||
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
|
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
|
||||||
|
|
||||||
# ~140 MB vendor image. Please adjust system image / vendor image sizes
|
ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
|
||||||
# when finalizing them. The partition size needs to be a multiple of image
|
# emulator is Non-A/B device
|
||||||
# block size: 4096.
|
AB_OTA_UPDATER := false
|
||||||
BOARD_VENDORIMAGE_PARTITION_SIZE := 146800640
|
|
||||||
|
# emulator needs super.img
|
||||||
|
BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true
|
||||||
|
|
||||||
|
BOARD_EXT4_SHARE_DUP_BLOCKS := true
|
||||||
|
|
||||||
|
# 3G + header
|
||||||
|
BOARD_SUPER_PARTITION_SIZE := 3229614080
|
||||||
|
BOARD_SUPER_PARTITION_GROUPS := emulator_dynamic_partitions
|
||||||
|
BOARD_EMULATOR_DYNAMIC_PARTITIONS_PARTITION_LIST := \
|
||||||
|
system \
|
||||||
|
vendor
|
||||||
|
|
||||||
|
# 3G
|
||||||
|
BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE := 3221225472
|
||||||
|
else ifeq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true)
|
||||||
|
# Enable dynamic system image size and reserved 64MB in it.
|
||||||
|
BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864
|
||||||
|
BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 67108864
|
||||||
|
else
|
||||||
|
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472
|
||||||
|
BOARD_VENDORIMAGE_PARTITION_SIZE := 146800640
|
||||||
|
endif
|
||||||
|
|
||||||
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
|
BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
|
||||||
BOARD_FLASH_BLOCK_SIZE := 512
|
BOARD_FLASH_BLOCK_SIZE := 512
|
||||||
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
|
DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml
|
||||||
|
|
||||||
BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/common
|
BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/common
|
||||||
|
|
||||||
# TODO(b/125540538): Remove when emulator uses dynamic partitions
|
|
||||||
BOARD_BUILD_SYSTEM_ROOT_IMAGE := true
|
|
||||||
|
|
|
@ -29,8 +29,8 @@ TARGET_CPU_VARIANT := generic
|
||||||
TARGET_CPU_ABI := armeabi-v7a
|
TARGET_CPU_ABI := armeabi-v7a
|
||||||
TARGET_CPU_ABI2 := armeabi
|
TARGET_CPU_ABI2 := armeabi
|
||||||
|
|
||||||
include build/make/target/board/BoardConfigEmuCommon.mk
|
|
||||||
include build/make/target/board/BoardConfigGsiCommon.mk
|
include build/make/target/board/BoardConfigGsiCommon.mk
|
||||||
|
include build/make/target/board/BoardConfigEmuCommon.mk
|
||||||
|
|
||||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
|
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ TARGET_2ND_ARCH_VARIANT := armv8-a
|
||||||
TARGET_2ND_CPU_VARIANT := generic
|
TARGET_2ND_CPU_VARIANT := generic
|
||||||
endif
|
endif
|
||||||
|
|
||||||
include build/make/target/board/BoardConfigEmuCommon.mk
|
|
||||||
include build/make/target/board/BoardConfigGsiCommon.mk
|
include build/make/target/board/BoardConfigGsiCommon.mk
|
||||||
|
include build/make/target/board/BoardConfigEmuCommon.mk
|
||||||
|
|
||||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
|
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@ TARGET_ARCH_VARIANT := x86
|
||||||
|
|
||||||
TARGET_PRELINK_MODULE := false
|
TARGET_PRELINK_MODULE := false
|
||||||
|
|
||||||
include build/make/target/board/BoardConfigEmuCommon.mk
|
|
||||||
include build/make/target/board/BoardConfigGsiCommon.mk
|
include build/make/target/board/BoardConfigGsiCommon.mk
|
||||||
|
include build/make/target/board/BoardConfigEmuCommon.mk
|
||||||
|
|
||||||
# Resize to 4G to accomodate ASAN and CTS
|
# Resize to 4G to accomodate ASAN and CTS
|
||||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 4294967296
|
BOARD_USERDATAIMAGE_PARTITION_SIZE := 4294967296
|
||||||
|
|
|
@ -23,9 +23,8 @@ TARGET_2ND_ARCH := x86
|
||||||
TARGET_2ND_ARCH_VARIANT := x86_64
|
TARGET_2ND_ARCH_VARIANT := x86_64
|
||||||
|
|
||||||
TARGET_PRELINK_MODULE := false
|
TARGET_PRELINK_MODULE := false
|
||||||
|
|
||||||
include build/make/target/board/BoardConfigEmuCommon.mk
|
|
||||||
include build/make/target/board/BoardConfigGsiCommon.mk
|
include build/make/target/board/BoardConfigGsiCommon.mk
|
||||||
|
include build/make/target/board/BoardConfigEmuCommon.mk
|
||||||
|
|
||||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
|
BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ TARGET_TRANSLATE_2ND_ARCH := true
|
||||||
BUILD_BROKEN_DUP_RULES := true
|
BUILD_BROKEN_DUP_RULES := true
|
||||||
|
|
||||||
|
|
||||||
include build/make/target/board/BoardConfigEmuCommon.mk
|
|
||||||
include build/make/target/board/BoardConfigGsiCommon.mk
|
include build/make/target/board/BoardConfigGsiCommon.mk
|
||||||
|
include build/make/target/board/BoardConfigEmuCommon.mk
|
||||||
|
|
||||||
# Resize to 4G to accomodate ASAN and CTS
|
# Resize to 4G to accomodate ASAN and CTS
|
||||||
BOARD_USERDATAIMAGE_PARTITION_SIZE := 4294967296
|
BOARD_USERDATAIMAGE_PARTITION_SIZE := 4294967296
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||||
|
|
||||||
# The system image of aosp_arm-userdebug is a GSI for the devices with:
|
# The system image of aosp_arm-userdebug is a GSI for the devices with:
|
||||||
# - ARM 32 bits user space
|
# - ARM 32 bits user space
|
||||||
# - 64 bits binder interface
|
# - 64 bits binder interface
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||||
|
|
||||||
# The system image of aosp_arm64-userdebug is a GSI for the devices with:
|
# The system image of aosp_arm64-userdebug is a GSI for the devices with:
|
||||||
# - ARM 64 bits user space
|
# - ARM 64 bits user space
|
||||||
# - 64 bits binder interface
|
# - 64 bits binder interface
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||||
|
|
||||||
# The system image of aosp_x86-userdebug is a GSI for the devices with:
|
# The system image of aosp_x86-userdebug is a GSI for the devices with:
|
||||||
# - x86 32 bits user space
|
# - x86 32 bits user space
|
||||||
# - 64 bits binder interface
|
# - 64 bits binder interface
|
||||||
|
|
|
@ -14,6 +14,8 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||||
|
|
||||||
# The system image of aosp_x86_64-userdebug is a GSI for the devices with:
|
# The system image of aosp_x86_64-userdebug is a GSI for the devices with:
|
||||||
# - x86 64 bits user space
|
# - x86 64 bits user space
|
||||||
# - 64 bits binder interface
|
# - 64 bits binder interface
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
PRODUCT_USE_DYNAMIC_PARTITIONS := true
|
||||||
|
|
||||||
# aosp_x86 with arm libraries needed by binary translation.
|
# aosp_x86 with arm libraries needed by binary translation.
|
||||||
|
|
||||||
|
@ -31,13 +32,6 @@ include $(SRC_TARGET_DIR)/product/full_x86.mk
|
||||||
# Enable dynamic partition size
|
# Enable dynamic partition size
|
||||||
PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
|
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
|
# Needed by Pi newly launched device to pass VtsTrebleSysProp on GSI
|
||||||
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
|
PRODUCT_COMPATIBLE_PROPERTY_OVERRIDE := true
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue