News for hackers. Stuff that matters.
Re:So you want to build an embedded Linux system? (2020) by nickysielicki on Wednesday February 09, 2022 @12:03PM (#30275001)
Previous thread, 2020: https://news.ycombinator.com/item?id=24800037

This article is awesome and has a ton of great knowledge, but it’s a little dismissive of openembedded, and if you click through to the previous thread you’ll see a lot of people come to it’s defense.

Re:So you want to build an embedded Linux system? (2020) by voakbasda on Wednesday February 09, 2022 @06:36PM (#30280363)
Lots of good replies on that thread.

I have been doing embedded development for 30 years, and Yocto is the best build system that I have used for managing large embedded systems. If you need to professionally manage multiple distributions across menagerie of different host and target machines, there simply is no other meaningful choice that operates at its scale.

I first encountered BitBake before either the OpenEmbedded or Yocto projects existed. Since then, I have done professional embedded systems consulting for dozens of platforms, using Yocto almost exclusively in recent years. I have done everything with it, from simple board bring ups to implementing re-usable BSP layers used by multiple product families. I might be a little biased here, but I have used all of the other popular embedded build systems too.

Other choices still have their place for smaller and simpler projects, just as one might choose something smaller than Linux for the kernel. However, Yocto and Linux have attracted unparalleled open source development and support resources. Other projects simply cannot hope to match their established output. These projects will not go away any time soon, which means LTS releases and stable infrastructure to host them, regardless of individual players or projects coming or going. What other choice exists with that kind of backing?

For commercial projects that grow beyond a certain scope (i.e. most modern full-featured embedded systems), other choices simply do not match its existing capabilities. Of course, you can always fork a full server/desktop Linux distribution like Debian, but dressing up a standard distribution in embedded clothing often requires more customization. That comes with develop and maintenance costs, though I admit the lines do start to blur at a certain point.

The BitBake/OpenEmbedded/Yocto/Poky ecosystem is huge and poses a long and steep learning curve, but it offers customization and extensibility unparalleled by any other offering that I have had the (mis)fortune of using in my career. The same is true for the Linux kernel ecosystem, right? Them's the trade-offs we make.

Re:So you want to build an embedded Linux system? (2020) by na85 on Wednesday February 09, 2022 @11:24PM (#30282441)
>I have been doing embedded development for 30 years

What's your take on the various *BSD distros in the embedded space? A lot of BSD proponents like to talk about the stability and minimalism (a proxy for resource-efficiency I guess) of BSD in comparison to Linux.

Is there any reason to reach for BSD in an embedded application these days?

Re:So you want to build an embedded Linux system? (2020) by voakbasda on Thursday February 10, 2022 @01:15PM (#30290261)
The BSDs fall into the class of server/desktop systems. They would be a great choice for certain classes of products (e.g. routers) where there exists strong feature alignment, but not something I would consider suitable for producing my usual minimal custom embedded systems.

Generally, esoteric hardware support also will be better in Linux, so BSD would likely require porting or writing more drivers when bringing up a custom board.

That said, BSDs have not my strongest area, so I would be curious to see others’ experiences and opinions.

Re:So you want to build an embedded Linux system? (2020) by synergy20 on Wednesday February 09, 2022 @10:19PM (#30282045)
I have been doing embedded linux for 22 years and sadly Openembedded/Yocto has been the worst build system ever. It's the Gentoo for embedded(where is Gentoo nowadays), over-engineered so much for most use cases unless you work at Windriver or Amazon that deals with lots of different boards from different vendors and you have unlimited resource to work with the complexity.

If I got a codebase that uses Yocto/Openembedded, the first thing I do is to find the related patches there and convert them to buildroot/debian/openwrt/LTIB(old stuff)/etc depends on the hardware spec. I wasted too much time when there is a bug in Openembedded that could take forever to debug, layer over layer, override over override on those meta mazes, it always feels like you're fighting with openembedded/yocto itself instead of getting your work done. I since have been avoiding openembedded/yocto at all costs.

Re:So you want to build an embedded Linux system? (2020) by dgfitz on Wednesday February 09, 2022 @10:40PM (#30282188)
There is a learning curve, but when crossed, it’s a beautiful system.
Re:So you want to build an embedded Linux system? (2020) by synergy20 on Wednesday February 09, 2022 @10:57PM (#30282298)
same could be said to gentoo, from experience over 2 decades and at least 5 projects involved yocto(back then it was openembedded), for the same project, yocto will take 5x more time/efforts per my measurement. yes adding stuff is fine, building is the slowest but I can wait, however if something went wrong, be prepared to debug openembdded/yocto-itself for days, this does not exist in other alternatives: you debug your own code, not the framework there.

It's over engineered, over rated, great for consultants to charge hours, terrible for companies(except for big guns) to deliver product fast.

Sorry I have a strong opinion here but it just wasted too much of my time in the past.

Re:So you want to build an embedded Linux system? (2020) by nrclark on Thursday February 10, 2022 @11:20AM (#30288401)
Buildroot is definitely much simpler, and more limited. That's a plus and a negative, depending on what you're doing with it.

Do you have one board that you need to bring up in isolation? Buildroot is great. It's easy and fast. Do you want to share configuration across multiple designs? Buildroot hits its limits pretty quickly there. And Yocto really starts to shine.

I worked at a company that used Buildroot to support 20 different boards, all in the same repo. The boards shared some level of common configuration across the whole repo, and groups of boards also shared some common configuration.

The entire thing was managed by the C preprocessor as a pre-Buildroot step, and it was a gordian knot of emergent complexity.

The catch is that Buildroot doesn't give you any tools to enable shared configuration, none at all. Buildroot doesn't know how to share build-products across multiple images, and doesn't even know how to _build_ multiple images or keep them separate without having to clean your workdir. It doesn't even track file dependencies, let alone configuration dependencies. It's terrible at knowing when a package is stale.

Yocto is much, much better than Buildroot for handling these kinds of use cases. Images are just recipes, like any other kind of recipe. You can build 8 different images by just asking for each of them by name. Yocto won't rebuild anything that can be shared, and your images can be subclasses of each other which just add or remove a few packages or a bit of configuration.

Yocto is also better at tracking/managing customizations. In Yocto, it's easy to express something like "use the upstream OpenSSH recipe, but do something custom for the config step, and add an extra post-build step, and add these 3 patches, but only add patch 3 on some designs, etc".

In Buildroot, you have to do this in a global namespace using macro-processing in GNU Make. You have no control over the parse order of included Makefiles relative to the upstream files. It's messy and difficult to modify anything, and you have to understand each recipe's quirks and hooks. And the only programming language you have is GNU Make.

In Yocto, there is an inheritance system that lets you use .bbappend files to override the behavior of any recipe you want. You can also stack multiple append files across different layers. If you need something exotic, you can express it as parse-time Python. Yocto is more complex up-front, but it pays off IMO.

Re:So you want to build an embedded Linux system? (2020) by synergy20 on Thursday February 10, 2022 @01:40PM (#30290575)
As I said, to deal with multiple boards or vendors yocto might worth the pain, but the majority of users do not do 20 boards in parallel.

network gears, go openwrt, general spi-flash based boards, buildroot it, anything with a SD card and 256MB+ RAM, just use debian, if you're a BSP vendor like windriver, take on yocto then(which is why Intel 'owned' Yocto when they also bought windriver then)

Re:So you want to build an embedded Linux system? (2020) by eschneider on Wednesday February 09, 2022 @09:49PM (#30281873)
Yocto is fantastic and well documented but getting started is hard and nothing makes much sense until you fully understand it. Once it clicks, though, it’s great. Totally worth the effort.
Re:So you want to build an embedded Linux system? (2020) by PragmaticPulp on Wednesday February 09, 2022 @07:14PM (#30280736)
> but it’s a little dismissive of openembedded

I don't really see it in the article.

I use OpenEmbedded for my projects, but I never recommend it to beginners as the place to start. Buildroot is unquestionably easier to get started with and use for one-off projects (unless you're trying to use vendor-provided Yocto/OE layers, in which case obviously it's not an option).

The article's conclusion about Yocto is spot-on, in my opinion: If you're quickly iterating, Buildroot is the way to go.

Re:So you want to build an embedded Linux system? (2020) by pmorici on Wednesday February 09, 2022 @05:01PM (#30279164)
The authors description of the two has been consistent with my experience. Buildroot is a lot easier to get going with. There might be good reasons to use yacto but if you are new to all this I wouldn’t start their.