From a5c832ebcb04e20f7c436f398f6cd9b5f7152340 Mon Sep 17 00:00:00 2001 From: "Christian I. Nilsson" Date: Mon, 12 Aug 2024 16:36:13 +0200 Subject: [PATCH] Update qemu testing, especially EFI usages Relates to #64 --- .gitignore | 3 +++ test_w_qemu.sh | 18 ++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 646ffdd..0dfbeaa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,5 @@ *.iso +*.iso.DIGESTS +*.iso.asc *.qcow2 +kvm_lxgentootest* diff --git a/test_w_qemu.sh b/test_w_qemu.sh index a7253f0..b8e6f4a 100755 --- a/test_w_qemu.sh +++ b/test_w_qemu.sh @@ -4,6 +4,9 @@ netscript="-nic user,model=virtio" DISK=kvm_lxgentootest.qcow2 disktype=" +-device virtio-blk-pci,drive=d1 +" +disktypeahci=" -device ahci,id=ahci -device ide-hd,drive=d1,bus=ahci.0 " @@ -29,7 +32,10 @@ netscript=" ;; useefi) USEEFI=YES - efibios="-bios usr/share/edk2.git/ovmf-x64/OVMF-pure-efi.fd" + cp /usr/share/edk2-ovmf/OVMF_VARS.fd kvm_lxgentootest_VARS.fd + #efibios="-smbios type=0,uefi=on -bios /usr/share/edk2-ovmf/OVMF_CODE.fd" + efibios="-drive if=pflash,unit=0,format=raw,readonly=on,file=/usr/share/edk2-ovmf/OVMF_CODE.fd \ + -drive if=pflash,unit=1,format=raw,file=kvm_lxgentootest_VARS.fd" ;; usenvme) disktype="-device nvme,drive=d1,id=nvme1,serial=nonoptionalsn001" @@ -39,6 +45,10 @@ netscript=" VNC="" VGA="-nographic" ;; + -cdrom) + shift + POSITIONAL+=("-drive file=$1,if=none,media=cdrom,id=cd1 -device ahci,id=achi0 -device ide-cd,bus=achi0.0,drive=cd1") + ;; -m) shift echo "Set memory to $1 gb" @@ -69,13 +79,13 @@ set -- "${POSITIONAL[@]}" # restore positional parameters [[ "$VNC" != "" ]] && (sleep 3; vncviewer :22) & set -x -jn=$(nproc) +jn=$(($(nproc)/2)) qemu-system-x86_64 -enable-kvm -M q35 -m $(($memorygb*1024)) -cpu host -smp $jn,cores=$jn,sockets=1 -name lxgentootest \ --drive id=d1,file=$DISK,format=qcow2,if=none,media=disk,index=1,cache=unsafe \ +-drive id=d1,file=$DISK,format=qcow2,if=none,media=disk,cache=unsafe \ ${disktype} \ $netscript \ -device i6300esb -action watchdog=reset \ --boot menu=on -usb ${VGA} ${VNC} \ +-usb ${VGA} ${VNC} \ ${efibios} \ $*