Introduction
While Linux has become an increasingly popular operating system in recent years, it often takes users some time to choose their preferred distribution. Every distribution has its own quirks, features and frustrations. For a long time, Redhat had a nasty reputation for burying configuration files under the /usr tree, whereas Debian maintains that ALL configuration files live in /etc .Inevitably, there will be features from one distribution that the users wishes were present in their preferred distribution. For example, a set of Fedora scripts for dealing with wireless LAN cards might be a worthy edition to a Slackware installation. If you try and mangle Slackware to work with those Fedora scripts it is probably possible, but it'll need a lot of hacking to get working. Linux from Scratch (LFS) is the control freak's solution ? build everything from the ground up, just how you like it, so your Linux distribution contains everything you need, just how you like it.
What is LFS ?
LFS is really a recipe book rather than a distribution. The book details a common method used to build a linux system from scratch. There is a vibrant community associated with the book, including an active IRC help channel, extensive documentation, and a large collection of hints and tips to get you through most problems. A LFS system begins as a blank canvas, and it is up to you how you grow it into your distribution. Although the book is now so advanced that it is possible to build a system without having a clue what you're doing, its true value comes in following and understanding the process. It comes as a shock, but when you first boot up your shiney LFS system you get a bash terminal, and not much else. This is not a bug, it's a feature ! The bare-bones beginnings of an LFS system provides the user with the opportunity to choose their software and configuration very carefully. LFS is an opportunity to dominate your linux system, by starting with nothing and building it up into what you want your system to be.
How does it work ?
The process begins with the installation of a common linux distribution. I began my LFS adventure with RedHat 8.0 when it had just been released, and I used that as a host system to construct my own linux system. Using the compilers, linkers and build tools on the host system a new toolchain is built on a spare partition. Then, by chrooting into the newly built toolchain, you use these new tools to build your new operating system. It is quite exciting to watch your linux system building in front of your eyes, and to be driving it, rather than simply watching emerge do it for you. Once your basic system is installed, you have the task of compiling and installing the software you want to run, where you'd like it, and how you'd like it. If you don't like a package, don't install it ? use an alternative.
Why use LFS ?
There are two key advantages to a LFS system.
Firstly, you have complete control over the system. You know exactly where everything is installed, and if it breaks, you know what to fix, how, and when. If you don't, someone is likely to have had a similar experience and you'll soon become adept at troubleshooting compiler errors, using log files to track down problematic software, and filing accurate bug reports.
Secondly, you can guarantee that a LFS will have a small footprint. Last time I built an LFS system, (Version 5.1) the complete installation (including X, and all necessary tools) took about 350 MB. In comparison, the basic Ubuntu footprint is about 1 gigabyte and the basic Windows XP footprint is similar. Once I stripped the binaries I'd built of debugging symbols, I had a compact graphical system of around 270MB. That's cute.
The other main reason that I recommend a LFS system is that building the system is a fantastic learning experience. You meet some very knowledgeable people, and you learn to understand exactly what is under the hood, and how it got to be there. There really is nothing like hands-on experience to get to understand your linux system.
Why not use LFS ?
LFS is not a cuddly operating system when you first meet it. There are no tools or wizards to hold your hands, and the first challenge is getting information onto the machine! You have little or no tools, and you need to build everything from the ground up. Even with a fast machine it still takes a long time to build your system and customise it to you. Once it is done it doesn't need a lot of maintenance, it will keep running happily, but it takes a long time to get to that stage. A worthwhile experience, but a time consuming one.
It can also be difficult to keep your system up to date with the latest packages. There are over 100 packages in the core system alone, not to mention all the packages you add to make your system unique. It can be tedious to keep track of all of these and download and compile these as soon as they are updated. The lack of a serious package management system and the source-building approach is both a key feature and a disadvantage of a LFS system. I wouldn't recommend an LFS system for a production server, simply because it is so difficult to keep up to date.
Conclusion
LFS is a fantastic learning experience. By reading the book, compiling your base system from your host and cleaning up, you can learn an awful lot about UNIX systems. Adding all your favorite applications and scripts to the system will also help you understand your system, and what makes it tick. Or, more importantly, why it isn't ticking. As fun and educational as LFS can be, it is too difficult to keep up to date to be of practical use as a production system. I recommend it heartily to all linux enthusiasts as a valuable learning tool, but not one that you will likely use beyond /home.
mercurus
mercurus@gmail.com
This article was originally published by CyberArmy.net in the CyberArmy Library.
|
|