From e18ee9f1750137f04fe3061ded85947085a3e308 Mon Sep 17 00:00:00 2001 From: Ivan Davidov Date: Mon, 25 Dec 2017 07:46:53 +0200 Subject: [PATCH] 32-bit arch detection fails on Linux systems different than i386 (e.g. on i686). --- src/qemu-bios.sh | 8 +++++++- src/qemu-uefi.sh | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/qemu-bios.sh b/src/qemu-bios.sh index 8b2d5562e..ec7892740 100755 --- a/src/qemu-bios.sh +++ b/src/qemu-bios.sh @@ -10,7 +10,13 @@ # If you get kernel panic with message "No working init found", then try to # increase the RAM from 128M to 256M. -cmd="qemu-system-$(uname -m) -m 128M -cdrom minimal_linux_live.iso -boot d -vga std" +if [ "`uname -m`" = "x86_64" ] ; then + ARCH="x86_64" +else + ARCH="i386" +fi + +cmd="qemu-system-$ARCH -m 128M -cdrom minimal_linux_live.iso -boot d -vga std" if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then echo "Starting QEMU with attached ISO image and hard disk." diff --git a/src/qemu-uefi.sh b/src/qemu-uefi.sh index d02b0cf81..cfe4083b3 100755 --- a/src/qemu-uefi.sh +++ b/src/qemu-uefi.sh @@ -17,7 +17,13 @@ # OVMF_LOCATION=~/Downloads/OVMF.fd -cmd="qemu-system-$(uname -m) -pflash $OVMF_LOCATION -m 128M -cdrom minimal_linux_live.iso -boot d -vga std" +if [ "`uname -m`" = "x86_64" ] ; then + ARCH="x86_64" +else + ARCH="i386" +fi + +cmd="qemu-system-$ARCH -pflash $OVMF_LOCATION -m 128M -cdrom minimal_linux_live.iso -boot d -vga std" if [ "$1" = "-hdd" -o "$1" = "-h" ] ; then echo "Starting QEMU with attached ISO image and hard disk."