diff options
author | Pierre Labastie <pieere@linuxfromscratch.org> | 2020-06-08 08:12:16 +0000 |
---|---|---|
committer | Pierre Labastie <pieere@linuxfromscratch.org> | 2020-06-08 08:12:16 +0000 |
commit | 22422a8a13083ea8efc196dc410cfac0f498856c (patch) | |
tree | c23375c884afa8f384d6934a286c072fe1bef706 /chapter06/kernfs.xml | |
parent | 069c0ecc1ae0422f98f907c3c7f8fe7e49bd9f1f (diff) |
Remove unneeded files in chapter 6, and fix href' in chapter 7
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11901 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06/kernfs.xml')
-rw-r--r-- | chapter06/kernfs.xml | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml deleted file mode 100644 index dd6b8991c..000000000 --- a/chapter06/kernfs.xml +++ /dev/null @@ -1,115 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-tools-kernfs"> - <?dbhtml filename="kernfs.html"?> - - <title>Preparing Virtual Kernel File Systems</title> - - <indexterm zone="ch-tools-kernfs"> - <primary sortas="e-/dev/">/dev/*</primary> - </indexterm> - - <para>Various file systems exported by the kernel are used to communicate to - and from the kernel itself. These file systems are virtual in that no disk - space is used for them. The content of the file systems resides in - memory.</para> - - <para>Begin by creating directories onto which the file systems will be - mounted:</para> - -<screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen> - - <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. The device nodes must be created - on the hard disk so that they are available before <command>udevd</command> - has been started, and additionally when Linux is started with - <parameter>init=/bin/bash</parameter>. Create the devices by running the - following commands:</para> - -<screen><userinput>mknod -m 600 $LFS/dev/console c 5 1 -mknod -m 666 $LFS/dev/null c 1 3</userinput></screen> - - </sect2> - - <sect2 id="ch-system-bindmount"> - <title>Mounting and Populating /dev</title> - - <para>The recommended method of populating the <filename - class="directory">/dev</filename> directory with devices is to mount a - virtual filesystem (such as <systemitem - class="filesystem">tmpfs</systemitem>) on the <filename - class="directory">/dev</filename> directory, and allow the devices to be - created dynamically on that virtual filesystem as they are detected or - accessed. Device creation is generally done during the boot process - by Udev. Since this new system does not yet have Udev and has not yet - been booted, it is necessary to mount and populate <filename - class="directory">/dev</filename> manually. This is accomplished by bind - mounting the host system's <filename class="directory">/dev</filename> - directory. A bind mount is 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 command to achieve this:</para> - -<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen> - - </sect2> - - <sect2 id="ch-system-kernfsmount"> - <title>Mounting Virtual Kernel File Systems</title> - - <para>Now mount the remaining virtual kernel filesystems:</para> - -<screen><userinput>mount -v --bind /dev/pts $LFS/dev/pts -mount -vt proc proc $LFS/proc -mount -vt sysfs sysfs $LFS/sys -mount -vt tmpfs tmpfs $LFS/run</userinput></screen> - - <variablelist> - <title>The meaning of the mount options for devpts:</title> - - <varlistentry> - <term><parameter>gid=5</parameter></term> - <listitem> - <para>This ensures that all devpts-created device nodes are owned by - group ID 5. This is the ID we will use later on for the <systemitem - class="groupname">tty</systemitem> group. We use the group ID instead - of a name, since the host system might use a different ID for its - <systemitem class="groupname">tty</systemitem> group.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter>mode=0620</parameter></term> - <listitem> - <para>This ensures that all devpts-created device nodes have mode 0620 - (user readable and writable, group writable). Together with the - option above, this ensures that devpts will create device nodes that - meet the requirements of grantpt(), meaning the Glibc - <command>pt_chown</command> helper binary (which is not installed by - default) is not necessary.</para> - </listitem> - </varlistentry> - - </variablelist> - - <para>In some host systems, <filename>/dev/shm</filename> is a - symbolic link to <filename class="directory">/run/shm</filename>. - The /run tmpfs was mounted above so in this case only a - directory needs to be created.</para> - -<screen><userinput>if [ -h $LFS/dev/shm ]; then - mkdir -pv $LFS/$(readlink $LFS/dev/shm) -fi</userinput></screen> - - </sect2> - -</sect1> |