how.xml 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  4. <!ENTITY % general-entities SYSTEM "../general.ent">
  5. %general-entities;
  6. ]>
  7. <sect1 id="ch-intro-how">
  8. <?dbhtml filename="how.html"?>
  9. <title>How to Build an LFS System</title>
  10. <para>The LFS system will be built by using an already installed
  11. Linux distribution (such as Debian, OpenMandriva, Fedora, or openSUSE). This
  12. existing Linux system (the host) will be used as a starting point to
  13. provide necessary programs, including a compiler, linker, and shell,
  14. to build the new system. Select the <quote>development</quote> option
  15. during the distribution installation to be able to access these
  16. tools.</para>
  17. <para>As an alternative to installing a separate distribution onto your
  18. machine, you may wish to use <!-- the Linux From Scratch LiveCD or --> a LiveCD from a
  19. commercial distribution. <!-- The LFS LiveCD works well as a host system,
  20. providing all the tools you need to successfully follow the instructions in
  21. this book. The LiveCD version is behind the current book, but is still useful
  22. as a host for building the current book. The <quote>-nosrc</quote> or
  23. <quote>-min</quote> editions of the LiveCD are the most appropriate for
  24. building a current LFS system. For more information about the LFS LiveCD or
  25. to download a copy, visit <ulink url="&livecd-root;"/>. --></para>
  26. <!--
  27. <note>
  28. <para>The LFS LiveCD might not work on newer hardware configurations,
  29. failing to boot or failing to detect some devices such as some SATA hard
  30. drives.</para>
  31. </note> -->
  32. <para><xref linkend="chapter-partitioning"/> of this book describes how
  33. to create a new Linux native partition and file system. This is the place
  34. where the new LFS system will be compiled and installed. <xref
  35. linkend="chapter-getting-materials"/> explains which packages and
  36. patches need to be downloaded to build an LFS system and how to store
  37. them on the new file system. <xref linkend="chapter-final-preps"/>
  38. discusses the setup of an appropriate working environment. Please read
  39. <xref linkend="chapter-final-preps"/> carefully as it explains several
  40. important issues you need be aware of before beginning to
  41. work your way through <xref linkend="chapter-temporary-tools"/> and beyond.</para>
  42. <para><xref linkend="chapter-temporary-tools"/> explains the installation of
  43. a number of packages that are needed to resolve circular
  44. dependencies&mdash;for example, to compile a compiler, you need a compiler.
  45. or to unpack the tar package, you need tar.</para>
  46. <para><xref linkend="chapter-temporary-tools"/> also shows you how to
  47. build a first pass of the toolchain, including Binutils and GCC (first pass
  48. basically means these two core packages will be reinstalled).
  49. The next step is to build Glibc, the C library. Glibc will be compiled by
  50. the toolchain programs built in the first pass. Then, a second pass of the
  51. toolchain will be built. This time, the toolchain will be dynamically linked
  52. against the newly built Glibc. The remaining <xref
  53. linkend="chapter-temporary-tools"/> packages are built using this second
  54. pass toolchain. When this is done, the LFS installation process will no
  55. longer depend on the host distribution, with the exception of the running
  56. kernel. </para>
  57. <para>This effort to isolate the new system from the host distribution may
  58. seem excessive. A full technical explanation as to why this is done is
  59. provided in <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
  60. <para><xref linkend="chapter-building-system"/> begins with installing the
  61. remaining packages needed to build and test the final toolchain. Then, the
  62. full LFS system is built. But first, the <command>chroot</command> (change
  63. root) program is used to enter a virtual environment and start a new shell
  64. whose root directory will be set to the LFS partition. This is very similar
  65. to rebooting and instructing the kernel to mount the LFS partition as the
  66. root partition. The system does not actually reboot, but instead uses
  67. <command>chroot</command> because creating a bootable system requires
  68. additional work which is not necessary just yet. The major advantage is
  69. that <quote>chrooting</quote> allows you to continue using the host system
  70. while LFS is being built. While waiting for package compilations to
  71. complete, you can continue using your computer as normal.</para>
  72. <para>To finish the installation, the basic system configuration is set up in
  73. <xref linkend="chapter-config"/>, and the kernel and boot loader are set
  74. up in <xref linkend="chapter-bootable"/>. <xref linkend="chapter-finalizing"/>
  75. contains information on continuing the LFS experience beyond this book.
  76. After the steps in this book have been implemented, the computer will be
  77. ready to reboot into the new LFS system.</para>
  78. <para>This is the process in a nutshell. Detailed information on each
  79. step is discussed in the following chapters and package descriptions.
  80. Items that may seem complicated will be clarified, and everything will
  81. fall into place as you embark on the LFS adventure.</para>
  82. </sect1>