Index: BOOK/system-config/common/bootscripts.xml
===================================================================
--- BOOK/system-config/common/bootscripts.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/bootscripts.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,280 @@
+<?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-config-bootscripts" role="wrap">
+  <?dbhtml filename="bootscripts.html"?>
+
+  <title>Bootscripts for CLFS &bootscripts-clfs-version;</title>
+
+  <indexterm zone="ch-config-bootscripts">
+    <primary sortas="a-Bootscripts">Bootscripts</primary>
+  </indexterm>
+
+  <sect2 role="package">
+    <title/>
+
+    <para>The Bootscripts package contains a set of scripts to
+    start/stop the CLFS system at bootup/shutdown.</para>
+
+  </sect2>
+
+  <sect2 role="installation">
+    <title>Installation of Bootscripts</title>
+
+    <para os="a">Install the bootscripts:</para>
+
+<screen os="b"><userinput>make install-bootscripts</userinput></screen>
+
+    <para os="c">If you are going to use a network card, run the following
+    command to install scripts for starting and configuring the network
+    interface:</para>
+
+<screen os="d"><userinput>make install-network</userinput></screen>
+
+  </sect2>
+
+  <sect2 id="contents-bootscripts" role="content">
+    <title>Contents of Bootscripts</title>
+
+    <segmentedlist>
+      <segtitle>Installed scripts</segtitle>
+
+      <seglistitem>
+        <seg>checkfs, cleanfs, console, functions, halt, ifdown,
+        ifup, localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals,
+        setclock, static, swap, sysklogd, template, and udev.</seg>
+      </seglistitem>
+    </segmentedlist>
+
+    <variablelist>
+      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+      <?dbfo list-presentation="list"?>
+      <?dbhtml list-presentation="table"?>
+
+      <varlistentry id="checkfs-bootscripts">
+        <term><command>checkfs</command></term>
+        <listitem>
+          <para>Checks the integrity of the file systems before they are
+          mounted (with the exception of journal and network based file
+          systems)</para>
+          <indexterm zone="ch-config-bootscripts checkfs-bootscripts">
+            <primary sortas="d-checkfs">checkfs</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="cleanfs-bootscripts">
+        <term><command>cleanfs</command></term>
+        <listitem>
+          <para>Removes files that should not be preserved between reboots,
+          such as those in <filename class="directory">/var/run/</filename>
+          and <filename class="directory">/var/lock/</filename>; it re-creates
+          <filename>/var/run/utmp</filename> and removes the possibly present
+          <filename>/etc/nologin</filename>, <filename>/fastboot</filename>,
+          and <filename>/forcefsck</filename> files</para>
+          <indexterm zone="ch-config-bootscripts cleanfs-bootscripts">
+            <primary sortas="d-cleanfs">cleanfs</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="console-bootscripts">
+        <term><command>console</command></term>
+        <listitem>
+          <para>Loads the correct keymap table for the desired keyboard
+          layout; it also sets the screen font</para>
+          <indexterm zone="ch-config-bootscripts console-bootscripts">
+            <primary sortas="d-console">console</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="functions-bootscripts">
+        <term><command>functions</command></term>
+        <listitem>
+          <para>Contains common functions, such as error and status checking,
+          that are used by several bootscripts</para>
+          <indexterm zone="ch-config-bootscripts functions-bootscripts">
+            <primary sortas="d-functions">functions</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="halt-bootscripts">
+        <term><command>halt</command></term>
+        <listitem>
+          <para>Halts the system</para>
+          <indexterm zone="ch-config-bootscripts halt-bootscripts">
+            <primary sortas="d-halt">halt</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="ifdown-bootscripts">
+        <term><command>ifdown</command></term>
+        <listitem>
+          <para>Assists the network script with stopping network devices</para>
+          <indexterm zone="ch-config-bootscripts ifdown-bootscripts">
+            <primary sortas="d-ifdown">ifdown</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="ifup-bootscripts">
+        <term><command>ifup</command></term>
+        <listitem>
+          <para>Assists the network script with starting network devices</para>
+          <indexterm zone="ch-config-bootscripts ifup-bootscripts">
+            <primary sortas="d-ifup">ifup</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="localnet-bootscripts">
+        <term><command>localnet</command></term>
+        <listitem>
+          <para>Sets up the system's hostname and local loopback device</para>
+          <indexterm zone="ch-config-bootscripts localnet-bootscripts">
+            <primary sortas="d-localnet">localnet</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="mountfs-bootscripts">
+        <term><command>mountfs</command></term>
+        <listitem>
+          <para>Mounts all file systems, except ones that are marked
+          <emphasis>noauto</emphasis> or are network based</para>
+          <indexterm zone="ch-config-bootscripts mountfs-bootscripts">
+            <primary sortas="d-mountfs">mountfs</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="mountkernfs-bootscripts">
+        <term><command>mountkernfs</command></term>
+        <listitem>
+          <para>Mounts virtual kernel file systems, such as
+          <systemitem class="filesystem">proc</systemitem></para>
+          <indexterm zone="ch-config-bootscripts mountkernfs-bootscripts">
+            <primary sortas="d-mountkernfs">mountkernfs</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="network-bootscripts">
+        <term><command>network</command></term>
+        <listitem>
+          <para>Sets up network interfaces, such as network cards, and sets up
+          the default gateway (where applicable)</para>
+          <indexterm zone="ch-config-bootscripts network-bootscripts">
+            <primary sortas="d-network">network</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="rc-bootscripts">
+        <term><command>rc</command></term>
+        <listitem>
+          <para>The master run-level control script; it is responsible for
+          running all the other bootscripts one-by-one, in a sequence
+          determined by the name of the symbolic links being processed</para>
+          <indexterm zone="ch-config-bootscripts rc-bootscripts">
+            <primary sortas="d-rc">rc</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="reboot-bootscripts">
+        <term><command>reboot</command></term>
+        <listitem>
+          <para>Reboots the system</para>
+          <indexterm zone="ch-config-bootscripts reboot-bootscripts">
+            <primary sortas="d-reboot">reboot</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="sendsignals-bootscripts">
+        <term><command>sendsignals</command></term>
+        <listitem>
+          <para>Makes sure every process is terminated before the system reboots
+          or halts</para>
+          <indexterm zone="ch-config-bootscripts sendsignals-bootscripts">
+            <primary sortas="d-sendsignals">sendsignals</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="setclock-bootscripts">
+        <term><command>setclock</command></term>
+        <listitem>
+          <para>Resets the kernel clock to local time in case the hardware clock
+          is not set to UTC time</para>
+          <indexterm zone="ch-config-bootscripts setclock-bootscripts">
+            <primary sortas="d-setclock">setclock</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="static-bootscripts">
+        <term><command>static</command></term>
+        <listitem>
+          <para>Provides the functionality needed to assign a static Internet
+          Protocol (IP) address to a network interface</para>
+          <indexterm zone="ch-config-bootscripts static-bootscripts">
+            <primary sortas="d-static">static</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="swap-bootscripts">
+        <term><command>swap</command></term>
+        <listitem>
+          <para>Enables and disables swap files and partitions</para>
+          <indexterm zone="ch-config-bootscripts swap-bootscripts">
+            <primary sortas="d-swap">swap</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="sysklogd-bootscripts">
+        <term><command>sysklogd</command></term>
+        <listitem>
+          <para>Starts and stops the system and kernel log daemons</para>
+          <indexterm zone="ch-config-bootscripts sysklogd-bootscripts">
+            <primary sortas="d-sysklogd">sysklogd</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="template-bootscripts">
+        <term><command>template</command></term>
+        <listitem>
+          <para>A template to create custom bootscripts for other
+          daemons</para>
+          <indexterm zone="ch-config-bootscripts template-bootscripts">
+            <primary sortas="d-template">template</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+      <varlistentry id="eudev-bootscripts">
+        <term><command>udev</command></term>
+        <listitem>
+          <para>Starts and stops the Eudev daemon</para>
+          <indexterm zone="ch-config-bootscripts eudev-bootscripts">
+            <primary sortas="d-eudev">udev</primary>
+          </indexterm>
+        </listitem>
+      </varlistentry>
+
+    </variablelist>
+
+  </sect2>
+
+</sect1>
Index: BOOK/system-config/common/console.xml
===================================================================
--- BOOK/system-config/common/console.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/console.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,40 @@
+<?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-config-console">
+  <?dbhtml filename="console.html"?>
+  <title>Configuring the Linux Console</title>
+
+  <indexterm zone="ch-config-console">
+    <primary sortas="d-console">console</primary>
+  <secondary>configuring</secondary></indexterm>
+
+  <para>This section discusses how to configure the <command>i18n</command>
+  bootscript that sets up the keyboard map and the console font. If non-ASCII
+  characters (e.g., the British pound sign and Euro character) will not be
+  used and the keyboard is a U.S. one, skip this section. Without the
+  configuration file, the <command>i18n</command> bootscript will do
+  nothing.</para>
+
+  <para>The <command>i18n</command> script reads the
+  <filename>/etc/sysconfig/i18n</filename> file for configuration
+  information. Decide which keymap and screen font will be used. Various
+  language-specific HOWTO's can also help with this (see <ulink
+  url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
+  <filename>/etc/sysconfig/i18n</filename> file with known settings for
+  several countries was installed with the CLFS-Bootscripts package, so the
+  relevant section can be uncommented if the country is supported. If still
+  in doubt, look in the <filename class="directory">/usr/share/consolefonts</filename>
+  for valid screen fonts and <filename class="directory">/usr/share/keymaps</filename>
+  for valid keymaps.</para>
+
+  <para>The default <filename>/etc/sysconfig/i18n</filename> is set up for UTF-8
+  using the us keymap. You will need to edit the file to your specific needs.
+  The <filename>/etc/sysconfig/i18n</filename> file has additional information
+  in it to help you to assist in configuring.</para>
+
+</sect1>
Index: BOOK/system-config/common/eudev.xml
===================================================================
--- BOOK/system-config/common/eudev.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/eudev.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,348 @@
+<?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-config-eudev">
+  <?dbhtml filename="eudev.html"?>
+
+  <title>Device and Module Handling on a CLFS System</title>
+
+  <indexterm zone="ch-config-eudev">
+    <primary sortas="a-Eudev">Eudev</primary>
+    <secondary>usage</secondary>
+  </indexterm>
+
+  <para>In <xref linkend="chapter-building-system"/>, we installed the Eudev
+  package. Before we go into the details regarding how this works,
+  a brief history of previous methods of handling devices is in
+  order.</para>
+
+  <para>Linux systems in general traditionally use a static device creation
+  method, whereby a great many device nodes are created under <filename
+  class="directory">/dev</filename> (sometimes literally thousands of nodes),
+  regardless of whether the corresponding hardware devices actually exist. This
+  is typically done via a <command>MAKEDEV</command> script, which contains a
+  number of calls to the <command>mknod</command> program with the relevant
+  major and minor device numbers for every possible device that might exist in
+  the world.</para>
+
+  <para>Using the Eudev method, only those devices which are detected by the
+  kernel get device nodes created for them. Because these device nodes will be
+  created each time the system boots, they will be stored on a <systemitem
+  class="filesystem">tmpfs</systemitem> file system (a virtual file system that
+  resides entirely in system memory). Device nodes do not require much space, so
+  the memory that is used is negligible.</para>
+
+  <sect2>
+    <title>History</title>
+
+    <para>In February 2000, a new filesystem called <systemitem
+    class="filesystem">devfs</systemitem> was merged into the 2.3.46 kernel
+    and was made available during the 2.4 series of stable kernels. Although
+    it was present in the kernel source itself, this method of creating devices
+    dynamically never received overwhelming support from the core kernel
+    developers.</para>
+
+    <para>The main problem with the approach adopted by <systemitem
+    class="filesystem">devfs</systemitem> was the way it handled device
+    detection, creation, and naming. The latter issue, that of device node
+    naming, was perhaps the most critical. It is generally accepted that if
+    device names are allowed to be configurable, then the device naming policy
+    should be up to a system administrator, not imposed on them by any
+    particular developer(s). The <systemitem
+    class="filesystem">devfs</systemitem> file system also suffers from race
+    conditions that are inherent in its design and cannot be fixed without a
+    substantial revision to the kernel. It has also been marked as deprecated
+    due to a lack of recent maintenance.</para>
+
+    <para>With the development of the unstable 2.5 kernel tree, later released
+    as the 2.6 series of stable kernels, a new virtual filesystem called
+    <systemitem class="filesystem">sysfs</systemitem> came to be. The job of
+    <systemitem class="filesystem">sysfs</systemitem> is to export a view of
+    the system's hardware configuration to userspace processes. With this
+    userspace-visible representation, the possibility of seeing a userspace
+    replacement for <systemitem class="filesystem">devfs</systemitem> became
+    much more realistic.</para>
+
+  </sect2>
+
+  <sect2>
+    <title>Eudev Implementation</title>
+
+    <sect3>
+      <title>Sysfs</title>
+
+      <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
+      mentioned briefly above. One may wonder how <systemitem
+      class="filesystem">sysfs</systemitem> knows about the devices present on
+      a system and what device numbers should be used for them. Drivers that
+      have been compiled into the kernel directly register their objects with
+      <systemitem class="filesystem">sysfs</systemitem> as they are detected by
+      the kernel. For drivers compiled as modules, this registration will happen
+      when the module is loaded. Once the <systemitem
+      class="filesystem">sysfs</systemitem> filesystem is mounted (on <filename
+      class="directory">/sys</filename>), data which the built-in drivers
+      registered with <systemitem class="filesystem">sysfs</systemitem> are
+      available to userspace processes and to <command>udevd</command> for device
+      node creation.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Eudev Bootscript</title>
+
+      <para>The <command>S10udev</command> initscript takes care of creating
+      device nodes when Linux is booted. The script unsets the uevent handler
+      from the default of <command>/sbin/hotplug</command>.  This is done
+      because the kernel no longer needs to call out to an external binary.
+      Instead <command>udevd</command> will listen on a netlink socket for
+      uevents that the kernel raises. Next, the bootscript copies any static
+      device nodes that exist in <filename
+      class="directory">/lib/udev/devices</filename> to <filename
+      class="directory">/dev</filename>. This is necessary because some devices,
+      directories, and symlinks are needed before the dynamic device handling
+      processes are available during the early stages of booting a system.
+      Creating static device nodes in <filename
+      class="directory">/lib/udev/devices</filename> also provides an easy
+      workaround for devices that are not supported by the dynamic device
+      handling infrastructure. The bootscript then starts the Eudev daemon,
+      <command>udevd</command>, which will act on any uevents it receives.
+      Finally, the bootscript forces the kernel to replay uevents for any
+      devices that have already been registered and then waits for
+      <command>udevd</command> to handle them.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Device Node Creation</title>
+
+      <para>To obtain the right major and minor number for a device, Eudev relies
+      on the information provided by <systemitem
+      class="filesystem">sysfs</systemitem> in <filename
+      class="directory">/sys</filename>.  For example,
+      <filename>/sys/class/tty/vcs/dev</filename> contains the string
+      <quote>7:0</quote>. This string is used by <command>udevd</command>
+      to create a device node with major number <emphasis>7</emphasis> and minor
+      <emphasis>0</emphasis>. The names and permissions of the nodes created
+      under the <filename class="directory">/dev</filename> directory are
+      determined by rules specified in the files within the <filename
+      class="directory">/etc/udev/rules.d/</filename> directory. These are
+      numbered in a similar fashion to the CLFS-Bootscripts package. If
+      <command>udevd</command> can't find a rule for the device it is creating,
+      it will default permissions to <emphasis>660</emphasis> and ownership to
+      <emphasis>root:root</emphasis>. Documentation on the syntax of the Eudev
+      rules configuration files is available in
+      <filename>/usr/share/doc/udev/writing_udev_rules/index.html</filename></para>
+
+    </sect3>
+
+    <sect3>
+      <title>Module Loading</title>
+
+      <para>Device drivers compiled as modules may have aliases built into them.
+      Aliases are visible in the output of the <command>modinfo</command>
+      program and are usually related to the bus-specific identifiers of devices
+      supported by a module. For example, the <emphasis>snd-fm801</emphasis>
+      driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801,
+      and has an alias of <quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>.
+      For most devices, the bus driver exports the alias of the driver that
+      would handle the device via <systemitem
+      class="filesystem">sysfs</systemitem>. E.g., the
+      <filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> file
+      might contain the string
+      <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>.
+      The default rules provided by Eudev will cause <command>udevd</command>
+      to call out to <command>/sbin/modprobe</command> with the contents of the
+      <envar>MODALIAS</envar> uevent environment variable (that should be the
+      same as the contents of the <filename>modalias</filename> file in sysfs),
+      thus loading all modules whose aliases match this string after wildcard
+      expansion.</para>
+
+      <para>In this example, this means that, in addition to
+      <emphasis>snd-fm801</emphasis>, the obsolete (and unwanted)
+      <emphasis>forte</emphasis> driver will be loaded if it is
+      available. See below for ways in which the loading of unwanted drivers can
+      be prevented.</para>
+
+      <para>The kernel itself is also able to load modules for network
+      protocols, filesystems and NLS support on demand.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Handling Hotpluggable/Dynamic Devices</title>
+
+      <para>When you plug in a device, such as a Universal Serial Bus (USB) MP3
+      player, the kernel recognizes that the device is now connected and
+      generates a uevent. This uevent is then handled by
+      <command>udevd</command> as described above.</para>
+
+    </sect3>
+
+  </sect2>
+
+  <sect2>
+    <title>Problems with Loading Modules and Creating Devices</title>
+
+    <para>There are a few possible problems when it comes to automatically
+    creating device nodes.</para>
+
+    <sect3>
+      <title>A kernel module is not loaded automatically</title>
+
+      <para>Eudev will only load a module if it has a bus-specific alias and the
+      bus driver properly exports the necessary aliases to <systemitem
+      class="filesystem">sysfs</systemitem>. In other cases, one should
+      arrange module loading by other means. With Linux-&linux-version;, Eudev is
+      known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI,
+      SERIO and FireWire devices.</para>
+
+      <para>To determine if the device driver you require has the necessary
+      support for Eudev, run <command>modinfo</command> with the module name as
+      the argument.  Now try locating the device directory under
+      <filename class="directory">/sys/bus</filename> and check whether there is
+      a <filename>modalias</filename> file there.</para>
+
+      <para>If the <filename>modalias</filename> file exists in <systemitem
+      class="filesystem">sysfs</systemitem>, the driver supports the device and
+      can talk to it directly, but doesn't have the alias, it is a bug in the
+      driver. Load the driver without the help from Eudev and expect the issue
+      to be fixed later.</para>
+
+      <para>If there is no <filename>modalias</filename> file in the relevant
+      directory under <filename class="directory">/sys/bus</filename>, this
+      means that the kernel developers have not yet added modalias support to
+      this bus type. With Linux-&linux-version;, this is the case with ISA
+      busses. Expect this issue to be fixed in later kernel versions.</para>
+
+      <para>Eudev is not intended to load <quote>wrapper</quote> drivers such as
+      <emphasis>snd-pcm-oss</emphasis> and non-hardware drivers such as
+      <emphasis>loop</emphasis> at all.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>A kernel module is not loaded automatically, and Eudev is not
+      intended to load it</title>
+
+      <para>If the <quote>wrapper</quote> module only enhances the functionality
+      provided by some other module (e.g., <emphasis>snd-pcm-oss</emphasis>
+      enhances the functionality of <emphasis>snd-pcm</emphasis> by making the
+      sound cards available to OSS applications), configure
+      <command>modprobe</command> to load the wrapper after Eudev loads the
+      wrapped module. To do this, add an <quote>install</quote> line in
+      <filename>/etc/modprobe.conf</filename>. For example:</para>
+
+<screen role="nodump"><literal>install snd-pcm /sbin/modprobe -i snd-pcm ; \
+    /sbin/modprobe snd-pcm-oss ; true</literal></screen>
+
+      <para>If the module in question is not a wrapper and is useful by itself,
+      configure the <command>S05modules</command> bootscript to load this
+      module on system boot. To do this, add the module name to the
+      <filename>/etc/sysconfig/modules</filename> file on a separate line.
+      This works for wrapper modules too, but is suboptimal in that case.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Eudev loads some unwanted module</title>
+
+      <para>Either don't build the module, or blacklist it in
+      <filename>/etc/modprobe.conf</filename> file as done with the
+      <emphasis>forte</emphasis> module in the example below:</para>
+
+<screen role="nodump"><literal>blacklist forte</literal></screen>
+
+      <para>Blacklisted modules can still be loaded manually with the
+      explicit <command>modprobe</command> command.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Eudev creates a device incorrectly, or makes a wrong symlink</title>
+
+      <para>This usually happens if a rule unexpectedly matches a device. For
+      example, a poorly-writen rule can match both a SCSI disk (as desired)
+      and the corresponding SCSI generic device (incorrectly) by vendor.
+      Find the offending rule and make it more specific, with the help of
+      <command>udevadm info</command>.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Eudev rule works unreliably</title>
+
+      <para>This may be another manifestation of the previous problem. If not,
+      and your rule uses <systemitem class="filesystem">sysfs</systemitem>
+      attributes, it may be a kernel timing issue, to be fixed in later kernels.
+      For now, you can work around it by creating a rule that waits for the used
+      <systemitem class="filesystem">sysfs</systemitem> attribute and appending
+      it to the <filename>/etc/udev/rules.d/10-wait_for_sysfs.rules</filename>
+      file. Please notify the CLFS Development list if you do so and it
+      helps.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Eudev does not create a device</title>
+
+      <para>Further text assumes that the driver is built statically into the
+      kernel or already loaded as a module, and that you have already checked
+      that Eudev doesn't create a misnamed device.</para>
+
+      <para>Eudev has no information needed to create a device node if a kernel
+      driver does not export its data to <systemitem
+      class="filesystem">sysfs</systemitem>.
+      This is most common with third party drivers from outside the kernel
+      tree. Create a static device node in
+      <filename>/lib/udev/devices</filename> with the appropriate major/minor
+      numbers (see the file <filename>devices.txt</filename> inside the kernel
+      documentation or the documentation provided by the third party driver
+      vendor). The static device node will be copied to
+      <filename class="directory">/dev</filename> by the
+      <command>S10udev</command> bootscript.</para>
+
+    </sect3>
+
+    <sect3>
+      <title>Device naming order changes randomly after rebooting</title>
+
+      <para>This is due to the fact that Eudev, by design, handles uevents and
+      loads modules in parallel, and thus in an unpredictable order. This will
+      never be <quote>fixed</quote>. You should not rely upon the kernel device
+      names being stable. Instead, create your own rules that make symlinks with
+      stable names based on some stable attributes of the device, such as a
+      serial number or the output of various *_id utilities installed by Eudev.
+      See <xref linkend="ch-config-symlinks"/> and
+      <xref linkend="chapter-network"/> for examples.</para>
+
+    </sect3>
+
+  </sect2>
+
+  <sect2>
+    <title>Useful Reading</title>
+
+    <para>Additional helpful documentation is available at the following
+    sites:</para>
+
+    <itemizedlist>
+
+      <listitem>
+        <para remap="verbatim">A Userspace Implementation of <systemitem class="filesystem">devfs</systemitem>
+        <ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para>
+      </listitem>
+
+      <listitem>
+        <para remap="verbatim">The <systemitem class="filesystem">sysfs</systemitem> Filesystem
+        <ulink url="http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf"/></para>
+      </listitem>
+
+    </itemizedlist>
+
+  </sect2>
+
+</sect1>
Index: BOOK/system-config/common/inputrc.xml
===================================================================
--- BOOK/system-config/common/inputrc.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/inputrc.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,85 @@
+<?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-config-inputrc">
+  <?dbhtml filename="inputrc.html"?>
+
+  <title>Creating the /etc/inputrc File</title>
+
+  <indexterm zone="ch-config-inputrc">
+    <primary sortas="e-/etc/inputrc">/etc/inputrc</primary>
+  </indexterm>
+
+  <para>The <filename>/etc/inputrc</filename> file deals with mapping
+  the keyboard for specific situations. This file is the start-up file
+  used by Readline &mdash; the input-related library &mdash; used by Bash
+  and most other shells.</para>
+
+  <para>Most people do not need user-specific keyboard mappings so
+  the command below creates a global <filename>/etc/inputrc</filename>
+  used by everyone who logs in. If you later decide you need to override
+  the defaults on a per-user basis, you can create a
+  <filename>.inputrc</filename> file in the user's home directory with
+  the modified mappings.</para>
+
+  <para>For more information on how to edit the <filename>inputrc</filename>
+  file, see <command>info bash</command> under the <emphasis>Readline Init
+  File</emphasis> section. <command>info readline</command> is also a good
+  source of information.</para>
+
+  <para>Below is a generic global <filename>inputrc</filename> along
+  with comments to explain what the various options do. Note that
+  comments cannot be on the same line as commands. Create the file
+  using the following command:</para>
+
+<screen><?dbfo keep-together="auto"?><userinput>cat &gt; /etc/inputrc &lt;&lt; "EOF"
+<literal># Begin /etc/inputrc
+# Modified by Chris Lynn &lt;roryo@roryo.dynup.net&gt;
+
+# Allow the command prompt to wrap to the next line
+set horizontal-scroll-mode Off
+
+# Enable 8bit input
+set meta-flag On
+set input-meta On
+
+# Turns off 8th bit stripping
+set convert-meta Off
+
+# Keep the 8th bit for display
+set output-meta On
+
+# none, visible or audible
+set bell-style none
+
+# All of the following map the escape sequence of the
+# value contained inside the 1st argument to the
+# readline specific functions
+
+"\eOd": backward-word
+"\eOc": forward-word
+
+# for linux console
+"\e[1~": beginning-of-line
+"\e[4~": end-of-line
+"\e[5~": beginning-of-history
+"\e[6~": end-of-history
+"\e[3~": delete-char
+"\e[2~": quoted-insert
+
+# for xterm
+"\eOH": beginning-of-line
+"\eOF": end-of-line
+
+# for Konsole
+"\e[H": beginning-of-line
+"\e[F": end-of-line
+
+# End /etc/inputrc</literal>
+EOF</userinput></screen>
+
+</sect1>
Index: BOOK/system-config/common/introduction.xml
===================================================================
--- BOOK/system-config/common/introduction.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/introduction.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,28 @@
+<?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-config-introduction">
+  <?dbhtml filename="introduction.html"?>
+
+  <title>Introduction</title>
+
+  <para>This chapter details how to install and configure the CLFS-Bootscripts
+  package. Most of these scripts will work without modification, but a few
+  require additional configuration files because they deal with
+  hardware-dependent information.</para>
+
+  <para>System-V style init scripts are employed in this book because they
+  are widely used. For additional options, a hint detailing the BSD style
+  init setup is available at <ulink
+  url="&hints-root;BSD-Init"/>.
+  Searching the LFS mailing lists for <quote>depinit</quote> will also offer
+  additional choices.</para>
+
+  <para>If using an alternative style of init scripts, skip this chapter and
+  move on to <xref linkend="chapter-bootable"/>.</para>
+
+</sect1>
Index: BOOK/system-config/common/locale.xml
===================================================================
--- BOOK/system-config/common/locale.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/locale.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,137 @@
+<?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-config-locale">
+  <title>Setting Up Locale Information</title>
+  <?dbhtml filename="locale.html"?>
+
+  <indexterm zone="ch-config-locale">
+    <primary sortas="e-/etc/profile">/etc/profile</primary>
+  </indexterm>
+
+  <para>The base <filename>/etc/profile</filename> below sets some
+  environment variables necessary for native language support. Setting
+  them properly results in:</para>
+
+  <itemizedlist>
+    <listitem>
+      <para>The output of programs translated into the native language</para>
+    </listitem>
+    <listitem>
+      <para>Correct classification of characters into letters, digits and
+      other classes. This is necessary for <command>bash</command> to
+      properly accept non-ASCII characters in command lines in non-English
+      locales</para>
+    </listitem>
+    <listitem>
+      <para>The correct alphabetical sorting order for the country</para>
+    </listitem>
+    <listitem>
+      <para>Appropriate default paper size</para>
+    </listitem>
+    <listitem>
+      <para>Correct formatting of monetary, time, and date values</para>
+    </listitem>
+  </itemizedlist>
+
+  <para>This script also sets the <envar>INPUTRC</envar> environment variable
+  that makes Bash and Readline use the <filename>/etc/inputrc</filename> file
+  created earlier.</para>
+
+  <para>Replace <replaceable>[ll]</replaceable> below with the
+  two-letter code for the desired language (e.g., <quote>en</quote>) and
+  <replaceable>[CC]</replaceable> with the two-letter code for the
+  appropriate country (e.g., <quote>GB</quote>).
+  <replaceable>[charmap]</replaceable> should be replaced with the
+  canonical charmap for your chosen locale.</para>
+
+  <para>The list of all locales supported by Glibc can be obtained by running
+  the following command:</para>
+
+<screen role="nodump"><userinput>locale -a</userinput></screen>
+
+  <para>Locales can have a number of synonyms, e.g. <quote>ISO-8859-1</quote>
+  is also referred to as <quote>iso8859-1</quote> and <quote>iso88591</quote>.
+  Some applications cannot handle the various synonyms correctly, so it is
+  safest to choose the canonical name for a particular locale. To determine
+  the canonical name, run the following command, where <replaceable>[locale
+  name]</replaceable> is the output given by <command>locale -a</command> for
+  your preferred locale (<quote>en_US.utf8</quote> in our example).</para>
+
+<screen role="nodump"><userinput>LC_ALL=<replaceable>[locale name]</replaceable> locale charmap</userinput></screen>
+
+  <para>For the <quote>en_US.utf8</quote> locale, the above command
+  will print:</para>
+
+<screen><computeroutput>UTF-8</computeroutput></screen>
+
+  <para>This results in a final locale setting of <quote>en_US.UTF-8</quote>.
+  It is important that the locale found using the heuristic above is tested prior
+  to it being added to the Bash startup files:</para>
+
+<screen role="nodump"><userinput>LC_ALL=[locale name] locale territory 
+LC_ALL=[locale name] locale language
+LC_ALL=[locale name] locale charmap
+LC_ALL=[locale name] locale int_curr_symbol
+LC_ALL=[locale name] locale int_prefix</userinput></screen>
+
+  <para>The above commands should print the language name, the character
+  encoding used by the locale, the local currency, and the prefix to dial
+  before the telephone number in order to get into the country. If any of the
+  commands above fail with a message similar to the one shown below, this means
+  that your locale was either not installed in Chapter 10 or is not supported by
+  the default installation of Glibc.</para>
+
+<screen><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></screen>
+
+  <para>If this happens, you should either install the desired locale using
+  the <command>localedef</command> command, or consider choosing a different
+  locale. Further instructions assume that there are no such error messages
+  from Glibc.</para>
+
+  <para>Some packages beyond CLFS may also lack support for your chosen locale.
+  One example is the X library (part of the X Window System), which outputs
+  the following error message:</para>
+
+<screen><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></screen>
+
+  <para>Sometimes it is possible to fix this by removing the charmap part of
+  the locale specification, as long as that does not change the character map
+  that Glibc associates with the locale (this can be checked by running the
+  <command>locale charmap</command> command in both locales). For example,
+  one would have to change &quot;de_DE.ISO-8859-15@euro&quot; to
+  &quot;de_DE@euro&quot; in order to get this locale recognized by Xlib.</para>
+
+  <para>Other packages can also function incorrectly (but may not necessarily
+  display any error messages) if the locale name does not meet their expectations.
+  In those cases, investigating how other Linux distributions support your locale
+  might provide some useful information.</para>
+
+  <para>Once the proper locale settings have been determined, create the
+  <filename>/etc/profile</filename> file:</para>
+
+<screen><userinput>cat &gt; /etc/profile &lt;&lt; "EOF"
+<literal># Begin /etc/profile
+
+export LANG=<replaceable>[ll]</replaceable>_<replaceable>[CC]</replaceable>.<replaceable>[charmap]</replaceable>
+export INPUTRC=/etc/inputrc
+
+# End /etc/profile</literal>
+EOF</userinput></screen>
+
+  <para>Setting the keyboard layout, screen font, and locale-related
+  environment variables are the only internationalization steps needed to
+  support locales that use ordinary single-byte encodings and left-to-right
+  writing direction. UTF-8 has been tested on the English, French, German,
+  Italian, and Spanish locales. All other locales are untested. If you discover
+  issues with any other locale please open a ticket in our Trac system.</para>
+
+  <para>Some locales need additional programs and support. CLFS will not be
+  supporting these locales in the book. We welcome the support for these other
+  locales via <ulink url="&cblfs-root;"/>.</para>
+
+</sect1>
Index: BOOK/system-config/common/profile.xml
===================================================================
--- BOOK/system-config/common/profile.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/profile.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,44 @@
+<?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-config-profile">
+  <title>The Bash Shell Startup Files</title>
+  <?dbhtml filename="profile.html"?>
+
+  <indexterm zone="ch-config-profile">
+    <primary sortas="e-/etc/profile">/etc/profile</primary>
+  </indexterm>
+
+  <para>The shell program <command>/bin/bash</command> (hereafter
+  referred to as <quote>the shell</quote>) uses a collection of startup
+  files to help create an environment to run in. Each file has a
+  specific use and may affect login and interactive environments
+  differently. The files in the <filename class="directory">/etc</filename>
+  directory provide global settings. If an equivalent file exists in the
+  home directory, it may override the global settings.</para>
+
+  <para>An interactive login shell is started after a successful login,
+  using <command>/bin/login</command>, by reading the
+  <filename>/etc/passwd</filename> file. An interactive non-login shell
+  is started at the command-line (e.g.,
+  <prompt>[prompt]$</prompt><command>/bin/bash</command>). A
+  non-interactive shell is usually present when a shell script is
+  running. It is non-interactive because it is processing a script and
+  not waiting for user input between commands.</para>
+
+  <para>For more information, see <command>info bash</command> under the
+  <emphasis>Bash Startup Files and Interactive Shells</emphasis> section,
+  and <ulink url="&cblfs-root;index.php/Bash_Startup_Files">Bash Startup
+  Files</ulink> in CBLFS.</para>
+
+  <para>The files <filename>/etc/profile</filename> and
+  <filename>~/.bash_profile</filename> are read when the shell is
+  invoked as an interactive login shell. In the next section, a base
+  <filename>/etc/profile</filename> will be created to set up locale
+  information.</para>
+
+</sect1>
Index: BOOK/system-config/common/setclock.xml
===================================================================
--- BOOK/system-config/common/setclock.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/setclock.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,56 @@
+<?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-config-setclock">
+  <?dbhtml filename="setclock.html"?>
+
+  <title>Configuring the setclock Script</title>
+
+  <indexterm zone="ch-config-setclock">
+    <primary sortas="d-setclock">setclock</primary>
+  <secondary>configuring</secondary></indexterm>
+
+  <para os="a">The <command>setclock</command> script reads the time from the
+  hardware clock, also known as the BIOS or the Complementary Metal Oxide
+  Semiconductor (CMOS) clock. If the hardware clock is set to UTC, this
+  script will convert the hardware clock's time to the local time using
+  the <filename>/etc/localtime</filename> file (which tells the
+  <command>hwclock</command> program which timezone the user is in). There
+  is no way to detect whether or not the hardware clock is set to UTC, so
+  this needs to be configured manually.</para>
+
+  <para os="b">If you cannot remember whether or not the hardware clock is set
+  to UTC, find out by running the <userinput>hwclock --localtime
+  --show</userinput> command. This will display what the current time is
+  according to the hardware clock. If this time matches whatever your
+  watch says, then the hardware clock is set to local time. If the output
+  from <command>hwclock</command> is not local time, chances are it is set
+  to UTC time. Verify this by adding or subtracting the proper amount of
+  hours for the timezone to the time shown by <command>hwclock</command>.
+  For example, if you are currently in the MST timezone, which is also
+  known as GMT -0700, add seven hours to the local time.</para>
+
+  <para os="c">Change the value of the <envar>UTC</envar> variable below
+  to a value of <option>0</option> (zero) if the hardware clock
+  is <emphasis>not</emphasis> set to UTC time.</para>
+
+  <para os="d">Create a new file <filename>/etc/sysconfig/clock</filename> by running
+  the following:</para>
+
+<screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
+<literal># Begin /etc/sysconfig/clock
+
+UTC=1
+
+# End /etc/sysconfig/clock</literal>
+EOF</userinput></screen>
+
+  <para os="e">A good hint explaining how to deal with time on CLFS is available
+  at <ulink url="&hints-root;time.txt"/>. It explains issues such as
+  time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
+
+</sect1>
Index: BOOK/system-config/common/symlinks.xml
===================================================================
--- BOOK/system-config/common/symlinks.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/symlinks.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,141 @@
+<?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-config-symlinks">
+  <?dbhtml filename="symlinks.html"?>
+
+  <title>Creating custom symlinks to devices</title>
+
+  <sect2>
+
+    <title>CD-ROM symlinks</title>
+
+    <para>Some software that you may want to install later (e.g., various
+    media players) expect the /dev/cdrom and /dev/dvd symlinks to exist.
+    Also, it may be convenient to put references to those symlinks into
+    <filename>/etc/fstab</filename>. For each of your CD-ROM devices,
+    find the corresponding directory under
+    <filename class="directory">/sys</filename> (e.g., this can be
+    <filename class="directory">/sys/block/hdd</filename>) and
+    run a command similar to the following:</para>
+
+<screen role="nodump"><userinput>udevadm test /sys/block/hdd</userinput></screen>
+
+    <para>Look at the lines containing the output of various *_id programs.</para>
+
+    <para>There are two approaches to creating symlinks. The first one is to
+    use the model name and the serial number, the second one is based on the
+    location of the device on the bus. If you are going to use the first
+    approach, create a file similar to the following:</para>
+
+<screen role="nodump"><userinput>cat &gt;/etc/udev/rules.d/82-cdrom.rules &lt;&lt; EOF
+<literal>
+# Custom CD-ROM symlinks
+SUBSYSTEM=="block", ENV{ID_MODEL}=="SAMSUNG_CD-ROM_SC-148F", \
+    ENV{ID_REVISION}=="PS05", SYMLINK+="cdrom"
+SUBSYSTEM=="block", ENV{ID_MODEL}=="PHILIPS_CDD5301", \
+    ENV{ID_SERIAL}=="5VO1306DM00190", SYMLINK+="cdrom1 dvd"
+</literal>
+EOF</userinput></screen>
+
+    <note>
+      <para>Although the examples in this book work properly, be aware
+      that Eudev does not recognize the backslash for line continuation.
+      If modifying Eudev rules with an editor, be sure to leave each rule
+      on one physical line.</para>
+    </note>
+
+    <para>This way, the symlinks will stay correct even if you move the drives
+    to different positions on the IDE bus, but the
+    <filename>/dev/cdrom</filename> symlink won't be created if you replace
+    the old SAMSUNG CD-ROM with a new drive.</para>
+<!-- The symlinks in the first approach survive even the transition
+     to libata for IDE drives, but that is not for the book. -->
+
+    <para>The SUBSYSTEM==&quot;block&quot; key is needed in order to avoid
+    matching SCSI generic devices. Without it, in the case with SCSI
+    CD-ROMs, the symlinks will sometimes point to the correct
+    <filename>/dev/srX</filename> devices, and sometimes to
+    <filename>/dev/sgX</filename>, which is wrong.</para>
+
+    <para>The second approach yields:</para>
+
+<screen role="nodump"><userinput>cat &gt;/etc/udev/rules.d/82-cdrom.rules &lt;&lt; EOF
+<literal>
+# Custom CD-ROM symlinks
+SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", \
+    ENV{ID_PATH}=="pci-0000:00:07.1-ide-0:1", SYMLINK+="cdrom"
+SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", \
+    ENV{ID_PATH}=="pci-0000:00:07.1-ide-1:1", SYMLINK+="cdrom1 dvd"
+</literal>
+EOF</userinput></screen>
+
+    <para>This way, the symlinks will stay correct even if you replace drives
+    with different models, but place them to the old positions on the IDE
+    bus. The ENV{ID_TYPE}==&quot;cd&quot; key makes sure that the symlink
+    disappears if you put something other than a CD-ROM in that position on
+    the bus.</para>
+
+    <para>Of course, it is possible to mix the two approaches.</para>
+
+  </sect2>
+
+  <sect2>
+
+    <title>Dealing with duplicate devices</title>
+
+    <para>As explained in <xref linkend="ch-config-eudev"/>, the order in
+    which devices with the same function appear in
+    <filename class="directory">/dev</filename> is essentially random.
+    E.g., if you have a USB web camera and a TV tuner, sometimes
+    <filename>/dev/video0</filename> refers to the camera and
+    <filename>/dev/video1</filename> refers to the tuner, and sometimes
+    after a reboot the order changes to the opposite one.
+    For all classes of hardware except sound cards and network cards, this is
+    fixable by creating udev rules for custom persistent symlinks.
+    The case of network cards is covered separately in
+    <xref linkend="chapter-network"/>, and sound card configuration can
+    be found in <ulink url="&cblfs-root;">CBLFS</ulink>.</para>
+
+    <para>For each of your devices that is likely to have this problem
+    (even if the problem doesn't exist in your current Linux distribution),
+    find the corresponding directory under
+    <filename class="directory">/sys/class</filename> or
+    <filename class="directory">/sys/block</filename>.
+    For video devices, this may be
+    <filename
+    class="directory">/sys/class/video4linux/video<replaceable>X</replaceable></filename>.
+    Figure out the attributes that identify the device uniquely (usually,
+    vendor and product IDs and/or serial numbers work):</para>
+
+<screen role="nodump"><userinput>udevadm info -a -p /sys/class/video4linux/video0</userinput></screen>
+
+    <para>Then write rules that create the symlinks, e.g.:</para>
+
+<screen role="nodump"><userinput>cat &gt;/etc/udev/rules.d/83-duplicate_devs.rules &lt;&lt; EOF
+<literal>
+# Persistent symlinks for webcam and tuner
+KERNEL=="video*", SYSFS{idProduct}=="1910", SYSFS{idVendor}=="0d81", \
+    SYMLINK+="webcam"
+KERNEL=="video*", SYSFS{device}=="0x036f", SYSFS{vendor}=="0x109e", \
+    SYMLINK+="tvtuner"
+</literal>
+EOF</userinput></screen>
+
+    <para>The result is that <filename>/dev/video0</filename> and
+    <filename>/dev/video1</filename> devices still refer randomly to the tuner
+    and the web camera (and thus should never be used directly), but there are
+    symlinks <filename>/dev/tvtuner</filename> and
+    <filename>/dev/webcam</filename> that always point to the correct
+    device.</para>
+
+    <para>More information on writing Eudev rules can be found in
+    <filename>/usr/share/doc/udev/writing_udev_rules/index.html</filename>.</para>
+
+ </sect2>
+
+</sect1>
Index: BOOK/system-config/common/usage.xml
===================================================================
--- BOOK/system-config/common/usage.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
+++ BOOK/system-config/common/usage.xml	(revision 775d9a7c49bab4e22bc88e7f546dde103996c520)
@@ -0,0 +1,129 @@
+<?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-config-usage">
+  <?dbhtml filename="usage.html"?>
+
+  <title>How Do These Bootscripts Work?</title>
+
+  <indexterm zone="ch-config-usage">
+    <primary sortas="a-Bootscripts">Bootscripts</primary>
+  <secondary>usage</secondary></indexterm>
+
+  <para>Linux uses a special booting facility named SysVinit that is
+  based on a concept of <emphasis>run-levels</emphasis>. It can be quite
+  different from one system to another, so it cannot be assumed that
+  because things worked in one particular Linux distribution, they should work
+  the same in CLFS too. CLFS has its own way of doing things, but it
+  respects generally accepted standards.</para>
+
+  <para>SysVinit (which will be referred to as <quote>init</quote> from
+  now on) works using a run-levels scheme. There are seven (numbered 0 to 6)
+  run-levels (actually, there are more run-levels, but they are for
+  special cases and are generally not used. See <filename>init(8)</filename>
+  for more details), and each one of those corresponds to the actions the
+  computer is supposed to perform when it starts up. The default
+  run-level is 3. Here are the descriptions of the different run-levels
+  as they are implemented:</para>
+
+<literallayout>0: halt the computer
+1: single-user mode
+2: multi-user mode without networking
+3: multi-user mode with networking
+4: reserved for customization, otherwise does the same as 3
+5: same as 4, it is usually used for GUI login (like X's <command>xdm</command> or KDE's <command>kdm</command>)
+6: reboot the computer</literallayout>
+
+  <para>The command used to change run-levels is <command>init
+  <replaceable>[runlevel]</replaceable></command>, where
+  <replaceable>[runlevel]</replaceable> is the target run-level. For example,
+  to reboot the computer, a user could issue the <command>init 6</command>
+  command, which is an alias for the <command>reboot</command> command.
+  Likewise, <command>init 0</command> is an alias for the
+  <command>halt</command> command.</para>
+
+  <para>There are a number of directories under <filename
+  class="directory">/etc/rc.d</filename> that look like <filename
+  class="directory">rc?.d</filename> (where ? is the number of the
+  run-level) and <filename class="directory">rcsysinit.d</filename>, all
+  containing a number of symbolic links. Some begin with a
+  <emphasis>K</emphasis>, the others begin with an
+  <emphasis>S</emphasis>, and all of them have two numbers following the
+  initial letter. The K means to stop (kill) a service and the S means
+  to start a service. The numbers determine the order in which the
+  scripts are run, from 00 to 99&mdash;the lower the number the earlier it
+  gets executed. When <command>init</command> switches to another run-level,
+  the appropriate services are either started or stopped, depending on the
+  runlevel chosen.</para>
+
+  <para>The real scripts are in <filename
+  class="directory">/etc/rc.d/init.d</filename>. They do the actual work,
+  and the symlinks all point to them. Killing links and starting links point
+  to the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
+  This is because the scripts can be called with different parameters like
+  <option>start</option>, <option>stop</option>, <option>restart</option>,
+  <option>reload</option>, and <option>status</option>. When a K link is
+  encountered, the appropriate script is run with the <option>stop</option>
+  argument. When an S link is encountered, the appropriate script is run
+  with the <option>start</option> argument.</para>
+
+  <para>There is one exception to this explanation. Links that start
+  with an <emphasis>S</emphasis> in the <filename
+  class="directory">rc0.d</filename> and <filename
+  class="directory">rc6.d</filename> directories will not cause anything
+  to be started. They will be called with the parameter
+  <option>stop</option> to stop something. The logic behind this
+  is that when a user is going to reboot or halt the system, nothing
+  needs to be started. The system only needs to be stopped.</para>
+
+  <para>These are descriptions of what the arguments make the scripts
+  do:</para>
+
+  <variablelist>
+    <varlistentry>
+      <term><option>start</option></term>
+      <listitem>
+        <para>The service is started.</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term><option>stop</option></term>
+      <listitem>
+        <para>The service is stopped.</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term><option>restart</option></term>
+      <listitem>
+        <para>The service is stopped and then started again.</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term><option>reload</option></term>
+      <listitem>
+        <para>The configuration of the service is updated. This is used
+        after the configuration file of a service was modified, when the
+        service does not need to be restarted.</para>
+      </listitem>
+    </varlistentry>
+
+    <varlistentry>
+      <term><option>status</option></term>
+      <listitem>
+        <para>Tells if the service is running and with which PIDs.</para>
+      </listitem>
+    </varlistentry>
+  </variablelist>
+
+  <para>Feel free to modify the way the boot process works (after all,
+  it is your own CLFS system). The files given here are an example of how
+  it can be done.</para>
+
+</sect1>
