From: Simon Glass <sjg@chromium.org> Add documentation explaining how to use the fw_cfg interface to specify a boot command for QEMU x86. This feature allows automated testing and scripting by providing the boot command directly through QEMU's firmware configuration interface. The documentation includes: - How to create a boot command file - The QEMU command-line syntax with -fw_cfg option - Behavior and limitations of the feature 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --- doc/board/emulation/qemu-x86.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/doc/board/emulation/qemu-x86.rst b/doc/board/emulation/qemu-x86.rst index c604e42990e..c2862e631ee 100644 --- a/doc/board/emulation/qemu-x86.rst +++ b/doc/board/emulation/qemu-x86.rst @@ -113,6 +113,26 @@ sure the specified CPU supports 64-bit like '-cpu core2duo'. Conversely '-cpu pentium' won't work for obvious reasons that the processor only supports 32-bit. +Specifying a boot command +-------------------------- + +It is possible to specify the boot command directly using the fw_cfg interface. +This allows QEMU to control the boot command, which can be useful for automated +testing or scripting. To use this feature, create a file containing the boot +command and pass it to QEMU using the fw_cfg option:: + + $ echo "qfw load; zboot 01000000 - 04000000 1b1ab50" > bootcmd.txt + $ qemu-system-x86_64 -nographic -bios path/to/u-boot.rom \ + -fw_cfg name=opt/u-boot/bootcmd,file=bootcmd.txt + +U-Boot will read the boot command from the firmware configuration and execute it +automatically during the boot process. This bypasses the normal distro boot +sequence. + +Note that the boot command is limited in length and should not exceed the boot +command buffer size. If the command is too long, U-Boot will fail to read it and +fall back to the default boot behavior. + Booting distros --------------- -- 2.43.0