From 1c98a5b3b36f7e9abe1e62dcfe49cc0fa298379f Mon Sep 17 00:00:00 2001 From: Johannes Schauer Marin Rodrigues Date: Tue, 18 Apr 2023 13:29:02 +0200 Subject: bin/debvm-run: qemu (>> 1:8.0) provides symlinks for qemu-system-${debarch} as well as qemu-system-any --- bin/debvm-run | 12 +++++------- debian/control | 3 ++- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bin/debvm-run b/bin/debvm-run index f3811ad..909d2a2 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -270,7 +270,11 @@ 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. +QEMU="qemu-system-$(dpkg-architecture --force --host-arch $KERNELARCH --query DEB_HOST_ARCH_CPU)" CPU= MACHINE= MAX_SMP= @@ -279,7 +283,6 @@ RNG_DEV=virtio-rng-pci,rng=rng0 case "$KERNELARCH" in amd64) - QEMU=qemu-system-x86_64 MACHINE="type=q35" ;; arm|armel|armhf) @@ -288,7 +291,6 @@ case "$KERNELARCH" in MAX_SMP=8 ;; arm64) - QEMU=qemu-system-aarch64 CPU=max,pauth-impdef=on MACHINE="type=virt,gic-version=max" ;; @@ -306,12 +308,8 @@ case "$KERNELARCH" in MAX_SMP=1 ;; powerpc) - QEMU=qemu-system-ppc MAX_SMP=1 ;; - ppc64el) - QEMU=qemu-system-ppc64 - ;; riscv64) MACHINE="type=virt" ;; diff --git a/debian/control b/debian/control index 60112be..0d63dff 100644 --- a/debian/control +++ b/debian/control @@ -13,11 +13,12 @@ Package: debvm Architecture: all Depends: ${misc:Depends}, + dpkg-dev, e2fsprogs, genext2fs, mmdebstrap (>= 1.3.0), passwd, - qemu-kvm | qemu-system-arm | qemu-system-mips | qemu-system-misc | qemu-system-ppc | qemu-system-sparc | qemu-system-x86, + qemu-kvm (>> 1:8.0) | qemu-system-any # Required for -device virtio-net-pci,netdev=net0 ipxe-qemu, Recommends: -- cgit v1.2.3 From fb5708a5518bbbde2f55847cb8f1cc0b433cb178 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 19 Jun 2023 14:12:07 +0200 Subject: debvm-run: make shellcheck happy Fixes: 1c98a5b3b36f ("bin/debvm-run: qemu (>> 1:8.0) provides symlinks for qemu-system-${debarch} as well as qemu-system-any") --- bin/debvm-run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/debvm-run b/bin/debvm-run index 909d2a2..d09d8c7 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -274,7 +274,7 @@ set -- \ # 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. -QEMU="qemu-system-$(dpkg-architecture --force --host-arch $KERNELARCH --query DEB_HOST_ARCH_CPU)" +QEMU="qemu-system-$(dpkg-architecture --force --host-arch "$KERNELARCH" --query DEB_HOST_ARCH_CPU)" CPU= MACHINE= MAX_SMP= -- cgit v1.2.3 From df3057d10b644e2d01ab57a8ad0547de08dbdfb6 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 19 Jun 2023 14:14:07 +0200 Subject: gitlab-ci: copy dpkg-dev dependency Fixes: 1c98a5b3b36f ("bin/debvm-run: qemu (>> 1:8.0) provides symlinks for qemu-system-${debarch} as well as qemu-system-any") --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 63734c1..e8b7754 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,7 @@ release_test: script: - apt-get update - apt-get dist-upgrade --yes - - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-kvm + - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-kvm dpkg-dev - PATH=$(pwd)/bin:$PATH ./tests/create-and-run.sh $(dpkg --print-architecture) "$RELEASE" arch_test: @@ -46,6 +46,6 @@ arch_test: - test -e /proc/sys/fs/binfmt_misc/status || mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc - apt-get update - apt-get dist-upgrade --yes - - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-system arch-test qemu-user-static file systemd + - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-system arch-test qemu-user-static file systemd dpkg-dev - /lib/systemd/systemd-binfmt - PATH=$(pwd)/bin:$PATH ./tests/create-and-run.sh "$ARCHITECTURE" sid -- cgit v1.2.3 From e36f7f1d7b8b2e41154dd07981129bace2293403 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 19 Jun 2023 14:16:31 +0200 Subject: debvm-run: match on DEB_HOTS_ARCH_CPU rather than DEB_HOST_ARCH This way we loose unnecessary detail such as libc, kernel and abi. For one thing this simplifies the arm* match. For another, this makes us stop think about arm64ilp32 or x32. --- bin/debvm-run | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bin/debvm-run b/bin/debvm-run index d09d8c7..406da39 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -274,18 +274,19 @@ set -- \ # 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. -QEMU="qemu-system-$(dpkg-architecture --force --host-arch "$KERNELARCH" --query DEB_HOST_ARCH_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) MACHINE="type=q35" ;; - arm|armel|armhf) + arm) CPU=max MACHINE="type=virt" MAX_SMP=8 -- cgit v1.2.3