settingenviron.po 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. # SOME DESCRIPTIVE TITLE
  2. # Copyright (C) YEAR Free Software Foundation, Inc.
  3. # This file is distributed under the same license as the PACKAGE package.
  4. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
  5. #
  6. #, fuzzy
  7. msgid ""
  8. msgstr ""
  9. "Project-Id-Version: PACKAGE VERSION\n"
  10. "POT-Creation-Date: 2020-06-17 12:44+0800\n"
  11. "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  12. "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  13. "Language-Team: LANGUAGE <LL@li.org>\n"
  14. "Language: \n"
  15. "MIME-Version: 1.0\n"
  16. "Content-Type: text/plain; charset=UTF-8\n"
  17. "Content-Transfer-Encoding: 8bit\n"
  18. #. type: Content of: <sect1><title>
  19. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:11
  20. msgid "Setting Up the Environment"
  21. msgstr ""
  22. #. type: Content of: <sect1><para>
  23. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:13
  24. msgid ""
  25. "Set up a good working environment by creating two new startup files for the "
  26. "<command>bash</command> shell. While logged in as user <systemitem "
  27. "class=\"username\">lfs</systemitem>, issue the following command to create a "
  28. "new <filename>.bash_profile</filename>:"
  29. msgstr ""
  30. #. type: Content of: <sect1><screen>
  31. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:18
  32. #, no-wrap
  33. msgid ""
  34. "<userinput>cat &gt; ~/.bash_profile &lt;&lt; \"EOF\"\n"
  35. "<literal>exec env -i HOME=$HOME TERM=$TERM PS1='\\u:\\w\\$ ' "
  36. "/bin/bash</literal>\n"
  37. "EOF</userinput>"
  38. msgstr ""
  39. #. type: Content of: <sect1><para>
  40. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:22
  41. msgid ""
  42. "When logged on as user <systemitem class=\"username\">lfs</systemitem>, the "
  43. "initial shell is usually a <emphasis>login</emphasis> shell which reads the "
  44. "<filename>/etc/profile</filename> of the host (probably containing some "
  45. "settings and environment variables) and then "
  46. "<filename>.bash_profile</filename>. The <command>exec env "
  47. "-i.../bin/bash</command> command in the <filename>.bash_profile</filename> "
  48. "file replaces the running shell with a new one with a completely empty "
  49. "environment, except for the <envar>HOME</envar>, <envar>TERM</envar>, and "
  50. "<envar>PS1</envar> variables. This ensures that no unwanted and potentially "
  51. "hazardous environment variables from the host system leak into the build "
  52. "environment. The technique used here achieves the goal of ensuring a clean "
  53. "environment."
  54. msgstr ""
  55. #. type: Content of: <sect1><para>
  56. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:34
  57. msgid ""
  58. "The new instance of the shell is a <emphasis>non-login</emphasis> shell, "
  59. "which does not read, and execute, the conten of "
  60. "<filename>/etc/profile</filename> or <filename>.bash_profile</filename> "
  61. "files, but rather reads, and executes, the <filename>.bashrc</filename> file "
  62. "instead. Create the <filename>.bashrc</filename> file now:"
  63. msgstr ""
  64. #. type: Content of: <sect1><screen>
  65. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:40
  66. #, no-wrap
  67. msgid ""
  68. "<userinput>cat &gt; ~/.bashrc &lt;&lt; \"EOF\"\n"
  69. "<literal>set +h\n"
  70. "umask 022\n"
  71. "LFS=/mnt/lfs\n"
  72. "LC_ALL=POSIX\n"
  73. "LFS_TGT=$(uname -m)-lfs-linux-gnu\n"
  74. "PATH=/usr/bin\n"
  75. "if [ ! -L /bin ]; then PATH=/bin:$PATH; fi\n"
  76. "PATH=$LFS/tools/bin:$PATH\n"
  77. "export LFS LC_ALL LFS_TGT PATH</literal>\n"
  78. "EOF</userinput>"
  79. msgstr ""
  80. #. type: Content of: <sect1><variablelist><title>
  81. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:53
  82. msgid "The meaning of the settings in <filename>.bashrc</filename>"
  83. msgstr ""
  84. #. type: Content of: <sect1><variablelist><varlistentry><term>
  85. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:56
  86. msgid "<parameter>set +h</parameter>"
  87. msgstr ""
  88. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  89. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:58
  90. msgid ""
  91. "The <command>set +h</command> command turns off <command>bash</command>'s "
  92. "hash function. Hashing is ordinarily a useful "
  93. "feature&mdash;<command>bash</command> uses a hash table to remember the full "
  94. "path of executable files to avoid searching the <envar>PATH</envar> time and "
  95. "again to find the same executable. However, the new tools should be used as "
  96. "soon as they are installed. By switching off the hash function, the shell "
  97. "will always search the <envar>PATH</envar> when a program is to be run. As "
  98. "such, the shell will find the newly compiled tools in <filename "
  99. "class=\"directory\">~/tools</filename> as soon as they are available without "
  100. "remembering a previous version of the same program in a different location."
  101. msgstr ""
  102. #. type: Content of: <sect1><variablelist><varlistentry><term>
  103. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:73
  104. msgid "<parameter>umask 022</parameter>"
  105. msgstr ""
  106. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  107. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:75
  108. msgid ""
  109. "Setting the user file-creation mask (umask) to 022 ensures that newly "
  110. "created files and directories are only writable by their owner, but are "
  111. "readable and executable by anyone (assuming default modes are used by the "
  112. "<function>open(2)</function> system call, new files will end up with "
  113. "permission mode 644 and directories with mode 755)."
  114. msgstr ""
  115. #. type: Content of: <sect1><variablelist><varlistentry><term>
  116. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:84
  117. msgid "<parameter>LFS=/mnt/lfs</parameter>"
  118. msgstr ""
  119. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  120. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:86
  121. msgid "The <envar>LFS</envar> variable should be set to the chosen mount point."
  122. msgstr ""
  123. #. type: Content of: <sect1><variablelist><varlistentry><term>
  124. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:92
  125. msgid "<parameter>LC_ALL=POSIX</parameter>"
  126. msgstr ""
  127. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  128. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:94
  129. msgid ""
  130. "The <envar>LC_ALL</envar> variable controls the localization of certain "
  131. "programs, making their messages follow the conventions of a specified "
  132. "country. Setting <envar>LC_ALL</envar> to <quote>POSIX</quote> or "
  133. "<quote>C</quote> (the two are equivalent) ensures that everything will work "
  134. "as expected in the chroot environment."
  135. msgstr ""
  136. #. type: Content of: <sect1><variablelist><varlistentry><term>
  137. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:103
  138. msgid "<parameter>LFS_TGT=(uname -m)-lfs-linux-gnu</parameter>"
  139. msgstr ""
  140. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  141. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:105
  142. msgid ""
  143. "The <envar>LFS_TGT</envar> variable sets a non-default, but compatible "
  144. "machine description for use when building our cross compiler and linker and "
  145. "when cross compiling our temporary toolchain. More information is contained "
  146. "in <xref linkend=\"ch-tools-toolchaintechnotes\" role=\"\"/>."
  147. msgstr ""
  148. #. type: Content of: <sect1><variablelist><varlistentry><term>
  149. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:113
  150. msgid "<parameter>PATH=/usr/bin</parameter>"
  151. msgstr ""
  152. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  153. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:115
  154. msgid ""
  155. "Many modern linux distributions have merged <filename "
  156. "class=\"directory\">/bin</filename> and <filename "
  157. "class=\"directory\">/usr/bin</filename>. When this is the case, the standard "
  158. "<envar>PATH</envar> variable needs just to be set to <filename "
  159. "class=\"directory\">/usr/bin/</filename> for the <xref "
  160. "linkend=\"chapter-temporary-tools\"/> environment. When this is not the "
  161. "case, the following line adds <filename class=\"directory\">/bin</filename> "
  162. "to the path."
  163. msgstr ""
  164. #. type: Content of: <sect1><variablelist><varlistentry><term>
  165. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:127
  166. msgid "<parameter>if [ ! -L /bin ]; then PATH=/bin:$PATH; fi</parameter>"
  167. msgstr ""
  168. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  169. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:129
  170. msgid ""
  171. "If <filename class=\"directory\">/bin</filename> is not a symbolic link, "
  172. "then it has to be added to the <envar>PATH</envar> variable."
  173. msgstr ""
  174. #. type: Content of: <sect1><variablelist><varlistentry><term>
  175. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:135
  176. msgid "<parameter>PATH=$LFS/tools/bin:$PATH</parameter>"
  177. msgstr ""
  178. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  179. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:137
  180. msgid ""
  181. "By putting <filename class=\"directory\">$LFS/tools/bin</filename> ahead of "
  182. "the standard <envar>PATH</envar>, the cross-compiler installed at the "
  183. "beginning of <xref linkend=\"chapter-cross-tools\"/> is picked up by the "
  184. "shell immediately after its installation. This, combined with turning off "
  185. "hashing, limits the risk that the compiler from the host be used instead of "
  186. "the cross-compiler."
  187. msgstr ""
  188. #. type: Content of: <sect1><variablelist><varlistentry><term>
  189. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:147
  190. msgid "<parameter>export LFS LC_ALL LFS_TGT PATH</parameter>"
  191. msgstr ""
  192. #. type: Content of: <sect1><variablelist><varlistentry><listitem><para>
  193. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:149
  194. msgid ""
  195. "While the above commands have set some variables, in order to make them "
  196. "visible within any sub-shells, we export them."
  197. msgstr ""
  198. #. type: Content of: <sect1><para>
  199. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:156
  200. msgid ""
  201. "Finally, to have the environment fully prepared for building the temporary "
  202. "tools, source the just-created user profile:"
  203. msgstr ""
  204. #. type: Content of: <sect1><screen>
  205. #: /home/xry111/svn-repos/LFS-BOOK/chapter04/settingenviron.xml:159
  206. #, no-wrap
  207. msgid "<userinput>source ~/.bash_profile</userinput>"
  208. msgstr ""