Skip to contentSkip to conversation

barebox-bringup utility

DISCUSSION Sascha Hauer 2 participants 3 messages Jan 5 – Jan 6

lore
Share & tools
lore
#0 lore raw

Hi,

Claude Code struggles to to bring up barebox properly with labgrid-pytest and running barebox on real hardware with the barebox integrated pytest infrastructure is also not easy as there are several assumptions about QEMU in it. I thought letting Claude write a small python tool to start barebox in QEMU. It turned out to be useful for interactive usage as well, so here it is:

https://github.com/saschahauer/barebox-bringup

It makes starting barebox as easy as:

barebox-bringup -c ~/test/arm/imx6s-riotboard.yaml barebox-bringup -c test/arm/virt@multi_v7_defconfig.yaml

It will open a console which captures the barebox output from the start. The tool has options to capture to a log file and to accept input from a fifo.

At least with real hardware the closest I could get was:

labgrid-client -c ~/test/arm/imx6s-riotboard.yaml -s barebox console

This loses output though, as the console is only started after barebox has already started, so I usually had running a permanent console on another terminal.

Maybe there are ways to improve the barebox pytest or to improve labgrid itself, but in the meantime somebody might find this useful as well.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#1 lore raw

Hello Sascha,

Quoted 6 lines · Sascha Hauer

Hi,

Claude Code struggles to to bring up barebox properly with labgrid-pytest and running barebox on real hardware with the barebox integrated pytest infrastructure is also not easy as there are several assumptions about QEMU in it.

We have a container to address this.

Quoted 10 lines

I thought letting Claude write a small
python tool to start barebox in QEMU. It turned out to be useful for interactive usage as well, so here it is:

https://github.com/saschahauer/barebox-bringup

It makes starting barebox as easy as:

barebox-bringup -c ~/test/arm/imx6s-riotboard.yaml barebox-bringup -c test/arm/virt@multi_v7_defconfig.yaml

Does

./scripts/container.sh pytest --interactive \
--lg-env test/arm/virt@multi_v8_defconfig.yaml

not work for you?

Quoted 2 lines

It will open a console which captures the barebox output from the start. The tool has options to capture to a log file

This can be achieved with --lg-log when using pytest.

Quoted 2 lines

and to accept input from a
fifo.

Untested, but should be possible with mkfifo and redirection?

Quoted 3 lines

At least with real hardware the closest I could get was:

labgrid-client -c ~/test/arm/imx6s-riotboard.yaml -s barebox console

By the way, I think we should start adding YAMLs for real hardware as well into the repository.

Quoted 6 lines

This loses output though, as the console is only started after barebox has already started, so I usually had running a permanent console on another terminal.

Maybe there are ways to improve the barebox pytest or to improve labgrid itself, but in the meantime somebody might find this useful as well.

I already rewrote my perl tool in python, so it's more approachable to others. It would be cool if missing features are implemented there, so everyone can use it.

Cheers,
Ahmad

Quoted 3 lines

Sascha

Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
#2 lore raw
Quoted 23 lines · Ahmad Fatoum

Hello Sascha,

Quoted 6 lines · Sascha Hauer

Hi,

Claude Code struggles to to bring up barebox properly with labgrid-pytest and running barebox on real hardware with the barebox integrated pytest infrastructure is also not easy as there are several assumptions about QEMU in it.

We have a container to address this.

Quoted 10 lines

I thought letting Claude write a small
python tool to start barebox in QEMU. It turned out to be useful for interactive usage as well, so here it is:

https://github.com/saschahauer/barebox-bringup

It makes starting barebox as easy as:

barebox-bringup -c ~/test/arm/imx6s-riotboard.yaml barebox-bringup -c test/arm/virt@multi_v7_defconfig.yaml

Quoted 6 lines

Does

./scripts/container.sh pytest --interactive \
--lg-env test/arm/virt@multi_v8_defconfig.yaml

not work for you?

No, I don't have podman installed.

However, labgrid-pytest --lg-env test/arm/virt@multi_v8_defconfig.yaml --interactive works

Quoted 4 lines
Quoted 2 lines

It will open a console which captures the barebox output from the start. The tool has options to capture to a log file

This can be achieved with --lg-log when using pytest.

With --lg-log a logfile is created, but it's empty.
With output redirection to a file I get pytest output, but not the console. Maybe that's different when using ./scripts/container.sh instead of labgrid-pytest.

Quoted 5 lines
Quoted 3 lines

and to accept input from a
fifo.

Untested, but should be possible with mkfifo and redirection?

Likely, yes.

Quoted 7 lines
Quoted 4 lines

At least with real hardware the closest I could get was:

labgrid-client -c ~/test/arm/imx6s-riotboard.yaml -s barebox console

By the way, I think we should start adding YAMLs for real hardware as well into the repository.

How do we accomplish this? The YAML files contain many site specific details, like RemotePlace name, coordinator_address, which PowerDriver, wether to use a USB loader, SD-MUX or JTAG for bringup. There's not much left that is generic.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |