yoctoqemubarebox

qemu-system-arm run barebox image


may I ask? I need to build a barebox image inside yocto and run it in qemu, I can’t build a qemuarm image in yocto, there is no such recipe, in general, the question is, is it possible to somehow slip under such a dts into the barebox assembly that qemu-system-arm with -M mcimx6ul-evk option will be able to run barebox builded in yocto?


Solution

  • You can enable CONFIG_BOARD_ARM_GENERIC_DT=y in the barebox config and barebox will generate an images/barebox-dt-2nd.img file that is bootable like a Linux kernel: You can pass it to QEMU -kernel and it will receive a device tree from the outside.

    barebox contains a test/emulate.pl script that can spawn QEMU VMs for you. Passing it --dryrun will print the options used (edited for formatting):

    $ ./test/emulate.pl --no-tuxmake --dry-run virt@vexpress_defconfig
    /usr/bin/qemu-system-arm -M virt -cpu cortex-a7 -m 1024M -kernel \
       ./build/images/barebox-dt-2nd.img -serial mon:stdio -trace file=/dev/null
    

    In the above case, QEMU will provide the device tree, but you can pass your own as well (make sure to build barebox with a config that enables board and platform support in line with the FDT and QEMU machine you configure). See the barebox documentation on Emulated targets for more information.