47 lines
1.0 KiB
Bash
Executable File
47 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
set -x
|
|
|
|
POSITIONAL_ARGS=()
|
|
|
|
QEMU_EXTRA=""
|
|
ENABLE_KVM=1
|
|
|
|
while [[ $# -gt 0 ]]; do
|
|
case $1 in
|
|
--test-usb-stick-xhci)
|
|
QEMU_EXTRA+=" -drive if=none,id=usbstick,format=raw,file=$2 \
|
|
-usb \
|
|
-device qemu-xhci,id=xhci \
|
|
-device usb-storage,bus=xhci.0,drive=usbstick,id=myusbstick0 \
|
|
-trace usb_xhci_* -D qemu-xhci-log.txt "
|
|
shift
|
|
shift
|
|
;;
|
|
--test-pci-ide)
|
|
QEMU_EXTRA+=" -drive file=$2,format=raw,if=ide,index=0,media=disk "
|
|
shift
|
|
shift
|
|
;;
|
|
--debug)
|
|
QEMU_EXTRA+=" -s -S "
|
|
ENABLE_KVM=0
|
|
shift
|
|
;;
|
|
--uefi)
|
|
QEMU_EXTRA+=" -drive if=pflash,format=raw,readonly=on,file=./OVMF/OVMF_CODE.fd \
|
|
-drive if=pflash,format=raw,snapshot=on,file=./OVMF/OVMF_VARS.fd "
|
|
shift
|
|
;;
|
|
*)
|
|
POSITIONAL_ARGS+=("$1")
|
|
shift
|
|
;;
|
|
esac
|
|
done
|
|
|
|
[ "$ENABLE_KVM" -eq 1 ] && KVM_FLAG="-enable-kvm" || KVM_FLAG=""
|
|
|
|
qemu-system-x86_64 -M pc -m 4G -serial stdio $KVM_FLAG \
|
|
-smp 4 -boot menu=on $QEMU_EXTRA "${POSITIONAL_ARGS[@]}"
|