mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* yocto integration - best practice
@ 2021-10-08 13:18 Konstantin Kletschke
  2021-10-11  8:11 ` Sascha Hauer
  0 siblings, 1 reply; 3+ messages in thread
From: Konstantin Kletschke @ 2021-10-08 13:18 UTC (permalink / raw)
  To: barebox

Hi All,

I wonder how to properly integrate bare box into my yocto. I read many 
other examples in
the internet how other people do this and I am a little stupid now.

I have a yocto poky image up and running based on their beaglebone-yocto 
subset which can be utlilized
in my case with a rather minimal setup with a local.conf only. This 
since I by accident actually
use a Beaglebone Black board.

I added my own meta-insidem2m layer also and in this layer I modify 
kernel config, integrate out of
kernel modules and other stuff. Also barebox patches (for default boot 
configs) are added from there.
The local.conf shrunk to a rather minimal content, because I have an own 
distro in it with three
different images.

Additionally I integrated meta-barebox successfully into this and use 
barebox in my daily development
work to boot from internal MMC and external SD-Card.

What I wonder, what is need to be done to integrate MLO and barebox.bin 
into the SD-Card image? It is
not really importand, since copying the files by hand into the boot 
partition works fine and the final
install goes into the internal MMC flash anyway. But it would be fine to 
get barebox initially into
the image to generate immediately bootable images for SD-Card. It would 
be possible to raw write such
an image to the internal MMC 1:1 also...

But where is the hook to exchange u-boot by barebox in the yocto 
framework? Can it be done in an own
distro? I find bootloader stuff dealt with in /conf/machine/*, is it 
necessary to be done there?
This would be challenging a bit since then a kernel and other system 
stuff has to be recreated too
(tried that) and relying/utilizing the beaglebone stuff is not possible 
anymore. Additionally I see
many companies heavily providing software support for their boards with 
yocto and barebox without
/conf/machine/* stuff (if I read right).

Other way round: I plan to fully integrate RAUC into our software, what 
is best preparation for this
regarding barebox integration?

Kind Regards
Konstantin Kletschke

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: yocto integration - best practice
  2021-10-08 13:18 yocto integration - best practice Konstantin Kletschke
@ 2021-10-11  8:11 ` Sascha Hauer
  2021-10-11  8:29   ` Enrico Jörns
  0 siblings, 1 reply; 3+ messages in thread
From: Sascha Hauer @ 2021-10-11  8:11 UTC (permalink / raw)
  To: Konstantin Kletschke; +Cc: barebox, Enrico Joerns

Hi Konsti,

On Fri, Oct 08, 2021 at 03:18:56PM +0200, Konstantin Kletschke wrote:
> Hi All,
> 
> I wonder how to properly integrate bare box into my yocto. I read many other
> examples in
> the internet how other people do this and I am a little stupid now.
> 
> I have a yocto poky image up and running based on their beaglebone-yocto
> subset which can be utlilized
> in my case with a rather minimal setup with a local.conf only. This since I
> by accident actually
> use a Beaglebone Black board.
> 
> I added my own meta-insidem2m layer also and in this layer I modify kernel
> config, integrate out of
> kernel modules and other stuff. Also barebox patches (for default boot
> configs) are added from there.
> The local.conf shrunk to a rather minimal content, because I have an own
> distro in it with three
> different images.
> 
> Additionally I integrated meta-barebox successfully into this and use
> barebox in my daily development
> work to boot from internal MMC and external SD-Card.
> 
> What I wonder, what is need to be done to integrate MLO and barebox.bin into
> the SD-Card image?

We use https://github.com/pengutronix/genimage for this task. The tool
can generate all kinds of images with complete partitioning, also
containing bootloader images and barebox environment images if you like.

I'm not very much into YOCTO, I don't know how genimage is integrated
into YOCTO, there must be the right receipt files somewhere. Added
Enrico to Cc: for that.

Regards,
  Sascha

-- 
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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: yocto integration - best practice
  2021-10-11  8:11 ` Sascha Hauer
