Hello all, I’m an embedded software guy struggling with Yocto. I’m not asking for assistance as I cannot be saved. Rather, I’d like to make my own. How hard it would be to put a Linux distro onto a device without it? For example, if I were to get a perfectly good distro (let’s just say Debian) with the right architecture going in a container. Is there a simple way to combine that with u-Boot, and other crap from a SoC manufacturer to build an image? If that is oversimplifying, I’ve done Linux from scratch before, and I’d be willing to go that route as well. I guess the issue boils down to the specifics like building the image and anything else that I’m not aware of.
So, what part of this idea is going to be a lot harder than I’m giving it credit for?
By the way, I’m aware of Buildroot. This is more for learning purposes, and who knows… maybe I will actually make something out of it.
What platform are you trying to target? That makes a big difference in what kind of support is available. The more uncommon your hardware is, the more work you will have to put into building the distro. If I recall, Debian does provide some documentation on bootstrapping new hardware. You could try going that route. Yocto and the bitbake recipe syntax does have a learning curve in the beginning, but it is a really powerful build system, and probably would save you a lot of headache. Especially if you want to keep the image updated or extend the capabilities in the future. If you already have a cross compiler, bootloader, and a kernel for your target, you’re halfway there. Then all you need to do is figure out what applications you want for your distro. But if you’re going to have to build that all from scratch, Yocto will probably save you a bunch of time when you have to recompile and redeploy.
Right now, the most common target we have at work is variscite imx6,7 and 8. Nxp has leaned heavily into yocto. To be clear, this would be an outside of work thing, but I’ll probably yoke one of our dev boards.
Yeah you’re right, NXP does lean into Yocto. The IMX line has good support with it. You might have the flexibility of going with the community built BSPs and/or vanilla Linux kernel, if you don’t want to rely fully on NXP written software. I’m not 100% certain on the support for your boards under the community supported repos, so you’ll have to look into your exact use case. But it does give you some options.
You may want to take a look at the TockOS instead of Linux if you’re doing embedded dev - it’s a safer alternative to Linux for embedded devices, and generally easier to work with (though the supported hardware alternatives are not as numerous as with Yocto / linux).
I’d recommend against something like Debian for embedded work - it’s too large, and presents too much of an attack surface for most embedded project needs. And while Debian doesn’t often see critical security vulnerabilities, it does on occasion and you’d need to figure out a method for performing those upgrades on your embedded device (which wouldn’t be fun for yourself or anyone else who uses your project). Just something to keep in mind…
Yeah I tried Buildroot and Yocto and got frustrated. Buildroot did work, but it does a ton of stuff with a ton of not-very-well-documented options, and it definitely wasn’t integrated into a proper build system. Like there’s no way I’d trust any kind of incremental build.
I ended up doing it myself. Tbf I was just benchmarking kernel boots so I didn’t need userspace or even real hardware. I only needed OpenSBI (a RISC-V firmware thing) and the kernel.
Frankly OpenSBI is a rather undocumented mess too. Incremental OpenSBI builds don’t work, and I did try and contribute fixes but despite the repo being on GitHub they auto-close PRs and tell you to use
git send email from the command line to a mailing list like it's the 90s
. I shit you not. How to keep away contributors.Anyway my conclusion is that the whole Linux OS building story is a shit show. If you only want a basic image with busybox etc. you can probably do it yourself and then you will actually understand it, but you will just be recreating Buildroot.
Ha. I’ve never used buildroot, but I think I’m going to have a go at it. I promise not to use python ;]
Thank you for the insight.