First published 15 May 2004 as a replacement for the introduction for the Linux From Scratch book.
Who would want to read this book
There are many reasons why somebody would want to read this book; the principal reason being to install a Linux system straight from the source code. A question many people raise is “Why go through all the hassle of manually building a Linux system from scratch when you can just download and install an existing one?”. In this section, we will explain why you want an LFS system and what the main advantages of it are. We also explain the principles and assumptions which are fundamental to this book.
While most Linux distributions are generally more usable out of the box, they hide the complexities of a Linux system. They install a lot of software which you may not use at all, and can leave you wondering who’s actually in control of your computer. If you have an itch to learn more about the system, to keep it compact and stay in control, then this book is for you! The Linux From Scratch book explains how to build a Linux system using nothing but the sources of the packages. The two main goals for building an LFS system are (1) education about Linux systems, and (2, with BLFS) building a personalized Linux system. LFS is ideally suited for both goals.
One of the primary goals of LFS is to educate you about the inner workings of a Linux system. Since we believe in learning by doing, LFS will build a minimal system, guiding the reader as closely as possible while still assuming basic Linux/Unix knowledge. References to other documentation are made throughout the book, thus allowing the book to remain focused and narrow.
Personal Linux system:
Using LFS to build your own system has the following advantages:
All packages are installed from source, which means that you always know exactly what packages are installed and what version is installed. You have complete control over his system and even have the choice of several package management systems to automate your system. With LFS, you are in the driver’s seat and dictate every aspect of your system, such as the directory layout and bootscript setup. You also dictate where, why and how programs are installed.
Because LFS provides only the minimum base packages required for a functioning (though not necessarily very usable) system, it is very compact. You choose to install only the software you wish, thus the tightest possible installation is possible, allowing a very minimalistic system even suitable for USB drives.
An LFS box can be built using the latest releases of software. No more waiting for distro’s patches! Since an LFS system is compact and you’re in complete control of installing software, it is usually more secure by default then other distro’s. Since you are in complete control of what software gets installed, you don’t have to worry about unnecessary daemons or servers running. For additional security you might want to check out Hardened LFS, an offspring of LFS, which focuses both on a secure default setup as well as hardening a basic LFS system.
By using the latest development tools available, your packages can be optimized more. By stripping binaries from debugging code you don’t need, your system will be even faster. And for the real speed freaks, you can set CFLAGS to optimize all your applications. But keep in mind that extensive optimization is always a stability risk.
The primary focus in LFS is on learning about the system. We believe you learn the most by following the procedures outlined in the book. These procedures are well-tested and are optimized for technical excellence. The book is thus meant to be read linearly and its approach is very deterministic. This means that completing the instructions in the book does not mean that your system is finished! You’ll very likely want to install additional packages to customize your system, and you’ll have to do some planning in advance if you wish to replace your current Linux system. The LFS book is much like a blueprint of a solid foundation upon which anything can be built – a house (terminal), a villa (desktop system), a prison (firewall), a mall (fileserver), etc. In order to allow all these systems, LFS is both generic and quite minimal. After you’ve finished the LFS book, you’ll definitely want to check out the BLFS project for instructions on how to use the foundation LFS provides and turn it into your ideal Linux system.
Like we mentioned above, the goals of the LFS book are education and building a foundation for your own system. To allow this dual goal, we have set the following principles to set the scope for the packages which will be installed:
- The LFS system is independent of the host, thus capable of booting, logging and shutdown.
- The LFS system can recreate itself according to the LFS book. This requires a functional toolchain and the most common developer tools.
- The LFS system will be representative of a modern Linux system, incorporating the latest technology/functionality where it doesn’t detract from the educational value of the book, and it aids in achieving point 4 below.
- The LFS system provides hardware support for essential system components for our target architectures (x86 and ppc). This requirement is met by the kernel and it’s helper systems.
- It provides the standard UNIX file manipulation tools and their documentation.
- It provides basic network connectivity. 1
- It provides support for multiple users.
This has the advantage that from each package, you’ll be able to identify its purpose and its reason of existence in the book. The LFS system uses as up-to-date versions of packages wherever possible and testing and editing resources allow. This is not just for security, as mentioned above, but also to incorporate bug-fixes as soon as they are made available from the package developers/maintainers. It also allows LFS developers and users to provide more accurate bug reports upstream as and when they are required, thus enabling us to give something back to the FLOSS (Free/Libre Open Source Software) community.
For each package, we provide an explanation of its function. Furthermore, we provide installation and configuration instructions according to the advice and expectations of the developers or maintainers of the software packages we install. Adjustments are only made to fit our build procedure or fix bugs. Where there are multiple packages available with the same behaviour, the choice of which one is included in LFS is based on the relative stability, compatibility with the rest of LFS, and availability of upstream support of each of the packages. Finally, when appropriate, we will point you to alternative or additional instructions, for example when choosing a specific filesystem.
Who would not want to read this book
Building and maintaining an LFS system takes quite some time. If you’re convinced of the benefits of a source-based system but don’t want to manually build everything yourself, you might want to check out Gentoo.
If you only want to know what happens while your computer boots, then we recommend the From Power Up To Bash Prompt HOWTO. The HOWTO builds a bare system which is similar to that of this book, but it focuses strictly on creating a system capable of booting to a BASH prompt.
While you decide which to read, consider your objective. If you wish to build a Linux system while learning along the way, then this book is probably your best choice. If your objective is strictly educational and you do not have any plans for your finished system, then the “From Power Up To Bash Prompt” HOWTO is probably a better choice.
1Basic networking means different things to different people. Considering the objectives for LFS and BLFS, we only provide configuration for a static IP address and refer to BLFS for extended network configuration such as a home network or an Internet connection. This nicely fits our paradigm of configuring all packages we install without broadening the scope of the book. Practically, this means that many people won’t be able to connect to the Internet with a basic LFS system. Since the means to connectivity vary so much for different users, you’ll have to refer to the BLFS book for instructions on how to achieve this. If you wish to replace your current Linux system, please consider this in your migration plan.