how.xml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <?xml version="1.0" encoding="UTF-8"?>
  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>如何构建 LFS 系统</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>LFS 系统必须在一个已经安装好的 Linux 发行版 (如 Debian、
  18. OpenMandriva、Fedora 或者 openSUSE) 中构建。这个安装好的 Linux 系统
  19. (称为宿主) 提供包括编译器、链接器和 shell 在内的必要程序,
  20. 作为构建新系统的起点。
  21. 请在安装发行版的过程中选择<quote>development</quote>
  22. (开发) 选项,以使用这些工具。</para>
  23. <!-- Junk here has been removed in translation -->
  24. <para>您也可以选择不安装一个单独的发行版,而是使用某个商业发行版的
  25. LiveCD 。</para>
  26. <!--para><xref linkend="chapter-partitioning"/> of this book describes how
  27. to create a new Linux native partition and file system. This is the place
  28. where the new LFS system will be compiled and installed. <xref
  29. linkend="chapter-getting-materials"/> explains which packages and
  30. patches need to be downloaded to build an LFS system and how to store
  31. them on the new file system. <xref linkend="chapter-final-preps"/>
  32. discusses the setup of an appropriate working environment. Please read
  33. <xref linkend="chapter-final-preps"/> carefully as it explains several
  34. important issues you need be aware of before beginning to
  35. work your way through <xref linkend="chapter-temporary-tools"/> and beyond.</para-->
  36. <para>本书的<xref linkend="chapter-partitioning"/>描述了如何创建一个新的
  37. Linux 本地分区和文件系统,新的 LFS 系统将在该文件系统中被编译和安装。
  38. <xref linkend="chapter-getting-materials"/>
  39. 列举了在构建 LFS 系统的过程中必须下载的软件包和补丁,
  40. 并解释了在新文件系统中存储它们的方法。
  41. <xref linkend="chapter-final-preps"/>讨论工作环境的正确配置。
  42. 请仔细阅读<xref linkend="chapter-final-preps"/>,因为它解释了您在开始
  43. <xref linkend="chapter-temporary-tools"/>
  44. 及后续章节的工作前必须了解的一些重要问题。</para>
  45. <!--para><xref linkend="chapter-temporary-tools"/> explains the
  46. installation of a number of packages that will form the basic
  47. development suite (or toolchain) which is used to build the actual
  48. system in <xref linkend="chapter-building-system"/>. Some of these
  49. packages are needed to resolve circular dependencies&mdash;for example,
  50. to compile a compiler, you need a compiler.</para-->
  51. <para><xref linkend="chapter-temporary-tools"/>
  52. 解释了安装大量软件包以形成基本开发套件 (或称为工具链) 的过程,
  53. 之后在 <xref linkend="chapter-building-system"/>
  54. 中将用工具链构建真正的系统。其中一些包需要解决循环依赖问题
  55. &mdash;&mdash;例如,为了编译一个编译器,您首先需要一个编译器。</para>
  56. <!--para><xref linkend="chapter-temporary-tools"/> also shows you how to
  57. build a first pass of the toolchain, including Binutils and GCC (first pass
  58. basically means these two core packages will be reinstalled).
  59. The next step is to build Glibc, the C library. Glibc will be compiled by
  60. the toolchain programs built in the first pass. Then, a second pass of the
  61. toolchain will be built. This time, the toolchain will be dynamically linked
  62. against the newly built Glibc. The remaining <xref
  63. linkend="chapter-temporary-tools"/> packages are built using this second
  64. pass toolchain. When this is done, the LFS installation process will no
  65. longer depend on the host distribution, with the exception of the running
  66. kernel. </para-->
  67. <para>另外,
  68. <xref linkend="chapter-temporary-tools"/>
  69. 也展示了构建第一轮工具链的过程,包括 Binutils 和 GCC
  70. (<quote>第一轮</quote>表示这两个核心软件包会被重新安装一次)。
  71. 下一步是构建 Glibc ,即 C 运行库。我们将用第一轮工具链中的程序编译
  72. Glibc 。之后,我们构建第二轮工具链,
  73. 第二轮工具链将会动态链接到新编译的 Glibc 上。
  74. 我们将使用第二轮工具链构建
  75. <xref linkend="chapter-temporary-tools"/> 中的其余软件包。
  76. 在这些工作完成后,除正在运行的内核外,
  77. LFS 的安装过程将不再依赖于作为宿主的发行版。</para>
  78. <!--para>This effort to isolate the new system from the host distribution may
  79. seem excessive. A full technical explanation as to why this is done is provided in
  80. <xref linkend="ch-tools-toolchaintechnotes"/>.</para-->
  81. <para>我们努力将新构造的系统从宿主发行版分离出来。这个过程看上去很繁琐,
  82. 我们将会在
  83. <xref linkend="ch-tools-toolchaintechnotes"/>
  84. 完整地从技术上解释这样做的必要性。</para>
  85. <!--para>In <xref linkend="chapter-building-system"/>, the full LFS system is
  86. built. The <command>chroot</command> (change root) program is used to enter
  87. a virtual environment and start a new shell whose root directory will be
  88. set to the LFS partition. This is very similar to rebooting and instructing
  89. the kernel to mount the LFS partition as the root partition. The system
  90. does not actually reboot, but instead uses <command>chroot</command> because
  91. creating a bootable system requires additional work which is not necessary
  92. just yet. The major advantage is that <quote>chrooting</quote> allows you
  93. to continue using the host system while LFS is being built. While waiting
  94. for package compilations to complete, you can continue using your computer as
  95. normal.</para-->
  96. <para>在<xref linkend="chapter-building-system"/>中,
  97. 我们将构建完整的 LFS 系统。我们使用 <command>chroot</command>
  98. (改变根目录) 命令进入一个虚拟化环境,其中根目录被设置为 LFS 文件系统。
  99. 这与重启计算机并指示内核将 LFS 文件系统挂载为根文件系统很相似,
  100. 然而由于创建一个可引导的系统需要一些尚未完成的额外工作,
  101. 我们选择使用 <command>chroot</command> 。<quote>换根</quote>
  102. 的最大好处是,我们在构建 LFS 的过程中,可以继续使用宿主系统。
  103. 在等待软件包编译的过程中,您可以继续正常使用计算机。</para>
  104. <!--para>To finish the installation, the basic system configuration is set up in
  105. <xref linkend="chapter-bootscripts"/>, and the kernel and boot loader are set
  106. up in <xref linkend="chapter-bootable"/>. <xref linkend="chapter-finalizing"/>
  107. contains information on continuing the LFS experience beyond this book.
  108. After the steps in this book have been implemented, the computer will be
  109. ready to reboot into the new LFS system.</para-->
  110. <para>为了完成安装,我们在 <xref linkend="chapter-bootscripts"/>
  111. 中进行系统的基本设置,在 <xref linkend="chapter-bootable"/>
  112. 中配置内核和引导加载器。最后,<xref linkend="chapter-finalizing"/>
  113. 包含在阅读完本书后继续体验 LFS 的相关信息。在完成本书的所有流程后,
  114. 重启计算机即可进入新的 LFS 系统。</para>
  115. <!--para>This is the process in a nutshell. Detailed information on each
  116. step is discussed in the following chapters and package descriptions.
  117. Items that may seem complicated will be clarified, and everything will
  118. fall into place as you embark on the LFS adventure.</para-->
  119. <para>以上是 LFS 构建过程的简要介绍,
  120. 针对特定步骤的详细信息将在之后章节以及软件包的简介中讨论。
  121. 在您踏上 LFS 的构建之旅后,就能逐步理清这些看上去很复杂的步骤,
  122. 每一步都将变得非常清晰。</para>
  123. </sect1>