
Hi,
when running QEMU and specifying both a firmware binary (--bios) and a kernel (-kernel) on the command line, QEMU will run the firmware, but will also record information about the provided kernel in the QEMU firmware device. U-Boot's "qfw" command can load the kernel to a provided address then. However using a kernel (and initrd) provided this way requires typing some rather generic commands.
This series automates this, so that the default boot sequence tries to launch a kernel this way first. If that fails, we gracefully continue with the existing boot locations.
This simplifies automated booting, with external firmware: $ qemu-system-aarch64 -machine virt,virtualization=on,gic-version=2 -cpu cortex-a57 -nographic -display none -d unimp --bios u-boot.bin -kernel Image -initrd initrd.gz -append "earlycon"
The first two patches clean up some qfw issues, so that the automatic booting becomes smoother, while the third patch adds the new commands to QEMU's distro_boot script.
Please have a look!
Cheers, Andre
Andre Przywara (3): qfw: store loaded file size in environment variable qfw: return failure when no kernel could be loaded qemu: Try to automatically boot from the QEMU firmware device (qfw)
cmd/qfw.c | 6 ++++-- include/configs/qemu-arm.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-)