Don't write vendor to dynamic_partitions_info.txt if it's unavailable.

If an AOSP target is built with dynamic partitions support but without
vendor.img available at build time, don't write 'vendor' to
dynamic_partitions_info.txt that will be used for building OTA packages.

We can't remove the partition from BoardConfig file, because the name
will be still needed in other places, such as generating the partition
metadata (super_empty.img). Otherwise manually flashing vendor.img at a
later point would require additional steps (e.g. `fastboot
create-logical-partition`).

Bug: 120852744
Test: `m -j dist` with and without vendor projects.
Change-Id: Ia1c3ed5bbea0255f1908958140dac97a1597586d
This commit is contained in:
Tao Bao 2018-12-19 10:39:34 -08:00
parent 00d74cc938
commit 943fa4c523
1 changed files with 8 additions and 4 deletions

View File

@ -3779,12 +3779,16 @@ ifdef BUILT_VENDOR_MATRIX
endif
ifneq ($(BOARD_SUPER_PARTITION_GROUPS),)
$(hide) echo "super_partition_groups=$(BOARD_SUPER_PARTITION_GROUPS)" > $(zip_root)/META/dynamic_partitions_info.txt
@# Remove 'vendor' from the group partition list if the image is not available. This should only
@# happen to AOSP targets built without vendor.img. We can't remove the partition from the
@# BoardConfig file, as it's still needed elsewhere (e.g. when creating super_empty.img).
$(foreach group,$(BOARD_SUPER_PARTITION_GROUPS), \
$(eval _group_partition_list := $(BOARD_$(call to-upper,$(group))_PARTITION_LIST)) \
$(if $(INSTALLED_VENDORIMAGE_TARGET),,$(eval _group_partition_list := $(filter-out vendor,$(_group_partition_list)))) \
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
$(if $(_group_partition_list), \
echo "$(group)_partition_list=$(_group_partition_list)" >> $(zip_root)/META/dynamic_partitions_info.txt;))
endif # BOARD_SUPER_PARTITION_GROUPS
$(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)
@# Zip everything up, preserving symlinks and placing META/ files first to