Hacker News new | ask | show | jobs
by msarnoff 480 days ago
The one thing I still don't like about Yocto is the setup process. You need to check out multiple layer repositories, make sure you check out the right commit from each repository (need reproducibility!), put everything in the correct directory structure, and then set up `bblayers.conf` and `local.conf`.

I've got a script that does all this, but it's still a pain.

I've been thinking about putting everything in a monorepo, and adding poky, the third-party layers, and my proprietary layers as submodules. Then, when the build server needs to check out the code or a new developer needs to be onboarded, they just `git clone` and `git submodule update`. When it's time to update to the latest version of Yocto, update your layer submodules to the new branch. If you need to go back in time and build an older version of your firmware image, just roll back to the appropriate tag from your monorepo.

Anyone else have another solution to this issue?

Oh yeah, and the build times. It's crazy disk I/O bound. But if you're using something like Jenkins on an AWS instance with 96GB of RAM, set up your build job to use `/tmp` as your work directory and you can do a whole-OS CI build in minutes.

4 comments

I recently found out about the 'kas' tool that tries to be a better version of the hacky scripts we all write for this. Here's a link to an example YAML config to give you a taste: https://kas.readthedocs.io/en/1.0/userguide.html#project-con...
+1 for kas I won't build yocto images any other way. Using their kas-container script makes building with their container a breeze.

Other kas features I love: - Patching 3rd party layers with quilt - Configuration fragments - Chaining together configuration fragments

As another example, here is my kas setup for building rootfs images and container images for various different boards:

https://github.com/unitexe/meta-unit-kas

There's ongoing work on an official setup solution, "bitbake-setup". See https://lists.openembedded.org/g/openembedded-core/topic/111....

Shameless plug, there is also my own tool, yb. It's very early days though: https://github.com/Agilent/yb

I just use git submodules because, whilst they can be frustrating, it's a workflow I'm familiar with. Other options would be kas or gclient.
You could see whether kas[0] could help you there. It fixes some of the manual steps, while adding tons of goodies.

[0] https://kas.readthedocs.io/en/latest/