build_library/qemu_template.sh: Simplify mounting VM image

There's no need to differentiate between amd64 and arm64 boards here
any more. This also adds bootindex=1 option to the -device flag, so we
can pass more secondary disks without affecting the boot order.
This commit is contained in:
Krzesimir Nowak 2025-04-22 14:45:49 +02:00
parent 47e60959f1
commit 2ca63a3a82

View File

@ -258,15 +258,8 @@ if [ -n "${CONFIG_IMAGE}" ]; then
fi
if [ -n "${VM_IMAGE}" ]; then
case "${VM_BOARD}" in
amd64-usr)
set -- -drive if=virtio,file="${VM_IMAGE}" "$@" ;;
arm64-usr)
set -- -drive if=none,id=blk,file="${VM_IMAGE}" \
-device virtio-blk-device,drive=blk "$@"
;;
*) die "Unsupported arch" ;;
esac
set -- -drive if=none,id=blk,file="${VM_IMAGE}" \
-device virtio-blk-pci,drive=blk,bootindex=1 "$@"
fi
if [ -n "${VM_KERNEL}" ]; then