Skip to content

Commit 6cc576f

Browse files
author
neil
committed
add check
1 parent 29d76b9 commit 6cc576f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

anyvm.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3125,8 +3125,15 @@ def find_image_link(releases, target_zst, target_xz):
31253125
"-machine", machine_opts,
31263126
"-cpu", cpu_opts,
31273127
"-device", "qemu-xhci",
3128-
"-device", "{},netdev=net0".format(net_card),
3129-
"-kernel", "/usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin",
3128+
"-device", "{},netdev=net0".format(net_card)
3129+
])
3130+
3131+
uboot_bin = "/usr/lib/u-boot/qemu-riscv64_smode/u-boot.bin"
3132+
if not os.path.exists(uboot_bin):
3133+
fatal("RISC-V u-boot binary not found at {}.\nPlease install it: sudo apt-get install u-boot-qemu".format(uboot_bin))
3134+
3135+
args_qemu.extend([
3136+
"-kernel", uboot_bin,
31303137
"-device", "virtio-balloon-pci"
31313138
])
31323139
else:

0 commit comments

Comments
 (0)