[kvm-unit-tests PATCH v2 09/10] x86 UEFI: Improve Boot Speed

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

 



From: Zixuan Wang <zxwang42@xxxxxxxxx>

The previous runner script uses `startup.nsh` to specify the EFI
binaries. When a UEFI firmware sees this script, it waits 5 seconds for
user input before executing the script.

To remove this 5-second waiting, this commit drops the `startup.nsh`
script, and renames test case binaries as UEFI's default binary filename
`EFI/BOOT/BOOTX64.EFI`. This does not trigger the 5-second waiting.

This commit only fix the boot speed for x86/efi/run script. The
run-tests.sh will be fixed by the follow-up patch.

Signed-off-by: Zixuan Wang <zxwang42@xxxxxxxxx>
---
 x86/efi/run | 30 +++++++-----------------------
 1 file changed, 7 insertions(+), 23 deletions(-)

diff --git a/x86/efi/run b/x86/efi/run
index e6486ed..a888979 100755
--- a/x86/efi/run
+++ b/x86/efi/run
@@ -30,32 +30,16 @@ fi
 shift 1
 
 # Prepare EFI boot file system
-#   - Copy .efi file to host dir $EFI_TEST/$EFI_CASE/
+#   - Copy .efi file to host dir $EFI_TEST/$EFI_CASE/EFI/BOOT/BOOTX64.EFI
 #     This host dir will be loaded by QEMU as a FAT32 image
-#   - Make UEFI startup script that runs the .efi on boot
-mkdir -p "$EFI_TEST/$EFI_CASE/"
-if [ $EFI_CASE != "_NO_FILE_4Uhere_" ]; then
-  cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_TEST/$EFI_CASE/"
-else
-  touch "$EFI_TEST/$EFI_CASE/$EFI_CASE.efi"
-fi
+#   - UEFI firmware by default loads the file EFI/BOOT/BOOTX64.EFI
+: "${EFI_CASE_DIR:="$EFI_TEST/$EFI_CASE/EFI/BOOT"}"
+: "${EFI_CASE_BINARY:="$EFI_CASE_DIR/BOOTX64.EFI"}"
 
-pushd "$EFI_TEST/$EFI_CASE" || exit 2
-# 'startup.nsh' is the default script executed by UEFI on boot
-# Use this script to run the test binary automatically
-if [ $EFI_CASE != "_NO_FILE_4Uhere_" ]; then
-  cat << EOF >startup.nsh
-@echo -off
-fs0:
-"$EFI_CASE.efi"
-EOF
-else
-  cat << EOF >startup.nsh
-@echo -off
-reset -s
-EOF
+mkdir -p "$EFI_CASE_DIR"
+if [ "$EFI_CASE" != "_NO_FILE_4Uhere_" ]; then
+	cp "$EFI_SRC/$EFI_CASE.efi" "$EFI_CASE_BINARY"
 fi
-popd || exit 2
 
 # Run test case with 256MiB QEMU memory. QEMU default memory size is 128MiB.
 # After UEFI boot up and we call `LibMemoryMap()`, the largest consecutive
-- 
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