Add generic board-agnostic pre-built pvmfw.img
Make use of the pvmfw.img-building AOSP framework to provide a common
default image instead of requiring boards to necessarily provide their
own but allow over-writing it through BOARD_PREBUILT_PVMFWIMAGE, if
desired.
Note: The Android Virtualization Framework requires the pvmfw partition.
Bug: 199717422
Test: m ${ANDROID_PRODUCT_OUT}/pvmfw.img
Change-Id: I5e06f08d6e22178e45254b7ab63acd3855d99a38
diff --git a/core/Makefile b/core/Makefile
index 8b3c9eb..3e11679 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -3479,9 +3479,12 @@
# Protected VM firmware image
ifeq ($(BOARD_USES_PVMFWIMAGE),true)
INSTALLED_PVMFWIMAGE_TARGET := $(PRODUCT_OUT)/pvmfw.img
+INTERNAL_PREBUILT_PVMFWIMAGE := packages/modules/Virtualization/pvmfw/pvmfw.img
ifdef BOARD_PREBUILT_PVMFWIMAGE
BUILT_PVMFWIMAGE_TARGET := $(BOARD_PREBUILT_PVMFWIMAGE)
+else ifeq ($(BUILDING_PVMFW_IMAGE),true)
+BUILT_PVMFWIMAGE_TARGET := $(INTERNAL_PREBUILT_PVMFWIMAGE)
endif
ifeq ($(BOARD_AVB_ENABLE),true)