VM script for tests
authorRalph Ronnquist <rrq@rrq.au>
Mon, 5 Feb 2024 23:59:52 +0000 (10:59 +1100)
committerRalph Ronnquist <rrq@rrq.au>
Mon, 5 Feb 2024 23:59:52 +0000 (10:59 +1100)
run.sh [new file with mode: 0755]

diff --git a/run.sh b/run.sh
new file mode 100755 (executable)
index 0000000..3f19b19
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+DISK=disk.raw
+CD=$1
+PCODE=/usr/share/OVMF/OVMF_CODE_4M.fd
+PVARS=/usr/share/OVMF/OVMF_VARS_4M.fd
+cp $PVARS pvars.bin
+EFI="
+    -drive if=pflash,readonly=on,format=raw,file=$PCODE
+    -drive if=pflash,readonly=off,format=raw,file=pvars.bin
+"
+NET="-nic vde,sock=/run/vde.ctl,model=e1000,mac=06:38:d0:34:20:d2"
+QEMU=qemu-system-x86_64
+[ -z "${CD##*i386*}" ] && QEMU=qemu-system-i386
+exec $QEMU -name "${CD%.img}" -m 2G -M pc,accel=kvm -cpu host \
+    -drive media=disk,format=raw,file=$CD \
+    -drive media=disk,format=raw,file=$DISK \
+    -serial mon:stdio -echr 0x1c -vga std \
+    $NET
+#    -boot menu=on,splash-time=60000 \
+#    -virtfs local,path=FS,mount_tag=FS,security_model=passthrough \
+#    -kernel FS/vmlinuz -initrd FS/initrd.img \
+#    -append "root=FS rootfstype=9p console=ttyS0"