mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-18 19:29:21 +01:00
Made grammatical corrections and stylistic changes to chapter 7.3.
Added clarification; the virtual file systems expose certain information to programs in user space; chroot won't work without them.
This commit is contained in:
parent
52ddd6c033
commit
29526d35ef
@ -14,12 +14,14 @@
|
|||||||
<primary sortas="e-/dev/">/dev/*</primary>
|
<primary sortas="e-/dev/">/dev/*</primary>
|
||||||
</indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<para>Various file systems exported by the kernel are used to communicate to
|
<para>Applications running in user space utilize various file
|
||||||
and from the kernel itself. These file systems are virtual in that no disk
|
systems exported by the kernel to communicate
|
||||||
|
with the kernel itself. These file systems are virtual: no disk
|
||||||
space is used for them. The content of the file systems resides in
|
space is used for them. The content of the file systems resides in
|
||||||
memory.</para>
|
memory. These file systems must exist in the $LFS directory tree
|
||||||
|
before you can <command>chroot</command> successfully.</para>
|
||||||
|
|
||||||
<para>Begin by creating directories onto which the file systems will be
|
<para>Begin by creating directories on which the file systems will be
|
||||||
mounted:</para>
|
mounted:</para>
|
||||||
|
|
||||||
<screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen>
|
<screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen>
|
||||||
@ -29,18 +31,18 @@
|
|||||||
|
|
||||||
<para>During a normal boot, the kernel automatically mounts the
|
<para>During a normal boot, the kernel automatically mounts the
|
||||||
<systemitem class="filesystem">devtmpfs</systemitem> filesystem on the
|
<systemitem class="filesystem">devtmpfs</systemitem> filesystem on the
|
||||||
<filename class="directory">/dev</filename> directory, and allow the
|
<filename class="directory">/dev</filename> directory; the
|
||||||
devices to be created dynamically on that virtual filesystem as they
|
devices are created dynamically on that virtual filesystem when they
|
||||||
are detected or accessed. Device creation is generally done during the
|
are first detected or accessed. Device creation is generally done during the
|
||||||
boot process by the kernel and Udev.
|
boot process by the kernel and the udev program.
|
||||||
Since this new system does not yet have Udev and
|
Since the new system does not yet include udev and
|
||||||
has not yet been booted, it is necessary to mount and populate
|
has not yet been booted, it is necessary to mount and populate
|
||||||
<filename class="directory">/dev</filename> manually. This is
|
the <filename class="directory">/dev</filename> directory manually. This is
|
||||||
accomplished by bind mounting the host system's
|
accomplished by bind mounting the host system's
|
||||||
<filename class="directory">/dev</filename> directory. A bind mount is
|
<filename class="directory">/dev</filename> directory. A bind mount is
|
||||||
a special type of mount that allows you to create a mirror of a
|
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
|
directory or mount point at some other location. Use the following
|
||||||
command to achieve this:</para>
|
command to do this:</para>
|
||||||
|
|
||||||
<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen>
|
<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen>
|
||||||
|
|
||||||
@ -89,10 +91,10 @@ mount -vt tmpfs tmpfs $LFS/run</userinput></screen>
|
|||||||
The /run tmpfs was mounted above so in this case only a
|
The /run tmpfs was mounted above so in this case only a
|
||||||
directory needs to be created.</para>
|
directory needs to be created.</para>
|
||||||
|
|
||||||
<para>In other cases <filename>/dev/shm</filename> is a mountpoint
|
<para>In other host systems <filename>/dev/shm</filename> is a mount point
|
||||||
for a tmpfs. In that case the mount of /dev above will only create
|
for a tmpfs. In that case the mount of /dev above will only create
|
||||||
/dev/shm in the chroot environment as a directory. In this situation
|
/dev/shm as a directory in the chroot environment. In this situation
|
||||||
we explicitly mount a tmpfs,</para>
|
we must explicitly mount a tmpfs:</para>
|
||||||
|
|
||||||
<screen><userinput>if [ -h $LFS/dev/shm ]; then
|
<screen><userinput>if [ -h $LFS/dev/shm ]; then
|
||||||
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
|
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
|
||||||
|
Loading…
Reference in New Issue
Block a user