%general-entities; ]> How to Build an LFS System The LFS system will be built by using an already installed Linux distribution (such as Debian, OpenMandriva, Fedora, or openSUSE). This existing Linux system (the host) will be used as a starting point to provide necessary programs, including a compiler, linker, and shell, to build the new system. Select the development option during the distribution installation to be able to access these tools. As an alternative to installing a separate distribution onto your machine, you may wish to use a LiveCD from a commercial distribution. of this book describes how to create a new Linux native partition and file system. This is the place where the new LFS system will be compiled and installed. explains which packages and patches need to be downloaded to build an LFS system and how to store them on the new file system. discusses the setup of an appropriate working environment. Please read carefully as it explains several important issues you need be aware of before beginning to work your way through and beyond. explains the installation of a number of packages that are needed to resolve circular dependencies—for example, to compile a compiler, you need a compiler. or to unpack the tar package, you need tar. also shows you how to build a C cross-compiling toolchain as a first step, including binutils and GCC. Cross-compiling is not absolutely needed since the machine we'll run LFS on is the same as the one we build on, but it has the advantage of clearly separating the already installed system and the future LFS one. The next step is to build Glibc, the C library. Glibc will be compiled by the toolchain programs built previously. Then, the missing bits for a C++ cross-compiling toolchain will be built. It is then possible to build packages that are needed to resolve circular dependencies in such a way that the produced executables and libraries are completely independent from the installed distribution. The remainder of adds the packages necessary to get a complete build environment. This is done after running the chroot (change root) program to enter a virtual environment and start a new shell whose root directory will be set to the LFS partition. This is very similar to rebooting and instructing the kernel to mount the LFS partition as the root partition. The system does not actually reboot, but instead uses chroot because creating a bootable system requires additional work which is not ecessary just yet. The major advantage is that chrooting allows to isolate the build process from the installed distribution, while using the installed kernel. This effort to isolate the new system from the host distribution may seem excessive. A full technical explanation as to why this is done is provided in . In , The full LFS system is built. Another advantage provided by the chroot environment is that it allows you to continue using the host system while LFS is being built. While waiting for package compilations to complete, you can continue using your computer as normal. To finish the installation, the basic system configuration is set up in , and the kernel and boot loader are set up in . contains information on continuing the LFS experience beyond this book. After the steps in this book have been implemented, the computer will be ready to reboot into the new LFS system. This is the process in a nutshell. Detailed information on each step is discussed in the following chapters and package descriptions. Items that may seem complicated will be clarified, and everything will fall into place as you embark on the LFS adventure.