Stop assuming that pvmfw.img can only be pre-built
Introduce the BOARD_USES_PVMFWIMAGE variable, similarly to all other
partitions, and use it where appropriate (in particular, where the
soon-to-be incorrect assumption that pvmfw.img could only be a pre-built
board image was made).
Bug: 199717422
Test: m ${ANDROID_PRODUCT_OUT}/pvmfw.img # with TARGET_PKVM_ENABLED=true
Change-Id: I8f4faa78c741d29b473303b521834387dbd48cd1
diff --git a/core/Makefile b/core/Makefile
index c51babb..caca065 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3477,7 +3477,7 @@
# -----------------------------------------------------------------
# Protected VM firmware image
-ifdef BOARD_PREBUILT_PVMFWIMAGE
+ifeq ($(BOARD_USES_PVMFWIMAGE),true)
INSTALLED_PVMFWIMAGE_TARGET := $(PRODUCT_OUT)/pvmfw.img
ifeq ($(BOARD_AVB_ENABLE),true)
@@ -3493,7 +3493,7 @@
cp $(BOARD_PREBUILT_PVMFWIMAGE) $@
endif
-endif # BOARD_PREBUILT_PVMFWIMAGE
+endif # BOARD_USES_PVMFWIMAGE
# Returns a list of image targets corresponding to the given list of partitions. For example, it
# returns "$(INSTALLED_PRODUCTIMAGE_TARGET)" for "product", or "$(INSTALLED_SYSTEMIMAGE_TARGET)
@@ -4668,7 +4668,7 @@
endif # BOARD_AVB_DTBO_KEY_PATH
endif # BOARD_AVB_ENABLE
endif # BOARD_PREBUILT_DTBOIMAGE
-ifdef BOARD_PREBUILT_PVMFWIMAGE
+ifeq ($(BOARD_USES_PVMFWIMAGE),true)
$(hide) echo "has_pvmfw=true" >> $@
ifeq ($(BOARD_AVB_ENABLE),true)
$(hide) echo "pvmfw_size=$(BOARD_PVMFWIMG_PARTITION_SIZE)" >> $@
@@ -4679,7 +4679,7 @@
$(hide) echo "avb_pvmfw_rollback_index_location=$(BOARD_AVB_PVMFW_ROLLBACK_INDEX_LOCATION)" >> $@
endif # BOARD_AVB_PVMFW_KEY_PATH
endif # BOARD_AVB_ENABLE
-endif # BOARD_PREBUILT_PVMFWIMAGE
+endif # BOARD_USES_PVMFWIMAGE
$(call dump-dynamic-partitions-info,$@)
@# VINTF checks
ifeq ($(PRODUCT_ENFORCE_VINTF_MANIFEST),true)