how.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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 an existing running
  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
  17. distribution onto your machine, you may wish to use the Linux From
  18. Scratch LiveCD. This cd works well as a host sytem, providing all
  19. the tools you need to successfully follow the instructions in this
  20. book. Additionally, it contains all the source packages, patches and
  21. a copy of this book so once you have the cd, no network connection or
  22. additional downloads are necessary. For more information about the LFS
  23. LiveCD or to download a copy, visit
  24. <ulink url="http://linuxfromscratch.org/~jhuntwork/livecd/"/></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 work 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
  35. beyond.</para>
  36. <para><xref linkend="chapter-temporary-tools"/> explains the
  37. installation of a number of packages that will form the basic
  38. development suite (or toolchain) which is used to build the actual
  39. system in <xref linkend="chapter-building-system"/>. Some of these
  40. packages are needed to resolve circular dependencies&mdash;for example,
  41. to compile a compiler, you need a compiler.</para>
  42. <para><xref linkend="chapter-temporary-tools"/> also shows the user how
  43. to build a first pass of the toolchain, including Binutils and GCC
  44. (first pass basically means these two core packages will be
  45. re-installed a second time). The next step is to build Glibc, the C library.
  46. Glibc will be compiled by the toolchain programs built in the first pass. Then,
  47. a second pass of the toolchain will be built. This time, the toolchain will be
  48. dynamically linked against the newly built Glibc. The remaining
  49. <xref linkend="chapter-temporary-tools"/> packages are built using this second
  50. pass toolchain. When this is done, the LFS installation process will no longer
  51. depend on the host distribution, with the exception of the running kernel.
  52. </para>
  53. <para>While this may initially seem like a lot of work to get away
  54. from a host distribution, a full technical explanation is provided at
  55. the beginning of <xref linkend="chapter-temporary-tools"/>.</para>
  56. <para>In <xref linkend="chapter-building-system"/>, the full LFS system is
  57. built. The chroot (change root) program is used to enter a virtual
  58. environment and start a new shell whose root directory will be set to
  59. the LFS partition. This is very similar to rebooting and instructing
  60. the kernel to mount the LFS partition as the root partition. The
  61. system does not actually reboot, but instead chroots because creating a
  62. bootable system requires additional work which is not necessary just
  63. yet. The major advantage is that <quote>chrooting</quote> allows the
  64. builder to continue using the host while LFS is being built. While
  65. waiting for package compilation to complete, a user can switch to a
  66. different virtual console (VC) or X desktop and continue using the
  67. computer as normal.</para>
  68. <para>To finish the installation, the bootscripts are set up in <xref
  69. linkend="chapter-bootscripts"/>, and the kernel and boot loader are set
  70. up in <xref linkend="chapter-bootable"/>. <xref
  71. linkend="chapter-finalizing"/> contains information on furthering the
  72. LFS experience beyond this book. After the steps in this book have
  73. been implemented, the computer will be ready to reboot into the new
  74. LFS system.</para>
  75. <para>This is the process in a nutshell. Detailed information on each
  76. step is discussed in the following chapters and package descriptions.
  77. Items that may seem complicated will be clarified, and everything will
  78. fall into place as the developer embarks on the LFS adventure.</para>
  79. </sect1>