Makefile: Add support for custom VM images
Add a Make flags allowing the user to pass a custom VM image. If not
passed, the infrastructure defaults to using the host image, the
previous behavior. This will become necessary when booting VMs in
protected mode as pvmfw will expect an AVB-signed image (while the host
image is not).
Bug: 198568262
Test: make VM_IMAGE=<...> test-crosvm
Change-Id: I140d8632128a9bf0ea816d54790b5e3e25a6585a
diff --git a/Makefile b/Makefile
index dcf9103..717a143 100644
--- a/Makefile
+++ b/Makefile
@@ -156,6 +156,10 @@
@echo ' test-kut - runs all kvm-unit-tests in qemu-aarch64 simulated environment'
@echo ' test-list - lists all test targets'
@echo ''
+ @echo 'Test Parameters:'
+ @echo ' VM_IMAGE - path to an image to be used by the VMM to boot the VM'
+ @echo ' (default: uses the host image)'
+ @echo ''
@echo 'Test Flags:'
@echo ' VERBOSE=[0|1] - prints the verbose output of the scripts running the test'
@echo ' (default: 0)'
@@ -431,6 +435,8 @@
CROSVM_HELLOWORLD_TESTS := $(addprefix test-crosvm-helloworld-,$(KVM_MODES))
+VM_IMAGE ?= $(KERNEL_IMAGE)
+
.PHONY: test-crosvm-helloworld
test-crosvm-helloworld: $(CROSVM_HELLOWORLD_TESTS)
@@ -443,7 +449,7 @@
$(CROSVM_HELLOWORLD_TESTS): RUN_TEST_QEMU_ARGS = \
-s 4 \
-R $(SCRIPTS_DIR)/crosvm/helloworld/guest.sh \
- -R $(KERNEL_IMAGE) \
+ -R $(VM_IMAGE) \
-R $(PREBUILTS_ROOTFS_EXT4) \
-R $(PREBUILTS_CROSVM_EXT4)
$(CROSVM_HELLOWORLD_TESTS): RUN_TEST_TIMEOUT := 300s