mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-06-19 03:39:20 +01:00
Chapter07 indentation.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7230 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
b78c7479d4
commit
d781ffbe09
@ -1,239 +1,302 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-bootscripts" role="wrap">
|
<sect1 id="ch-scripts-bootscripts" role="wrap">
|
||||||
<title>LFS-Bootscripts-&lfs-bootscripts-version;</title>
|
<?dbhtml filename="bootscripts.html"?>
|
||||||
<?dbhtml filename="bootscripts.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-bootscripts"><primary sortas="a-Bootscripts">Bootscripts</primary></indexterm>
|
<title>LFS-Bootscripts-&lfs-bootscripts-version;</title>
|
||||||
|
|
||||||
<sect2 role="package"><title/>
|
<indexterm zone="ch-scripts-bootscripts">
|
||||||
<para>The LFS-Bootscripts package contains a set of scripts to start/stop the
|
<primary sortas="a-Bootscripts">Bootscripts</primary>
|
||||||
LFS system at bootup/shutdown.</para>
|
</indexterm>
|
||||||
|
|
||||||
<segmentedlist>
|
<sect2 role="package">
|
||||||
<segtitle>&buildtime;</segtitle>
|
<title/>
|
||||||
<segtitle>&diskspace;</segtitle>
|
|
||||||
<seglistitem><seg>0.1 SBU</seg><seg>516 KB</seg></seglistitem>
|
|
||||||
</segmentedlist>
|
|
||||||
|
|
||||||
<segmentedlist>
|
<para>The LFS-Bootscripts package contains a set of scripts to start/stop the
|
||||||
<segtitle>&dependencies;</segtitle>
|
LFS system at bootup/shutdown.</para>
|
||||||
<seglistitem><seg>Bash and Coreutils</seg></seglistitem>
|
|
||||||
</segmentedlist>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2 role="installation">
|
<segmentedlist>
|
||||||
<title>Installation of LFS-Bootscripts</title>
|
<segtitle>&buildtime;</segtitle>
|
||||||
|
<segtitle>&diskspace;</segtitle>
|
||||||
|
|
||||||
<para>Install the package:</para>
|
<seglistitem>
|
||||||
|
<seg>0.1 SBU</seg>
|
||||||
|
<seg>516 KB</seg>
|
||||||
|
</seglistitem>
|
||||||
|
</segmentedlist>
|
||||||
|
|
||||||
|
<segmentedlist>
|
||||||
|
<segtitle>&dependencies;</segtitle>
|
||||||
|
|
||||||
|
<seglistitem>
|
||||||
|
<seg>Bash and Coreutils</seg>
|
||||||
|
</seglistitem>
|
||||||
|
</segmentedlist>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
|
<sect2 role="installation">
|
||||||
|
<title>Installation of LFS-Bootscripts</title>
|
||||||
|
|
||||||
|
<para>Install the package:</para>
|
||||||
|
|
||||||
<screen><userinput>make install</userinput></screen>
|
<screen><userinput>make install</userinput></screen>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2 id="contents-bootscripts" role="content"><title>Contents of LFS-Bootscripts</title>
|
<sect2 id="contents-bootscripts" role="content">
|
||||||
|
<title>Contents of LFS-Bootscripts</title>
|
||||||
|
|
||||||
<segmentedlist>
|
<segmentedlist>
|
||||||
<segtitle>Installed scripts</segtitle>
|
<segtitle>Installed scripts</segtitle>
|
||||||
<seglistitem><seg>checkfs, cleanfs, console, functions, halt, hotplug, 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>
|
<seglistitem>
|
||||||
<?dbfo list-presentation="list"?>
|
<seg>checkfs, cleanfs, console, functions, halt, hotplug, ifdown, ifup,
|
||||||
<?dbhtml list-presentation="table"?>
|
localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals,
|
||||||
|
setclock, static, swap, sysklogd, template, and udev</seg>
|
||||||
|
</seglistitem>
|
||||||
|
</segmentedlist>
|
||||||
|
|
||||||
<varlistentry id="checkfs-bootscripts">
|
<variablelist>
|
||||||
<term><command>checkfs</command></term>
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
||||||
<listitem>
|
<?dbfo list-presentation="list"?>
|
||||||
<para>Checks the integrity of the file systems before they are mounted (with the
|
<?dbhtml list-presentation="table"?>
|
||||||
exception of journal and network based file systems)</para>
|
|
||||||
<indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm>
|
|
||||||
</listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry id="cleanfs-bootscripts">
|
<varlistentry id="checkfs-bootscripts">
|
||||||
<term><command>cleanfs</command></term>
|
<term><command>checkfs</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Removes files that should not be
|
<para>Checks the integrity of the file systems before they are mounted
|
||||||
preserved between reboots, such as those in <filename class="directory">/var/run/</filename> and
|
(with the exception of journal and network based file systems)</para>
|
||||||
<filename class="directory">/var/lock/</filename>; it re-creates <filename>/var/run/utmp</filename>
|
<indexterm zone="ch-scripts-bootscripts checkfs-bootscripts">
|
||||||
and removes the possibly present <filename>/etc/nologin</filename>,
|
<primary sortas="d-checkfs">checkfs</primary>
|
||||||
<filename>/fastboot</filename>, and <filename>/forcefsck</filename> files</para>
|
</indexterm>
|
||||||
<indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts"><primary sortas="d-cleanfs">cleanfs</primary></indexterm>
|
</listitem>
|
||||||
</listitem>
|
</varlistentry>
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry id="console-bootscripts">
|
<varlistentry id="cleanfs-bootscripts">
|
||||||
<term><command>console</command></term>
|
<term><command>cleanfs</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Loads the correct keymap table for the desired keyboard layout; it also
|
<para>Removes files that should not be preserved between reboots, such
|
||||||
sets the screen font</para>
|
as those in <filename class="directory">/var/run/</filename> and
|
||||||
<indexterm zone="ch-scripts-bootscripts console-bootscripts"><primary sortas="d-console">console</primary></indexterm>
|
<filename class="directory">/var/lock/</filename>; it re-creates
|
||||||
</listitem>
|
<filename>/var/run/utmp</filename> and removes the possibly present
|
||||||
</varlistentry>
|
<filename>/etc/nologin</filename>, <filename>/fastboot</filename>, and
|
||||||
|
<filename>/forcefsck</filename> files</para>
|
||||||
|
<indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts">
|
||||||
|
<primary sortas="d-cleanfs">cleanfs</primary>
|
||||||
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="functions-bootscripts">
|
<varlistentry id="console-bootscripts">
|
||||||
<term><command>functions</command></term>
|
<term><command>console</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Contains common functions, such as error and status checking, that are
|
<para>Loads the correct keymap table for the desired keyboard layout;
|
||||||
used by several bootscripts</para>
|
it also sets the screen font</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts console-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-console">console</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="halt-bootscripts">
|
<varlistentry id="functions-bootscripts">
|
||||||
<term><command>halt</command></term>
|
<term><command>functions</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Halts the system</para>
|
<para>Contains common functions, such as error and status checking,
|
||||||
<indexterm zone="ch-scripts-bootscripts halt-bootscripts"><primary sortas="d-halt">halt</primary></indexterm>
|
that are used by several bootscripts</para>
|
||||||
</listitem>
|
<indexterm zone="ch-scripts-bootscripts functions-bootscripts">
|
||||||
</varlistentry>
|
<primary sortas="d-functions">functions</primary>
|
||||||
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="hotplug-bootscripts">
|
<varlistentry id="halt-bootscripts">
|
||||||
<term><command>hotplug</command></term>
|
<term><command>halt</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Loads modules for system devices</para>
|
<para>Halts the system</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts hotplug-bootscripts"><primary sortas="d-hotplug">hotplug</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts halt-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-halt">halt</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="ifdown-bootscripts">
|
<varlistentry id="hotplug-bootscripts">
|
||||||
<term><command>ifdown</command></term>
|
<term><command>hotplug</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Assists the network script with stopping network devices</para>
|
<para>Loads modules for system devices</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts hotplug-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-hotplug">hotplug</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="ifup-bootscripts">
|
<varlistentry id="ifdown-bootscripts">
|
||||||
<term><command>ifup</command></term>
|
<term><command>ifdown</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Assists the network script with starting network devices</para>
|
<para>Assists the network script with stopping network devices</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts ifup-bootscripts"><primary sortas="d-ifup">ifup</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts ifdown-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-ifdown">ifdown</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="localnet-bootscripts">
|
<varlistentry id="ifup-bootscripts">
|
||||||
<term><command>localnet</command></term>
|
<term><command>ifup</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Sets up the system's hostname and local loopback device</para>
|
<para>Assists the network script with starting network devices</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts localnet-bootscripts"><primary sortas="d-localnet">localnet</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts ifup-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-ifup">ifup</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="mountfs-bootscripts">
|
<varlistentry id="localnet-bootscripts">
|
||||||
<term><command>mountfs</command></term>
|
<term><command>localnet</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Mounts all file systems, except ones that are marked
|
<para>Sets up the system's hostname and local loopback device</para>
|
||||||
<emphasis>noauto</emphasis> or are network based</para>
|
<indexterm zone="ch-scripts-bootscripts localnet-bootscripts">
|
||||||
<indexterm zone="ch-scripts-bootscripts mountfs-bootscripts"><primary sortas="d-mountfs">mountfs</primary></indexterm>
|
<primary sortas="d-localnet">localnet</primary>
|
||||||
</listitem>
|
</indexterm>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="mountkernfs-bootscripts">
|
<varlistentry id="mountfs-bootscripts">
|
||||||
<term><command>mountkernfs</command></term>
|
<term><command>mountfs</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Mounts virtual kernel file systems, such as <systemitem
|
<para>Mounts all file systems, except ones that are marked
|
||||||
class="filesystem">proc</systemitem></para>
|
<emphasis>noauto</emphasis> or are network based</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts mountfs-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-mountfs">mountfs</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="network-bootscripts">
|
<varlistentry id="mountkernfs-bootscripts">
|
||||||
<term><command>network</command></term>
|
<term><command>mountkernfs</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Sets up network interfaces, such as network cards, and sets up
|
<para>Mounts virtual kernel file systems, such as <systemitem
|
||||||
the default gateway (where applicable)</para>
|
class="filesystem">proc</systemitem></para>
|
||||||
<indexterm zone="ch-scripts-bootscripts network-bootscripts"><primary sortas="d-network">network</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-mountkernfs">mountkernfs</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="rc-bootscripts">
|
<varlistentry id="network-bootscripts">
|
||||||
<term><command>rc</command></term>
|
<term><command>network</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>The master run-level control script; it is responsible for running all the
|
<para>Sets up network interfaces, such as network cards, and sets up
|
||||||
other bootscripts one-by-one, in a sequence determined by the name of the
|
the default gateway (where applicable)</para>
|
||||||
symbolic links being processed</para>
|
<indexterm zone="ch-scripts-bootscripts network-bootscripts">
|
||||||
<indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm>
|
<primary sortas="d-network">network</primary>
|
||||||
</listitem>
|
</indexterm>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="reboot-bootscripts">
|
<varlistentry id="rc-bootscripts">
|
||||||
<term><command>reboot</command></term>
|
<term><command>rc</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Reboots the system</para>
|
<para>The master run-level control script; it is responsible for
|
||||||
<indexterm zone="ch-scripts-bootscripts reboot-bootscripts"><primary sortas="d-reboot">reboot</primary></indexterm>
|
running all the other bootscripts one-by-one, in a sequence determined
|
||||||
</listitem>
|
by the name of the symbolic links being processed</para>
|
||||||
</varlistentry>
|
<indexterm zone="ch-scripts-bootscripts rc-bootscripts">
|
||||||
|
<primary sortas="d-rc">rc</primary>
|
||||||
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="sendsignals-bootscripts">
|
<varlistentry id="reboot-bootscripts">
|
||||||
<term><command>sendsignals</command></term>
|
<term><command>reboot</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Makes sure every process is terminated before the system reboots
|
<para>Reboots the system</para>
|
||||||
or halts</para>
|
<indexterm zone="ch-scripts-bootscripts reboot-bootscripts">
|
||||||
<indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts"><primary sortas="d-sendsignals">sendsignals</primary></indexterm>
|
<primary sortas="d-reboot">reboot</primary>
|
||||||
</listitem>
|
</indexterm>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="setclock-bootscripts">
|
<varlistentry id="sendsignals-bootscripts">
|
||||||
<term><command>setclock</command></term>
|
<term><command>sendsignals</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Resets the kernel clock to local time in case the hardware clock
|
<para>Makes sure every process is terminated before the system reboots
|
||||||
is not set to UTC time</para>
|
or halts</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts setclock-bootscripts"><primary sortas="d-setclock">setclock</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-sendsignals">sendsignals</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="static-bootscripts">
|
<varlistentry id="setclock-bootscripts">
|
||||||
<term><command>static</command></term>
|
<term><command>setclock</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Provides the functionality needed to assign a static Internet
|
<para>Resets the kernel clock to local time in case the hardware clock
|
||||||
Protocol (IP) address to a network interface</para>
|
is not set to UTC time</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts static-bootscripts"><primary sortas="d-static">static</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts setclock-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-setclock">setclock</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="swap-bootscripts">
|
<varlistentry id="static-bootscripts">
|
||||||
<term><command>swap</command></term>
|
<term><command>static</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Enables and disables swap files and partitions</para>
|
<para>Provides the functionality needed to assign a static Internet
|
||||||
<indexterm zone="ch-scripts-bootscripts swap-bootscripts"><primary sortas="d-swap">swap</primary></indexterm>
|
Protocol (IP) address to a network interface</para>
|
||||||
</listitem>
|
<indexterm zone="ch-scripts-bootscripts static-bootscripts">
|
||||||
</varlistentry>
|
<primary sortas="d-static">static</primary>
|
||||||
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="sysklogd-bootscripts">
|
<varlistentry id="swap-bootscripts">
|
||||||
<term><command>sysklogd</command></term>
|
<term><command>swap</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Starts and stops the system and kernel log daemons</para>
|
<para>Enables and disables swap files and partitions</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts sysklogd-bootscripts"><primary sortas="d-sysklogd">sysklogd</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts swap-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-swap">swap</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="template-bootscripts">
|
<varlistentry id="sysklogd-bootscripts">
|
||||||
<term><command>template</command></term>
|
<term><command>sysklogd</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>A template to create custom bootscripts for other
|
<para>Starts and stops the system and kernel log daemons</para>
|
||||||
daemons</para>
|
<indexterm zone="ch-scripts-bootscripts sysklogd-bootscripts">
|
||||||
<indexterm zone="ch-scripts-bootscripts template-bootscripts"><primary sortas="d-template">template</primary></indexterm>
|
<primary sortas="d-sysklogd">sysklogd</primary>
|
||||||
</listitem>
|
</indexterm>
|
||||||
</varlistentry>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry id="udev-bootscripts">
|
<varlistentry id="template-bootscripts">
|
||||||
<term><command>udev</command></term>
|
<term><command>template</command></term>
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>Prepares the <filename class="directory">/dev</filename> directory and
|
<para>A template to create custom bootscripts for other
|
||||||
starts Udev</para>
|
daemons</para>
|
||||||
<indexterm zone="ch-scripts-bootscripts udev-bootscripts"><primary sortas="d-udev">udev</primary></indexterm>
|
<indexterm zone="ch-scripts-bootscripts template-bootscripts">
|
||||||
</listitem>
|
<primary sortas="d-template">template</primary>
|
||||||
</varlistentry>
|
</indexterm>
|
||||||
</variablelist>
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
</sect2>
|
<varlistentry id="udev-bootscripts">
|
||||||
|
<term><command>udev</command></term>
|
||||||
|
<listitem>
|
||||||
|
<para>Prepares the <filename class="directory">/dev</filename>
|
||||||
|
directory and starts Udev</para>
|
||||||
|
<indexterm zone="ch-scripts-bootscripts udev-bootscripts">
|
||||||
|
<primary sortas="d-udev">udev</primary>
|
||||||
|
</indexterm>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
|
</variablelist>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,24 +1,27 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
<chapter id="chapter-bootscripts" xreflabel="Chapter 7">
|
|
||||||
<?dbhtml dir="chapter07"?>
|
|
||||||
<title>Setting Up System Bootscripts</title>
|
|
||||||
<?dbhtml filename="chapter07.html"?>
|
|
||||||
|
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
|
<chapter id="chapter-bootscripts" xreflabel="Chapter 7">
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bootscripts.xml"/>
|
<?dbhtml dir="chapter07"?>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="usage.xml"/>
|
<?dbhtml filename="chapter07.html"?>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
|
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="setclock.xml"/>
|
<title>Setting Up System Bootscripts</title>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="console.xml"/>
|
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inputrc.xml"/>
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bootscripts.xml"/>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="profile.xml"/>
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="usage.xml"/>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostname.xml"/>
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hosts.xml"/>
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="setclock.xml"/>
|
||||||
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="network.xml"/>
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="console.xml"/>
|
||||||
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
|
||||||
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inputrc.xml"/>
|
||||||
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="profile.xml"/>
|
||||||
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostname.xml"/>
|
||||||
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hosts.xml"/>
|
||||||
|
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="network.xml"/>
|
||||||
|
|
||||||
</chapter>
|
</chapter>
|
||||||
|
@ -1,70 +1,76 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-console">
|
<sect1 id="ch-scripts-console">
|
||||||
<title>Configuring the Linux Console</title>
|
<?dbhtml filename="console.html"?>
|
||||||
<?dbhtml filename="console.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-console">
|
<title>Configuring the Linux Console</title>
|
||||||
<primary sortas="d-console">console</primary>
|
|
||||||
<secondary>configuring</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>This section discusses how to configure the <command>console</command>
|
<indexterm zone="ch-scripts-console">
|
||||||
bootscript that sets up the keyboard map and the console font. If non-ASCII
|
<primary sortas="d-console">console</primary>
|
||||||
characters (e.g., the British pound sign and Euro character) will not be used
|
<secondary>configuring</secondary>
|
||||||
and the keyboard is a U.S. one, skip this section. Without the configuration
|
</indexterm>
|
||||||
file, the <command>console</command> bootscript will do nothing.</para>
|
|
||||||
|
|
||||||
<para>The <command>console</command> script reads the
|
<para>This section discusses how to configure the <command>console</command>
|
||||||
<filename>/etc/sysconfig/console</filename> file for configuration information.
|
bootscript that sets up the keyboard map and the console font. If non-ASCII
|
||||||
Decide which keymap and screen font will be used. Various language-specific
|
characters (e.g., the British pound sign and Euro character) will not be used
|
||||||
HOWTO's can also help with this (see <ulink
|
and the keyboard is a U.S. one, skip this section. Without the configuration
|
||||||
url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
|
file, the <command>console</command> bootscript will do nothing.</para>
|
||||||
<filename>/etc/sysconfig/console</filename> file with known settings for several
|
|
||||||
countries was installed with the LFS-Bootscripts package, so the relevant
|
<para>The <command>console</command> script reads the
|
||||||
section can be uncommented if the country is supported. If still in doubt, look
|
<filename>/etc/sysconfig/console</filename> file for configuration information.
|
||||||
in the <filename class="directory">/usr/share/kbd</filename> directory for valid
|
Decide which keymap and screen font will be used. Various language-specific
|
||||||
keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
|
HOWTO's can also help with this (see <ulink
|
||||||
<filename>setfont(8)</filename> to determine the correct arguments for
|
url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
|
||||||
these programs. Once decided, create the configuration file with the following
|
<filename>/etc/sysconfig/console</filename> file with known settings for several
|
||||||
command:</para>
|
countries was installed with the LFS-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/kbd</filename> directory for valid
|
||||||
|
keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
|
||||||
|
<filename>setfont(8)</filename> to determine the correct arguments for
|
||||||
|
these programs. Once decided, create the configuration file with the following
|
||||||
|
command:</para>
|
||||||
|
|
||||||
<screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
<screen><userinput>cat >/etc/sysconfig/console <<"EOF"
|
||||||
<literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
<literal>KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>"
|
||||||
FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
|
FONT="<replaceable>[arguments for setfont]</replaceable>"</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>For example, for Spanish users who also want to use the Euro
|
<para>For example, for Spanish users who also want to use the Euro
|
||||||
character (accessible by pressing AltGr+E), the following settings are
|
character (accessible by pressing AltGr+E), the following settings are
|
||||||
correct:</para>
|
correct:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>cat >/etc/sysconfig/console <<"EOF"
|
<screen role="nodump"><userinput>cat >/etc/sysconfig/console <<"EOF"
|
||||||
<literal>KEYMAP="es euro2"
|
<literal>KEYMAP="es euro2"
|
||||||
FONT="lat9-16 -u iso01"</literal>
|
FONT="lat9-16 -u iso01"</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<note><para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
|
<note>
|
||||||
character set. If using ISO 8859-1 and, therefore, a pound sign
|
<para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
|
||||||
instead of Euro, the correct <envar>FONT</envar> line would be:</para>
|
character set. If using ISO 8859-1 and, therefore, a pound sign
|
||||||
|
instead of Euro, the correct <envar>FONT</envar> line would be:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>FONT="lat1-16"</userinput></screen></note>
|
<screen role="nodump"><userinput>FONT="lat1-16"</userinput></screen>
|
||||||
|
</note>
|
||||||
|
|
||||||
<para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set, the
|
<para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set,
|
||||||
<command>console</command> initscript will not run the corresponding
|
the <command>console</command> initscript will not run the corresponding
|
||||||
program.</para>
|
program.</para>
|
||||||
|
|
||||||
<para>In some keymaps, the Backspace and Delete keys send characters different
|
<para>In some keymaps, the Backspace and Delete keys send characters different
|
||||||
from ones in the default keymap built into the kernel. This confuses some
|
from ones in the default keymap built into the kernel. This confuses some
|
||||||
applications. For example, Emacs displays its help (instead of erasing the
|
applications. For example, Emacs displays its help (instead of erasing the
|
||||||
character before the cursor) when Backspace is pressed. To check if the keymap
|
character before the cursor) when Backspace is pressed. To check if the keymap
|
||||||
in use is affected (this works only for i386 keymaps):</para>
|
in use is affected (this works only for i386 keymaps):</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
<screen role="nodump"><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
|
||||||
|
|
||||||
<para>If the keycode 14 is Backspace instead of Delete, create the
|
<para>If the keycode 14 is Backspace instead of Delete, create the
|
||||||
following keymap snippet to fix this issue:</para>
|
following keymap snippet to fix this issue:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>mkdir -pv /etc/kbd && cat > /etc/kbd/bs-sends-del <<"EOF"
|
<screen role="nodump"><userinput>mkdir -pv /etc/kbd && cat > /etc/kbd/bs-sends-del <<"EOF"
|
||||||
<literal> keycode 14 = Delete Delete Delete Delete
|
<literal> keycode 14 = Delete Delete Delete Delete
|
||||||
@ -76,32 +82,31 @@ following keymap snippet to fix this issue:</para>
|
|||||||
altgr control alt keycode 111 = Boot</literal>
|
altgr control alt keycode 111 = Boot</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>Tell the <command>console</command> script to load this
|
<para>Tell the <command>console</command> script to load this
|
||||||
snippet after the main keymap:</para>
|
snippet after the main keymap:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
<screen role="nodump"><userinput>cat >>/etc/sysconfig/console <<"EOF"
|
||||||
<literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
|
<literal>KEYMAP_CORRECTIONS="/etc/kbd/bs-sends-del"</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>To compile the keymap directly into the kernel instead of
|
<para>To compile the keymap directly into the kernel instead of
|
||||||
setting it every time from the <command>console</command> bootscript,
|
setting it every time from the <command>console</command> bootscript,
|
||||||
follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
|
follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
|
||||||
Doing this ensures that the keyboard will always work as expected,
|
Doing this ensures that the keyboard will always work as expected,
|
||||||
even when booting into maintenance mode (by passing
|
even when booting into maintenance mode (by passing
|
||||||
<parameter>init=/bin/sh</parameter> to the kernel), because the
|
<parameter>init=/bin/sh</parameter> to the kernel), because the
|
||||||
<command>console</command> bootscript will not be run in that
|
<command>console</command> bootscript will not be run in that
|
||||||
situation. Additionally, the kernel will not set the screen font
|
situation. Additionally, the kernel will not set the screen font
|
||||||
automatically. This should not pose many problems because ASCII characters
|
automatically. This should not pose many problems because ASCII characters
|
||||||
will be handled correctly, and it is unlikely that a user would need
|
will be handled correctly, and it is unlikely that a user would need
|
||||||
to rely on non-ASCII characters while in maintenance mode.</para>
|
to rely on non-ASCII characters while in maintenance mode.</para>
|
||||||
|
|
||||||
<para>Since the kernel will set up the keymap, it is possible to omit
|
<para>Since the kernel will set up the keymap, it is possible to omit
|
||||||
the <envar>KEYMAP</envar> variable from the
|
the <envar>KEYMAP</envar> variable from the
|
||||||
<filename>/etc/sysconfig/console</filename> configuration file. It can
|
<filename>/etc/sysconfig/console</filename> configuration file. It can
|
||||||
also be left in place, if desired, without consequence. Keeping it
|
also be left in place, if desired, without consequence. Keeping it
|
||||||
could be beneficial if running several different kernels where it is
|
could be beneficial if running several different kernels where it is
|
||||||
difficult to ensure that the keymap is compiled into every one of
|
difficult to ensure that the keymap is compiled into every one of
|
||||||
them.</para>
|
them.</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,29 +1,32 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-hostname">
|
<sect1 id="ch-scripts-hostname">
|
||||||
<title>Configuring the localnet Script</title>
|
<?dbhtml filename="hostname.html"?>
|
||||||
<?dbhtml filename="hostname.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-hostname">
|
<title>Configuring the localnet Script</title>
|
||||||
<primary sortas="d-localnet">localnet</primary>
|
|
||||||
<secondary>configuring</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>Part of the job of the <command>localnet</command> script is setting the
|
<indexterm zone="ch-scripts-hostname">
|
||||||
system's hostname. This needs to be configured in the
|
<primary sortas="d-localnet">localnet</primary>
|
||||||
<filename>/etc/sysconfig/network</filename> file.</para>
|
<secondary>configuring</secondary>
|
||||||
|
</indexterm>
|
||||||
|
|
||||||
<para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
|
<para>Part of the job of the <command>localnet</command> script is setting the
|
||||||
hostname by running:</para>
|
system's hostname. This needs to be configured in the
|
||||||
|
<filename>/etc/sysconfig/network</filename> file.</para>
|
||||||
|
|
||||||
|
<para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
|
||||||
|
hostname by running:</para>
|
||||||
|
|
||||||
<screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" > /etc/sysconfig/network</userinput></screen>
|
<screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" > /etc/sysconfig/network</userinput></screen>
|
||||||
|
|
||||||
<para><replaceable>[lfs]</replaceable> needs to be replaced with the name given
|
<para><replaceable>[lfs]</replaceable> needs to be replaced with the name given
|
||||||
to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That
|
to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That
|
||||||
information will be put in the <filename>/etc/hosts</filename> file in the next
|
information will be put in the <filename>/etc/hosts</filename> file in the next
|
||||||
section.</para>
|
section.</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,48 +1,53 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-hosts">
|
<sect1 id="ch-scripts-hosts">
|
||||||
<title>Creating the /etc/hosts File</title>
|
<?dbhtml filename="hosts.html"?>
|
||||||
<?dbhtml filename="hosts.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-hosts"><primary sortas="e-/etc/hosts">/etc/hosts</primary></indexterm>
|
<title>Creating the /etc/hosts File</title>
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-hosts">
|
<indexterm zone="ch-scripts-hosts">
|
||||||
<primary sortas="d-localnet">localnet</primary>
|
<primary sortas="e-/etc/hosts">/etc/hosts</primary>
|
||||||
<secondary>/etc/hosts</secondary></indexterm>
|
</indexterm>
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-hosts">
|
<indexterm zone="ch-scripts-hosts">
|
||||||
<primary sortas="d-network">network</primary>
|
<primary sortas="d-localnet">localnet</primary>
|
||||||
<secondary>/etc/hosts</secondary></indexterm>
|
<secondary>/etc/hosts</secondary></indexterm>
|
||||||
|
|
||||||
<para>If a network card is to be configured, decide on the IP address,
|
<indexterm zone="ch-scripts-hosts">
|
||||||
FQDN, and possible aliases for use in the
|
<primary sortas="d-network">network</primary>
|
||||||
<filename>/etc/hosts</filename> file. The syntax is:</para>
|
<secondary>/etc/hosts</secondary></indexterm>
|
||||||
|
|
||||||
<screen><IP address> myhost.example.org aliases</screen>
|
<para>If a network card is to be configured, decide on the IP address,
|
||||||
|
FQDN, and possible aliases for use in the
|
||||||
|
<filename>/etc/hosts</filename> file. The syntax is:</para>
|
||||||
|
|
||||||
<para>Unless the computer is to be visible to the Internet (i.e.,
|
<screen><literal><IP address> myhost.example.org aliases</literal></screen>
|
||||||
there is a registered domain and a valid block of assigned IP
|
|
||||||
addresses—most users do not have this), make sure that the IP
|
|
||||||
address is in the private network IP address range. Valid ranges
|
|
||||||
are:</para>
|
|
||||||
|
|
||||||
<screen> Class Networks
|
<para>Unless the computer is to be visible to the Internet (i.e.,
|
||||||
|
there is a registered domain and a valid block of assigned IP
|
||||||
|
addresses—most users do not have this), make sure that the IP
|
||||||
|
address is in the private network IP address range. Valid ranges
|
||||||
|
are:</para>
|
||||||
|
|
||||||
|
<screen><literal> Class Networks
|
||||||
A 10.0.0.0
|
A 10.0.0.0
|
||||||
B 172.16.0.0 through 172.31.0.255
|
B 172.16.0.0 through 172.31.0.255
|
||||||
C 192.168.0.0 through 192.168.255.255</screen>
|
C 192.168.0.0 through 192.168.255.255</literal></screen>
|
||||||
|
|
||||||
<para>A valid IP address could be 192.168.1.1. A valid FQDN for this
|
<para>A valid IP address could be 192.168.1.1. A valid FQDN for this
|
||||||
IP could be www.linuxfromscratch.org (not recommended because this is
|
IP could be www.linuxfromscratch.org (not recommended because this is
|
||||||
a valid registered domain address and could cause domain name server
|
a valid registered domain address and could cause domain name server
|
||||||
issues).</para>
|
issues).</para>
|
||||||
|
|
||||||
<para>Even if not using a network card, an FQDN is still required.
|
<para>Even if not using a network card, an FQDN is still required.
|
||||||
This is necessary for certain programs to operate correctly.</para>
|
This is necessary for certain programs to operate correctly.</para>
|
||||||
|
|
||||||
<para>Create the <filename>/etc/hosts</filename> file by running:</para>
|
<para>Create the <filename>/etc/hosts</filename> file by running:</para>
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/hosts << "EOF"
|
<screen><userinput>cat > /etc/hosts << "EOF"
|
||||||
<literal># Begin /etc/hosts (network card version)
|
<literal># Begin /etc/hosts (network card version)
|
||||||
@ -53,14 +58,14 @@ This is necessary for certain programs to operate correctly.</para>
|
|||||||
# End /etc/hosts (network card version)</literal>
|
# End /etc/hosts (network card version)</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>The <replaceable>[192.168.1.1]</replaceable> and
|
<para>The <replaceable>[192.168.1.1]</replaceable> and
|
||||||
<replaceable>[<HOSTNAME>.example.org]</replaceable>
|
<replaceable>[<HOSTNAME>.example.org]</replaceable>
|
||||||
values need to be changed for specific users or requirements (if
|
values need to be changed for specific users or requirements (if
|
||||||
assigned an IP address by a network/system administrator and the
|
assigned an IP address by a network/system administrator and the
|
||||||
machine will be connected to an existing network).</para>
|
machine will be connected to an existing network).</para>
|
||||||
|
|
||||||
<para>If a network card is not going to be configured, create the
|
<para>If a network card is not going to be configured, create the
|
||||||
<filename>/etc/hosts</filename> file by running:</para>
|
<filename>/etc/hosts</filename> file by running:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>cat > /etc/hosts << "EOF"
|
<screen role="nodump"><userinput>cat > /etc/hosts << "EOF"
|
||||||
<literal># Begin /etc/hosts (no network card version)
|
<literal># Begin /etc/hosts (no network card version)
|
||||||
@ -71,4 +76,3 @@ machine will be connected to an existing network).</para>
|
|||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,31 +1,37 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-inputrc">
|
<sect1 id="ch-scripts-inputrc">
|
||||||
<title>Creating the /etc/inputrc File</title>
|
<?dbhtml filename="inputrc.html"?>
|
||||||
<?dbhtml filename="inputrc.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-inputrc"><primary sortas="e-/etc/inputrc">/etc/inputrc</primary></indexterm>
|
<title>Creating the /etc/inputrc File</title>
|
||||||
|
|
||||||
<para>The <filename>inputrc</filename> file handles keyboard mapping for
|
<indexterm zone="ch-scripts-inputrc">
|
||||||
specific situations. This file is the startup file used by Readline — the
|
<primary sortas="e-/etc/inputrc">/etc/inputrc</primary>
|
||||||
input-related library — used by Bash and most other shells.</para>
|
</indexterm>
|
||||||
|
|
||||||
<para>Most people do not need user-specific keyboard mappings so the command
|
<para>The <filename>inputrc</filename> file handles keyboard mapping for
|
||||||
below creates a global <filename>/etc/inputrc</filename> used by everyone who
|
specific situations. This file is the startup file used by Readline — the
|
||||||
logs in. If you later decide you need to override the defaults on a per-user
|
input-related library — used by Bash and most other shells.</para>
|
||||||
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,
|
<para>Most people do not need user-specific keyboard mappings so the command
|
||||||
see <command>info bash</command> under the <emphasis>Readline Init File</emphasis>
|
below creates a global <filename>/etc/inputrc</filename> used by everyone who
|
||||||
section. <command>info readline</command> is also a good source of information.</para>
|
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>Below is a generic global <filename>inputrc</filename> along with comments
|
<para>For more information on how to edit the <filename>inputrc</filename>
|
||||||
to explain what the various options do. Note that comments cannot be on the same
|
file, see <command>info bash</command> under the <emphasis>Readline Init
|
||||||
line as commands. Create the file using the following command:</para>
|
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><userinput>cat > /etc/inputrc << "EOF"
|
<screen><userinput>cat > /etc/inputrc << "EOF"
|
||||||
<literal># Begin /etc/inputrc
|
<literal># Begin /etc/inputrc
|
||||||
@ -74,4 +80,3 @@ set bell-style none
|
|||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,27 +1,28 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-introduction">
|
<sect1 id="ch-scripts-introduction">
|
||||||
<title>Introduction</title>
|
<?dbhtml filename="introduction.html"?>
|
||||||
<?dbhtml filename="introduction.html"?>
|
|
||||||
|
|
||||||
<para>This chapter details how to install and configure the LFS-Bootscripts
|
<title>Introduction</title>
|
||||||
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
|
<para>This chapter details how to install and configure the LFS-Bootscripts
|
||||||
widely used. For additional options, a hint detailing the BSD style
|
package. Most of these scripts will work without modification, but a few require
|
||||||
init setup is available at
|
additional configuration files because they deal with hardware-dependent
|
||||||
<ulink
|
information.</para>
|
||||||
url="http://www.linuxfromscratch.org/hints/downloads/files/bsd-init.txt"/>.
|
|
||||||
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
|
<para>System-V style init scripts are employed in this book because they are
|
||||||
and move on to <xref linkend="chapter-bootable"/>.</para>
|
widely used. For additional options, a hint detailing the BSD style init setup
|
||||||
|
is available at <ulink
|
||||||
|
url="http://www.linuxfromscratch.org/hints/downloads/files/bsd-init.txt"/>.
|
||||||
|
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>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,40 +1,42 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-network">
|
<sect1 id="ch-scripts-network">
|
||||||
<title>Configuring the network Script</title>
|
<?dbhtml filename="network.html"?>
|
||||||
<?dbhtml filename="network.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-network">
|
<title>Configuring the network Script</title>
|
||||||
<primary sortas="d-network">network</primary>
|
|
||||||
<secondary>configuring</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>This section only applies if a network card is to be
|
<indexterm zone="ch-scripts-network">
|
||||||
configured.</para>
|
<primary sortas="d-network">network</primary>
|
||||||
|
<secondary>configuring</secondary></indexterm>
|
||||||
|
|
||||||
<para>If a network card will not be used, there is likely no need to
|
<para>This section only applies if a network card is to be
|
||||||
create any configuration files relating to network cards. If that is
|
configured.</para>
|
||||||
the case, remove the <filename class="symlink">network</filename>
|
|
||||||
symlinks from all run-level directories (<filename
|
|
||||||
class="directory">/etc/rc.d/rc*.d</filename>).</para>
|
|
||||||
|
|
||||||
<sect2>
|
<para>If a network card will not be used, there is likely no need to
|
||||||
<title>Creating Network Interface Configuration Files</title>
|
create any configuration files relating to network cards. If that is
|
||||||
|
the case, remove the <filename class="symlink">network</filename>
|
||||||
|
symlinks from all run-level directories (<filename
|
||||||
|
class="directory">/etc/rc.d/rc*.d</filename>).</para>
|
||||||
|
|
||||||
<!-- Edit Me -->
|
<sect2>
|
||||||
<para>Which interfaces are brought up and down by the network script
|
<title>Creating Network Interface Configuration Files</title>
|
||||||
depends on the files and directories in the <filename
|
|
||||||
class="directory">/etc/sysconfig/network-devices</filename> hierarchy.
|
|
||||||
This directory should contain a sub-directory for each interface to be configured,
|
|
||||||
such as <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a
|
|
||||||
network interface name. Inside this directory would be files defining
|
|
||||||
the attributes to this interface, such as its IP address(es), subnet
|
|
||||||
masks, and so forth.</para>
|
|
||||||
|
|
||||||
<para>The following command creates a sample <filename>ipv4</filename> file for
|
<para>Which interfaces are brought up and down by the network script
|
||||||
the <emphasis>eth0</emphasis> device:</para>
|
depends on the files and directories in the <filename
|
||||||
|
class="directory">/etc/sysconfig/network-devices</filename> hierarchy.
|
||||||
|
This directory should contain a sub-directory for each interface to be
|
||||||
|
configured, such as <filename>ifconfig.xyz</filename>, where
|
||||||
|
<quote>xyz</quote> is a network interface name. Inside this directory
|
||||||
|
would be files defining the attributes to this interface, such as its IP
|
||||||
|
address(es), subnet masks, and so forth.</para>
|
||||||
|
|
||||||
|
<para>The following command creates a sample <filename>ipv4</filename>
|
||||||
|
file for the <emphasis>eth0</emphasis> device:</para>
|
||||||
|
|
||||||
<screen><userinput>cd /etc/sysconfig/network-devices &&
|
<screen><userinput>cd /etc/sysconfig/network-devices &&
|
||||||
mkdir -v ifconfig.eth0 &&
|
mkdir -v ifconfig.eth0 &&
|
||||||
@ -47,45 +49,50 @@ PREFIX=24
|
|||||||
BROADCAST=192.168.1.255</literal>
|
BROADCAST=192.168.1.255</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>The values of these variables must be changed in every file to match the
|
<para>The values of these variables must be changed in every file to match
|
||||||
proper setup. If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote>
|
the proper setup. If the <envar>ONBOOT</envar> variable is set to
|
||||||
the network script will bring up the Network Interface Card (NIC) during booting
|
<quote>yes</quote> the network script will bring up the Network Interface
|
||||||
of the system. If set to anything but <quote>yes</quote> the NIC will be ignored
|
Card (NIC) during booting of the system. If set to anything but
|
||||||
by the network script and not be brought up.</para>
|
<quote>yes</quote> the NIC will be ignored by the network script and not
|
||||||
|
be brought up.</para>
|
||||||
|
|
||||||
<para>The <envar>SERVICE</envar> variable defines the method used for obtaining
|
<para>The <envar>SERVICE</envar> variable defines the method used for
|
||||||
the IP address. The LFS-Bootscripts package has a modular IP assignment format,
|
obtaining the IP address. The LFS-Bootscripts package has a modular IP
|
||||||
and creating additional files in the <filename
|
assignment format, and creating additional files in the <filename
|
||||||
class="directory">/etc/sysconfig/network-devices/services</filename> directory
|
class="directory">/etc/sysconfig/network-devices/services</filename>
|
||||||
allows other IP assignment methods. This is commonly used for Dynamic Host
|
directory allows other IP assignment methods. This is commonly used for
|
||||||
Configuration Protocol (DHCP), which is addressed in the BLFS book.</para>
|
Dynamic Host Configuration Protocol (DHCP), which is addressed in the
|
||||||
|
BLFS book.</para>
|
||||||
|
|
||||||
<para>The <envar>GATEWAY</envar> variable should contain
|
<para>The <envar>GATEWAY</envar> variable should contain the default
|
||||||
the default gateway IP address, if one is present. If not, then comment out
|
gateway IP address, if one is present. If not, then comment out the
|
||||||
the variable entirely.</para>
|
variable entirely.</para>
|
||||||
|
|
||||||
<para>The <envar>PREFIX</envar> variable needs to contain the number of bits
|
<para>The <envar>PREFIX</envar> variable needs to contain the number of
|
||||||
used in the subnet. Each octet in an IP address is 8 bits. If the subnet's
|
bits used in the subnet. Each octet in an IP address is 8 bits. If the
|
||||||
netmask is 255.255.255.0, then it is using the first three octets (24 bits) to
|
subnet's netmask is 255.255.255.0, then it is using the first three octets
|
||||||
specify the network number. If the netmask is 255.255.255.240, it would be using
|
(24 bits) to specify the network number. If the netmask is 255.255.255.240,
|
||||||
the first 28 bits. Prefixes longer than 24 bits are commonly used by DSL and
|
it would be using the first 28 bits. Prefixes longer than 24 bits are
|
||||||
cable-based Internet Service Providers (ISPs). In this example (PREFIX=24), the
|
commonly used by DSL and cable-based Internet Service Providers (ISPs).
|
||||||
netmask is 255.255.255.0. Adjust the <envar>PREFIX</envar> variable according to
|
In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the
|
||||||
your specific subnet.</para>
|
<envar>PREFIX</envar> variable according to your specific subnet.</para>
|
||||||
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
<sect2 id="resolv.conf">
|
<sect2 id="resolv.conf">
|
||||||
<title>Creating the /etc/resolv.conf File</title>
|
<title>Creating the /etc/resolv.conf File</title>
|
||||||
<indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm>
|
|
||||||
|
|
||||||
<para>If the system is going to be connected to the Internet, it will
|
<indexterm zone="resolv.conf">
|
||||||
need some means of Domain Name Service (DNS) name resolution to
|
<primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary>
|
||||||
resolve Internet domain names to IP addresses, and vice versa. This is
|
</indexterm>
|
||||||
best achieved by placing the IP address of the DNS server, available
|
|
||||||
from the ISP or network administrator, into
|
<para>If the system is going to be connected to the Internet, it will
|
||||||
<filename>/etc/resolv.conf</filename>. Create the file by running the
|
need some means of Domain Name Service (DNS) name resolution to
|
||||||
following:</para>
|
resolve Internet domain names to IP addresses, and vice versa. This is
|
||||||
|
best achieved by placing the IP address of the DNS server, available
|
||||||
|
from the ISP or network administrator, into
|
||||||
|
<filename>/etc/resolv.conf</filename>. Create the file by running the
|
||||||
|
following:</para>
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/resolv.conf << "EOF"
|
<screen><userinput>cat > /etc/resolv.conf << "EOF"
|
||||||
<literal># Begin /etc/resolv.conf
|
<literal># Begin /etc/resolv.conf
|
||||||
@ -97,14 +104,13 @@ nameserver <replaceable>[IP address of your secondary nameserver]</replaceable>
|
|||||||
# End /etc/resolv.conf</literal>
|
# End /etc/resolv.conf</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>Replace <replaceable>[IP address of the
|
<para>Replace <replaceable>[IP address of the nameserver]</replaceable>
|
||||||
nameserver]</replaceable> with the IP address of the DNS most
|
with the IP address of the DNS most appropriate for the setup. There will
|
||||||
appropriate for the setup. There will often be more than one entry
|
often be more than one entry (requirements demand secondary servers for
|
||||||
(requirements demand secondary servers for fallback capability). If
|
fallback capability). If you only need or want one DNS server, remove the
|
||||||
you only need or want one DNS server, remove the second
|
second <emphasis>nameserver</emphasis> line from the file. The IP address
|
||||||
<emphasis>nameserver</emphasis> line from the file. The IP address may
|
may also be a router on the local network.</para>
|
||||||
also be a router on the local network.</para>
|
|
||||||
</sect2>
|
</sect2>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,91 +1,99 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-profile">
|
<sect1 id="ch-scripts-profile">
|
||||||
<title>The Bash Shell Startup Files</title>
|
<?dbhtml filename="profile.html"?>
|
||||||
<?dbhtml filename="profile.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-profile"><primary sortas="e-/etc/profile">/etc/profile</primary></indexterm>
|
<title>The Bash Shell Startup Files</title>
|
||||||
|
|
||||||
<para>The shell program <command>/bin/bash</command> (hereafter
|
<indexterm zone="ch-scripts-profile">
|
||||||
referred to as <quote>the shell</quote>) uses a collection of startup
|
<primary sortas="e-/etc/profile">/etc/profile</primary>
|
||||||
files to help create an environment to run in. Each file has a
|
</indexterm>
|
||||||
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,
|
<para>The shell program <command>/bin/bash</command> (hereafter referred to
|
||||||
using <command>/bin/login</command>, by reading the
|
as <quote>the shell</quote>) uses a collection of startup files to help
|
||||||
<filename>/etc/passwd</filename> file. An interactive non-login shell
|
create an environment to run in. Each file has a specific use and may affect
|
||||||
is started at the command-line (e.g.,
|
login and interactive environments differently. The files in the <filename
|
||||||
<prompt>[prompt]$</prompt><command>/bin/bash</command>). A
|
class="directory">/etc</filename> directory provide global settings. If an
|
||||||
non-interactive shell is usually present when a shell script is
|
equivalent file exists in the home directory, it may override the global
|
||||||
running. It is non-interactive because it is processing a script and
|
settings.</para>
|
||||||
not waiting for user input between commands.</para>
|
|
||||||
|
|
||||||
<para>For more information, see <command>info bash</command> under the
|
<para>An interactive login shell is started after a successful login, using
|
||||||
<emphasis>Bash Startup Files and Interactive Shells</emphasis> section.</para>
|
<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>The files <filename>/etc/profile</filename> and
|
<para>For more information, see <command>info bash</command> under the
|
||||||
<filename>~/.bash_profile</filename> are read when the shell is
|
<emphasis>Bash Startup Files and Interactive Shells</emphasis> section.</para>
|
||||||
invoked as an interactive login shell.</para>
|
|
||||||
|
|
||||||
<para>The base <filename>/etc/profile</filename> below sets some
|
<para>The files <filename>/etc/profile</filename> and
|
||||||
environment variables necessary for native language support. Setting
|
<filename>~/.bash_profile</filename> are read when the shell is
|
||||||
them properly results in:</para>
|
invoked as an interactive login shell.</para>
|
||||||
|
|
||||||
<itemizedlist>
|
<para>The base <filename>/etc/profile</filename> below sets some
|
||||||
<listitem><para>The output of programs translated into the native
|
environment variables necessary for native language support. Setting
|
||||||
language</para></listitem>
|
them properly results in:</para>
|
||||||
<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
|
<itemizedlist>
|
||||||
makes Bash and Readline use the <filename>/etc/inputrc</filename> file created
|
<listitem>
|
||||||
earlier.</para>
|
<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>Replace <replaceable>[ll]</replaceable> below with the
|
<para>This script also sets the <envar>INPUTRC</envar> environment variable that
|
||||||
two-letter code for the desired language (e.g., <quote>en</quote>) and
|
makes Bash and Readline use the <filename>/etc/inputrc</filename> file created
|
||||||
<replaceable>[CC]</replaceable> with the two-letter code for the
|
earlier.</para>
|
||||||
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
|
<para>Replace <replaceable>[ll]</replaceable> below with the two-letter code
|
||||||
the following command:</para>
|
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>
|
<screen role="nodump"><userinput>locale -a</userinput></screen>
|
||||||
|
|
||||||
<para>Locales can have a number of synonyms, e.g. <quote>ISO-8859-1</quote> is
|
<para>Locales can have a number of synonyms, e.g. <quote>ISO-8859-1</quote>
|
||||||
also referred to as <quote>iso8859-1</quote> and <quote>iso88591</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
|
Some applications cannot handle the various synonyms correctly, so it is
|
||||||
to choose the canonical name for a particular locale. To determine the
|
safest to choose the canonical name for a particular locale. To determine
|
||||||
canonical name, run the following command, where
|
the canonical name, run the following command, where <replaceable>[locale
|
||||||
<replaceable>[locale name]</replaceable> is the output given by
|
name]</replaceable> is the output given by <command>locale -a</command> for
|
||||||
<command>locale -a</command> for your preferred locale
|
your preferred locale (<quote>en_GB.iso88591</quote> in our example).</para>
|
||||||
(<quote>en_GB.iso88591</quote> in our example).</para>
|
|
||||||
|
|
||||||
<screen role="nodump"><userinput>LC_ALL=<replaceable>[locale name]</replaceable> locale charmap</userinput></screen>
|
<screen role="nodump"><userinput>LC_ALL=<replaceable>[locale name]</replaceable> locale charmap</userinput></screen>
|
||||||
|
|
||||||
<para>For the <quote>en_GB.iso88591</quote> locale, the above command
|
<para>For the <quote>en_GB.iso88591</quote> locale, the above command
|
||||||
will print:</para>
|
will print:</para>
|
||||||
|
|
||||||
<screen>ISO-8859-1</screen>
|
<screen><computeroutput>ISO-8859-1</computeroutput></screen>
|
||||||
|
|
||||||
<para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.
|
<para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.
|
||||||
It is important that the locale found using the heuristic above is tested prior
|
It is important that the locale found using the heuristic above is tested prior
|
||||||
to it being added to the Bash startup files:</para>
|
to it being added to the Bash startup files:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>LC_ALL=[locale name] locale country
|
<screen role="nodump"><userinput>LC_ALL=[locale name] locale country
|
||||||
LC_ALL=[locale name] locale language
|
LC_ALL=[locale name] locale language
|
||||||
@ -93,39 +101,40 @@ LC_ALL=[locale name] locale charmap
|
|||||||
LC_ALL=[locale name] locale int_curr_symbol
|
LC_ALL=[locale name] locale int_curr_symbol
|
||||||
LC_ALL=[locale name] locale int_prefix</userinput></screen>
|
LC_ALL=[locale name] locale int_prefix</userinput></screen>
|
||||||
|
|
||||||
<para>The above commands should print the country and language names, the
|
<para>The above commands should print the country and language names, the
|
||||||
character encoding used by the locale, the local currency and the prefix to dial
|
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
|
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
|
commands above fail with a message similar to the one shown below, this means
|
||||||
that your locale was either not installed in Chapter 6 or is not supported by
|
that your locale was either not installed in Chapter 6 or is not supported by
|
||||||
the default installation of Glibc.</para>
|
the default installation of Glibc.</para>
|
||||||
|
|
||||||
<screen><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></screen>
|
<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.
|
<para>If this happens, you should either install the desired locale using the
|
||||||
Further instructions assume that there are no such error messages from Glibc.
|
<command>localedef</command> command, or consider choosing a different locale.
|
||||||
</para>
|
Further instructions assume that there are no such error messages from
|
||||||
|
Glibc.</para>
|
||||||
|
|
||||||
<para>Some packages beyond LFS may also lack support for your chosen locale. One
|
<para>Some packages beyond LFS may also lack support for your chosen locale. One
|
||||||
example is the X library (part of the X Window System), which outputs the
|
example is the X library (part of the X Window System), which outputs the
|
||||||
following error message:</para>
|
following error message:</para>
|
||||||
|
|
||||||
<screen><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></screen>
|
<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
|
<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
|
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
|
Glibc associates with the locale (this can be checked by running the
|
||||||
<command>locale charmap</command> command in both locales). For example, one
|
<command>locale charmap</command> command in both locales). For example, one
|
||||||
would have to change "de_DE.ISO-8859-15@euro" to
|
would have to change "de_DE.ISO-8859-15@euro" to
|
||||||
"de_DE@euro" in order to get this locale recognized by Xlib.</para>
|
"de_DE@euro" in order to get this locale recognized by Xlib.</para>
|
||||||
|
|
||||||
<para>Other packages can also function incorrectly (but may not necessarily
|
<para>Other packages can also function incorrectly (but may not necessarily
|
||||||
display any error messages) if the locale name does not meet their expectations.
|
display any error messages) if the locale name does not meet their expectations.
|
||||||
In those cases, investigating how other Linux distributions support your locale
|
In those cases, investigating how other Linux distributions support your locale
|
||||||
might provide some useful information.</para>
|
might provide some useful information.</para>
|
||||||
|
|
||||||
<para>Once the proper locale settings have been determined, create the
|
<para>Once the proper locale settings have been determined, create the
|
||||||
<filename>/etc/profile</filename> file:</para>
|
<filename>/etc/profile</filename> file:</para>
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/profile << "EOF"
|
<screen><userinput>cat > /etc/profile << "EOF"
|
||||||
<literal># Begin /etc/profile
|
<literal># Begin /etc/profile
|
||||||
@ -136,18 +145,17 @@ export INPUTRC=/etc/inputrc
|
|||||||
# End /etc/profile</literal>
|
# End /etc/profile</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<note><para>The <quote>C</quote> (default) and <quote>en_US</quote>
|
<note>
|
||||||
(the recommended one for United States English users) locales are
|
<para>The <quote>C</quote> (default) and <quote>en_US</quote> (the
|
||||||
different.</para></note>
|
recommended one for United States English users) locales are different.</para>
|
||||||
|
</note>
|
||||||
|
|
||||||
<para>Setting the keyboard layout, screen font, and
|
<para>Setting the keyboard layout, screen font, and locale-related environment
|
||||||
locale-related environment variables are the only internationalization
|
variables are the only internationalization steps needed to support locales
|
||||||
steps needed to support locales that use ordinary single-byte
|
that use ordinary single-byte encodings and left-to-right writing direction.
|
||||||
encodings and left-to-right writing direction. More complex cases
|
More complex cases (including UTF-8 based locales) require additional steps
|
||||||
(including UTF-8 based locales) require additional steps and
|
and additional patches because many applications tend to not work properly
|
||||||
additional patches because many applications tend to not work properly
|
under such conditions. These steps and patches are not included in the LFS
|
||||||
under such conditions. These steps and patches are not included in
|
book and such locales are not yet supported by LFS.</para>
|
||||||
the LFS book and such locales are not yet supported by LFS.</para>
|
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,42 +1,45 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-setclock">
|
<sect1 id="ch-scripts-setclock">
|
||||||
<title>Configuring the setclock Script</title>
|
<?dbhtml filename="setclock.html"?>
|
||||||
<?dbhtml filename="setclock.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-setclock">
|
<title>Configuring the setclock Script</title>
|
||||||
<primary sortas="d-setclock">setclock</primary>
|
|
||||||
<secondary>configuring</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>The <command>setclock</command> script reads the time from the hardware
|
<indexterm zone="ch-scripts-setclock">
|
||||||
clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
|
<primary sortas="d-setclock">setclock</primary>
|
||||||
(CMOS) clock. If the hardware clock is set to UTC, this script will convert the
|
<secondary>configuring</secondary></indexterm>
|
||||||
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>If you cannot remember whether or not the hardware clock is set to UTC,
|
<para>The <command>setclock</command> script reads the time from the hardware
|
||||||
find out by running the <userinput>hwclock --localtime --show</userinput>
|
clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
|
||||||
command. This will display what the current time is according to the hardware
|
(CMOS) clock. If the hardware clock is set to UTC, this script will convert the
|
||||||
clock. If this time matches whatever your watch says, then the hardware clock is
|
hardware clock's time to the local time using the
|
||||||
set to local time. If the output from <command>hwclock</command> is not local
|
<filename>/etc/localtime</filename> file (which tells the
|
||||||
time, chances are it is set to UTC time. Verify this by adding or subtracting
|
<command>hwclock</command> program which timezone the user is in). There is no
|
||||||
the proper amount of hours for the timezone to the time shown by
|
way to detect whether or not the hardware clock is set to UTC, so this
|
||||||
<command>hwclock</command>. For example, if you are currently in the MST
|
needs to be configured manually.</para>
|
||||||
timezone, which is also known as GMT -0700, add seven hours to the local
|
|
||||||
time.</para>
|
|
||||||
|
|
||||||
<para>Change the value of the <envar>UTC</envar> variable below
|
<para>If you cannot remember whether or not the hardware clock is set to UTC,
|
||||||
to a value of <parameter>0</parameter> (zero) if the hardware clock
|
find out by running the <userinput>hwclock --localtime --show</userinput>
|
||||||
is <emphasis>not</emphasis> set to UTC time.</para>
|
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>Create a new file <filename>/etc/sysconfig/clock</filename> by running
|
<para>Change the value of the <envar>UTC</envar> variable below
|
||||||
the following:</para>
|
to a value of <parameter>0</parameter> (zero) if the hardware clock
|
||||||
|
is <emphasis>not</emphasis> set to UTC time.</para>
|
||||||
|
|
||||||
|
<para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
|
||||||
|
the following:</para>
|
||||||
|
|
||||||
<screen><userinput>cat > /etc/sysconfig/clock << "EOF"
|
<screen><userinput>cat > /etc/sysconfig/clock << "EOF"
|
||||||
<literal># Begin /etc/sysconfig/clock
|
<literal># Begin /etc/sysconfig/clock
|
||||||
@ -46,9 +49,8 @@ UTC=1
|
|||||||
# End /etc/sysconfig/clock</literal>
|
# End /etc/sysconfig/clock</literal>
|
||||||
EOF</userinput></screen>
|
EOF</userinput></screen>
|
||||||
|
|
||||||
<para>A good hint explaining how to deal with time on LFS is available
|
<para>A good hint explaining how to deal with time on LFS is available
|
||||||
at <ulink url="&hints-root;time.txt"/>. It explains issues such as
|
at <ulink url="&hints-root;time.txt"/>. It explains issues such as
|
||||||
time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
|
time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,22 +1,26 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-sysklogd">
|
<sect1 id="ch-scripts-sysklogd">
|
||||||
<title>Configuring the sysklogd script</title>
|
<?dbhtml filename="sysklogd.html"?>
|
||||||
<?dbhtml filename="sysklogd.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-sysklogd">
|
<title>Configuring the sysklogd script</title>
|
||||||
<primary sortas="d-sysklogd">sysklogd</primary>
|
|
||||||
<secondary>configuring</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>The <filename>sysklogd</filename> script invokes the
|
<indexterm zone="ch-scripts-sysklogd">
|
||||||
<command>syslogd</command> program with the <parameter>-m 0</parameter> option.
|
<primary sortas="d-sysklogd">sysklogd</primary>
|
||||||
This option turns off the periodic timestamp mark that
|
<secondary>configuring</secondary>
|
||||||
<command>syslogd</command> writes to the log files every 20 minutes by default.
|
</indexterm>
|
||||||
If you want to turn on this periodic timestamp mark, edit the
|
|
||||||
<filename>sysklogd</filename> script and make the changes accordingly. See
|
<para>The <filename>sysklogd</filename> script invokes the
|
||||||
<userinput>man syslogd</userinput> for more information.</para>
|
<command>syslogd</command> program with the <parameter>-m 0</parameter> option.
|
||||||
|
This option turns off the periodic timestamp mark that
|
||||||
|
<command>syslogd</command> writes to the log files every 20 minutes by default.
|
||||||
|
If you want to turn on this periodic timestamp mark, edit the
|
||||||
|
<filename>sysklogd</filename> script and make the changes accordingly. See
|
||||||
|
<userinput>man syslogd</userinput> for more information.</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
@ -1,213 +1,237 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-udev">
|
<sect1 id="ch-scripts-udev">
|
||||||
<title>Device and Module Handling on an LFS System</title>
|
<?dbhtml filename="udev.html"?>
|
||||||
<?dbhtml filename="udev.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-udev">
|
<title>Device and Module Handling on an LFS System</title>
|
||||||
<primary sortas="a-Udev">Udev</primary>
|
|
||||||
<secondary>usage</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>In <xref linkend="chapter-building-system"/>, we installed the Udev
|
<indexterm zone="ch-scripts-udev">
|
||||||
package. Before we go into the details regarding how this works,
|
<primary sortas="a-Udev">Udev</primary>
|
||||||
a brief history of previous methods of handling devices is in
|
<secondary>usage</secondary>
|
||||||
order.</para>
|
</indexterm>
|
||||||
|
|
||||||
<para>Linux systems in general traditionally use a static device creation
|
<para>In <xref linkend="chapter-building-system"/>, we installed the Udev
|
||||||
method, whereby a great many device nodes are created under <filename
|
package. Before we go into the details regarding how this works,
|
||||||
class="directory">/dev</filename> (sometimes literally thousands of nodes),
|
a brief history of previous methods of handling devices is in
|
||||||
regardless of whether the corresponding hardware devices actually exist. This is
|
order.</para>
|
||||||
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.
|
|
||||||
Using the Udev 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>
|
<para>Linux systems in general traditionally use a static device creation
|
||||||
<title>History</title>
|
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.
|
||||||
|
Using the Udev 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>
|
||||||
|
|
||||||
<para>In February 2000, a new filesystem called <systemitem
|
<sect2>
|
||||||
class="filesystem">devfs</systemitem> was merged into the 2.3.46
|
<title>History</title>
|
||||||
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
|
<para>In February 2000, a new filesystem called <systemitem
|
||||||
class="filesystem">devfs</systemitem> was the way it handled
|
class="filesystem">devfs</systemitem> was merged into the 2.3.46 kernel
|
||||||
device detection, creation, and naming. The latter issue, that of
|
and was made available during the 2.4 series of stable kernels. Although
|
||||||
device node naming, was perhaps the most critical. It is generally
|
it was present in the kernel source itself, this method of creating devices
|
||||||
accepted that if device names are allowed to be configurable, then
|
dynamically never received overwhelming support from the core kernel
|
||||||
the device naming policy should be up to a system administrator, not
|
developers.</para>
|
||||||
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
|
<para>The main problem with the approach adopted by <systemitem
|
||||||
the 2.6 series of stable kernels, a new virtual filesystem called <systemitem
|
class="filesystem">devfs</systemitem> was the way it handled device
|
||||||
class="filesystem">sysfs</systemitem> came to be. The job of <systemitem
|
detection, creation, and naming. The latter issue, that of device node
|
||||||
class="filesystem">sysfs</systemitem> is to export a view of the system's
|
naming, was perhaps the most critical. It is generally accepted that if
|
||||||
hardrware configuration to userspace processes. With this userspace-visible
|
device names are allowed to be configurable, then the device naming policy
|
||||||
representation, the possibility of seeing a userspace replacement for
|
should be up to a system administrator, not imposed on them by any
|
||||||
<systemitem class="filesystem">devfs</systemitem> became much more
|
particular developer(s). The <systemitem class="filesystem">devfs</systemitem>
|
||||||
realistic.</para>
|
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>
|
||||||
|
|
||||||
</sect2>
|
<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
|
||||||
|
hardrware 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>Udev Implementation</title>
|
|
||||||
|
|
||||||
<para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
|
<sect2>
|
||||||
mentioned briefly above. One may wonder how <systemitem
|
<title>Udev Implementation</title>
|
||||||
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>udev</command> for device node creation.</para>
|
|
||||||
|
|
||||||
<para>The <command>S10udev</command> initscript takes care of creating these
|
<para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
|
||||||
device nodes when Linux is booted. This script starts by registering
|
mentioned briefly above. One may wonder how <systemitem
|
||||||
<command>/sbin/udevsend</command> as a hotplug event handler. Hotplug events
|
class="filesystem">sysfs</systemitem> knows about the devices present on
|
||||||
(discussed below) are not usually generated during this stage, but
|
a system and what device numbers should be used for them. Drivers that have
|
||||||
<command>udev</command> is registered just in case they do occur. The
|
been compiled into the kernel directly register their objects with
|
||||||
<command>udevstart</command> program then walks through the <systemitem
|
<systemitem class="filesystem">sysfs</systemitem> as they are detected by
|
||||||
class="filesystem">/sys</systemitem> filesystem and creates devices under
|
the kernel. For drivers compiled as modules, this registration will happen
|
||||||
<filename class="directory">/dev</filename> that match the descriptions. For
|
when the module is loaded. Once the <systemitem
|
||||||
example, <filename>/sys/class/tty/vcs/dev</filename> contains the string
|
class="filesystem">sysfs</systemitem> filesystem is mounted (on <filename
|
||||||
<quote>7:0</quote> This string is used by <command>udevstart</command> to create
|
class="directory">/sys</filename>), data which the built-in drivers
|
||||||
<filename>/dev/vcs</filename> with major number <emphasis>7</emphasis> and minor
|
registered with <systemitem class="filesystem">sysfs</systemitem> are
|
||||||
<emphasis>0</emphasis>. The names and permissions of the nodes created under
|
available to userspace processes and to <command>udev</command> for device
|
||||||
the <filename class="directory">/dev</filename> directory are configured
|
node creation.</para>
|
||||||
according to the 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 LFS-Bootscripts package. If <command>udev</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>.</para>
|
|
||||||
|
|
||||||
<para>Once the above stage is complete, all devices that were already present
|
<para>The <command>S10udev</command> initscript takes care of creating
|
||||||
and have compiled-in drivers will be available for use. This leads us to the
|
these device nodes when Linux is booted. This script starts by registering
|
||||||
devices that have modular drivers.</para>
|
<command>/sbin/udevsend</command> as a hotplug event handler. Hotplug events
|
||||||
|
(discussed below) are not usually generated during this stage, but
|
||||||
|
<command>udev</command> is registered just in case they do occur. The
|
||||||
|
<command>udevstart</command> program then walks through the <systemitem
|
||||||
|
class="filesystem">/sys</systemitem> filesystem and creates devices under
|
||||||
|
<filename class="directory">/dev</filename> that match the descriptions.
|
||||||
|
For example, <filename>/sys/class/tty/vcs/dev</filename> contains the
|
||||||
|
string <quote>7:0</quote> This string is used by <command>udevstart</command>
|
||||||
|
to create <filename>/dev/vcs</filename> 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 configured according to the
|
||||||
|
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 LFS-Bootscripts package. If
|
||||||
|
<command>udev</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>.</para>
|
||||||
|
|
||||||
<para>Earlier, we mentioned the concept of a <quote>hotplug event
|
<para>Once the above stage is complete, all devices that were already present
|
||||||
handler.</quote> When a new device connection is detected by the kernel, the
|
and have compiled-in drivers will be available for use. This leads us to the
|
||||||
kernel will generate a hotplug event and look at the file
|
devices that have modular drivers.</para>
|
||||||
<filename>/proc/sys/kernel/hotplug</filename> to determine the userspace program
|
|
||||||
that handles the device's connection. The <command>udev</command> bootscript
|
|
||||||
registered <command>udevsend</command> as this handler. When these hotplug
|
|
||||||
events are generated, the kernel will tell <command>udev</command> to check the
|
|
||||||
<filename class="directory">/sys</filename> filesystem for the information
|
|
||||||
pertaining to this new device and create the <filename
|
|
||||||
class="directory">/dev</filename> entry for it.</para>
|
|
||||||
|
|
||||||
<para>This brings us to one problem that exists with <command>udev</command>,
|
<para>Earlier, we mentioned the concept of a <quote>hotplug event
|
||||||
and likewise with <systemitem class="filesystem">devfs</systemitem> before it.
|
handler.</quote> When a new device connection is detected by the kernel,
|
||||||
It is commonly referred to as the <quote>chicken and egg</quote> problem. Most
|
the kernel will generate a hotplug event and look at the file
|
||||||
Linux distributions handle loading modules via entries in
|
<filename>/proc/sys/kernel/hotplug</filename> to determine the userspace
|
||||||
<filename>/etc/modules.conf</filename>. Access to a device node causes the
|
program that handles the device's connection. The <command>udev</command>
|
||||||
appropriate kernel module to load. With <command>udev</command>, this method
|
bootscript registered <command>udevsend</command> as this handler. When
|
||||||
will not work because the device node does not exist until the module is loaded.
|
these hotplug events are generated, the kernel will tell
|
||||||
To solve this, the <command>S05modules</command> bootscript was added to the
|
<command>udev</command> to check the <filename
|
||||||
LFS-Bootscripts package, along with the
|
class="directory">/sys</filename> filesystem for the information pertaining
|
||||||
<filename>/etc/sysconfig/modules</filename> file. By adding module names to the
|
to this new device and create the <filename class="directory">/dev</filename>
|
||||||
<filename>modules</filename> file, these modules will be loaded when the
|
entry for it.</para>
|
||||||
computer starts up. This allows <command>udev</command> to detect the devices
|
|
||||||
and create the appropriate device nodes.</para>
|
|
||||||
|
|
||||||
<para>Note that on slower machines or for drivers that create a lot
|
<para>This brings us to one problem that exists with <command>udev</command>,
|
||||||
of device nodes, the process of creating devices may take a few
|
and likewise with <systemitem class="filesystem">devfs</systemitem> before it.
|
||||||
seconds to complete. This means that some device nodes may not be
|
It is commonly referred to as the <quote>chicken and egg</quote> problem. Most
|
||||||
immediately accessible.</para>
|
Linux distributions handle loading modules via entries in
|
||||||
</sect2>
|
<filename>/etc/modules.conf</filename>. Access to a device node causes the
|
||||||
|
appropriate kernel module to load. With <command>udev</command>, this method
|
||||||
|
will not work because the device node does not exist until the module is loaded.
|
||||||
|
To solve this, the <command>S05modules</command> bootscript was added to the
|
||||||
|
LFS-Bootscripts package, along with the
|
||||||
|
<filename>/etc/sysconfig/modules</filename> file. By adding module names to the
|
||||||
|
<filename>modules</filename> file, these modules will be loaded when the
|
||||||
|
computer starts up. This allows <command>udev</command> to detect the devices
|
||||||
|
and create the appropriate device nodes.</para>
|
||||||
|
|
||||||
<sect2>
|
<para>Note that on slower machines or for drivers that create a lot of device
|
||||||
<title>Handling Hotpluggable/Dynamic Devices</title>
|
nodes, the process of creating devices may take a few seconds to complete.
|
||||||
|
This means that some device nodes may not be immediately accessible.</para>
|
||||||
|
|
||||||
<para>When you plug in a device, such as a Universal Serial Bus (USB) MP3 player, the kernel
|
</sect2>
|
||||||
recognizes that the device is now connected and generates a hotplug
|
|
||||||
event. If the driver is already loaded (either because it was compiled
|
|
||||||
into the kernel or because it was loaded via the
|
|
||||||
<command>S05modules</command> bootscript), <command>udev</command> will
|
|
||||||
be called upon to create the relevant device node(s) according to the
|
|
||||||
<systemitem class="filesystem">sysfs</systemitem> data available in
|
|
||||||
<filename class="directory">/sys</filename>.</para>
|
|
||||||
|
|
||||||
<para>If the driver for the just plugged in device is available as a module but
|
<sect2>
|
||||||
currently unloaded, the Hotplug package will load the appropriate module
|
<title>Handling Hotpluggable/Dynamic Devices</title>
|
||||||
and make this device available by creating the device node(s) for it.</para>
|
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2>
|
<para>When you plug in a device, such as a Universal Serial Bus (USB) MP3
|
||||||
<title>Problems with Creating Devices</title>
|
player, the kernel recognizes that the device is now connected and generates
|
||||||
|
a hotplug event. If the driver is already loaded (either because it was
|
||||||
|
compiled into the kernel or because it was loaded via the
|
||||||
|
<command>S05modules</command> bootscript), <command>udev</command> will be
|
||||||
|
called upon to create the relevant device node(s) according to the
|
||||||
|
<systemitem class="filesystem">sysfs</systemitem> data available in
|
||||||
|
<filename class="directory">/sys</filename>.</para>
|
||||||
|
|
||||||
<para>There are a few known problems when it comes to automatically creating
|
<para>If the driver for the just plugged in device is available as a module but
|
||||||
device nodes:</para>
|
currently unloaded, the Hotplug package will load the appropriate module
|
||||||
|
and make this device available by creating the device node(s) for it.</para>
|
||||||
|
|
||||||
<para>1) A kernel driver may not export its data to <systemitem
|
</sect2>
|
||||||
class="filesystem">sysfs</systemitem>.</para>
|
|
||||||
|
|
||||||
<para>This is most common with third party drivers from outside the kernel tree.
|
<sect2>
|
||||||
Udev will be unable to automatically create device nodes for such drivers. Use
|
<title>Problems with Creating Devices</title>
|
||||||
the <filename>/etc/sysconfig/createfiles</filename> configuration file to
|
|
||||||
manually create the devices. Consult the <filename>devices.txt</filename> file
|
|
||||||
inside the kernel documentation or the documentation for that driver to find the
|
|
||||||
proper major/minor numbers.</para>
|
|
||||||
|
|
||||||
<para>2) A non-hardware device is required. This is most common with
|
<para>There are a few known problems when it comes to automatically creating
|
||||||
the Advanced Linux Sound Architecture (ALSA) project's Open Sound
|
device nodes:</para>
|
||||||
System (OSS) compatibility module. These types of devices can be
|
|
||||||
handled in one of two ways:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
<para>1) A kernel driver may not export its data to <systemitem
|
||||||
|
class="filesystem">sysfs</systemitem>.</para>
|
||||||
|
|
||||||
<listitem><para>Adding the module names to
|
<para>This is most common with third party drivers from outside the kernel
|
||||||
<filename>/etc/sysconfig/modules</filename></para></listitem>
|
tree. Udev will be unable to automatically create device nodes for such
|
||||||
<listitem><para>Using an
|
drivers. Use the <filename>/etc/sysconfig/createfiles</filename>
|
||||||
<quote>install</quote> line in
|
configuration file to manually create the devices. Consult the
|
||||||
<filename>/etc/modprobe.conf</filename>. This tells the
|
<filename>devices.txt</filename> file inside the kernel documentation or
|
||||||
<command>modprobe</command> command <quote>when loading this module,
|
the documentation for that driver to find the proper major/minor
|
||||||
also load this other module, at the same time.</quote> For example:</para>
|
numbers.</para>
|
||||||
|
|
||||||
|
<para>2) A non-hardware device is required. This is most common with
|
||||||
|
the Advanced Linux Sound Architecture (ALSA) project's Open Sound
|
||||||
|
System (OSS) compatibility module. These types of devices can be
|
||||||
|
handled in one of two ways:</para>
|
||||||
|
|
||||||
|
<itemizedlist>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Adding the module names to
|
||||||
|
<filename>/etc/sysconfig/modules</filename></para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>Using an <quote>install</quote> line in
|
||||||
|
<filename>/etc/modprobe.conf</filename>. This tells the
|
||||||
|
<command>modprobe</command> command <quote>when loading this module,
|
||||||
|
also load this other module, at the same time.</quote>
|
||||||
|
For example:</para>
|
||||||
|
|
||||||
<screen role="nodump"><userinput>install snd-pcm modprobe -i snd-pcm ; modprobe \
|
<screen role="nodump"><userinput>install snd-pcm modprobe -i snd-pcm ; modprobe \
|
||||||
snd-pcm-oss ; true</userinput></screen>
|
snd-pcm-oss ; true</userinput></screen>
|
||||||
|
|
||||||
<para>This will cause the system to load both the
|
<para>This will cause the system to load both the
|
||||||
<emphasis>snd-pcm</emphasis> and <emphasis>snd-pcm-oss</emphasis>
|
<emphasis>snd-pcm</emphasis> and <emphasis>snd-pcm-oss</emphasis>
|
||||||
modules when any request is made to load the driver
|
modules when any request is made to load the driver
|
||||||
<emphasis>snd-pcm</emphasis>.</para></listitem>
|
<emphasis>snd-pcm</emphasis>.</para>
|
||||||
</itemizedlist>
|
</listitem>
|
||||||
</sect2>
|
|
||||||
|
|
||||||
<sect2>
|
</itemizedlist>
|
||||||
<title>Useful Reading</title>
|
|
||||||
|
|
||||||
<para>Additional helpful documentation is available at the following
|
</sect2>
|
||||||
sites:</para>
|
|
||||||
|
|
||||||
<itemizedlist>
|
<sect2>
|
||||||
<listitem><para>A Userspace Implementation of <systemitem class="filesystem">devfs</systemitem>
|
<title>Useful Reading</title>
|
||||||
<ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para></listitem>
|
|
||||||
|
|
||||||
<listitem><para>udev FAQ
|
<para>Additional helpful documentation is available at the following
|
||||||
<ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ"/></para></listitem>
|
sites:</para>
|
||||||
|
|
||||||
<listitem><para>The Linux Kernel Driver Model
|
<itemizedlist>
|
||||||
<ulink url="http://public.planetmirror.com/pub/lca/2003/proceedings/papers/Patrick_Mochel/Patrick_Mochel.pdf"/></para></listitem>
|
|
||||||
</itemizedlist>
|
<listitem>
|
||||||
</sect2>
|
<para>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>udev FAQ
|
||||||
|
<ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ"/></para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>The Linux Kernel Driver Model
|
||||||
|
<ulink url="http://public.planetmirror.com/pub/lca/2003/proceedings/papers/Patrick_Mochel/Patrick_Mochel.pdf"/></para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
|
</itemizedlist>
|
||||||
|
|
||||||
|
</sect2>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
@ -1,29 +1,33 @@
|
|||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
||||||
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
||||||
<!ENTITY % general-entities SYSTEM "../general.ent">
|
<!ENTITY % general-entities SYSTEM "../general.ent">
|
||||||
%general-entities;
|
%general-entities;
|
||||||
]>
|
]>
|
||||||
|
|
||||||
<sect1 id="ch-scripts-usage">
|
<sect1 id="ch-scripts-usage">
|
||||||
<title>How Do These Bootscripts Work?</title>
|
<?dbhtml filename="usage.html"?>
|
||||||
<?dbhtml filename="usage.html"?>
|
|
||||||
|
|
||||||
<indexterm zone="ch-scripts-usage">
|
<title>How Do These Bootscripts Work?</title>
|
||||||
<primary sortas="a-Bootscripts">Bootscripts</primary>
|
|
||||||
<secondary>usage</secondary></indexterm>
|
|
||||||
|
|
||||||
<para>Linux uses a special booting facility named SysVinit that is based on a
|
<indexterm zone="ch-scripts-usage">
|
||||||
concept of <emphasis>run-levels</emphasis>. It can be quite different from one
|
<primary sortas="a-Bootscripts">Bootscripts</primary>
|
||||||
system to another, so it cannot be assumed that because things worked in one
|
<secondary>usage</secondary>
|
||||||
particular Linux distribution, they should work the same in LFS too. LFS has its
|
</indexterm>
|
||||||
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)
|
<para>Linux uses a special booting facility named SysVinit that is based on a
|
||||||
works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels
|
concept of <emphasis>run-levels</emphasis>. It can be quite different from one
|
||||||
(actually, there are more run-levels, but they are for special cases and are
|
system to another, so it cannot be assumed that because things worked in one
|
||||||
generally not used. See <filename>init(8)</filename> for more details), and each one
|
particular Linux distribution, they should work the same in LFS too. LFS has its
|
||||||
of those corresponds to the actions the computer is supposed to perform when it
|
own way of doing things, but it respects generally accepted standards.</para>
|
||||||
starts up. The default run-level is 3. Here are the descriptions of the
|
|
||||||
different run-levels as they are implemented:</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
|
<literallayout>0: halt the computer
|
||||||
1: single-user mode
|
1: single-user mode
|
||||||
@ -33,83 +37,93 @@ different run-levels as they are implemented:</para>
|
|||||||
5: same as 4, it is usually used for GUI login (like X's <command>xdm</command> or KDE's <command>kdm</command>)
|
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>
|
6: reboot the computer</literallayout>
|
||||||
|
|
||||||
<para>The command used to change run-levels is <command>init
|
<para>The command used to change run-levels is <command>init
|
||||||
<replaceable>[runlevel]</replaceable></command>, where
|
<replaceable>[runlevel]</replaceable></command>, where
|
||||||
<replaceable>[runlevel]</replaceable> is the target run-level. For example, to
|
<replaceable>[runlevel]</replaceable> is the target run-level. For example, to
|
||||||
reboot the computer, a user could issue the <command>init 6</command> command,
|
reboot the computer, a user could issue the <command>init 6</command> command,
|
||||||
which is an alias for the <command>reboot</command> command. Likewise,
|
which is an alias for the <command>reboot</command> command. Likewise,
|
||||||
<command>init 0</command> is an alias for the <command>halt</command>
|
<command>init 0</command> is an alias for the <command>halt</command>
|
||||||
command.</para>
|
command.</para>
|
||||||
|
|
||||||
<para>There are a number of directories under <filename
|
<para>There are a number of directories under <filename
|
||||||
class="directory">/etc/rc.d</filename> that look like <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
|
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
|
<filename class="directory">rcsysinit.d</filename>, all containing a number of
|
||||||
symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with
|
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
|
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
|
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
|
service. The numbers determine the order in which the scripts are run, from 00
|
||||||
to 99—the lower the number the earlier it gets executed. When
|
to 99—the lower the number the earlier it gets executed. When
|
||||||
<command>init</command> switches to another run-level, the appropriate services
|
<command>init</command> switches to another run-level, the appropriate services
|
||||||
are either started or stopped, depending on the runlevel chosen.</para>
|
are either started or stopped, depending on the runlevel chosen.</para>
|
||||||
|
|
||||||
<para>The real scripts are in <filename
|
<para>The real scripts are in <filename
|
||||||
class="directory">/etc/rc.d/init.d</filename>. They do the actual
|
class="directory">/etc/rc.d/init.d</filename>. They do the actual work, and
|
||||||
work, and the symlinks all point to them. Killing links and starting
|
the symlinks all point to them. Killing links and starting links point to
|
||||||
links point to the same script in <filename
|
the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
|
||||||
class="directory">/etc/rc.d/init.d</filename>. This is because the
|
This is because the scripts can be called with different parameters like
|
||||||
scripts can be called with different parameters like
|
<parameter>start</parameter>, <parameter>stop</parameter>,
|
||||||
<parameter>start</parameter>, <parameter>stop</parameter>,
|
<parameter>restart</parameter>, <parameter>reload</parameter>, and
|
||||||
<parameter>restart</parameter>, <parameter>reload</parameter>, and
|
<parameter>status</parameter>. When a K link is encountered, the appropriate
|
||||||
<parameter>status</parameter>. When a K link is encountered, the
|
script is run with the <parameter>stop</parameter> argument. When an S link
|
||||||
appropriate script is run with the <parameter>stop</parameter>
|
is encountered, the appropriate script is run with the
|
||||||
argument. When an S link is encountered, the appropriate script is run
|
<parameter>start</parameter> argument.</para>
|
||||||
with the <parameter>start</parameter> argument.</para>
|
|
||||||
|
|
||||||
<para>There is one exception to this explanation. Links that start
|
<para>There is one exception to this explanation. Links that start
|
||||||
with an <emphasis>S</emphasis> in the <filename
|
with an <emphasis>S</emphasis> in the <filename
|
||||||
class="directory">rc0.d</filename> and <filename
|
class="directory">rc0.d</filename> and <filename
|
||||||
class="directory">rc6.d</filename> directories will not cause anything
|
class="directory">rc6.d</filename> directories will not cause anything
|
||||||
to be started. They will be called with the parameter
|
to be started. They will be called with the parameter
|
||||||
<parameter>stop</parameter> to stop something. The logic behind this
|
<parameter>stop</parameter> to stop something. The logic behind this
|
||||||
is that when a user is going to reboot or halt the system, nothing
|
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>
|
needs to be started. The system only needs to be stopped.</para>
|
||||||
|
|
||||||
<para>These are descriptions of what the arguments make the scripts
|
<para>These are descriptions of what the arguments make the scripts
|
||||||
do:</para>
|
do:</para>
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
|
||||||
<term><parameter>start</parameter></term>
|
|
||||||
<listitem><para>The service is started.</para></listitem>
|
|
||||||
</varlistentry>
|
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><parameter>stop</parameter></term>
|
<term><parameter>start</parameter></term>
|
||||||
<listitem><para>The service is stopped.</para></listitem>
|
<listitem>
|
||||||
</varlistentry>
|
<para>The service is started.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><parameter>restart</parameter></term>
|
<term><parameter>stop</parameter></term>
|
||||||
<listitem><para>The service is stopped and then started again.</para></listitem>
|
<listitem>
|
||||||
</varlistentry>
|
<para>The service is stopped.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><parameter>reload</parameter></term>
|
<term><parameter>restart</parameter></term>
|
||||||
<listitem><para>The configuration of the service is updated.
|
<listitem>
|
||||||
This is used after the configuration file of a service was modified, when
|
<para>The service is stopped and then started again.</para>
|
||||||
the service does not need to be restarted.</para></listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
<term><parameter>status</parameter></term>
|
<term><parameter>reload</parameter></term>
|
||||||
<listitem><para>Tells if the service is running and with which PIDs.</para></listitem>
|
<listitem>
|
||||||
</varlistentry>
|
<para>The configuration of the service is updated.
|
||||||
</variablelist>
|
This is used after the configuration file of a service was modified, when
|
||||||
|
the service does not need to be restarted.</para>
|
||||||
|
</listitem>
|
||||||
|
</varlistentry>
|
||||||
|
|
||||||
<para>Feel free to modify the way the boot process works (after all,
|
<varlistentry>
|
||||||
it is your own LFS system). The files given here are an example of how
|
<term><parameter>status</parameter></term>
|
||||||
it can be done.</para>
|
<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 LFS system). The files given here are an example of how
|
||||||
|
it can be done.</para>
|
||||||
|
|
||||||
</sect1>
|
</sect1>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user