| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 | msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""POT-Creation-Date: 2020-06-17 12:44+0800\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""Language: zh_CN\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n""X-Generator: Translate Toolkit 2.2.5\n"#. type: Content of: <sect1><title>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:11msgid "Preparing Virtual Kernel File Systems"msgstr "准备虚拟内核文件系统"#. type: Content of: <sect1><indexterm><primary>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:14msgid "/dev/*"msgstr "/dev/*"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:17msgid """Various file systems exported by the kernel are used to communicate to and ""from the kernel itself. These file systems are virtual in that no disk space ""is used for them. The content of the file systems resides in memory."msgstr """内核对外提供了一些文件系统,以便自己和用户空间进行通信。它们是虚拟文件系统,""并不占用磁盘空间,其内容保留在内存中。"#. type: Content of: <sect1><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:22msgid """Begin by creating directories onto which the file systems will be mounted:"msgstr "首先创建这些文件系统的挂载点:"#. type: Content of: <sect1><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:25#, no-wrapmsgid "<userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput>"msgstr "<userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput>"#. type: Content of: <sect1><sect2><title>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:28msgid "Creating Initial Device Nodes"msgstr "创建初始设备节点"#. type: Content of: <sect1><sect2><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:30msgid """When the kernel boots the system, it requires the presence of a few device ""nodes, in particular the <filename class=\"devicefile\">console</filename> ""and <filename class=\"devicefile\">null</filename> devices. The device nodes ""must be created on the hard disk so that they are available before the ""kernel populates <systemitem class=\"filesystem\">/dev</systemitem>), and ""additionally when Linux is started with <parameter>init=/bin/bash</""parameter>. Create the devices by running the following commands:"msgstr """在内核引导系统时,它需要一些设备节点,特别是 <filename class=\"devicefile""\">console</filename> 和 <filename class=\"devicefile\">null</filename> 两个""设备。它们需要创建在硬盘上,这样在内核填充 ""<systemitem class=\"filesystem\">/dev</systemitem> 前,""或者 Linux 使用 <parameter>init=/bin/bash</parameter> 内核选项启动时,""也能使用它们。运行以下命令创建它们:"#. type: Content of: <sect1><sect2><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:40#, no-wrapmsgid """<userinput>mknod -m 600 $LFS/dev/console c 5 1\n""mknod -m 666 $LFS/dev/null c 1 3</userinput>"msgstr """<userinput>mknod -m 600 $LFS/dev/console c 5 1\n""mknod -m 666 $LFS/dev/null c 1 3</userinput>"#. type: Content of: <sect1><sect2><title>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:46msgid "Mounting and Populating /dev"msgstr "挂载和填充 /dev"#. type: Content of: <sect1><sect2><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:48msgid """The recommended method of populating the <filename class=\"directory\">/dev</""filename> directory with devices is to mount a virtual filesystem (such as ""<systemitem class=\"filesystem\">tmpfs</systemitem>) on the <filename class=""\"directory\">/dev</filename> directory, and allow the devices to be created ""dynamically on that virtual filesystem as they are detected or accessed. ""Device creation is generally done during the boot process by Udev. Since ""this new system does not yet have Udev and has not yet been booted, it is ""necessary to mount and populate <filename class=\"directory\">/dev</""filename> manually. This is accomplished by bind mounting the host system's ""<filename class=\"directory\">/dev</filename> directory. A bind mount is a ""special type of mount that allows you to create a mirror of a directory or ""mount point to some other location. Use the following command to achieve ""this:"msgstr """用设备文件填充 <filename class=\"directory\">/dev</filename> 目录的推荐方法是""挂载一个虚拟文件系统 (例如 <systemitem class=\"filesystem\">tmpfs</""systemitem>) 到 <filename class=\"directory\">/dev</filename>,然后在设备被""发现或访问时动态地创建设备文件。这个工作通常由 Udev 在系统引导时完成。然而,""我们的新系统还没有 Udev,也没有被引导过,因此必须手工挂载和填充 <filename ""class=\"directory\">/dev</filename>。这可以通过绑定挂载宿主系统的 <filename ""class=\"directory\">/dev</filename> 目录就实现。绑定挂载是一种特殊挂载类型,""它允许在另外的位置创建某个目录或挂载点的映像。运行以下命令进行绑定挂载:"#. type: Content of: <sect1><sect2><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:63#, no-wrapmsgid "<userinput>mount -v --bind /dev $LFS/dev</userinput>"msgstr "<userinput>mount -v --bind /dev $LFS/dev</userinput>"#. type: Content of: <sect1><sect2><title>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:68msgid "Mounting Virtual Kernel File Systems"msgstr "挂载虚拟内核文件系统"#. type: Content of: <sect1><sect2><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:70msgid "Now mount the remaining virtual kernel filesystems:"msgstr "现在挂载其余的虚拟内核文件系统:"#. type: Content of: <sect1><sect2><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:72#, no-wrapmsgid """<userinput>mount -v --bind /dev/pts $LFS/dev/pts\n""mount -vt proc proc $LFS/proc\n""mount -vt sysfs sysfs $LFS/sys\n""mount -vt tmpfs tmpfs $LFS/run</userinput>"msgstr """<userinput>mount -v --bind /dev/pts $LFS/dev/pts\n""mount -vt proc proc $LFS/proc\n""mount -vt sysfs sysfs $LFS/sys\n""mount -vt tmpfs tmpfs $LFS/run</userinput>"#. type: Content of: <sect1><sect2><para>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:105msgid """In some host systems, <filename>/dev/shm</filename> is a symbolic link to ""<filename class=\"directory\">/run/shm</filename>.  The /run tmpfs was ""mounted above so in this case only a directory needs to be created."msgstr """在某些宿主系统上,<filename>/dev/shm</filename> 是一个指向 <filename class=""\"directory\">/run/shm</filename> 的符号链接。我们已经在 /run 下挂载了 ""tmpfs 文件系统,因此在这里只需要创建一个目录。"#. type: Content of: <sect1><sect2><screen>#: /home/xry111/svn-repos/LFS-BOOK/chapter07/kernfs.xml:110#, no-wrapmsgid """<userinput>if [ -h $LFS/dev/shm ]; then\n""  mkdir -pv $LFS/$(readlink $LFS/dev/shm)\n""fi</userinput>"msgstr """<userinput>if [ -h $LFS/dev/shm ]; then\n""  mkdir -pv $LFS/$(readlink $LFS/dev/shm)\n""fi</userinput>"
 |