aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/devices.xml
diff options
context:
space:
mode:
authorGerard Beekmans <gerard@linuxfromscratch.org>2005-02-19 22:16:42 +0000
committerGerard Beekmans <gerard@linuxfromscratch.org>2005-02-19 22:16:42 +0000
commit81fd230419b0cfd052b08fc1ed352bb7d49975df (patch)
tree24c98d2876e5b457dcb88d39e7cca4905f58691a /chapter06/devices.xml
parent2f9131f8390243dbc350fe2eeb9e1d58f0264888 (diff)
Trunk is now identical to Testing
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4648 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06/devices.xml')
-rw-r--r--chapter06/devices.xml47
1 files changed, 41 insertions, 6 deletions
diff --git a/chapter06/devices.xml b/chapter06/devices.xml
index 4663f4caf..e46cf8ba5 100644
--- a/chapter06/devices.xml
+++ b/chapter06/devices.xml
@@ -3,20 +3,42 @@
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
-<sect1 id="ch-system-devices" xreflabel="devices">
+<sect1 id="ch-system-devices">
<title>Populating /dev</title>
<?dbhtml filename="devices.html"?>
-<para>Create the initial device nodes</para>
+<indexterm zone="ch-system-devices"><primary sortas="e-Devices">/dev/*</primary></indexterm>
+
+<sect2>
+<title>Creating Initial Device Nodes</title>
+
+<para>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. Create these by
+running the following commands:</para>
<screen><userinput>mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3</userinput></screen>
+</sect2>
+
+<sect2>
+<title>Mounting ramfs and Populating /dev</title>
-<para>Mount a ramfs in /dev</para>
+<para>The ideal way to populate <filename
+class="directory">/dev</filename> is to mount a <systemitem
+class="filesystem">ramfs</systemitem> onto <filename
+class="directory">/dev</filename>, like <systemitem
+class="filesystem">tmpfs</systemitem>, and create the devices on there
+during each bootup. Since the system has not been booted, it is
+necessary to do what the bootscripts would otherwise do and populate
+<filename class="directory">/dev</filename>. Begin by mounting
+<filename class="directory">/dev</filename>:</para>
<screen><userinput>mount -n -t ramfs none /dev</userinput></screen>
-<para>Create a minimal set of device nodes:</para>
+<!-- Edit Me -->
+<para>Since the Udev package will not be installed until later on in the
+process, create a minimal set of device nodes used for building:</para>
<screen><userinput>mknod -m 622 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3
@@ -26,8 +48,10 @@ mknod -m 666 /dev/tty c 5 0
mknod -m 444 /dev/random c 1 8
mknod -m 444 /dev/urandom c 1 9
chown root:tty /dev/{console,ptmx,tty}</userinput></screen>
+<!-- -->
-<para>Create some symlinks and directories:</para>
+<para>There are some symlinks and directories required by LFS that are
+not created by Udev, so create those here:</para>
<screen><userinput>ln -s /proc/self/fd /dev/fd
ln -s /proc/self/fd/0 /dev/stdin
@@ -37,10 +61,21 @@ ln -s /proc/kcore /dev/core
mkdir /dev/pts
mkdir /dev/shm</userinput></screen>
-<para>Mount the virtual file systems:</para>
+<para>Finally, mount the proper virtual (kernel) file systems on the
+newly-created directories:</para>
<screen><userinput>mount -t devpts -o gid=4,mode=620 none /dev/pts
mount -t tmpfs none /dev/shm</userinput></screen>
+<para>The <command>mount</command> commands executed above may result
+in the following warning message:</para>
+
+<screen><computeroutput>can't open /etc/fstab: No such file or directory.</computeroutput></screen>
+
+<para>This file&mdash;<filename>/etc/fstab</filename>&mdash;has not
+been created yet but is also not required for the file systems to be
+properly mounted. As such, the warning can be safely ignored.</para>
+</sect2>
</sect1>
+