From 79bfba055b2b5eb8faf230a389fc59b8fc9b0c2e Mon Sep 17 00:00:00 2001 From: SzuWei Lin Date: Wed, 18 Jul 2018 18:06:25 +0800 Subject: [PATCH] Enable dyanmic image size for GSI The original size number of GSI are fixed size. Change to give size by the content with appending 64M bytes space. Bug: 71970853 Test: `make systemimage` and check the out system.img Change-Id: I345f5e22c2fee7b553fc3337e9bff0ba28f579e1 Merged-In: I345f5e22c2fee7b553fc3337e9bff0ba28f579e1 --- target/board/BoardConfigGsiCommon.mk | 3 +++ target/board/generic/BoardConfig.mk | 2 -- target/board/generic_arm64/BoardConfig.mk | 2 -- target/board/generic_arm_a/BoardConfig.mk | 3 --- target/board/generic_arm_ab/BoardConfig.mk | 3 --- target/board/generic_x86/BoardConfig.mk | 1 - target/board/generic_x86_64/BoardConfig.mk | 1 - target/board/treble_common.mk | 3 +++ target/board/treble_common_32.mk | 4 ---- target/board/treble_common_64.mk | 3 --- target/product/aosp_arm.mk | 3 +++ target/product/aosp_arm64.mk | 3 +++ target/product/aosp_x86.mk | 3 +++ target/product/aosp_x86_64.mk | 3 +++ target/product/treble_common.mk | 3 +++ 15 files changed, 21 insertions(+), 19 deletions(-) diff --git a/target/board/BoardConfigGsiCommon.mk b/target/board/BoardConfigGsiCommon.mk index 24614dedc..e91051493 100644 --- a/target/board/BoardConfigGsiCommon.mk +++ b/target/board/BoardConfigGsiCommon.mk @@ -10,6 +10,9 @@ TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true TARGET_USES_MKE2FS := true +# Enable dyanmic system image size and reserved 64MB in it. +BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864 + # Android Verified Boot (AVB): # Builds a special vbmeta.img that disables AVB verification. # Otherwise, AVB will prevent the device from booting the generic system.img. diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 8113ae37b..3577c2189 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -48,6 +48,4 @@ TARGET_CPU_ABI2 := armeabi include build/make/target/board/BoardConfigEmuCommon.mk include build/make/target/board/BoardConfigGsiCommon.mk -# Partition size is default 1.5GB (1536MB) for 64 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index ad6d229aa..519bafe58 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -55,8 +55,6 @@ endif include build/make/target/board/BoardConfigEmuCommon.mk include build/make/target/board/BoardConfigGsiCommon.mk -# Partition size is default 1.5GB (1536MB) for 64 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 # Emulator system image is going to be used as GSI and some vendor still hasn't diff --git a/target/board/generic_arm_a/BoardConfig.mk b/target/board/generic_arm_a/BoardConfig.mk index d93074924..57a5196a9 100644 --- a/target/board/generic_arm_a/BoardConfig.mk +++ b/target/board/generic_arm_a/BoardConfig.mk @@ -16,9 +16,6 @@ include build/make/target/board/treble_common_32.mk -# Overwrite the setting in treble_common_32.mk for non-A/B arm GSI -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368 # 768MB - TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a diff --git a/target/board/generic_arm_ab/BoardConfig.mk b/target/board/generic_arm_ab/BoardConfig.mk index 051a4f778..7d9ea9c0e 100644 --- a/target/board/generic_arm_ab/BoardConfig.mk +++ b/target/board/generic_arm_ab/BoardConfig.mk @@ -16,9 +16,6 @@ include build/make/target/board/treble_common_32.mk -# Overwrite the setting in treble_common_32.mk for non-A/B arm GSI -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 805306368 # 768MB - TARGET_ARCH := arm TARGET_ARCH_VARIANT := armv7-a-neon TARGET_CPU_ABI := armeabi-v7a diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index c8ba2cf54..1e6a38c45 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -23,5 +23,4 @@ TARGET_PRELINK_MODULE := false include build/make/target/board/BoardConfigEmuCommon.mk include build/make/target/board/BoardConfigGsiCommon.mk -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 1bae7f822..9bd024310 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -27,5 +27,4 @@ TARGET_PRELINK_MODULE := false include build/make/target/board/BoardConfigEmuCommon.mk include build/make/target/board/BoardConfigGsiCommon.mk -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2.5 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 diff --git a/target/board/treble_common.mk b/target/board/treble_common.mk index 187022edb..49b97be96 100644 --- a/target/board/treble_common.mk +++ b/target/board/treble_common.mk @@ -33,6 +33,9 @@ TARGET_USERIMAGES_USE_EXT4 := true TARGET_USERIMAGES_SPARSE_EXT_DISABLED := false TARGET_USES_MKE2FS := true +# Enable dyanmic 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 diff --git a/target/board/treble_common_32.mk b/target/board/treble_common_32.mk index dbe089948..b66c41eb0 100644 --- a/target/board/treble_common_32.mk +++ b/target/board/treble_common_32.mk @@ -15,7 +15,3 @@ # include build/make/target/board/treble_common.mk - -# Partition size defaults to 1 GB (1024 MB) for 32-bit products. It can -# be overwritten in specific BoardConfig.mk, if so desired. -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824 diff --git a/target/board/treble_common_64.mk b/target/board/treble_common_64.mk index 0a6eb172d..8980dfde1 100644 --- a/target/board/treble_common_64.mk +++ b/target/board/treble_common_64.mk @@ -18,6 +18,3 @@ include build/make/target/board/treble_common.mk # Enable 64-bits binder TARGET_USES_64_BIT_BINDER := true - -# Partition size is default 1.5GB (1536MB) for 64 bits projects -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736 diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index a052b3a4d..44d971ec9 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -34,6 +34,9 @@ PRODUCT_COPY_FILES += \ 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 diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index efbc300b1..185b8452e 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -51,6 +51,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) include $(SRC_TARGET_DIR)/product/emulator.mk +# Enable dynamic partition size +PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true + # Enable A/B update AB_OTA_UPDATER := true AB_OTA_PARTITIONS := system diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index 7929a3ef2..c7309a3ce 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -35,6 +35,9 @@ PRODUCT_COPY_FILES += \ 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 diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 5a934a90e..72d097ab7 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -48,6 +48,9 @@ $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_x86_64/device.mk) include $(SRC_TARGET_DIR)/product/emulator.mk +# Enable dynamic partition size +PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true + # Enable A/B update AB_OTA_UPDATER := true AB_OTA_PARTITIONS := system diff --git a/target/product/treble_common.mk b/target/product/treble_common.mk index 7e0e2ae47..b60849f53 100644 --- a/target/product/treble_common.mk +++ b/target/product/treble_common.mk @@ -23,6 +23,9 @@ $(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