udev.po 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  1. msgid ""
  2. msgstr ""
  3. "Project-Id-Version: PACKAGE VERSION\n"
  4. "POT-Creation-Date: 2020-06-17 12:44+0800\n"
  5. "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
  6. "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
  7. "Language-Team: LANGUAGE <LL@li.org>\n"
  8. "Language: zh_CN\n"
  9. "MIME-Version: 1.0\n"
  10. "Content-Type: text/plain; charset=UTF-8\n"
  11. "Content-Transfer-Encoding: 8bit\n"
  12. "X-Generator: Translate Toolkit 2.2.5\n"
  13. #. type: Content of: <sect1><title>
  14. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:11
  15. msgid "Overview of Device and Module Handling"
  16. msgstr "设备和模块管理概述"
  17. #. type: Content of: <sect1><indexterm><primary>
  18. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:14
  19. msgid "Udev"
  20. msgstr "Udev"
  21. #. type: Content of: <sect1><indexterm><secondary>
  22. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:15
  23. msgid "usage"
  24. msgstr "用法"
  25. #. type: Content of: <sect1><para>
  26. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:18
  27. msgid ""
  28. "In <xref linkend=\"chapter-building-system\"/>, we installed the udev "
  29. "package when <phrase revision=\"sysv\">eudev</phrase> <phrase revision="
  30. "\"systemd\">systemd</phrase> was built. Before we go into the details "
  31. "regarding how this works, a brief history of previous methods of handling "
  32. "devices is in order."
  33. msgstr ""
  34. "在<xref linkend=\"chapter-building-system\"/>中,我们在构建 <phrase "
  35. "revision=\"sysv\">eudev</phrase> <phrase revision=\"systemd\">systemd</"
  36. "phrase> 时安装了 Udev 软件包。在我们详细讨论它的工作原理之前,首先按时间顺序"
  37. "简要介绍历史上曾经使用过的设备管理方式。"
  38. #. type: Content of: <sect1><para>
  39. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:24
  40. msgid ""
  41. "Linux systems in general traditionally used a static device creation method, "
  42. "whereby a great many device nodes were created under <filename class="
  43. "\"directory\">/dev</filename> (sometimes literally thousands of nodes), "
  44. "regardless of whether the corresponding hardware devices actually existed. "
  45. "This was typically done via a <command>MAKEDEV</command> script, which "
  46. "contains a number of calls to the <command>mknod</command> program with the "
  47. "relevant major and minor device numbers for every possible device that might "
  48. "exist in the world."
  49. msgstr ""
  50. "传统的 Linux 系统通常使用静态地创建设备,即在 <filename class=\"directory\">/"
  51. "dev</filename> 下创建大量设备节点 (有时有数千个节点),无论对应的硬件设备是否"
  52. "真的存在。一般通过 <command>MAKEDEV</command> 脚本完成这一工作,它包含以相"
  53. "关的主设备号和次设备号,为世界上可能存在的每个设备建立节点的大量 "
  54. "<command>mknod</command> 命令。"
  55. #. type: Content of: <sect1><para>
  56. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:33
  57. msgid ""
  58. "Using the udev method, only those devices which are detected by the kernel "
  59. "get device nodes created for them. Because these device nodes will be "
  60. "created each time the system boots, they will be stored on a <systemitem "
  61. "class=\"filesystem\">devtmpfs</systemitem> file system (a virtual file "
  62. "system that resides entirely in system memory). Device nodes do not require "
  63. "much space, so the memory that is used is negligible."
  64. msgstr ""
  65. "使用 Udev,则只有那些被内核检测到的设备才会获得为它们创建的设备节点。由于这些"
  66. "设备节点在每次引导系统时都会重新创建,它们被储存在 <systemitem class="
  67. "\"filesystem\">devtmpfs</systemitem> 文件系统中 (一个虚拟文件系统,完全驻留在"
  68. "系统内存)。设备节点不需要太多空间,它们使用的系统内存可以忽略不计。"
  69. #. type: Content of: <sect1><sect2><title>
  70. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:41
  71. msgid "History"
  72. msgstr "历史"
  73. #. type: Content of: <sect1><sect2><para>
  74. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:43
  75. msgid ""
  76. "In February 2000, a new filesystem called <systemitem class=\"filesystem"
  77. "\">devfs</systemitem> was merged into the 2.3.46 kernel and was made "
  78. "available during the 2.4 series of stable kernels. Although it was present "
  79. "in the kernel source itself, this method of creating devices dynamically "
  80. "never received overwhelming support from the core kernel developers."
  81. msgstr ""
  82. "在 2000 年 2 月,一个称为 <systemitem class=\"filesystem\">devfs</"
  83. "systemitem> 的新文件系统被合并到 2.3.46 版内核中,并在 2.4 系列稳定内核中可"
  84. "用。尽管它本身曾经存在于内核源代码中,但这种设备节点动态创建方法从未得到内核"
  85. "核心开发者的大力支持。"
  86. #. type: Content of: <sect1><sect2><para>
  87. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:50
  88. msgid ""
  89. "The main problem with the approach adopted by <systemitem class=\"filesystem"
  90. "\">devfs</systemitem> was the way it handled device detection, creation, and "
  91. "naming. The latter issue, that of device node naming, was perhaps the most "
  92. "critical. It is generally accepted that if device names are allowed to be "
  93. "configurable, then the device naming policy should be up to a system "
  94. "administrator, not imposed on them by any particular developer(s). The "
  95. "<systemitem class=\"filesystem\">devfs</systemitem> file system also "
  96. "suffered from race conditions that were inherent in its design and could not "
  97. "be fixed without a substantial revision to the kernel. It was marked as "
  98. "deprecated for a long period &ndash; due to a lack of maintenance &ndash; "
  99. "and was finally removed from the kernel in June, 2006."
  100. msgstr ""
  101. "<systemitem class=\"filesystem\">devfs</systemitem> 实现机制的主要问题是它处"
  102. "理设备的检测、创建和命名的方式,其中最致命的或许最后一项,即设备节点命名方"
  103. "式。通常认为,如果设备名称是可配置的,那么设备命名策略应该由系统管理员,而不"
  104. "是某个 (某些)特定开发者决定。<systemitem class=\"filesystem\">devfs</"
  105. "systemitem> 还受到其设计中固有的竞争条件的严重影响,在不对内核进行大量修改的"
  106. "前提下无法修复这一问题。由于缺乏维护,它早已被标记为过时特性,最终在 2006 年 "
  107. "6 月被从内核中移除。"
  108. #. type: Content of: <sect1><sect2><para>
  109. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:63
  110. msgid ""
  111. "With the development of the unstable 2.5 kernel tree, later released as the "
  112. "2.6 series of stable kernels, a new virtual filesystem called <systemitem "
  113. "class=\"filesystem\">sysfs</systemitem> came to be. The job of <systemitem "
  114. "class=\"filesystem\">sysfs</systemitem> is to export a view of the system's "
  115. "hardware configuration to userspace processes. With this userspace-visible "
  116. "representation, the possibility of developing a userspace replacement for "
  117. "<systemitem class=\"filesystem\">devfs</systemitem> became much more "
  118. "realistic."
  119. msgstr ""
  120. "在不稳定的 2.5 系列内核开发过程中,加入了一个新的虚拟文件系统,称为 "
  121. "<systemitem class=\"filesystem\">sysfs</systemitem>,并在 2.6 系列稳定内核中"
  122. "发布。<systemitem class=\"filesystem\">sysfs</systemitem> 的工作是将系统硬件"
  123. "配置信息导出给用户空间进程,有了这个用户空间可见的配置描述,就可能开发一种 "
  124. "<systemitem class=\"filesystem\">devfs</systemitem> 的用户空间替代品。"
  125. #. type: Content of: <sect1><sect2><title>
  126. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:75
  127. msgid "Udev Implementation"
  128. msgstr "Udev 实现"
  129. #. type: Content of: <sect1><sect2><sect3><title>
  130. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:78
  131. msgid "Sysfs"
  132. msgstr "Sysfs"
  133. #. type: Content of: <sect1><sect2><sect3><para>
  134. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:80
  135. msgid ""
  136. "The <systemitem class=\"filesystem\">sysfs</systemitem> filesystem was "
  137. "mentioned briefly above. One may wonder how <systemitem class=\"filesystem"
  138. "\">sysfs</systemitem> knows about the devices present on a system and what "
  139. "device numbers should be used for them. Drivers that have been compiled into "
  140. "the kernel directly register their objects with a <systemitem class="
  141. "\"filesystem\">sysfs</systemitem> (devtmpfs internally) as they are "
  142. "detected by the kernel. For drivers compiled as modules, this registration "
  143. "will happen when the module is loaded. Once the <systemitem class="
  144. "\"filesystem\">sysfs</systemitem> filesystem is mounted (on /sys), data "
  145. "which the drivers register with <systemitem class=\"filesystem\">sysfs</"
  146. "systemitem> are available to userspace processes and to udevd for processing "
  147. "(including modifications to device nodes)."
  148. msgstr ""
  149. "前面已经简要提到了 <systemitem class=\"filesystem\">sysfs</systemitem> 文件系"
  150. "统。有些读者可能好奇,<systemitem class=\"filesystem\">sysfs</systemitem> "
  151. "是如何知道系统中存在哪些设备,以及应该为它们使用什么设备号的。答案是,那些编"
  152. "译到内核中的驱动程序在它们的对象被内核检测到时,直接将它们注册到 "
  153. "<systemitem class=\"filesystem\">sysfs</systemitem> (内部的 devtmpfs)。对于"
  154. "那些被编译为模块的驱动程序,注册过程在模块加载时进行。只要 <systemitem "
  155. "class=\"filesystem\">sysfs</systemitem> 文件系统被挂载好 (位于 /sys),用户空"
  156. "间程序即可使用驱动程序注册在 <systemitem class=\"filesystem\">sysfs</"
  157. "systemitem> 中的数据,Udev 就能够使用这些数据对设备进行处理 (包括修改设备节"
  158. "点)。"
  159. #. type: Content of: <sect1><sect2><sect3><title>
  160. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:97
  161. msgid "Device Node Creation"
  162. msgstr "设备节点的创建"
  163. #. type: Content of: <sect1><sect2><sect3><para>
  164. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:99
  165. msgid ""
  166. "Device files are created by the kernel by the <systemitem class=\"filesystem"
  167. "\">devtmpfs</systemitem> filesystem. Any driver that wishes to register a "
  168. "device node will go through the <systemitem class=\"filesystem\">devtmpfs</"
  169. "systemitem> (via the driver core) to do it. When a <systemitem class="
  170. "\"filesystem\">devtmpfs</systemitem> instance is mounted on <filename class="
  171. "\"directory\">/dev</filename>, the device node will initially be created "
  172. "with a fixed name, permissions, and owner."
  173. msgstr ""
  174. "内核通过 <systemitem class=\"filesystem\">devtmpfs</systemitem> 直接创建设备"
  175. "文件,任何希望注册设备节点的驱动程序都要通过 <systemitem class=\"filesystem"
  176. "\">devtmpfs</systemitem> (经过驱动程序核心) 实现。当一个 <systemitem class="
  177. "\"filesystem\">devtmpfs</systemitem> 实例被挂载到 <filename class=\"directory"
  178. "\">/dev</filename> 时,设备节点将被以固定的名称、访问权限和所有者首次创建。"
  179. #. type: Content of: <sect1><sect2><sect3><para>
  180. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:108
  181. msgid ""
  182. "A short time later, the kernel will send a uevent to <command> udevd</"
  183. "command>. Based on the rules specified in the files within the <filename "
  184. "class=\"directory\">/etc/udev/rules.d</filename>, <filename class=\"directory"
  185. "\">/lib/udev/rules.d</filename>, and <filename class=\"directory\">/run/udev/"
  186. "rules.d</filename> directories, <command> udevd</command> will create "
  187. "additional symlinks to the device node, or change its permissions, owner, or "
  188. "group, or modify the internal <command>udevd</command> database entry (name) "
  189. "for that object."
  190. msgstr ""
  191. "很快,内核会向 <command>udevd</command> 发送一个 uevent。根据 <filename "
  192. "class=\"directory\">/etc/udev/rules.d</filename>,<filename class=\"directory"
  193. "\">/lib/udev/rules.d</filename>,以及 <filename class=\"directory\">/run/"
  194. "udev/rules.d</filename> 目录中文件指定的规则,<command>udevd</command> 将为设"
  195. "备节点创建额外的符号链接,修改其访问权限,所有者,或属组,或者修改该对象的 "
  196. "<command>udevd</command> 数据库条目 (名称)。"
  197. #. type: Content of: <sect1><sect2><sect3><para>
  198. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:117
  199. msgid ""
  200. "The rules in these three directories are numbered and all three directories "
  201. "are merged together. If <command>udevd</command> can't find a rule for the "
  202. "device it is creating, it will leave the permissions and ownership at "
  203. "whatever <systemitem class=\"filesystem\">devtmpfs</systemitem> used "
  204. "initially."
  205. msgstr ""
  206. "以上三个目录中的规则都被编号,且这三个目录的内容将合并处理。如果 "
  207. "<command>udevd</command> 找不到它正在创建的设备对应的规则,它将会沿用 "
  208. "<systemitem class=\"filesystem\">devtmpfs</systemitem> 最早使用的配置。"
  209. #. type: Content of: <sect1><sect2><sect3><title>
  210. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:124
  211. msgid "Module Loading"
  212. msgstr "模块加载"
  213. #. type: Content of: <sect1><sect2><sect3><para>
  214. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:126
  215. msgid ""
  216. "Device drivers compiled as modules may have aliases built into them. "
  217. "Aliases are visible in the output of the <command>modinfo</command> program "
  218. "and are usually related to the bus-specific identifiers of devices supported "
  219. "by a module. For example, the <emphasis>snd-fm801</emphasis> driver supports "
  220. "PCI devices with vendor ID 0x1319 and device ID 0x0801, and has an alias of "
  221. "<quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>. For most devices, "
  222. "the bus driver exports the alias of the driver that would handle the device "
  223. "via <systemitem class=\"filesystem\">sysfs</systemitem>. E.g., the "
  224. "<filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> file might "
  225. "contain the string <quote>pci:"
  226. "v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>. The default "
  227. "rules provided with udev will cause <command>udevd</command> to call out to "
  228. "<command>/sbin/modprobe</command> with the contents of the <envar>MODALIAS</"
  229. "envar> uevent environment variable (which should be the same as the contents "
  230. "of the <filename>modalias</filename> file in sysfs), thus loading all "
  231. "modules whose aliases match this string after wildcard expansion."
  232. msgstr ""
  233. "编译为内核模块的设备驱动程序可能有内建的别名。别名可以通过 "
  234. "<command>modinfo</command> 程序查询,它通常和该模块支持的设备的总线相关标识符"
  235. "有关。例如,<emphasis>snd-fm801</emphasis> 驱动程序支持厂商 ID 为 0x1319,设"
  236. "备 ID 为 0x0801 的 PCI 设备,其别名为<quote>pci:"
  237. "v00001319d00000801sv*sd*bc04sc01l*</quote>。对于多数设备,总线驱动程序会通"
  238. "过 <systemitem class=\"filesystem\">sysfs</systemitem> 导出应该处理该设备的驱"
  239. "动程序别名,例如 <filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</"
  240. "filename> 文件应该包含字符串<quote>pci:"
  241. "v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>。Udev 附带的默认规"
  242. "则会导致 <command>udevd</command> 调用 <command>/sbin/modprobe</command> 时传"
  243. "递 <envar>MODALIAS</envar> uevent 环境变量 (它的值应该和 sysfs 中"
  244. "<filename>modalias</filename> 文件的内容相同),从而加载那些在通配符扩展后别名"
  245. "与这个字符串匹配的模块。"
  246. #. type: Content of: <sect1><sect2><sect3><para>
  247. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:145
  248. msgid ""
  249. "In this example, this means that, in addition to <emphasis>snd-fm801</"
  250. "emphasis>, the obsolete (and unwanted) <emphasis>forte</emphasis> driver "
  251. "will be loaded if it is available. See below for ways in which the loading "
  252. "of unwanted drivers can be prevented."
  253. msgstr ""
  254. "在本例中,这意味着除了 <emphasis>snd-fm801</emphasis> 外,过时 (且不希望) 的 "
  255. "<emphasis>forte</emphasis> 如果可用,也会被加载。之后将介绍防止加载不希望的"
  256. "驱动程序的方法。"
  257. #. type: Content of: <sect1><sect2><sect3><para>
  258. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:151
  259. msgid ""
  260. "The kernel itself is also able to load modules for network protocols, "
  261. "filesystems, and NLS support on demand."
  262. msgstr "内核本身也能够在需要时为网络协议,文件系统,以及 NLS 支持加载模块。"
  263. #. type: Content of: <sect1><sect2><sect3><title>
  264. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:157
  265. msgid "Handling Hotpluggable/Dynamic Devices"
  266. msgstr "处理热插拔/动态设备"
  267. #. type: Content of: <sect1><sect2><sect3><para>
  268. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:159
  269. msgid ""
  270. "When you plug in a device, such as a Universal Serial Bus (USB) MP3 player, "
  271. "the kernel recognizes that the device is now connected and generates a "
  272. "uevent. This uevent is then handled by <command>udevd</command> as described "
  273. "above."
  274. msgstr ""
  275. "当您插入一个设备,例如通用串行总线 (USB) MP3 播放器时,内核能够发现该设备现"
  276. "在已经被连接到系统,并生成一个 uevent 事件。之后 <command>udevd</command> 像"
  277. "前面描述的一样,处理该 uevent 事件。"
  278. #. type: Content of: <sect1><sect2><title>
  279. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:169
  280. msgid "Problems with Loading Modules and Creating Devices"
  281. msgstr "加载模块和创建设备时的问题"
  282. #. type: Content of: <sect1><sect2><para>
  283. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:171
  284. msgid ""
  285. "There are a few possible problems when it comes to automatically creating "
  286. "device nodes."
  287. msgstr "在自动创建设备节点时,可能出现一些问题。"
  288. #. type: Content of: <sect1><sect2><sect3><title>
  289. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:175
  290. msgid "A kernel module is not loaded automatically"
  291. msgstr "内核模块没有自动加载"
  292. #. type: Content of: <sect1><sect2><sect3><para>
  293. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:177
  294. msgid ""
  295. "Udev will only load a module if it has a bus-specific alias and the bus "
  296. "driver properly exports the necessary aliases to <systemitem class="
  297. "\"filesystem\">sysfs</systemitem>. In other cases, one should arrange module "
  298. "loading by other means. With Linux-&linux-version;, udev is known to load "
  299. "properly-written drivers for INPUT, IDE, PCI, USB, SCSI, SERIO, and FireWire "
  300. "devices."
  301. msgstr ""
  302. "Udev 只加载拥有总线特定别名,且总线驱动程序正确地向 <systemitem class="
  303. "\"filesystem\">sysfs</systemitem> 导出了必要别名的模块。如果情况不是这样,您"
  304. "应该考虑用其他方法加载模块。在 Linux-&linux-version; 中,已知 Udev 可以加载"
  305. "编写正确的 INPUT,IDE,PCI,USB,SCSI,SERIO,以及 FireWire 驱动程序。"
  306. #. type: Content of: <sect1><sect2><sect3><para>
  307. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:184
  308. msgid ""
  309. "To determine if the device driver you require has the necessary support for "
  310. "udev, run <command>modinfo</command> with the module name as the argument. "
  311. "Now try locating the device directory under <filename class=\"directory\">/"
  312. "sys/bus</filename> and check whether there is a <filename>modalias</"
  313. "filename> file there."
  314. msgstr ""
  315. "为了确定您需要的设备驱动程序是否包含 Udev 支持,以模块名为参数运行 "
  316. "<command>modinfo</command> 命令。然后试着在 <filename class=\"directory\">/"
  317. "sys/bus</filename> 中找到设备对应的目录,并检查其中是否有 "
  318. "<filename>modalias</filename> 文件。"
  319. #. type: Content of: <sect1><sect2><sect3><para>
  320. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:190
  321. msgid ""
  322. "If the <filename>modalias</filename> file exists in <systemitem class="
  323. "\"filesystem\">sysfs</systemitem>, the driver supports the device and can "
  324. "talk to it directly, but doesn't have the alias, it is a bug in the driver. "
  325. "Load the driver without the help from udev and expect the issue to be fixed "
  326. "later."
  327. msgstr ""
  328. "如果 <filename>modalias</filename> 文件存在于 <systemitem class=\"filesystem"
  329. "\">sysfs</systemitem> 中,说明驱动程序支持该设备,并能够直接和设备交互,但却"
  330. "没有正确的别名。这是驱动程序的 bug,您需要不通过 Udev 直接加载驱动,并等待这"
  331. "个问题日后被解决。"
  332. #. type: Content of: <sect1><sect2><sect3><para>
  333. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:196
  334. msgid ""
  335. "If there is no <filename>modalias</filename> file in the relevant directory "
  336. "under <filename class=\"directory\">/sys/bus</filename>, this means that the "
  337. "kernel developers have not yet added modalias support to this bus type. With "
  338. "Linux-&linux-version;, this is the case with ISA busses. Expect this issue "
  339. "to be fixed in later kernel versions."
  340. msgstr ""
  341. "如果 <filename>modalias</filename> 文件不存在于 <filename class=\"directory"
  342. "\">/sys/bus</filename> 下的对应目录中,说明内核开发者尚未对该总线类型增加 "
  343. "modalias 支持。在 Linux-&linux-version; 中,ISA 总线不受支持。只能等待这个问"
  344. "题在日后被解决。"
  345. #. type: Content of: <sect1><sect2><sect3><para>
  346. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:202
  347. msgid ""
  348. "Udev is not intended to load <quote>wrapper</quote> drivers such as "
  349. "<emphasis>snd-pcm-oss</emphasis> and non-hardware drivers such as "
  350. "<emphasis>loop</emphasis> at all."
  351. msgstr ""
  352. "Udev 根本不会尝试加载<quote>包装器</quote> 驱动程序,比如 <emphasis>snd-pcm-"
  353. "oss</emphasis> 等,或 <emphasis>loop</emphasis> 等非硬件驱动程序。"
  354. #. type: Content of: <sect1><sect2><sect3><title>
  355. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:209
  356. msgid ""
  357. "A kernel module is not loaded automatically, and udev is not intended to "
  358. "load it"
  359. msgstr "内核模块没有自动加载,且 Udev 不尝试加载它"
  360. #. type: Content of: <sect1><sect2><sect3><para>
  361. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:212
  362. msgid ""
  363. "If the <quote>wrapper</quote> module only enhances the functionality "
  364. "provided by some other module (e.g., <emphasis>snd-pcm-oss</emphasis> "
  365. "enhances the functionality of <emphasis>snd-pcm</emphasis> by making the "
  366. "sound cards available to OSS applications), configure <command>modprobe</"
  367. "command> to load the wrapper after udev loads the wrapped module. To do "
  368. "this, add a <quote>softdep</quote> line to the corresponding <filename>/etc/"
  369. "modprobe.d/<replaceable>&lt;filename&gt;</replaceable>.conf</filename> file. "
  370. "For example:"
  371. msgstr ""
  372. "如果<quote>包装器</quote>仅仅用于增强其他模块的功能 (例如,<emphasis>snd-"
  373. "pcm-oss</emphasis> 增强 <emphasis>snd-pcm</emphasis> 的功能,使 OSS 应用程序"
  374. "能够使用声卡),需要配置 <command>modprobe</command>,使其在 Udev 加载被包装的"
  375. "模块时,自动加载包装器。为此,需要将<quote>softdep</quote>行添加到对应的 "
  376. "<filename>/etc/modprobe.d/<replaceable>&lt;filename&gt;</replaceable>.conf</"
  377. "filename> 中。例如:"
  378. #. type: Content of: <sect1><sect2><sect3><screen>
  379. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:222
  380. #, no-wrap
  381. msgid "<literal>softdep snd-pcm post: snd-pcm-oss</literal>"
  382. msgstr "<literal>softdep snd-pcm post: snd-pcm-oss</literal>"
  383. #. type: Content of: <sect1><sect2><sect3><para>
  384. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:224
  385. msgid ""
  386. "Note that the <quote>softdep</quote> command also allows <literal>pre:</"
  387. "literal> dependencies, or a mixture of both <literal>pre:</literal> and "
  388. "<literal>post:</literal> dependencies. See the <filename>modprobe.d(5)</"
  389. "filename> manual page for more information on <quote>softdep</quote> syntax "
  390. "and capabilities."
  391. msgstr ""
  392. "注意<quote>softdep</quote>命令也允许 <literal>pre:</literal> 依赖项,或混合"
  393. "使用 <literal>pre:</literal> 和 <literal>post:</literal> 依赖项。参阅 "
  394. "<filename>modprobe.d(5)</filename> man 手册页面,了解更多关于"
  395. "<quote>softdep</quote>语法和功能的信息。"
  396. #. type: Content of: <sect1><sect2><sect3><para>
  397. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:230
  398. msgid ""
  399. "If the module in question is not a wrapper and is useful by itself, "
  400. "configure the <command>modules</command> bootscript to load this module on "
  401. "system boot. To do this, add the module name to the <filename>/etc/sysconfig/"
  402. "modules</filename> file on a separate line. This works for wrapper modules "
  403. "too, but is suboptimal in that case."
  404. msgstr ""
  405. "如果出现问题的模块不是包装器,而是本身就有特定功能的模块,需要配置 "
  406. "<command>modules</command> 引导脚本以在系统引导时加载它。为此,将模块名添加"
  407. "到 <filename>/etc/sysconfig/modules</filename> 中,作为单独的一行。包装器模块"
  408. "也可以被添加到这里,但对于包装器来说这不是最好的方案。"
  409. #. type: Content of: <sect1><sect2><sect3><title>
  410. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:239
  411. msgid "Udev loads some unwanted module"
  412. msgstr "Udev 加载了不希望的模块"
  413. #. type: Content of: <sect1><sect2><sect3><para>
  414. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:241
  415. msgid ""
  416. "Either don't build the module, or blacklist it in a <filename>/etc/modprobe."
  417. "d/blacklist.conf</filename> file as done with the <emphasis>forte</emphasis> "
  418. "module in the example below:"
  419. msgstr ""
  420. "不要构建该模块,或者在 <filename>/etc/modprobe.d/blacklist.conf</filename> 文"
  421. "件中禁用它。以 <emphasis>forte</emphasis> 为例,下面一行禁用了该模块:"
  422. #. type: Content of: <sect1><sect2><sect3><screen>
  423. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:245
  424. #, no-wrap
  425. msgid "<literal>blacklist forte</literal>"
  426. msgstr "<literal>blacklist forte</literal>"
  427. #. type: Content of: <sect1><sect2><sect3><para>
  428. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:247
  429. msgid ""
  430. "Blacklisted modules can still be loaded manually with the explicit "
  431. "<command>modprobe</command> command."
  432. msgstr ""
  433. "被禁用的模块仍然可以通过直接执行 <command>modprobe</command> 手动加载。"
  434. #. type: Content of: <sect1><sect2><sect3><title>
  435. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:253
  436. msgid "Udev creates a device incorrectly, or makes a wrong symlink"
  437. msgstr "Udev 创建了错误的设备或错误的符号链接"
  438. #. type: Content of: <sect1><sect2><sect3><para>
  439. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:255
  440. msgid ""
  441. "This usually happens if a rule unexpectedly matches a device. For example, a "
  442. "poorly-written rule can match both a SCSI disk (as desired) and the "
  443. "corresponding SCSI generic device (incorrectly) by vendor. Find the "
  444. "offending rule and make it more specific, with the help of the "
  445. "<command>udevadm info</command> command."
  446. msgstr ""
  447. "这一般是由于一条规则意外地匹配了某个设备。例如,一个写得不好的规则可能同时匹"
  448. "配到 SCSI 磁盘 (正确的) 和对应厂商的 SCSI 通用设备 (不正确的)。找到引起问题"
  449. "的规则,并通过 <command>udevadm info</command> 的帮助,将它进一步细化。"
  450. #. type: Content of: <sect1><sect2><sect3><title>
  451. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:264
  452. msgid "Udev rule works unreliably"
  453. msgstr "Udev 规则工作不可靠"
  454. #. type: Content of: <sect1><sect2><sect3><para>
  455. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:266
  456. msgid ""
  457. "This may be another manifestation of the previous problem. If not, and your "
  458. "rule uses <systemitem class=\"filesystem\">sysfs</systemitem> attributes, it "
  459. "may be a kernel timing issue, to be fixed in later kernels. For now, you "
  460. "can work around it by creating a rule that waits for the used <systemitem "
  461. "class=\"filesystem\">sysfs</systemitem> attribute and appending it to the "
  462. "<filename>/etc/udev/rules.d/10-wait_for_sysfs.rules</filename> file (create "
  463. "this file if it does not exist). Please notify the LFS Development list if "
  464. "you do so and it helps."
  465. msgstr ""
  466. "这可能是前一个问题的另一个表现形式。如果不是,而且您的规则使用了 "
  467. "<systemitem class=\"filesystem\">sysfs</systemitem> 属性,这个问题可能由内核"
  468. "计时问题引发,这类问题需要在新的内核版本中修复。目前,您可以创建一条规则以等"
  469. "待被使用的 <systemitem class=\"filesystem\">sysfs</systemitem> 属性,并将它"
  470. "附加到 <filename>/etc/udev/rules.d/10-wait-for-sysfs.rules</filename> 文件中"
  471. " (如果不存在就创建一个文件),绕过这个问题。如果您通过这种方法解决了问题,请"
  472. "通知 LFS 开发邮件列表。"
  473. #. type: Content of: <sect1><sect2><sect3><title>
  474. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:278
  475. msgid "Udev does not create a device"
  476. msgstr "Udev 没有创建设备"
  477. #. type: Content of: <sect1><sect2><sect3><para>
  478. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:280
  479. msgid ""
  480. "Further text assumes that the driver is built statically into the kernel or "
  481. "already loaded as a module, and that you have already checked that udev "
  482. "doesn't create a misnamed device."
  483. msgstr ""
  484. "以下内容假设驱动程序已经被编译到内核中,或作为模块被加载,而且您已经检查过并"
  485. "确认 Udev 没有创建命名错误的设备。"
  486. #. type: Content of: <sect1><sect2><sect3><para>
  487. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:284
  488. msgid ""
  489. "Udev has no information needed to create a device node if a kernel driver "
  490. "does not export its data to <systemitem class=\"filesystem\">sysfs</"
  491. "systemitem>. This is most common with third party drivers from outside the "
  492. "kernel tree. Create a static device node in <filename>/lib/udev/devices</"
  493. "filename> with the appropriate major/minor numbers (see the file "
  494. "<filename>devices.txt</filename> inside the kernel documentation or the "
  495. "documentation provided by the third party driver vendor). The static device "
  496. "node will be copied to <filename class=\"directory\">/dev</filename> by "
  497. "<command>udev</command>."
  498. msgstr ""
  499. "如果驱动程序没有将它的信息导出到 <systemitem class=\"filesystem\">sysfs</"
  500. "systemitem>,Udev 就无法获得创建设备节点必需的信息。这种问题往往出现在内核"
  501. "源代码树以外的第三方驱动程序中。这时,需要在 <filename>/lib/udev/devices</"
  502. "filename> 中使用正确的主设备号和次设备号,创建一个静态设备节点 (参考内核文档"
  503. "中的 <filename>devices.txt</filename> 或第三方驱动厂商提供的文档),该静态设备"
  504. "节点将被复制到 <filename class=\"directory\">/dev</filename>,"
  505. "<command>udev</command> 会自动完成复制。"
  506. #. type: Content of: <sect1><sect2><sect3><title>
  507. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:298
  508. msgid "Device naming order changes randomly after rebooting"
  509. msgstr "重启后设备命名顺序随机变化"
  510. #. type: Content of: <sect1><sect2><sect3><para>
  511. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:300
  512. msgid ""
  513. "This is due to the fact that udev, by design, handles uevents and loads "
  514. "modules in parallel, and thus in an unpredictable order. This will never be "
  515. "<quote>fixed</quote>. You should not rely upon the kernel device names being "
  516. "stable. Instead, create your own rules that make symlinks with stable names "
  517. "based on some stable attributes of the device, such as a serial number or "
  518. "the output of various *_id utilities installed by udev. See <xref linkend="
  519. "\"ch-config-symlinks\"/> and <xref linkend=\"ch-config-network\"/> for "
  520. "examples."
  521. msgstr ""
  522. "这是由于 Udev 从设计上就是并行加载模块的,因此无法预测加载顺序。这个问题永远"
  523. "也不会被 <quote>修复</quote>。您不应该指望内核提供稳定的设备命名,而是应该创"
  524. "建您自己的规则,以根据设备的一些稳定属性,例如设备序列号或 Udev 安装的一些 "
  525. "*_id 工具的输出,来创建具有稳定名称的符号链接。可以参考<xref linkend=\"ch-"
  526. "config-symlinks\"/>和<xref linkend=\"ch-config-network\"/>中的例子。"
  527. #. type: Content of: <sect1><sect2><title>
  528. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:314
  529. msgid "Useful Reading"
  530. msgstr "扩展阅读"
  531. #. type: Content of: <sect1><sect2><para>
  532. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:316
  533. msgid "Additional helpful documentation is available at the following sites:"
  534. msgstr "以下链接包含了一些额外的帮助文档:"
  535. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  536. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:322
  537. msgid ""
  538. "A Userspace Implementation of <systemitem class=\"filesystem\">devfs</"
  539. "systemitem> <ulink url=\"http://www.kroah.com/linux/talks/"
  540. "ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf\"/>"
  541. msgstr ""
  542. "A Userspace Implementation of <systemitem class=\"filesystem\">devfs</"
  543. "systemitem> <ulink url=\"http://www.kroah.com/linux/talks/"
  544. "ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf\"/>"
  545. #. type: Content of: <sect1><sect2><itemizedlist><listitem><para>
  546. #: /home/xry111/svn-repos/LFS-BOOK/chapter09/udev.xml:327
  547. msgid ""
  548. "The <systemitem class=\"filesystem\">sysfs</systemitem> Filesystem <ulink "
  549. "url=\"http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/"
  550. "ols-2005/mochel.pdf\"/>"
  551. msgstr ""
  552. "The <systemitem class=\"filesystem\">sysfs</systemitem> Filesystem <ulink "
  553. "url=\"http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/"
  554. "ols-2005/mochel.pdf\"/>"