Bug 10793

Summary: Modify runqemu to run ELF images
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Juro Bystricky <juro.bystricky>
Component: Scripts and ToolsAssignee: Alejandro <alejandro>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: Medium CC: pavel, randy.macleod, richard.purdie, ross.burton, sgw
Version: 2.3   
Target Milestone: 4.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Juro Bystricky 2016-12-12 21:35:49 UTC
When building Zephyr images, the resulting image is in ELF file format.
It would be nice to be able to run the image in qemu via a command such as:

runqemu zephyr.elf [command line arguments]

Presently we must use full paths, for example qemux86:

    $ ./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 \
           -kernel ./tmp/deploy/images/qemux86/zephyr.elf \
           -nographic -machine type=pc-0.14 -display none -clock dynticks \
           -no-acpi -balloon none

or qemuarm:

    $ ./tmp/sysroots/x86_64-linux/usr/bin/qemu-system-arm  \
           -kernel ./tmp/deploy/images/qemuarm/zephyr.elf \
           -cpu cortex-m3 -machine lm3s6965evb -nographic -vga none
Comment 1 Robert Yang 2017-07-13 08:45:58 UTC
Sorry, I need more time to investigate how qemu boot elf.
Comment 2 Pavel Zhukov 2022-05-09 11:46:49 UTC
Looks like this has been fixed already:

# runqemu qemu-x86
runqemu - INFO - Running MACHINE=qemu-x86 bitbake -e ...
runqemu - INFO - Continuing with the following parameters:
KERNEL: [/mnt/builds/oniroproject/build-oniro-zephyr/tmp-newlib/deploy/images/qemu-x86/zephyr-philosophers.elf]
MACHINE: [qemu-x86]
FSTYPE: [elf]
ROOTFS: [/mnt/builds/oniroproject/build-oniro-zephyr/tmp-newlib/deploy/images/qemu-x86/zephyr-philosophers-image-qemu-x86.elf]
CONFFILE: [/mnt/builds/oniroproject/build-oniro-zephyr/tmp-newlib/deploy/images/qemu-x86/zephyr-philosophers-image-qemu-x86.qemuboot.conf]

runqemu - INFO - Running /mnt/builds/oniroproject/build-oniro-zephyr/tmp-newlib/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin/qe                                                                                                                                                                                                rial null -device virtio-vga  -display sdl,show-cursor=on  -kernel /mnt/builds/oniroproject/build-oniro-zephyr/tmp-newlib/deploy/images/qemu-x86/zephyr-phil
Comment 3 Pavel Zhukov 2022-05-09 12:56:27 UTC
This has been fixed see c#2