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 | <para>Create the initial device nodes</para>
|
---|
11 |
|
---|
12 | <screen><userinput>mknod -m 600 /dev/console c 5 1
|
---|
13 | mknod -m 666 /dev/null c 1 3</userinput></screen>
|
---|
14 |
|
---|
15 | <para>Mount a ramfs in /dev</para>
|
---|
16 |
|
---|
17 | <screen><userinput>mount -n -t ramfs none /dev</userinput></screen>
|
---|
18 |
|
---|
19 | <para>Create a minimal set of device nodes:</para>
|
---|
20 |
|
---|
21 | <screen><userinput>mknod -m 622 /dev/console c 5 1
|
---|
22 | mknod -m 666 /dev/null c 1 3
|
---|
23 | mknod -m 666 /dev/zero c 1 5
|
---|
24 | mknod -m 666 /dev/ptmx c 5 2
|
---|
25 | mknod -m 666 /dev/tty c 5 0
|
---|
26 | mknod -m 444 /dev/random c 1 8
|
---|
27 | mknod -m 444 /dev/urandom c 1 9
|
---|
28 | chown root:tty /dev/{console,ptmx,tty}</userinput></screen>
|
---|
29 |
|
---|
30 | <para>Create some symlinks and directories:</para>
|
---|
31 |
|
---|
32 | <screen><userinput>ln -s /proc/self/fd /dev/fd
|
---|
33 | ln -s /proc/self/fd/0 /dev/stdin
|
---|
34 | ln -s /proc/self/fd/1 /dev/stdout
|
---|
35 | ln -s /proc/self/fd/2 /dev/stderr
|
---|
36 | ln -s /proc/kcore /dev/core
|
---|
37 | mkdir /dev/pts
|
---|
38 | mkdir /dev/shm</userinput></screen>
|
---|
39 |
|
---|
40 | <para>Mount the virtual file systems:</para>
|
---|
41 |
|
---|
42 | <screen><userinput>mount -t devpts -o gid=4,mode=620 none /dev/pts
|
---|
43 | mount -t tmpfs none /dev/shm</userinput></screen>
|
---|
44 |
|
---|
45 |
|
---|
46 | </sect1>
|
---|