@ 2021-10-11  8:29   ` Enrico Jörns
  0 siblings, 0 replies; 3+ messages in thread
From: Enrico Jörns @ 2021-10-11  8:29 UTC (permalink / raw)
  To: Sascha Hauer, Konstantin Kletschke; +Cc: barebox

Hi Konsti,

Am Montag, dem 11.10.2021 um 10:11 +0200 schrieb Sascha Hauer:
> Hi Konsti,
> 
> On Fri, Oct 08, 2021 at 03:18:56PM +0200, Konstantin Kletschke wrote:
> > Hi All,
> > 
> > I wonder how to properly integrate bare box into my yocto. I read many other
> > examples in
> > the internet how other people do this and I am a little stupid now.
> > 
> > I have a yocto poky image up and running based on their beaglebone-yocto
> > subset which can be utlilized
> > in my case with a rather minimal setup with a local.conf only. This since I
> > by accident actually
> > use a Beaglebone Black board.
> > 
> > I added my own meta-insidem2m layer also and in this layer I modify kernel
> > config, integrate out of
> > kernel modules and other stuff. Also barebox patches (for default boot
> > configs) are added from there.
> > The local.conf shrunk to a rather minimal content, because I have an own
> > distro in it with three
> > different images.
> > 
> > Additionally I integrated meta-barebox successfully into this and use
> > barebox in my daily development
> > work to boot from internal MMC and external SD-Card.
> > 
> > What I wonder, what is need to be done to integrate MLO and barebox.bin into
> > the SD-Card image?
> 
> We use https://github.com/pengutronix/genimage for this task. The tool
> can generate all kinds of images with complete partitioning, also
> containing bootloader images and barebox environment images if you like.
> 

yes, this is actually one option. The other one (wic) I shortly describe below.

So when you want to use 'genimage' then you should add the meta-ptx layer:

https://github.com/pengutronix/meta-ptx

This comes with a 'genimage' recipe as well as 'genimage.bbclass':

https://github.com/pengutronix/meta-ptx/blob/master/classes/genimage.bbclass

Basically, you need to create an additional disk image recipe in Yocto that
includes this class and provides a 'genimage.config' file.

The rest is then mainly genimage-generic (where Sascha already posted a link
to). The artifacts used for building the disk image are expected to be located
in the deploy folder.

An example beaglebone genimage config you can get form the PTXdist DistroKit for
example:

https://git.pengutronix.de/cgit/DistroKit/tree/configs/platform-v7a/config/images/beaglebone.config


Now, the other approach (which is probably more yocto-like), is 'wic'.

Wic is the image toolkit that comes with Yocto and basically has the same
purpose as genimage has. However, it has a different syntax describing the
content and is a bit tighter coupled into bitbake process.
It also allows extending it by plugins written in python.

Unlike with genimage, you also do not need a separate recipe, but add the 'wic'
to IMAGE_FSTYPES.

An example Beaglebone wic kickstarter (.wks) file is:

http://git.yoctoproject.org/cgit/cgit.cgi/meta-yocto/tree/meta-yocto-bsp/wic/beaglebone-yocto.wks

The comprehensive documentation on wic you can find in the Yocto docs here:

https://docs.yoctoproject.org/dev-manual/common-tasks.html#creating-partitioned-images-using-wic

The full wks reference is here:

https://docs.yoctoproject.org/ref-manual/kickstart.html

> I'm not very much into YOCTO, I don't know how genimage is integrated
> into YOCTO, there must be the right receipt files somewhere. Added
> Enrico to Cc: for that.
> 

I hope I could at least give some pointers. For detailed help on specific Yocto-
related topics, you can also join the #oe or #yocto irc channels.


Best regards

Enrico

> Regards,
>   Sascha
> 

-- 
Pengutronix e.K.                           | Enrico Jörns                |
Embedded Linux Consulting & Support        | https://www.pengutronix.de/ |
Steuerwalder Str. 21                       | Phone: +49-5121-206917-180  |
31137 Hildesheim, Germany                  | Fax:   +49-5121-206917-9    |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-11  8:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-08 13:18 yocto integration - best practice Konstantin Kletschke
2021-10-11  8:11 ` Sascha Hauer
2021-10-11  8:29   ` Enrico Jörns

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox