[kvm-unit-tests PATCH v2 10/10] x86 UEFI: Make _NO_FILE_4Uhere_ work w/ BOOTX64.EFI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marc Orr <marcorr@xxxxxxxxxx>

The `_NO_FILE_4Uhere_` test case is used by the runner scripts to verify
QEMU's configuration. Make it work with EFI/BOOT/BOOTX64.EFI by compling
a minimal EFI binary, called dummy.c that returns immediately.

Signed-off-by: Marc Orr <marcorr@xxxxxxxxxx>
---
 scripts/runtime.bash |  2 +-
 x86/efi/run          | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/scripts/runtime.bash b/scripts/runtime.bash
index 228a207..bb89a53 100644
--- a/scripts/runtime.bash
+++ b/scripts/runtime.bash
@@ -132,7 +132,7 @@ function run()
 
     last_line=$(premature_failure > >(tail -1)) && {
         skip=true
-        if [ "${TARGET_EFI}" == "y" ] && [[ "${last_line}" =~ "Reset" ]]; then
+        if [ "${TARGET_EFI}" == "y" ] && [[ "${last_line}" =~ "enabling apic" ]]; then
             skip=false
         fi
         if [ ${skip} == true ]; then
diff --git a/x86/efi/run b/x86/efi/run
index a888979..834cd90 100755
--- a/x86/efi/run
+++ b/x86/efi/run
@@ -39,6 +39,18 @@ shift 1
 mkdir -p "$EFI_CASE_DIR"
 if [ "$EFI_CASE" != "_NO_FILE_4Uhere_" ]; then
 	cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_CASE_BINARY"
+else
+	if ! [ -f "$EFI_CASE_BINARY" ]; then
+		cat <<EOF >$EFI_SRC/efi/dummy.c
+int main(int argc, char **argv)
+{
+	return 0;
+}
+EOF
+		make "$EFI_SRC/efi/dummy.efi"
+		cp "$EFI_SRC/efi/dummy.efi" "$EFI_CASE_BINARY"
+		rm -f $EFI_SRC/efi/dummy*
+	fi
 fi
 
 # Run test case with 256MiB QEMU memory. QEMU default memory size is 128MiB.
-- 
2.33.0




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux