First of all, LFS is a book. It is intended for learning. The working Linux system you're ending up with after finishing reading the book is just a result of you performing practicing exercises while reading the book.
Linux
From Wikipedia, the free encyclopedia
Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).
Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.
Rules
- Posts must be relevant to operating systems running the Linux kernel. GNU/Linux or otherwise.
- No misinformation
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
Community icon by Alpár-Etele Méder, licensed under CC BY 3.0
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.
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.)
I'd say maybe limited embedded devices, but that would make sense before Yocto came along.
LFS is and has been mostly educational.
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.
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.