From 035c0ea0d408972be69793a31b15bd63d6f1a07c Mon Sep 17 00:00:00 2001 From: Yifan Hong Date: Fri, 4 Jan 2019 14:54:56 -0800 Subject: [PATCH] Allow devices launched with DAP to override super partition name. Test: on cuttlefish Bug: 111801737 Change-Id: Ibb9b7132898d3c871186ded01432de4419809e7c --- core/config.mk | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/core/config.mk b/core/config.mk index 59b8de00bc..a9b2f0e042 100644 --- a/core/config.mk +++ b/core/config.mk @@ -1066,19 +1066,25 @@ BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_META else # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS -# These should not be specified on devices launching with dynamic partition support. -ifdef BOARD_SUPER_PARTITION_BLOCK_DEVICES -$(error BOARD_SUPER_PARTITION_BLOCK_DEVICES can only be used if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS is true.) -endif -ifdef BOARD_SUPER_PARTITION_METADATA_DEVICE -$(error BOARD_SUPER_PARTITION_METADATA_DEVICE can only be used if PRODUCT_RETROFIT_DYNAMIC_PARTITIONS is true.) -endif - # For normal devices, we populate BOARD_SUPER_PARTITION_BLOCK_DEVICES so the # build can handle both cases consistently. -BOARD_SUPER_PARTITION_BLOCK_DEVICES := super +ifeq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),) BOARD_SUPER_PARTITION_METADATA_DEVICE := super -BOARD_SUPER_PARTITION_SUPER_DEVICE_SIZE := $(BOARD_SUPER_PARTITION_SIZE) +endif + +ifeq ($(BOARD_SUPER_PARTITION_BLOCK_DEVICES),) +BOARD_SUPER_PARTITION_BLOCK_DEVICES := $(BOARD_SUPER_PARTITION_METADATA_DEVICE) +endif + +# If only one super block device, default to super partition size. +ifeq ($(word 2,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)),) +BOARD_SUPER_PARTITION_$(call to-upper,$(strip $(BOARD_SUPER_PARTITION_BLOCK_DEVICES)))_DEVICE_SIZE ?= \ + $(BOARD_SUPER_PARTITION_SIZE) +endif + +ifneq ($(BOARD_SUPER_PARTITION_METADATA_DEVICE),super) +BOARD_KERNEL_CMDLINE += androidboot.super_partition=$(BOARD_SUPER_PARTITION_METADATA_DEVICE) +endif endif # PRODUCT_RETROFIT_DYNAMIC_PARTITIONS endif # BOARD_SUPER_PARTITION_SIZE @@ -1088,7 +1094,7 @@ endif # BOARD_SUPER_PARTITION_SIZE $(foreach device,$(call to-upper,$(BOARD_SUPER_PARTITION_BLOCK_DEVICES)), \ $(eval BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE := $(strip $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE))) \ $(if $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE),, \ - $(error $(BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty))) \ + $(error BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE must not be empty)) \ $(eval .KATI_READONLY := BOARD_SUPER_PARTITION_$(device)_DEVICE_SIZE)) endif # PRODUCT_BUILD_SUPER_PARTITION