creatingtoolsdir.xml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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-tools-creatingtoolsdir">
  8. <?dbhtml filename="creatingtoolsdir.html"?>
  9. <title>创建 $LFS/tools 目录</title>
  10. <!--para>All programs compiled in <xref linkend="chapter-temporary-tools"/>
  11. will be installed under <filename class="directory">$LFS/tools</filename>
  12. to keep them separate from the programs compiled in <xref
  13. linkend="chapter-building-system"/>. The programs compiled here are
  14. temporary tools and will not be a part of the final LFS system. By keeping
  15. these programs in a separate directory, they can easily be discarded later
  16. after their use. This also prevents these programs from ending up in the
  17. host production directories (easy to do by accident in <xref
  18. linkend="chapter-temporary-tools"/>).</para-->
  19. <para><xref linkend="chapter-temporary-tools"/>
  20. 中编译的所有程序都会被安装在
  21. <filename class="directory">$LFS/tools</filename>
  22. 目录中,以便和 <xref linkend="chapter-building-system"/>
  23. 中编译的程序分离开来。因为前者是临时工具,
  24. 并不是最终的 LFS 系统的一部分,将它们保存在单独的目录树中,
  25. 就可以在使用完后容易地删除。
  26. 另外,这也可以防止它们被意外地安装在宿主环境中 (这种意外在
  27. <xref linkend="chapter-temporary-tools"/> 中容易发生)。</para>
  28. <!--para>Create the required directory by running the following as
  29. <systemitem class="username">root</systemitem>:</para-->
  30. <para>以 <systemitem class="username">root</systemitem> 身份执行以下命令,
  31. 创建这个目录:</para>
  32. <screen><userinput>mkdir -v $LFS/tools</userinput></screen>
  33. <!--para>The next step is to create a <filename class="symlink">/tools</filename>
  34. symlink on the host system. This will point to the newly-created directory on
  35. the LFS partition. Run this command as <systemitem
  36. class="username">root</systemitem> as well:</para-->
  37. <para>下一步是在宿主系统中创建一个
  38. <filename class="symlink">/tools</filename> 符号链接。
  39. 这个链接指向刚刚创建的,在 LFS 分区中的目录。以
  40. <systemitem class="username">root</systemitem> 身份执行以下命令:
  41. </para>
  42. <screen><userinput>ln -sv $LFS/tools /</userinput></screen>
  43. <note>
  44. <!--para>The above command is correct. The <command>ln</command> command
  45. has a few syntactic variations, so be sure to check
  46. <command>info coreutils ln</command> and <filename>ln(1)</filename>
  47. before reporting what you may think is an error.</para-->
  48. <para>这个命令是正确的,<command>ln</command>命令的语法有一些变种。
  49. 请先阅读 <command>info coreutils ln</command> 和
  50. <filename>ln(1)</filename>,而不是直接发邮件断言这是一个错误。
  51. </para>
  52. </note>
  53. <!--para>The created symlink enables the toolchain to be compiled so that it
  54. always refers to <filename class="directory">/tools</filename>, meaning
  55. that the compiler, assembler, and linker will work both in Chapter&nbsp;5
  56. (when we are still using some tools from the host) and in the next (when
  57. we are <quote>chrooted</quote> to the LFS partition).</para-->
  58. <para>这个符号链接使得临时工具链总是可以通过
  59. <filename class="directory">/tools</filename> 这个路径访问,
  60. 这样,无论是在第 5 章(我们仍然需要使用宿主的一些工具)和第 6 章
  61. (我们已经 <quote>chroot</quote> 到 LFS 分区)中,它们都能正常工作。
  62. </para>
  63. </sect1>