barebox state w/ qemu

Wes Chow wes.chow at gmail.com
Sun Jul 7 19:22:17 PDT 2024


I am trying to better understand barebox and playing with it via
Buildroot with Qemu. One thing I don't understand is how the state
backend is configured. I see this:

https://github.com/barebox/barebox/blob/d74c84582591ac1f93b203d733831fcf18e6b033/common/boards/qemu-virt/qemu-virt-flash.dtso#L4

..however I don't know how to read dts overlay files. Do I need to set
up a disk with a partition scheme that matches lines 17-30? Or is it
sufficient to just have a partition with the "barebox-state" label?

Also possibly of relevance, I'm starting qemu like so:

qemu-system-aarch64 -m 2048M -cpu cortex-a57 -machine virt -display
none -serial mon:stdio -kernel output/images/barebox-dt-2nd.img
-device virtio-blk-pci,drive=hd0,disable-legacy=on -drive
file=output/images/rootfs.ext2,if=none,format=raw,id=hd0

The rootfs.ext2 disk becomes available to barebox as /dev/virtioblk0.
How does barebox know which disk to search for the backend?

In the target image, I installed dt-utils and so have access to the
barebox-state command. How does the barebox-state executable know
where to look for the state backend? Is this passed down through the
device tree?

Thanks,
Wes



More information about the barebox mailing list