[3f8be484] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[aa18ac0] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[3f8be484] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
| 8 | <sect1 id="ch-chroot-kernfs">
|
---|
| 9 | <?dbhtml filename="kernfs.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Mounting Virtual Kernel File Systems</title>
|
---|
| 12 |
|
---|
[dabbced] | 13 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
[13bd751] | 14 | href="../../boot/common/devices.xml"
|
---|
| 15 | xpointer="xpointer(//*[@os='a'])"/>
|
---|
[3f8be484] | 16 |
|
---|
| 17 | <para>Various file systems exported by the kernel are used to communicate
|
---|
| 18 | to and from the kernel itself. These file systems are virtual in that no
|
---|
| 19 | disk space is used for them. The content of the file systems resides in
|
---|
| 20 | memory.</para>
|
---|
| 21 |
|
---|
| 22 | <para>Begin by creating directories onto which the file systems will
|
---|
| 23 | be mounted:</para>
|
---|
| 24 |
|
---|
[040521bc] | 25 | <screen><userinput>mkdir -pv ${CLFS}/{dev,proc,sys}</userinput></screen>
|
---|
[3f8be484] | 26 |
|
---|
| 27 | <para>Now mount the file systems:</para>
|
---|
| 28 |
|
---|
[040521bc] | 29 | <screen><userinput>mount -vt proc proc ${CLFS}/proc
|
---|
| 30 | mount -vt sysfs sysfs ${CLFS}/sys</userinput></screen>
|
---|
[3f8be484] | 31 |
|
---|
[fb40919] | 32 | <para>Remember that if for any reason you stop working on the CLFS system
|
---|
[3f8be484] | 33 | and start again later, it is important to check that these file systems
|
---|
| 34 | are mounted again before entering the chroot environment.</para>
|
---|
| 35 |
|
---|
[27e1607] | 36 | <para>Two device nodes, /dev/console and /dev/null, are required to be
|
---|
| 37 | present on the filesystem. These are needed by the kernel even before
|
---|
[e81586f] | 38 | starting Eudev early in the boot process, so we create them here:</para>
|
---|
[3f8be484] | 39 |
|
---|
[040521bc] | 40 | <screen><userinput>mknod -m 600 ${CLFS}/dev/console c 5 1
|
---|
| 41 | mknod -m 666 ${CLFS}/dev/null c 1 3</userinput></screen>
|
---|
[27e1607] | 42 |
|
---|
| 43 | <para>Once the system is complete and booting, the rest of our device
|
---|
[e81586f] | 44 | nodes are created by the Eudev package. Since this package is not
|
---|
[27e1607] | 45 | available to us right now, we must take other steps to provide device
|
---|
[fb40919] | 46 | nodes under on the CLFS filesystem. We will use the <quote>bind</quote>
|
---|
[27e1607] | 47 | option in the mount command to make our host system's /dev structure
|
---|
[fb40919] | 48 | appear in the new CLFS filesystem:</para>
|
---|
[27e1607] | 49 |
|
---|
[040521bc] | 50 | <screen><userinput>mount -v -o bind /dev ${CLFS}/dev</userinput></screen>
|
---|
[27e1607] | 51 |
|
---|
| 52 | <para>Additional file systems will soon be mounted from within the chroot
|
---|
| 53 | environment. To keep the host up to date, perform a <quote>fake mount</quote>
|
---|
| 54 | for each of these now:</para>
|
---|
| 55 |
|
---|
[040521bc] | 56 | <screen><userinput>mount -f -vt tmpfs tmpfs ${CLFS}/dev/shm
|
---|
[8f1ae86] | 57 | mount -f -vt devpts -o gid=&gid-tty;,mode=620 devpts ${CLFS}/dev/pts</userinput></screen>
|
---|
[3f8be484] | 58 |
|
---|
| 59 | </sect1>
|
---|