How to Build Your Own Linux Distribution
Shelly writes "Go to the source to learn Linux basics and build the right Linux for you. Linux From Scratch (LFS) and its descendants represent a new way to teach users how the Linux operating systems work. LFS is based on the assumption that compiling a complete operating system piece by piece not only teaches how the operating system works but also allows an independent operator to build systems for speed, footprint, or security."
I want mine with hello kitty all over it
Beware the Jubjub bird, and shun the frumious Bandersnatch.
With LFS reaching 6.0 a while ago, how is this news exactly?
Queue gentoo fanboys...
But seriously, LFS is new? I based my distribution on LFS, and it taught me a lot about how linux works, but this was several years ago. How is LFS new?
--
The last digit of pi is four.
First, Linux From Scratch has been around a long time. Back when I first started using GNU/Linux, I had RedHat installed because I recognized the name. I soon decided that I wanted something that I knew worked because the programs were compiled together, the way they were meant to be. Enter LFS. But if you've ever set up a system (especially a slow system) from scratch, it is kind of painful. My laptop was an LFS system because nothing else worked right with the hardware. But Gentoo is really not a bad solution: you get the flexibility, but all the hard, painful work is done. No more looking for hundreds of package updates, no more hand checking dependencies. LFS is a good deal for systems that are tied to very specific applications, and I learned quite a bit about the layout of the system, so I encourage everyone to take a look at LFS. But for oft used systems, it's more of a hassle than it's worth.
found a great primer: http://www.ccoss.org/tutorials/lfs/Linux_from_Scra tch_A_Tour.htm
It can also provide you with the most frustrating experience ever!
./configure options, and installation in general.
Not entirely, but some broken packages (or installing one that breaks another) is probably the bane of most administrators existence...
This is why a source hybrid (ala. gentoo) system works so well. You compile from source (reaping all the benefits) but something else manages dependancies, conflicts,
(For the record, I used Linux From Scratch 5.0, I built my base system, then stopped before I had an x server or anything [also known as, Beyond LFS]. )
People have been doing LFS for years. It's nothing really too new or significant.
It's not even a really good way to learn about how "Linux the OS" works. It's just another way of spending an inordinate amount of time tinkering with your computer (not that there's anything wrong with that).
If you want the benefits of LFS without the pain, just stick with Gentoo or Sorcerer Linux and let someone else worry about the sources. You still get the custom compilation benefits but don't have to waste time trying to track down stupid dependency problems (at least not as much as you would with LFS, but more than with a mainstream distro).
LFS is a nice way to learn more about Linux, I built LFS on a box a few years ago, and probably learned more about Linux doing so than I ever could have just from using it, or just from reading books targed at a specific distribution.
That said though, I don't think it's very practicle for a system that you actually want to use for day to day use. Building a Linux system from scratch takes a lot of time, and then you have to keep track of all of the security patches for all of the packages you used, and if you want to upgrade one of the core libraries for some reason you end up having to rebuild most of the system.
Building a distro for scratch is a fun way to learn, and I encourage hobbiests who are interested in learning how a linux system works to do so, but unless you have a critical mass of people contributing patches, helping with stuff, etc, then you end up spending all your time keeping the distro up to date, and no time actually using the system.
Which, if your just in it for the hobbiest aspect isn't necessarily a bad thing, but I still think it's generally impracticle if you want to have an actually usuable distribution.
Famous Last Words: "hmm...wikipedia says it's edible"
Next week: Fire - A How-To Guide
(A disturbance in the force, as though an entire audience with Asperger's was thinking: "was that supposed to be funny?")
This is humor. Laugh damnit, laugh!
If you can follow directions you can get LFS up and running. That is all you need to know how to do. Complete newbies get Gentoo or LFS working simply by following directions.
LFS is cool and has a place for those willing and able to make decisions on how base libraries and apps are compiled. Speed? Sometimes, but only of import in limited applications. None of which newbies should be involved with.
I teach Linux use and administration, as well as security. LFS doesn't exactly provide you the opportunity to learn how to secure your system any more than SuSE, Redhat, or Gentoo for example, or even Slackware.
Further, there are many choices you have to make right from the get go. This merely teaches you a way (assuming you are doing more than following the directions), not the way. There are few "the way it works" out there. And that is how it works on nearly all distributions. LFS provides no advantage there.
Indeed, security-wise unless you already know what you are doing, LFS provides you a prime opportunity to leave your system open. Most modern distributions come fairly well locked down out of the box. LFS, by definition doesn't. While you are downloading the packages you are potentially exposed. So you have to follow the step by step directions. Which puts us back to merely following directions.
When I want/need to teach people the nitty gritty, I turn to gentoo, not LFS. I gave LFS a long trial and it failed in comparison to gentoo for this purpose. I've been "doing Linux" for about ten years, so the idea behind LFS isn't new to me. Gentoo provides a solid base on which to build a custom "distribution" (it isn't a distribution if it is for your own purposes/company/use - you have to distribute it to be a distribution).
LFS has it's place, but not as a teaching you how Linux works and how to make it fast and secure standpoint. It is mainly aimed at/useful for the hardcore or people who have very specific unmet software set needs.
My Suburban burns less gasoline than your Prius.
We probably don't need any more general purpose distributions, but the value in a kit for making a new distribution is for specialised applications. There are various router/firewall projects and a couple of DAW (Digital Audio Workstation) packages that come in to this category, for example. There's lots of potential for whole applications that boot from a CDROM like Knoppix and can be temporarily used on an PC without touching what was installed on the HD.
Best way to learn how Linux works is by breaking it. And then spending 3 days trying to fix it. And then breaking it again. And again. And again.
And it's easy, all you need to do is try to get that weird piece of equipment working, or that x version of software y which isn't in your distributions repository. And Linux will break. And you'll learn it! It's great!
Building your own Linux distribution is like building your own airplane.
People build their own airplanes not because they want Airplane X or Feature Y, they do it because they want to build an airplane. They want to take control of the construction process and be intimately familiar with the final product. They want to learn how the various airplane systems function. They will not necessarily learn the detailed workings of an internal combustion engine, but they will learn how it interacts with other systems.
The same is true with LFS. If you want a generic Linux distribution, then install Fedora, Gentoo, Debian, or whatever suits you. However, if you want to build your own Linux distribution, if want to take control and be intimately familiar with the final product, then LFS is the way to go. You will learn how the various components function. You will not necessarily learn the detailed workings of the Linux kernel, but you will learn how it interacts with other system components.