Chapter 5 explains the installation of a number of packages that will form the basic development suite (or toolchain) which is used to build the actual system in Chapter 6. Some of these packages are needed to resolve circular dependencies—for example, to compile a compiler, you need a compiler.
Chapter 5 also shows the user how to build a first pass of the toolchain, referred to as the “Embryo toolchain”, which includes Binutils and GCC. The next step is to compile the C library with the “Embryo toolchain”. Then a second toolchain, referred to as the “Cocoon toolchain”, will be linked against the newly installed C library. The remaining Chapter 5 packages are built using the “Cocoon toolchain”. When this is done the HLFS installation process will no longer depend on the host distribution, with the exception of the running kernel.
While this may initially seem like a lot of work to get away from a host distribution, a full technical explanation is provided at the beginning of Chapter 2.
In Chapter 6, the full HLFS system is built. The chroot (change root) program is used to enter a virtual environment and start a new shell whose root directory will be set to the HLFS partition. This is very similar to rebooting and instructing the kernel to mount the HLFS partition as the root partition. The system does not actually reboot, but instead chroots because creating a bootable system requires additional work which is not necessary just yet. The major advantage is that “chrooting” allows the builder to continue using the host while HLFS is being built. While waiting for package compilation to complete, a user can switch to a different virtual console (VC) or X desktop and continue using the computer as normal.
The final toolchain, installed in Chapter 6, is referred to as the “Butterfly toolchain”. This toolchain, and the packages it compiles, are completely independent of the previous toolchains and host system.
To finish the installation, the bootscripts, kernel and boot loader are set up in Chapter 7. After the steps in this book have been implemented, the computer will be ready to reboot into the new HLFS 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 the developer embarks on the HLFS adventure.