how.xml 4.9 KB

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