Makefile: Add support for custom crosvm archives

Allow the user to pass a custom cvd-host_package.tar.gz to generate the
crosvm image instead of relying on the pre-built version, and
automatically package it into its own image. Use a file distinct from
the image packaging the pre-built archive to avoid confusing Make. The
user is expected to use it as follows:

    make CROSVM_TAR_GZ=<...>/cvd-host_package.tar.gz test-crosvm-X

Which allows running cutting-edge versions of crosvm and friends in this
testing infrastructure. To do so, the archive should be generated from
the Android source:

    lunch aosp_cf_arm64_phone-userdebug
    m hosttar

and CROSVM_TAR_GZ can then be set to

    $(AOSP)/out/soong/host/linux_bionic-arm64/cvd-host_package.tar.gz

Note that successive calls to make using the same CROSVM_TAR_GZ will
only conditionally re-build the image if the archive has changed. In the
unlikely case where more than one custom archive is intended to be used,
the user is expected to manually manage the images.

Bug: 198568262
Test: make CROSVM_TAR_GZ=<...>
Change-Id: Idf747ddc7a2bf81ae5ee7b63061bdcea2300a69b
diff --git a/Makefile b/Makefile
index b81ffcb..47bdee5 100644
--- a/Makefile
+++ b/Makefile
@@ -157,6 +157,8 @@
 	@echo '   test-list            - lists all test targets'
 	@echo ''
 	@echo 'Test Parameters:'
+	@echo '   CROSVM_TAR_GZ        - path to a custom cvd-host_package.tar.gz'
+	@echo '                          (default: uses a pre-built version)'
 	@echo '   VM_IMAGE             - path to an image to be used by the VMM to boot the VM'
 	@echo '                          (default: uses the host image)'
 	@echo ''
@@ -313,8 +315,12 @@
 PREBUILTS_QEMU_ROM := prebuilts/linux-aarch64/images/efi-virtio.rom
 PREBUILTS_QEMU_BIN := prebuilts/linux-x86/qemu
 
+ifeq ($(CROSVM_TAR_GZ),)
 CROSVM_TAR_GZ := $(PREBUILTS_CROSVM_TAR_GZ)
+CROSVM_EXT4 := $(OUT_DIR)/images/prebuilt-crosvm.ext4
+else
 CROSVM_EXT4 := $(OUT_DIR)/images/crosvm.ext4
+endif
 
 .PHONY:update-prebuilts
 update-prebuilts: \