Merge "Really mark sdk_addon as PHONY to fix `m snod`"
diff --git a/core/Makefile b/core/Makefile
index 9dbf6e4..6721757 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -2941,11 +2941,12 @@
   --metadata-slots $(if $(1),2,1) \
   --device-size $(BOARD_SUPER_PARTITION_SIZE) \
   $(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \
-    --group $(group):$(BOARD_$(call to-upper,$(group))_SIZE) \
+    --group $(group)$(1):$(BOARD_$(call to-upper,$(group))_SIZE) \
+    $(if $(1), --group $(group)_b:$(BOARD_$(call to-upper,$(group))_SIZE)) \
     $(foreach name,$(BOARD_$(call to-upper,$(group))_PARTITION_LIST), \
-      --partition $(name)$(1):readonly:$(if $(2),$(call read-size-of-partitions,$(name)),0):$(group) \
+      --partition $(name)$(1):readonly:$(if $(2),$(call read-size-of-partitions,$(name)),0):$(group)$(1) \
       $(if $(2), --image $(name)$(1)=$(call images-for-partitions,$(name))) \
-      $(if $(1), --partition $(name)_b:readonly:0:$(group)) \
+      $(if $(1), --partition $(name)_b:readonly:0:$(group)_b) \
   ))
 endef
 
@@ -3660,6 +3661,13 @@
 	$(hide) echo $(call build-superimage-target-args,$(if $(filter true,$(AB_OTA_UPDATER)),_a,)) \
 	    >> $(zip_root)/META/misc_info.txt
 endif
+ifneq ($(BOARD_SUPER_PARTITION_GROUPS),)
+	$(hide) echo "super_partition_groups=$(BOARD_SUPER_PARTITION_GROUPS)" > $(zip_root)/META/dynamic_partitions_info.txt
+	$(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \
+	    echo "$(group)_size=$(BOARD_$(call to-upper,$(group))_SIZE)" >> $(zip_root)/META/dynamic_partitions_info.txt; \
+	    $(if $(BOARD_$(call to-upper,$(group))_PARTITION_LIST), \
+	        echo "$(group)_partition_list=$(BOARD_$(call to-upper,$(group))_PARTITION_LIST)" >> $(zip_root)/META/dynamic_partitions_info.txt;))
+endif
 
 	$(hide) PATH=$(foreach p,$(INTERNAL_USERIMAGES_BINARY_PATHS),$(p):)$$PATH MKBOOTIMG=$(MKBOOTIMG) \
 	    build/make/tools/releasetools/add_img_to_target_files -a -v -p $(HOST_OUT) $(zip_root)
diff --git a/core/config.mk b/core/config.mk
index 0e4e1fb..3289a89 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -991,11 +991,11 @@
 # For each group in BOARD_SUPER_PARTITION_GROUPS, a BOARD_{GROUP}_SIZE and
 # BOARD_{GROUP}_PARTITION_PARTITION_LIST may be defined.
 #     - BOARD_{GROUP}_SIZE: The maximum sum of sizes of all partitions in the group.
-#       If empty, no limit is enforced on the sum of sizes for this group.
+#       Must not be empty.
 #     - BOARD_{GROUP}_PARTITION_PARTITION_LIST: the list of partitions that belongs to this group.
 #       If empty, no partitions belong to this group, and the sum of sizes is effectively 0.
 $(foreach group,$(call to-upper,$(BOARD_SUPER_PARTITION_GROUPS)), \
-    $(eval BOARD_$(group)_SIZE ?=) \
+    $(if $(BOARD_$(group)_SIZE),,$(error BOARD_$(group)_SIZE must not be empty)) \
     $(eval .KATI_READONLY := BOARD_$(group)_SIZE) \
     $(eval BOARD_$(group)_PARTITION_LIST ?=) \
     $(eval .KATI_READONLY := BOARD_$(group)_PARTITION_LIST) \