how.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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 a previously installed
  11. Linux distribution (such as Debian, Mandriva, 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 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. Unfortunately, development of the LiveCD has not progressed
  22. recently and it only contains older versions of the source packages and
  23. patches (for those ISOs not labels -nosrc or -min), and this book. For more
  24. information about the LFS LiveCD or to download a copy, visit <ulink
  25. url="&livecd-root;"/>.</para>
  26. <note>
  27. <para>The LFS LiveCD might not work on newer hardware configurations,
  28. failing to boot or failing to detect some devices such as some SATA hard
  29. drives.</para>
  30. </note>
  31. <para><xref linkend="chapter-partitioning"/> of this book describes how
  32. to create a new Linux native partition and file system, the place
  33. where the new LFS system will be compiled and installed. <xref
  34. linkend="chapter-getting-materials"/> explains which packages and
  35. patches need to be downloaded to build an LFS system and how to store
  36. them on the new file system. <xref linkend="chapter-final-preps"/>
  37. discusses the setup of an appropriate working environment. Please read
  38. <xref linkend="chapter-final-preps"/> carefully as it explains several
  39. important issues the reader should be aware of before beginning to
  40. work through <xref linkend="chapter-temporary-tools"/> and beyond.</para>
  41. <para><xref linkend="chapter-temporary-tools"/> explains the
  42. installation of a number of packages that will form the basic
  43. development suite (or toolchain) which is used to build the actual
  44. system in <xref linkend="chapter-building-system"/>. Some of these
  45. packages are needed to resolve circular dependencies&mdash;for example,
  46. to compile a compiler, you need a compiler.</para>
  47. <para><xref linkend="chapter-temporary-tools"/> also shows the user how to
  48. build a first pass of the toolchain, including Binutils and GCC (first pass
  49. basically means these two core packages will be reinstalled).
  50. The next step is to build Glibc, the C library. Glibc will be compiled by
  51. the toolchain programs built in the first pass. Then, a second pass of the
  52. toolchain will be built. This time, the toolchain will be dynamically linked
  53. against the newly built Glibc. The remaining <xref
  54. linkend="chapter-temporary-tools"/> packages are built using this second
  55. pass toolchain. When this is done, the LFS installation process will no
  56. longer depend on the host distribution, with the exception of the running
  57. kernel. </para>
  58. <para>This effort to isolate the new system from the host distribution may
  59. seem excessive, but a full technical explanation is provided in
  60. <xref linkend="ch-tools-toolchaintechnotes"/>.</para>
  61. <para>In <xref linkend="chapter-building-system"/>, the full LFS system is
  62. built. The <command>chroot</command> (change root) program is used to enter
  63. a virtual environment and start a new shell whose root directory will be
  64. set to the LFS partition. This is very similar to rebooting and instructing
  65. the kernel to mount the LFS partition as the root partition. The system
  66. does not actually reboot, but instead <command>chroot</command>'s because
  67. creating a bootable system requires additional work which is not necessary
  68. just yet. The major advantage is that <quote>chrooting</quote> allows the
  69. builder to continue using the host while LFS is being built. While waiting
  70. for package compilation to complete, a user can switch to a different
  71. virtual console (VC) or X desktop and continue using the computer as
  72. normal.</para>
  73. <para>To finish the installation, the LFS-Bootscripts are set up in
  74. <xref linkend="chapter-bootscripts"/>, and the kernel and boot loader are set
  75. up in <xref linkend="chapter-bootable"/>. <xref linkend="chapter-finalizing"/>
  76. contains information on furthering the LFS experience beyond this book.
  77. After the steps in this book have been implemented, the computer will be
  78. ready to reboot into the new LFS system.</para>
  79. <para>This is the process in a nutshell. Detailed information on each
  80. step is discussed in the following chapters and package descriptions.
  81. Items that may seem complicated will be clarified, and everything will
  82. fall into place as the reader embarks on the LFS adventure.</para>
  83. </sect1>