Tuned to handle arm64 and armhf qemu testing
authorRalph Ronnquist <rrq@rrq.au>
Wed, 18 Sep 2024 10:04:56 +0000 (20:04 +1000)
committerRalph Ronnquist <rrq@rrq.au>
Wed, 18 Sep 2024 10:04:56 +0000 (20:04 +1000)
initrd-init
vm.sh

index 4883fa9a715f6c1d3309f788ef4beabd8b4f90de..ebdb300729f98faddb3888a31d955b15c231c262 100755 (executable)
@@ -14,8 +14,9 @@ depmod
 echo NOW WE ARE HERE >&2
 /lib/debian-installer/start-udev
 
-# The virtio_{pci,blk} drivers suit the virt platform used by vm.sh
-modprobe virtio_pci
+# The virtio_{net,blk} drivers suit the virt platform used by vm.sh
+modprobe virtio_net
+ip l
 modprobe virtio_blk
 
 # Set up the pool media
diff --git a/vm.sh b/vm.sh
index 5bc827ab41d14f85a16447c8f4bd17c6ab6faebf..f3493472315f99abdbb43a822833eb8c845c4505 100755 (executable)
--- a/vm.sh
+++ b/vm.sh
@@ -1,17 +1,20 @@
 #!/bin/bash
 
+ARCH=${1:=arm64}
+
 IMG=disk.raw
 
-case "${1:=arm64}" in
+case "$ARCH" in
     arm64)
        QEMU=qemu-system-aarch64
        CPU=cortex-a53
-       NET="virtio-net-pci"
+       NET=virtio-net-device
        ;;
     armhf)
        QEMU=qemu-system-arm
        CPU=cortex-a15
-       NET="e1000e"
+       #USB="-device qemu-xhci -device usb-host"
+       NET=virtio-net-device
        ;;
     *)
        echo "unknown $1" >&2
@@ -22,15 +25,17 @@ esac
 ARGS=(
     -M virt -cpu $CPU -m 4G
     # boot setup
-    -kernel vmlinuz
-    -initrd initrd.gz
+    -kernel $ARCH/vmlinuz
+    -initrd $ARCH/initrd.gz
     -append "console=ttyAMA0 root=/dev/vda1 roottype=ext4"
     -serial mon:stdio -echr 0x1c
     # graphics setup
     -nographic
     # harddrive setup
-    -device virtio-blk-pci,drive=hd
+    -device virtio-blk-device,drive=hd
     -drive if=none,id=hd,file=$IMG,format=raw
+    # USB setup
+    $USB
     # network setup
     -device $NET,netdev=unet
     -netdev vde,sock=/run/vde.ctl,id=unet