Skip to contentSkip to conversation

Yocto migration meta-barebox -> walnascar

DISCUSSION Konstantin Kletschke 3 participants 6 messages Jan 6

lore
Share & tools
lore
#0 lore raw

Dear barebox people,
Happy New Year everybody :-)

I used up until scarthgap https://github.com/menschel-d/meta-barebox

In our meta layer we have config in distro conf like this:

ABREBOX_CONFIG:beaglebone-yocto = "omap_defconfig" BAREBOX_CONFIG:pn-barebox-pbl:beaglebone-yocto = "am335x_mlo_defconfig" BAREBOX_IMAGE_SRC:beaglebone-yocto = "images/barebox-am33xx-beaglebone.img" BAREBOX_IMAGE_SRC:pn-barebox-pbl:beaglebone-yocto = "images/barebox-am33xx-beaglebone-mlo.img" RDEPENDS:barebox:beaglebone-yocto += "barebox-pbl" COMPATIBLE_MACHINE:pn-barebox:beaglebone-yocto = "beaglebone-yocto" COMPATIBLE_MACHINE:pn-barebox-pbl:beaglebone-yocto = "beaglebone-yocto" PREFERRED_PROVIDER_virtual/bootloader = "barebox"

And a append recipe mainly with patches creating our custom configuration.

Now I learned, barebox went into openembedded-core, this is great news!

I ditched the meta-barebox, tried my best, needed to remove alle configs regarding "-pbl" and compiled:
ERROR: Nothing RPROVIDES 'barebox-pbl'
(but /home/konsti/Melitta/scarthgap/meta/recipes-bsp/barebox/barebox.bb RDEPENDS on or otherwise requires it)

Now I get several ~580kB img files in the deployment images directory, "ours" seems to be barebox-am33xx-beaglebone.img. File size is plausible for the ex barebox.bin and strings suggest our insidem2m stuff to boot/tftp/nfs landed up in it.

Where is the MLO part? Is barebox-am33xx-beaglebone.img the 1:1 barebox.bin equivalent?

We are used to create a partition table, first partition is vfat type 0x0c, MLO and barebox.bin are put there, works.

Kind Regards
Konstantin Kletschke

Signature · 14 lines
INSIDE M2M GmbH
Konstantin Kletschke
Berenbosteler Straße 76 B
30823 Garbsen

Telefon: +49 (0) 5137 90950136
Mobil: +49 (0) 151 15256238
Fax: +49 (0) 5137 9095010

[email protected]
http://www.inside-m2m.de 

Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover
#1 lore raw

Hi Konstantin,

Quoted 2 lines · Konstantin Kletschke

Dear barebox people,
Happy New Year everybody :-)

Thanks, happy new year to you too :)

Quoted 16 lines

I used up until scarthgap https://github.com/menschel-d/meta-barebox

In our meta layer we have config in distro conf like this:

ABREBOX_CONFIG:beaglebone-yocto = "omap_defconfig" BAREBOX_CONFIG:pn-barebox-pbl:beaglebone-yocto = "am335x_mlo_defconfig" BAREBOX_IMAGE_SRC:beaglebone-yocto = "images/barebox-am33xx-beaglebone.img" BAREBOX_IMAGE_SRC:pn-barebox-pbl:beaglebone-yocto = "images/barebox-am33xx-beaglebone-mlo.img" RDEPENDS:barebox:beaglebone-yocto += "barebox-pbl" COMPATIBLE_MACHINE:pn-barebox:beaglebone-yocto = "beaglebone-yocto" COMPATIBLE_MACHINE:pn-barebox-pbl:beaglebone-yocto = "beaglebone-yocto" PREFERRED_PROVIDER_virtual/bootloader = "barebox"

And a append recipe mainly with patches creating our custom configuration.

Quoted 7 lines

Now I learned, barebox went into openembedded-core, this is great news!

I ditched the meta-barebox, tried my best, needed to remove alle configs regarding "-pbl" and compiled:
ERROR: Nothing RPROVIDES 'barebox-pbl'
(but /home/konsti/Melitta/scarthgap/meta/recipes-bsp/barebox/barebox.bb RDEPENDS on or otherwise requires it)

Which barebox version do you use?

Quoted 7 lines

Now I get several ~580kB img files in the deployment images directory, "ours" seems to be barebox-am33xx-beaglebone.img. File size is plausible for the ex barebox.bin and strings suggest our insidem2m stuff to boot/tftp/nfs landed up in it.

Where is the MLO part? Is barebox-am33xx-beaglebone.img the 1:1 barebox.bin equivalent?

