From 3e12f3f2e803f84b81412ae99c728583412d988a Mon Sep 17 00:00:00 2001 From: Ralph Ronnquist Date: Wed, 18 Sep 2024 20:04:56 +1000 Subject: [PATCH] Tuned to handle arm64 and armhf qemu testing --- initrd-init | 5 +++-- vm.sh | 17 +++++++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/initrd-init b/initrd-init index 4883fa9..ebdb300 100755 --- a/initrd-init +++ b/initrd-init @@ -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 5bc827a..f349347 100755 --- 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 -- 2.39.2