When it comes to most “normie” use cases in Linux (and I am including the self hosting community here as well), people prefer working on well established and supported distributions such as Debian, Ubuntu, CentOS, Fedora, etc.

Generally, people would discourage the use of bleeding edge distributions like Arch, Gentoo, etc. as it might break something if the user doesn’t know what they’re doing. Yet, I have seen instances where this has been used by hobbyists and companies. (ChromeOS is a Gentoo corruption, and SteamOS is an arch derivative).

What about Linux from Scratch (LFS)? Under what circumstances would one want to build Linux from the ground up for production or commercial purposes?

  • @[email protected]
    link
    fedilink
    English
    819 hours ago

    Linux From Scratch (aka LFS) is a set of documentation and resources that describe one way in which to build everything on a Linux system yourself. It is not the only way though. Embedded systems is one place you might build every image from scratch but if you go down that route you are typically using something like yocto or buildroot which are designed to compile simple embedded distros for specific projects using an existing system for the build process. These are useful as embedded systems are often resource constraint and you don’t want to include things that are not required and often on different architectures from the host systems (such as ARM CPUs).

    These days there is very little commercial purpose to creating your own distro from scratch that are not for embedded systems. It is a lot of work and generally not worth the effort unless building a distro is the point of your business - but even then you better have a good reason that using an existing one as a base is not a good idea. Packaging everything for a general purpose distro is a lot of work with very little benefit for a company to do. It is vastly easier to use what others have done as the base until you can justify the expense of managing everything your self (if it ever makes sense to do that).

    So the only real place that you would go down building a distro from scratch is if you have a new or different idea about package management. Arch Linux did this with pacman, Gentoo with emerge, Alpine with apk, and Nixos with nix. These types of things typically start out as hobbyist projects and grow from there rather than with a commercial intent in mind.

    The only other thing that makes sense is from a very high threat model for security reasons - thinking nation state level actors not your every day home user. You may want to build everything from scratch if you want to absolutely trust everything on your system and have the time and resources to do this.

  • @[email protected]
    link
    fedilink
    821 hours ago

    I’d say “under no circumstances”. When building for production, you want to build on a stable foundation. LFS isn’t that, it’s an educational tool. It does not result in a maintainable, robust system. It requires tremendous amounts of work to keep it secure and updated: there’s no package manager, no repository you can pull from, no nothing. You have to build an entire distribution on your own. Outside of educational purposes, I’m having trouble to imagine any situation where that might be a good idea.

    No, not even embedded. There were always distros targetting embedded systems, LFS was never a good choice there either. It was much more straightforward to strip down - say - Debian for a limited device, than to build something from scratch for it. (I spent a few years building and operating embedded Linux systems at the early 2000s, we built it on a stripped down Debian.)

  • @[email protected]
    link
    fedilink
    821 hours ago

    I’d say maybe limited embedded devices, but that would make sense before Yocto came along.

    LFS is and has been mostly educational.

  • Dave.
    link
    fedilink
    4
    edit-2
    21 hours ago

    Mainly when you are building a single-purpose , “appliance” device and you have the bare minimum of RAM/storage available. You just want to get the board powered up and initialised and then jump to your application.

    So you build a kernel with only the correct drivers you need, you skip initrd, you skip initscripts and (lord forbid) systemd, you just jump straight to your program, with possibly busybox available if you need debugging.

    Edit: I’m talking more about building it from scratch here, not LFS. Regarding security issues, you then “only” have to deal with kernel exploits, with a limited surface as you have limited modules linked, and exploits in your application.

  • @[email protected]
    link
    fedilink
    English
    220 hours ago

    in my experience: it’s come down to professional & legally binding licensed support.

    when it comes to money; they won’t want to know the name of the person whose throat they can choke if anything goes wrong.