Live data from Hacker News

Yocto, RockPi and SBOMs: Building modern embedded Linux images

vpetersson.com

21–30 of 125 posts

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#21
Last time I tried Yocto, some people here on HN suggested that I try Buildroot instead.

I don’t see so many mentions of Buildroot in this thread yet.

If you are interested in Yocto it might be worth having a look at Buildroot as well. I liked it a lot when I tried it.

My thread from years ago, where people told me about Buildroot:

https://news.ycombinator.com/item?id=18083506

The website of Buildroot:

https://buildroot.org/

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#22
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.

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#23
post #17

This toolchain is about half my dayjob. Bitbake is a meta-compiler, and the tool suite is very powerful. Just realize to this means you need to be an expert error-message debugger, and able to jump into (usually c/c++) code to address issues and flow patches upstream. It really is gratifying when you finally kick out a working image.

Yocto error messages are absurdly awful. Hope you like fishing out the one gcc error out of 10,000 lines of garbage output.

There's nothing as disappointing as starting a build, going out for a couple hours, and coming back to a terminal full of red.

But when it works, it works.

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#24

Last time I tried Yocto, some people here on HN suggested that I try Buildroot instead. I don’t see so many mentions of Buildroot in this thread yet. If you are interested in Yocto it might be worth having a look at Buildroot as well. I liked it a lot when I tried it. My thread from years ago, where people told me about Buildroot: https://news.ycombinator.com/item?id=18083506 The website of Buildroot: https://buildro…

I think, in a lot of cases, the choice between Buildroot and Yocto comes down to "which one does the SoC vendor support."

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#25
post #13

It's crazy that you have to use this custom "embedded" tooling when the vendor should be implementing support in vanilla Linux distros.

I agree that vendors should upstream, but into packages that are upstream of even the distros. It's not like x64 where the same binaries can support multiple systems. My product OS can't even boot on the chip maker's devkit and it's impossible to make a binary that works on both.

A vanilla distro doesn't want to support a platform with a few hundred thousand units and maybe a few dozen people on the planet that ever log into anything but the product's GUI. That's the realm of things like OpenWRT, and even they are targeting more popular devices.

I understand the hobbyist angle, and we don't stand in their way. But it's much cheaper to buy a SBC with a better processor. For the truly dedicated, I don't think expecting a skill level of someone who can take our yocto layer on top of the reference design is asking too much.

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#26
post #5

>you can’t run “apt update” if you want to get a little weird, you can tell yocto to compile everything into deb packages and host them yourself with something like aptly

Yeah that’s true. But if these are embedded devices, you probably want an A/B partition scheme with full transactional updates and rollback.

I once built a Yocto system that had both... We'd use our package index for quick hotfixes, and push a full OS image to the A/B partition for larger, riskier changes. It was nice to have options.

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#27

I am actually scared of switching jobs in case my next job doesn't involve yocto. How would I make use of the countless hours I have already invested in this piece of software? Countless keywords and the dark magic of the ever changing syntax. But when it works it works..

Just curious, what is the procedure that does NOT involve Yocto? I guess a ton of shell scripts? Where can I learn it (i.e. build a Linux system for any embedded system without using Yocto or similar tools)? Is the LFS project the first place I should visit?

Background: I just switched to Ubuntu 22.04 for my daily use (mostly coding for side projects) but TBH I'm just using it as Windows. I use a Macbook Pro for work and know a bit of shell scripting, some Python, a bit of C and C++. Basically your typical incompetent software developer.

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#28
post #13

It's crazy that you have to use this custom "embedded" tooling when the vendor should be implementing support in vanilla Linux distros.

This comment makes zero sense. It's a meta-distribution: it builds a custom one for you. Professional custom embedded distros are a different beast altogether from the vanilla distros.

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#29

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

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

Re: Yocto, RockPi and SBOMs: Building modern embedded Linux images

#30

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

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/

Post reply on HN