4 ms·
I find Linux From Scratch a bit masochistic. Embedded Linux development is equally educational while actually being useful. There are good frameworks like Build
by jake_morrison 6y ago
I find Linux From Scratch a bit masochistic. Embedded Linux development is equally educational while actually being useful. There are good frameworks like Buildroot: https://buildroot.org/ https://buildroot.org/
- pfranz 6y agoI think a bit of masochism is the point. I did it once to fill in all of the gaps and cement all the dependencies when putting together a system. That kind of knowledge helps when you're trying to do server maintenance but try and keep the system up or do crazier things but be fairly confident certain parts won't be affected. I can't see myself using a LFS system in production.
- jake_morrison 6y agoI ran Gentoo for a few years, and it was a great balance of being low level and customizable but practical for day to day use. When you have set things up from scratch, you can fix it when it breaks. The Gentoo install disk helped me recover many a server. I got tired of the endless compilation, though.
- JoshTriplett 6y agoExactly. I've been through a similar exercise of assembling a system more-or-less from scratch, and I found it quite useful as a learning experience. It's not about using the resulting system long-term, it's about seeing how one is put together.
- thom_nic 6y agoI agree, for a couple reasons. One, while you usually have to deal with a cross toolchain (usually intel-> ARM) it's easier to build and debug on a target board versus booting and rebooting your PC to see if you did everything right. Also the I've used debootstrap to build a Debian distro for ARM with a custom kernel (for an Olimex board target or Beaglebone.) That's very hands-off and not nearly the same "depth" as LFS. The next step was taking the same kernel and building a busybox-based rootfs. Then I had to make my own PID 1 and do init work to bring up services such as networking on boot which was very educational, yet busybox provides most of the "lego bricks" that you're not left writing too much from scratch. Building to an embedded target also allows one to punt on the most annoying and complex parts of a desktop linux distro, such as the desktop environment, audio/video drivers, UEFI bootloader, etc. Building a semi-custom (e.g. Arch or Debian/debootstrap, Buildroot or OpenEmbedded) headless distro was what I'd call a "shallow dive" or gentle introduction to more of Linux's inner workings without having to understand every bit in order to get a running system.
- InitEnabler 6y agoI think quite the opposite, while Buildroot is really nice for professional use from someone who doesn't know kconfig and advanced makefile usage trying to know how Buildroot builds stuff is somewhat difficult. PTXdist is another great tool and is a bit eaiser to understand as it only uses kconfig and a few bash scripts and simple makefiles. Then there is Yocto / bitbake which is basically based off of Gentoo's ebuilds... But the reason I've spent a lot of time looking at these projects is a bit of a story... I've been trying to work on getting my own distribution started from scratch myself, while LFS is a great starting point I needed to have multiple architectures. (For now I'm targeting just x86_64, aarch64 and riscv64) Which the current implementation of LFS is only applicable if you have a host with the same arch that your targeting. I've spent about maybe 9 to 15 months scripting, cross compiling, and researching this thing. Even tried looking at other projects that have somewhat simple bootstrapping processes that use musl such as Dragora Linux, Alpine Linux and Ataraxia Linux to bootstrap everything. However I couldn't really get to a good point in the compilation process where I can chroot into it and start building stuff. Might I note a year or so ago I didn't know much about toolchains, embedded buildtools, etc. but I did have a deep love for embedded. Now with these new LFS news and the changes that there are proposing / have implemented it seems that cross compiling for other archs will be a little easier since you have a good starting point to branch off of for other architectures (Though solely on your own or via lfs-hints if people are inclined to submit their alterations.). As of right now I'm running the first 3rd of the new development book, was able to write up a quick bootstrap script and bootstrap folder structure to get things going. So pretty excited about these new LFS changes and how they will pan out in the coming months. EDIT: Forgot to add, before anybody makes any assumptions. No, it's not going to be another desktop distro. It's purely focused on server machines (No GUI) with a focus on distributed systems think CoreOS / Clear Linux.
- jake_morrison 6y agoI have mixed feelings about make. On one hand, it's horrible. On the other hand, it's outlived all the competition, and will certainly be around in decades. And if you are a C programmer, you need to understand make anyway. I have used Yocto quite a bit and it's nice. But embedded systems tend to be pretty simple. What I would actually like to see is a modern scripting language like lua or Scheme embedded in the make binary. I like the idea of an embedded OS for running containers. There is actually quite a bit of support in systemd for that. So it might be as simple as Buildroot with systemd init plus a mechanism for managing system updates. Nerves is another nice approach: https://www.nerves-project.org/ https://www.nerves-project.org/
- jiggunjer 6y agoCan you recommend a good SBC?
- mech422 6y agoIt really depends on what architecture you want... I'm always raving about the ODroid H2s (love em) Arduino's and PIs are really popular. The there's an nvidia one out now too, if you want something with AI potential.
- rurban 6y agoExactly. LFS does not support multilib nor cross builds properly, neither does Fedora (missing the glibc headers). Debian or buildroot are fine to bootstrap new or natively unsupported architectures.