diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/debvm-run | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/bin/debvm-run b/bin/debvm-run index 70ee556..10e19be 100755 --- a/bin/debvm-run +++ b/bin/debvm-run @@ -203,6 +203,19 @@ INITRDNAME=$(/sbin/debugfs "$IMAGE" -R "stat ${BOOTDIR}initrd.img" | sed 's/Fast test -n "$INITRDNAME" || die "failed to discover initrd image" test "${INITRDNAME#/}" = "$INITRDNAME" && INITRDNAME="$BOOTDIR$INITRDNAME" +# Refine our VMARCH guess from /bin/true using the kernel image to improve +# experience for multiarch kernels. +if command -v file >/dev/null 2>&1; then + case "$VMARCH:$(file -b "$KERNELTMP")" in + "armel:Linux kernel ARM64 boot executable Image"*) VMARCH=arm64 ;; + "armhf:Linux kernel ARM64 boot executable Image"*) VMARCH=arm64 ;; + # The boot stub looks the same on i386 and amd64, so we + # actually inspect the kernel version here, which happens to + # include amd64 for Debian kernels. + "i386:Linux kernel x86 boot executable bzImage, version "*"-amd64 "*) VMARCH=amd64 ;; + esac +fi + KERNEL_CMDLINE="root=LABEL=debvm rw" NETDEV="user,id=net0" @@ -228,22 +241,16 @@ case "$VMARCH" in QEMU=qemu-system-x86_64 MACHINE="type=q35" ;; - arm|armel) + arm|armel|armhf) CPU=max MACHINE="type=virt" MAX_SMP=8 - RNG_DEV= ;; arm64) QEMU=qemu-system-aarch64 CPU=max MACHINE="type=virt" ;; - armhf) - CPU=max - MACHINE="type=virt" - MAX_SMP=8 - ;; m68k) MACHINE="type=virt" MAX_SMP=1 |