how.xml 4.7 KB

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