Ahmad added the support for a single barebox binary:
- https://lore.barebox.org/barebox/[email protected]/

IIRC the purpose of the patchset was exactly to fulfill an easier Yocto integration since the beaglebone is one of the oe-core real test hw.

Quoted 2 lines

We are used to create a partition table, first partition is vfat type 0x0c, MLO and barebox.bin are put there, works.

Since the single image approach targets only the SD/MMC boot, the standalone MLO image should be still possible.

Regards,
Marco

Quoted 23 lines

Kind Regards
Konstantin Kletschke

Signature · 14 lines
INSIDE M2M GmbH
Konstantin Kletschke
Berenbosteler Straße 76 B
30823 Garbsen

Telefon: +49 (0) 5137 90950136
Mobil: +49 (0) 151 15256238
Fax: +49 (0) 5137 9095010

[email protected]
http://www.inside-m2m.de 

Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover
Signature · 7 lines
#gernperDu 
#CallMeByMyFirstName

Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | https://www.pengutronix.de/ |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-9    |
#2 lore raw
Quoted 1 line · Marco Felsch

Which barebox version do you use?

It should be 2025.02.0.
I switched to walnascar and this should be the part used:
https://git.yoctoproject.org/poky/tree/meta/recipes-bsp/barebox?h=walnascar

Quoted 5 lines

Ahmad added the support for a single barebox binary:
- https://lore.barebox.org/barebox/[email protected]/

IIRC the purpose of the patchset was exactly to fulfill an easier Yocto integration since the beaglebone is one of the oe-core real test hw.

That's is very interesting.
What I did not get, yet:
So we can keep our partition scheme, the CPUs bootloader is searching hardcoded for partition table -> first vfat -> MLO.
Then barebox-am33xx-beaglebone.img is put there as MLO?

Quoted 2 lines

Since the single image approach targets only the SD/MMC boot, the standalone MLO image should be still possible.

Can this be switched on/off somewere in the yocto framework so the old MLO/barebox.bin pair is genereated?

Regards
Konstantin

#3 lore raw

Hello Konstantin,

Quoted 11 lines · Konstantin Kletschke
Quoted 1 line · Marco Felsch

Which barebox version do you use?

It should be 2025.02.0.
I switched to walnascar and this should be the part used:
https://git.yoctoproject.org/poky/tree/meta/recipes-bsp/barebox?h=walnascar

Quoted 3 lines

Ahmad added the support for a single barebox binary:
- https://lore.barebox.org/barebox/[email protected]/

Quoted 8 lines
Quoted 2 lines

IIRC the purpose of the patchset was exactly to fulfill an easier Yocto integration since the beaglebone is one of the oe-core real test hw.

That's is very interesting.
What I did not get, yet:
So we can keep our partition scheme, the CPUs bootloader is searching hardcoded for partition table -> first vfat -> MLO.
Then barebox-am33xx-beaglebone.img is put there as MLO?

When enabled, the same barebox build generates two images:
barebox-am33xx-beaglebone-mlo.mmc.img -> MLO barebox-am33xx-beaglebone.img -> barebox.bin

Both are placed in the VFAT.

Quoted 2 lines
Quoted 2 lines

Since the single image approach targets only the SD/MMC boot, the standalone MLO image should be still possible.

I didn't test it on eMMC and I suspect it needs light tweaking to work there. If you are happy to test, I can find some time later to send a patch.

Quoted 2 lines

Can this be switched on/off somewere in the yocto framework so the old MLO/barebox.bin pair is genereated?

For your old setup, you will need two recipes. Just define your own barebox.bb and barebox-pbl.bb recipes and inherit barebox in each and use different configs. All the core logic is in a barebox.bbclass to allow you to easily create your own recipes.

This allows you also to use a newer version than v2025.02.0 for example v2025.09.1, which is going to be maintained for longer than just a month.

Cheers,
Ahmad

Quoted 5 lines

Regards
Konstantin

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 |
#4 lore raw

Hello Ahmad!

Quoted 5 lines · Ahmad Fatoum

When enabled, the same barebox build generates two images:
barebox-am33xx-beaglebone-mlo.mmc.img -> MLO barebox-am33xx-beaglebone.img -> barebox.bin

Both are placed in the VFAT.

I do not necessaryly need two images, if booting is now done with a combined one, which is new, if I understood this correct.

In my images deploy dir the following images showed up after my migration to walnascar away from the meta-barebox layer which is not used anymore.

