summaryrefslogtreecommitdiff
path: root/bin/debvm-run
diff options
context:
space:
mode:
authorHelmut Grohne <helmutg@debian.org>2023-06-19 12:45:11 +0000
committerHelmut Grohne <helmutg@debian.org>2023-06-19 12:45:11 +0000
commit81f9e7abf9329da14f664c12625864bff2e85f25 (patch)
tree89084e393300445fab4888a9fa7d5295b5bff5ae /bin/debvm-run
parent8ce786ab8f39f2d7570355a5bbf26bc0669258d3 (diff)
parente36f7f1d7b8b2e41154dd07981129bace2293403 (diff)
downloaddebvm-81f9e7abf9329da14f664c12625864bff2e85f25.tar.gz
Merge branch 'qemu8exp' into 'main'
bin/debvm-run: qemu provides symlinks for qemu-system- starting with 1:8.0~rc4+dfsg-2 See merge request helmutg/debvm!31
Diffstat (limited to 'bin/debvm-run')
-rwxr-xr-xbin/debvm-run17
1 files changed, 8 insertions, 9 deletions
diff --git a/bin/debvm-run b/bin/debvm-run
index f3811ad..406da39 100755
--- a/bin/debvm-run
+++ b/bin/debvm-run
@@ -270,25 +270,28 @@ set -- \
-object rng-random,filename=/dev/urandom,id=rng0 \
"$@"
-QEMU="qemu-system-$KERNELARCH"
+# Translate KERNELARCH (a Debian architecture) to a Debian CPU name.
+# This utilizes the QEMU Debian package symlink mapping that ensures that
+# calling qemu-system-${DEB_HOST_ARCH_CPU} will run the QEMU binary providing
+# the correct emulator for that CPU.
+KERNELARCHCPU="$(dpkg-architecture --force --host-arch "$KERNELARCH" --query DEB_HOST_ARCH_CPU)"
+QEMU="qemu-system-$KERNELARCHCPU"
CPU=
MACHINE=
MAX_SMP=
NIC_DEV=virtio-net-pci,netdev=net0
RNG_DEV=virtio-rng-pci,rng=rng0
-case "$KERNELARCH" in
+case "$KERNELARCHCPU" in
amd64)
- QEMU=qemu-system-x86_64
MACHINE="type=q35"
;;
- arm|armel|armhf)
+ arm)
CPU=max
MACHINE="type=virt"
MAX_SMP=8
;;
arm64)
- QEMU=qemu-system-aarch64
CPU=max,pauth-impdef=on
MACHINE="type=virt,gic-version=max"
;;
@@ -306,12 +309,8 @@ case "$KERNELARCH" in
MAX_SMP=1
;;
powerpc)
- QEMU=qemu-system-ppc
MAX_SMP=1
;;
- ppc64el)
- QEMU=qemu-system-ppc64
- ;;
riscv64)
MACHINE="type=virt"
;;