diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-01-21 08:40:51 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-01-21 08:40:51 +0100 |
commit | f05ff18704cec8d393c4d0adff667dd815060a2a (patch) | |
tree | 1cfb09c7b358d4636306d1d3d63e656b2a83b591 | |
parent | ce41dbb1e0200e1cb2c5a024bb7e7f84961edebc (diff) | |
download | debvm-f05ff18704cec8d393c4d0adff667dd815060a2a.tar.gz |
debvm-run: skip virtio-rng-pci for architectures that lack pci
Fixes: aee1eb3d1c28 ("debvm-run: no need for true randomness -- use /dev/urandom to be faster")
-rwxr-xr-x | bin/debvm-run | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/bin/debvm-run b/bin/debvm-run index 891cf21..fc52154 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -212,13 +212,13 @@ set -- \ -m 1G \ -kernel "$KERNELTMP" \ -initrd "$INITRDTMP" \ - -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 \ -drive "media=disk,format=raw,discard=unmap,file=$IMAGE,if=virtio,cache=unsafe" \ -device "virtio-net-pci,netdev=net0" \ "$@" QEMU="qemu-system-$VMARCH" CPU= +HAVE_PCI=yes MACHINE= MAX_SMP= @@ -227,15 +227,23 @@ case "$VMARCH" in QEMU=qemu-system-x86_64 MACHINE="type=q35" ;; - arm|armel|armhf) + arm|armel) CPU=max MACHINE="type=virt" + HAVE_PCI=no ;; arm64) QEMU=qemu-system-aarch64 CPU=max MACHINE="type=virt" ;; + armhf) + CPU=max + MACHINE="type=virt" + ;; + m68k) + HAVE_PCI=no + ;; mips64el) CPU=5KEc ;; @@ -248,6 +256,9 @@ case "$VMARCH" in riscv64) MACHINE="type=virt" ;; + sparc64) + HAVE_PCI=no + ;; esac if test "$ARCHITECTURE" = "$VMARCH"; then @@ -283,6 +294,9 @@ if test -z "$MAX_SMP" || test "$MAX_SMP" -gt 1; then test -n "$MAX_SMP" && test "$NPROC" -gt "$MAX_SMP" && NPROC=$MAX_SMP set -- -smp "$NPROC" "$@" fi +if test "$HAVE_PCI" = yes; then + set -- -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-pci,rng=rng0 "$@" +fi if test -z "$GRAPHICAL"; then set -- -nographic "$@" |