From 4add90e60185d07c6e4efea413dbd47874bde21e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 23 Apr 2024 10:53:49 +0200 Subject: [PATCH] qemu: Synchronize with qeneth setting for console Change default console to hvc0 (same as qeneth) This is the only working console for now. --- board/common/qemu/Config.in.in | 3 +-- board/common/qemu/qemu.sh | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/board/common/qemu/Config.in.in b/board/common/qemu/Config.in.in index 03002433..af6cd72e 100644 --- a/board/common/qemu/Config.in.in +++ b/board/common/qemu/Config.in.in @@ -54,11 +54,10 @@ choice config QEMU_CONSOLE_VIRTIO bool "Virtio (hvc0)" - depends on QEMU_LOADER_KERNEL config QEMU_CONSOLE_SERIAL bool "Serial (ttyS0/ttyAMA0)" - + depends on !QEMU_LOADER_OVMF endchoice config QEMU_MACHINE diff --git a/board/common/qemu/qemu.sh b/board/common/qemu/qemu.sh index d382b74c..22c0d477 100755 --- a/board/common/qemu/qemu.sh +++ b/board/common/qemu/qemu.sh @@ -117,7 +117,7 @@ rootfs_args() echo -n "-device sd-card,drive=mmc " echo -n "-drive id=mmc,file=$CONFIG_QEMU_ROOTFS,if=none,format=raw " elif [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then - echo -n "-drive file=$CONFIG_QEMU_ROOTFS,if=virtio,format=raw,bus=0,unit=0 " + echo -n "-drive file=$CONFIG_QEMU_ROOTFS.qcow2,if=virtio,format=qcow2,bus=0,unit=0 " fi } @@ -148,14 +148,14 @@ usb_args() dd if=/dev/zero of=${USBSTICK} bs=8M count=1 >/dev/null 2>&1 mkfs.vfat $USBSTICK >/dev/null 2>&1 fi - echo -n "-drive if=none,id=usbstick,format=raw,file=${USBSTICK} " + echo -n "-drive if=none,id=usbstick,format=raw,file=$USBSTICK " echo -n "-usb " echo -n "-device usb-ehci,id=ehci " echo -n "-device usb-storage,bus=ehci.0,drive=usbstick " } rw_args() { - [ "$CONFIG_QEMU_RW" ] || return + [ "$CONFIG_QEMU_RW" ] || return if ! [ -f "$CONFIG_QEMU_RW" ]; then dd if=/dev/zero of="$CONFIG_QEMU_RW" bs=16M count=1 >/dev/null 2>&1 @@ -251,6 +251,9 @@ wdt_args() run_qemu() { + if [ "$CONFIG_QEMU_ROOTFS_VSCSI" = "y" ]; then + qemu-img create -f qcow2 -o backing_file=$CONFIG_QEMU_ROOTFS -F raw $CONFIG_QEMU_ROOTFS.qcow2 > /dev/null + fi local qemu read qemu <