source: chapter06/devices.xml@ 67129a2b

6.0
Last change on this file since 67129a2b was ef13657, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Completed global edits for upcoming 6.0 release

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/testing/BOOK@4000 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.3 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
3 <!ENTITY % general-entities SYSTEM "../general.ent">
4 %general-entities;
5]>
6<sect1 id="ch-system-devices" xreflabel="devices">
7<title>Populating /dev</title>
8<?dbhtml filename="devices.html"?>
9
10<indexterm zone="ch-system-devices"><primary sortas="e-Devices">Devices</primary></indexterm>
11
12<sect2>
13<title>Creating Initial Device Nodes</title>
14
15<para>When the kernel boots the system, it requires the presence of a few device
16nodes, in particular the <filename class="devicefile">console</filename> and
17<filename class="devicefile">null</filename> devices. Create these by
18running the following commands:</para>
19
20<screen><userinput>mknod -m 600 /dev/console c 5 1
21mknod -m 666 /dev/null c 1 3</userinput></screen>
22</sect2>
23
24<sect2>
25<title>Mounting ramfs and populating /dev</title>
26
27<para>The ideal way to populate <filename
28class="directory">/dev</filename> is to mount a ramfs onto <filename
29class="directory">/dev</filename> like <systemitem
30class="filesystem">tmpfs</systemitem>, and create the devices on there
31during each bootup. Since the system has not been booted, it is
32necessary to do what the bootscripts would otherwise do and populate
33<filename class="directory">/dev</filename>. Begin by mounting
34<filename class="directory">/dev</filename>:</para>
35
36<screen><userinput>mount -n -t ramfs none /dev</userinput></screen>
37
38<para>Now run the installed <command>udevstart</command> program to
39create the initial devices based on all the information in <filename
40class="directory">/sys</filename>:</para>
41
42<screen><userinput>/tools/sbin/udevstart</userinput></screen>
43
44<para>There are some symlinks and directories required by LFS that are
45not created by Udev, so create those here:</para>
46
47<screen><userinput>ln -s /proc/self/fd /dev/fd
48ln -s /proc/self/fd/0 /dev/stdin
49ln -s /proc/self/fd/1 /dev/stdout
50ln -s /proc/self/fd/2 /dev/stderr
51ln -s /proc/kcore /dev/core
52mkdir /dev/pts
53mkdir /dev/shm</userinput></screen>
54
55<para>Finally, mount the proper virtual (kernel) file systems on the
56newly-created directories:</para>
57
58<screen><userinput>mount -t devpts -o gid=4,mode=620 none /dev/pts
59mount -t tmpfs none /dev/shm</userinput></screen>
60</sect2>
61
62</sect1>
63
Note: See TracBrowser for help on using the repository browser.