Improve qemu_amd64.sh script

This commit is contained in:
2026-03-26 20:40:20 +01:00
parent fe33d98ef2
commit 032c5f71bd
2 changed files with 8 additions and 47 deletions

View File

@@ -9,22 +9,22 @@ QEMU_EXTRA=""
while [[ $# -gt 0 ]]; do while [[ $# -gt 0 ]]; do
case $1 in case $1 in
--test-usb-stick-xhci) --test-usb-stick-xhci)
QEMU_EXTRA="-drive if=none,id=usbstick,format=raw,file=$2 \ QEMU_EXTRA+=" -drive if=none,id=usbstick,format=raw,file=$2 \
-usb \ -usb \
-device qemu-xhci,id=xhci \ -device qemu-xhci,id=xhci \
-device usb-storage,bus=xhci.0,drive=usbstick \ -device usb-storage,bus=xhci.0,drive=usbstick \
-trace usb_xhci_* -D qemu-xhci-log.txt" -trace usb_xhci_* -D qemu-xhci-log.txt "
shift shift
shift shift
;; ;;
--test-pci-ide) --test-pci-ide)
QEMU_EXTRA="-hda $2" QEMU_EXTRA+=" -hda $2 "
shift shift
shift shift
;; ;;
-*|--*) --debug)
echo "Unknown option $1" QEMU_EXTRA+=" -s -S "
exit 1 shift
;; ;;
*) *)
POSITIONAL_ARGS+=("$1") POSITIONAL_ARGS+=("$1")
@@ -33,6 +33,5 @@ while [[ $# -gt 0 ]]; do
esac esac
done done
set -- "${POSITIONAL_ARGS[@]}" qemu-system-x86_64 -M pc -m 4G -serial stdio -enable-kvm \
-cdrom mop3.iso -smp 4 -boot d $QEMU_EXTRA "${POSITIONAL_ARGS[@]}"
qemu-system-x86_64 -M pc -m 4G -serial stdio -enable-kvm -cdrom mop3.iso -smp 4 -boot d $QEMU_EXTRA $@

View File

@@ -1,38 +0,0 @@
#!/bin/sh
set -x
POSITIONAL_ARGS=()
QEMU_EXTRA=""
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 \
-trace usb_xhci_* -D qemu-xhci-log.txt"
shift
shift
;;
--test-pci-ide)
QEMU_EXTRA="-hda $2"
shift
shift
;;
-*|--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1")
shift
;;
esac
done
set -- "${POSITIONAL_ARGS[@]}"
qemu-system-x86_64 -M pc -m 4G -serial stdio -cdrom mop3.iso -smp 1 -boot d -s -S $QEMU_EXTRA $@