| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 | <?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [  <!ENTITY % general-entities SYSTEM "../general.ent">  %general-entities;]><sect1 id="ch-scatter-how"><title>How to Build an LFS System</title><?dbhtml filename="how.html"?><para>The LFS system will be built by using a previously installedLinux distribution (such as Debian, Mandrake, Red Hat, or SuSE). Thisexisting Linux system (the host) will be used as a starting point toprovide necessary programs, including a compiler, linker, and shell,to build the new system. Select the <quote>development</quote> optionduring the distribution installation to be able to access thesetools.</para><para>As an alternative to installing an entire separate distribution onto yourmachine, you may wish to use the Linux From Scratch LiveCD. The CD works well asa host system, providing all the tools you need to successfully follow theinstructions in this book. Additionally, it contains all the source packages,patches and a copy of this book. So once you have the CD, no network connectionor additional downloads are necessary. For more information about the LFS LiveCDor to download a copy, visit <ulink url="&livecd-root;"/>.</para><para><xref linkend="chapter-partitioning"/> of this book describes howto create a new Linux native partition and file system, the placewhere the new LFS system will be compiled and installed. <xreflinkend="chapter-getting-materials"/> explains which packages andpatches need to be downloaded to build an LFS system and how to storethem on the new file system. <xref linkend="chapter-final-preps"/>discusses the setup for an appropriate working environment. Please read<xref linkend="chapter-final-preps"/> carefully as it explains severalimportant issues the developer should be aware of before beginning towork through <xref linkend="chapter-temporary-tools"/> andbeyond.</para><para><xref linkend="chapter-temporary-tools"/> explains theinstallation of a number of packages that will form the basicdevelopment suite (or toolchain) which is used to build the actualsystem in <xref linkend="chapter-building-system"/>. Some of thesepackages are needed to resolve circular dependencies—for example,to compile a compiler, you need a compiler.</para><para><xref linkend="chapter-temporary-tools"/> also shows the user howto build a first pass of the toolchain, including Binutils and GCC(first pass basically means these two core packages will bere-installed a second time). The next step is to build Glibc, the C library.Glibc will be compiled by the toolchain programs built in the first pass. Then,a second pass of the toolchain will be built. This time, the toolchain will bedynamically linked against the newly built Glibc. The remaining<xref linkend="chapter-temporary-tools"/> packages are built using this secondpass toolchain. When this is done, the LFS installation process will no longerdepend on the host distribution, with the exception of the running kernel.</para><para>This effort to isolate the new system from the host distribution may seemexcessive, but a full technical explanation is provided in<xref linkend="ch-tools-toolchaintechnotes"/>.</para><para>In <xref linkend="chapter-building-system"/>, the full LFS system isbuilt. The <command>chroot</command> (change root) program is used to enter a virtualenvironment and start a new shell whose root directory will be set tothe LFS partition. This is very similar to rebooting and instructingthe kernel to mount the LFS partition as the root partition. Thesystem does not actually reboot, but instead <command>chroot</command>'s because creating abootable system requires additional work which is not necessary justyet. The major advantage is that <quote>chrooting</quote> allows thebuilder to continue using the host while LFS is being built. Whilewaiting for package compilation to complete, a user can switch to adifferent virtual console (VC) or X desktop and continue using thecomputer as normal.</para><para>To finish the installation, the LFS-Bootscripts are set up in <xreflinkend="chapter-bootscripts"/>, and the kernel and boot loader are setup in <xref linkend="chapter-bootable"/>. <xreflinkend="chapter-finalizing"/> contains information on furthering theLFS experience beyond this book.  After the steps in this book havebeen implemented, the computer will be ready to reboot into the newLFS system.</para><para>This is the process in a nutshell. Detailed information on eachstep is discussed in the following chapters and package descriptions.Items that may seem complicated will be clarified, and everything willfall into place as the reader embarks on the LFS adventure.</para></sect1>
 |