g12: Refactor partition flags
authorSebastiano Barezzi <barezzisebastiano@gmail.com>
Wed, 20 Apr 2022 12:42:18 +0000 (14:42 +0200)
committerBruno Martins <bgcngm@gmail.com>
Mon, 4 Jul 2022 19:17:13 +0000 (20:17 +0100)
* Set file system type and copy out for each partition
* Reorder flags
* Unset PRODUCT_BUILD_SUPER_PARTITION as it defaults to the value
  of PRODUCT_USE_DYNAMIC_PARTITIONS

Change-Id: Ie2a3ec5a0fec79a07c79d3f9f633c11f4e40a433

BoardConfigCommon.mk
g12.mk

index ca89a1522be22e229a7ba686ca66ac9acba6b42c..9f952194c5532c1da165938052e3074eb2b4bc10 100644 (file)
@@ -70,12 +70,17 @@ TARGET_LMKD_STATS_LOG := true
 BOARD_USES_METADATA_PARTITION := true
 
 ## Partitions
-# Dynamic
-BOARD_AMLOGIC_DYNAMIC_PARTITIONS_PARTITION_LIST := odm product system system_ext vendor
+CORE_PARTITIONS := system vendor
+ADDITIONAL_PARTITIONS := odm product system_ext
+ALL_PARTITIONS := $(CORE_PARTITIONS) $(ADDITIONAL_PARTITIONS)
+
+BOARD_AMLOGIC_DYNAMIC_PARTITIONS_PARTITION_LIST := $(ALL_PARTITIONS)
 BOARD_AMLOGIC_DYNAMIC_PARTITIONS_SIZE := 1673527296 # (BOARD_SUPER_PARTITION_SIZE - "Reasonable Overhead of 4 MiB" 4194304)
+BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true
 BOARD_SUPER_PARTITION_GROUPS := amlogic_dynamic_partitions
+BOARD_SUPER_PARTITION_SIZE := 1677721600
+BUILDING_SUPER_EMPTY_IMAGE := true
 
-# Reservations
 ifneq ($(WITH_GMS),true)
 BOARD_PRODUCTIMAGE_PARTITION_RESERVED_SIZE := 15000000
 BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 626000000
@@ -83,28 +88,18 @@ BOARD_SYSTEM_EXTIMAGE_PARTITION_RESERVED_SIZE := 15000000
 endif
 BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 5000000
 
-# Sizes
+$(foreach p, $(call to-upper, $(ALL_PARTITIONS)), \
+    $(eval BOARD_$(p)IMAGE_FILE_SYSTEM_TYPE := ext4) \
+    $(eval TARGET_COPY_OUT_$(p) := $(call to-lower, $(p))))
+
 BOARD_BOOTIMAGE_PARTITION_SIZE := 16777216
+BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_CACHEIMAGE_PARTITION_SIZE := 838860800
 BOARD_DTBOIMG_PARTITION_SIZE := 2097152
 BOARD_FLASH_BLOCK_SIZE := 131072
+BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
 BOARD_USERDATAIMAGE_PARTITION_SIZE := 4896849920
 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 25165824
-BOARD_SUPER_PARTITION_SIZE := 1677721600
-
-# TARGET_COPY_OUT_$PARTITION
-TARGET_COPY_OUT_ODM := odm
-TARGET_COPY_OUT_PRODUCT := product
-TARGET_COPY_OUT_SYSTEM_EXT := system_ext
-TARGET_COPY_OUT_VENDOR := vendor
-
-# Types
-BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
-BOARD_ODMIMAGE_FILE_SYSTEM_TYPE := ext4
-BOARD_PRODUCTIMAGE_FILE_SYSTEM_TYPE := ext4
-BOARD_SYSTEM_EXTIMAGE_FILE_SYSTEM_TYPE := ext4
-BOARD_USERDATAIMAGE_FILE_SYSTEM_TYPE := ext4
-BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
 TARGET_USERIMAGES_USE_EXT4 := true
 
 ## Properties
diff --git a/g12.mk b/g12.mk
index 9da077b45f8a5f94f1157dd3eb85c122e34849d4..95b41b416961748906e54f0ced9dae2f5af81264 100644 (file)
--- a/g12.mk
+++ b/g12.mk
@@ -178,9 +178,6 @@ DEVICE_PACKAGE_OVERLAYS += \
 PRODUCT_ENFORCE_RRO_TARGETS := *
 
 ## Partitions
-BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT  := true
-BUILDING_SUPER_EMPTY_IMAGE := true
-PRODUCT_BUILD_SUPER_PARTITION := true
 PRODUCT_USE_DYNAMIC_PARTITIONS := true
 
 ## Permissions