barebox-am33xx-afi-gf.img barebox-am33xx-baltos.img barebox-am33xx-beaglebone.img barebox-am33xx-myirtech.img barebox-am33xx-phytec-phycard.img barebox-am33xx-phytec-phycore-emmc.img barebox-am33xx-phytec-phycore-no-eeprom.img barebox-am33xx-phytec-phycore-no-spi-no-eeprom.img barebox-am33xx-phytec-phycore-no-spi.img barebox-am33xx-phytec-phycore.img barebox-am33xx-phytec-phyflex-no-eeprom.img barebox-am33xx-phytec-phyflex-no-spi-no-eeprom.img barebox-am33xx-phytec-phyflex-no-spi.img barebox-am33xx-phytec-phyflex.img barebox-am35xx-pfc-750-820x.img barebox-beagleboard.img
barebox-dt-2nd.img

And that is, when I wondered myself, if - in our case - barebox-am33xx-beaglebone.img is going to be named MLO and put into the vfat boot partition or if I have something missing or done wrong, which is absolutely possible, of course!

So, no *mlo* file.

Quoted 4 lines

For your old setup, you will need two recipes. Just define your own barebox.bb and barebox-pbl.bb recipes and inherit barebox in each and use different configs. All the core logic is in a barebox.bbclass to allow you to easily create your own recipes.

So only using this approach with two barebox.bb and barebox-pbl.bb I would get an additional *mlo* file, right?
As said, if I can omit this approach this is fine by me.

Regards
Konsti

Signature · 14 lines
INSIDE M2M GmbH
Konstantin Kletschke
Berenbosteler Straße 76 B
30823 Garbsen

Telefon: +49 (0) 5137 90950136
Mobil: +49 (0) 151 15256238
Fax: +49 (0) 5137 9095010

[email protected]
http://www.inside-m2m.de 

Geschäftsführung: Michael Emmert, Derek Uhlig
HRB: 111204, AG Hannover
#5 lore raw

Hi,

Quoted 4 lines · Konstantin Kletschke

Hello Ahmad!

On Tue, Jan 06, 2026 at 12:33:21PM +0100, Ahmad Fatoum wrote:

Quoted 8 lines
Quoted 5 lines

When enabled, the same barebox build generates two images:
barebox-am33xx-beaglebone-mlo.mmc.img -> MLO barebox-am33xx-beaglebone.img -> barebox.bin

Both are placed in the VFAT.

I do not necessaryly need two images, if booting is now done with a combined one, which is new, if I understood this correct.

There must be a separate MLO image that is small enough to fit into SRAM. So you still need two images, the only difference is if you build barebox twice with two different configs or build it only once.

Both are possible, you just need to adapt your recipe(s) accordingly. For you old way of doing things, you need two recipes, each with its own config.

Quoted 13 lines

In my images deploy dir the following images showed up after my migration to walnascar away from the meta-barebox layer which is not used anymore.

barebox-am33xx-afi-gf.img barebox-am33xx-baltos.img barebox-am33xx-beaglebone.img barebox-am33xx-myirtech.img barebox-am33xx-phytec-phycard.img barebox-am33xx-phytec-phycore-emmc.img barebox-am33xx-phytec-phycore-no-eeprom.img barebox-am33xx-phytec-phycore-no-spi-no-eeprom.img barebox-am33xx-phytec-phycore-no-spi.img

Quoted 8 lines

barebox-am33xx-phytec-phycore.img barebox-am33xx-phytec-phyflex-no-eeprom.img barebox-am33xx-phytec-phyflex-no-spi-no-eeprom.img barebox-am33xx-phytec-phyflex-no-spi.img barebox-am33xx-phytec-phyflex.img barebox-am35xx-pfc-750-820x.img barebox-beagleboard.img
barebox-dt-2nd.img

These are all second stage barebox images (barebox.bin). To use the MLO as you did before, you need a second recipe where you build am335x_mlo_defconfig or w/e your config is.

Quoted 4 lines

And that is, when I wondered myself, if - in our case - barebox-am33xx-beaglebone.img is going to be named MLO and put into the vfat boot partition or if I have something missing or done wrong, which is absolutely possible, of course!

The MLO files have mlo in their name.

Quoted 10 lines

So, no *mlo* file.

Quoted 4 lines

For your old setup, you will need two recipes. Just define your own barebox.bb and barebox-pbl.bb recipes and inherit barebox in each and use different configs. All the core logic is in a barebox.bbclass to allow you to easily create your own recipes.

So only using this approach with two barebox.bb and barebox-pbl.bb I would get an additional *mlo* file, right?
As said, if I can omit this approach this is fine by me.

Given that eMMC doesn't work yet for the approach with a single recipe, I'd suggest you just add two recipes for now.

Cheers,
Ahmad

Quoted 6 lines

Regards
Konsti

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 |