introduction.xml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  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-system-introduction">
  8. <?dbhtml filename="introduction.html"?>
  9. <title>概述</title>
  10. <!--para>In this chapter, we enter the building site and start constructing the
  11. LFS system in earnest. That is, we chroot into the temporary mini Linux system,
  12. make a few final preparations, and then begin installing the packages.</para-->
  13. <para>在本章中,我们将进入构建环境,并真正开始构建 LFS 系统。
  14. 换句话说,我们 chroot 到前一章构建的临时迷你 Linux 系统中,
  15. 进行一些最后的准备,然后开始安装各软件包。</para>
  16. <!--para>The installation of this software is straightforward. Although in many
  17. cases the installation instructions could be made shorter and more generic,
  18. we have opted to provide the full instructions for every package to minimize
  19. the possibilities for mistakes. The key to learning what makes a Linux system
  20. work is to know what each package is used for and why you (or the system)
  21. may need it.</para-->
  22. <para>软件的安装过程是简单直接的。
  23. 尽管很多时候可以把安装说明写得更短、更通用,
  24. 我们还是选择为每个包提供完整的安装流程,以尽量减小出错的可能。
  25. 学习 Linux 系统工作原理的关键就是要知道每个包的作用,
  26. 以及您(或者系统)为什么需要它。</para>
  27. <!--para>We do not recommend using optimizations. They can make
  28. a program run slightly faster, but they may also cause compilation
  29. difficulties and problems when running the program. If a package refuses to
  30. compile when using optimization, try to compile it without optimization and
  31. see if that fixes the problem. Even if the package does compile when using
  32. optimization, there is the risk it may have been compiled incorrectly because
  33. of the complex interactions between the code and build tools. Also note that
  34. the <option>-march</option> and <option>-mtune</option> options using values
  35. not specified in the book have not been tested. This may cause problems with
  36. the toolchain packages (Binutils, GCC and Glibc). The small potential gains
  37. achieved in using compiler optimizations are often outweighed by the risks.
  38. First-time builders of LFS are encouraged to build without custom
  39. optimizations. The subsequent system will still run very fast and be stable
  40. at the same time.</para-->
  41. <para>我们不推荐在编译中使用优化,
  42. 编译优化可以使程序跑得稍微快一点,
  43. 但也可能在编译或运行的过程中带来问题。
  44. 如果一个软件包在打开优化时无法编译,试着关闭优化再编译它。
  45. 即使一个软件包在打开优化时可以编译,
  46. 由于源代码和编译工具的复杂相互作用,仍然存在编译不正确的风险。
  47. 另外请注意,除本书明确说明外,
  48. 设定 <option>-march</option> 和 <option>-mtune</option> 是未经验证的,
  49. 它们可能在工具链软件包(Binutils、GCC 和 Glibc)中引发问题。
  50. 使用编译优化带来的微小性能增益往往不值得冒编译错误的风险,
  51. 因此我们建议第一次构建 LFS 的读者不要使用自定义的优化选项。
  52. 即使不用优化,得到的系统仍然会运行得很快,而且会很稳定。</para>
  53. <note><title>译注</title>
  54. <para>软件包的配置系统会使用 <option>-O2</option> 或
  55. <option>-O3</option> 等作为默认的基本优化参数,
  56. 它们是经软件包作者检验可用的。
  57. 因此,不使用自定义优化参数也不会编译出非常慢的系统。</para>
  58. </note>
  59. <!--para>The order that packages are installed in this chapter needs to be
  60. strictly followed to ensure that no program accidentally acquires a path
  61. referring to <filename class="directory">/tools</filename> hard-wired into
  62. it. For the same reason, do not compile separate packages in parallel.
  63. Compiling in parallel may save time (especially on dual-CPU machines), but it
  64. could result in a program containing a hard-wired path to <filename
  65. class="directory">/tools</filename>, which will cause the program to stop
  66. working when that directory is removed.</para-->
  67. <para>必须严格按照本章给出的顺序安装软件包,
  68. 才能保证没有程序意外地获得指向
  69. <filename class="directory">/tools</filename> 的路径,
  70. 甚至将这样的路径硬编码到程序中。因此,
  71. 不要同时构建多个软件包,这可能节约时间(特别是在双 CPU 机器上),
  72. 但往往会导致某个程序包含一个硬编码的,指向
  73. <filename class="directory">/tools</filename> 的路径,
  74. 结果删除该目录后程序不能工作。</para>
  75. <!--para>Before the installation instructions, each installation page provides
  76. information about the package, including a concise description of what it
  77. contains, approximately how long it will take to build, and how much disk
  78. space is required during this building process. Following the installation
  79. instructions, there is a list of programs and libraries (along with brief
  80. descriptions of these) that the package installs.</para-->
  81. <para>在安装指令之前,每个页面都提供了软件包的基本信息,
  82. 包括其内容的简要描述,以及构建过程大概需要的时间和磁盘空间。
  83. 在安装指令之后,有一个包含该软件包提供的所有程序和库的清单
  84. (以及对它们的简要描述)。</para>
  85. <note>
  86. <!--para>The SBU values and required disk space includes
  87. test suite data for all applicable packages in Chapter&nbsp;6.</para-->
  88. <para>对于拥有可用的测试套件的软件包,第 6 章中给出的 SBU
  89. 值和需要的磁盘空间包含了运行测试套件需要的时间和磁盘空间。</para>
  90. </note>
  91. <sect2>
  92. <title>关于库</title>
  93. <!--para>In general, the LFS editors discourage building and installing static
  94. libraries. The original purpose for most static libraries has been made
  95. obsolete in a modern Linux system. In addition linking a static library
  96. into a program can be detrimental. If an update to the library is needed
  97. to remove a security problem, all programs that use the static library will
  98. need to be relinked to the new library. Since the use of static libraries
  99. is not always obvious, the relevant programs (and the procedures needed to
  100. do the linking) may not even be known.</para-->
  101. <para>一般来说,LFS 作者不推荐构建和安装静态库,它们是为了某些在现代
  102. Linux 系统中早已过时的原因而存在的。
  103. 另外,将静态库链接到程序中是有害的,
  104. 如果需要更新这个库以解决安全问题,
  105. 所有使用该静态库的程序都要重新链接。程序对静态库的使用并不是显然的,
  106. 甚至可能搞不清有哪些相关程序需要链接(或不知道如何重新链接)。
  107. </para>
  108. <!--para>In the procedures in Chapter&nbsp;6, we remove or disable installation of
  109. most static libraries. Usually this is done by passing a
  110. <option>disable-static</option> option to <command>configure</command>.
  111. In other cases, alternate means are needed. In a few cases, especially
  112. glibc and gcc, the use of static libraries remains essential to the general
  113. package building process. </para-->
  114. <para>在第 6 章的安装过程中,我们删除或者禁止安装多数静态库。
  115. 一般来说,向 <command>configure</command> 传递
  116. <option>--disable-static</option> 就可以禁用静态库,
  117. 但某些情况下需要其他手段。在极个别情况下,
  118. 特别是对于 Glibc 和 GCC,
  119. 静态库对于一般的软件包构建过程仍然很关键,就不能禁用静态库。
  120. </para>
  121. <!--para>For a more complete discussion of libraries, see the discussion
  122. <ulink url="&blfs-root;/view/&short-version;/introduction/libraries.html">
  123. Libraries: Static or shared?</ulink> in the BLFS book.</para-->
  124. <para>关于库的更详细讨论,可以参阅 BLFS 手册中的
  125. <ulink url="&blfs-book;/introduction/libraries.html">
  126. Libraries: Static or shared? </ulink> 一节。</para>
  127. </sect2>
  128. </sect1>