Modified QEMU arguments for network interface.
authorRalph Ronnquist <rrq@rrq.au>
Wed, 18 Sep 2024 01:20:45 +0000 (11:20 +1000)
committerRalph Ronnquist <rrq@rrq.au>
Wed, 18 Sep 2024 01:20:45 +0000 (11:20 +1000)
vm.sh

diff --git a/vm.sh b/vm.sh
index e06e8631b1a7e5b3cd8c3ffa637ee4110164d0e0..5bc827ab41d14f85a16447c8f4bd17c6ab6faebf 100755 (executable)
--- a/vm.sh
+++ b/vm.sh
@@ -2,13 +2,22 @@
 
 IMG=disk.raw
 
-QEMU=qemu-system-aarch64
-CPU=arm64
-
-if [ "$1" = armhf ] ; then
-    CPU=cortex-a15
-    QEMU=qemu-system-arm
-fi
+case "${1:=arm64}" in
+    arm64)
+       QEMU=qemu-system-aarch64
+       CPU=cortex-a53
+       NET="virtio-net-pci"
+       ;;
+    armhf)
+       QEMU=qemu-system-arm
+       CPU=cortex-a15
+       NET="e1000e"
+       ;;
+    *)
+       echo "unknown $1" >&2
+       exit 1
+       ;;
+esac
 
 ARGS=(
     -M virt -cpu $CPU -m 4G
@@ -23,7 +32,7 @@ ARGS=(
     -device virtio-blk-pci,drive=hd
     -drive if=none,id=hd,file=$IMG,format=raw
     # network setup
-    -device virtio-net-pci,netdev=unet
+    -device $NET,netdev=unet
     -netdev vde,sock=/run/vde.ctl,id=unet
 )