Changeset d781ffb


Ignore:
Timestamp:
12/18/2005 06:31:04 PM (18 years ago)
Author:
Manuel Canales Esparcia <manuel@…>
Branches:
10.0, 10.0-rc1, 10.1, 10.1-rc1, 11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, 11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
faaf88e
Parents:
b78c747
Message:

Chapter07 indentation.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7230 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

Location:
chapter07
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • chapter07/bootscripts.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-bootscripts" role="wrap">
    7 <title>LFS-Bootscripts-&lfs-bootscripts-version;</title>
    8 <?dbhtml filename="bootscripts.html"?>
    9 
    10 <indexterm zone="ch-scripts-bootscripts"><primary sortas="a-Bootscripts">Bootscripts</primary></indexterm>
    11 
    12 <sect2 role="package"><title/>
    13 <para>The LFS-Bootscripts package contains a set of scripts to start/stop the
    14 LFS system at bootup/shutdown.</para>
    15 
    16 <segmentedlist>
    17 <segtitle>&buildtime;</segtitle>
    18 <segtitle>&diskspace;</segtitle>
    19 <seglistitem><seg>0.1 SBU</seg><seg>516 KB</seg></seglistitem>
    20 </segmentedlist>
    21 
    22 <segmentedlist>
    23 <segtitle>&dependencies;</segtitle>
    24 <seglistitem><seg>Bash and Coreutils</seg></seglistitem>
    25 </segmentedlist>
    26 </sect2>
    27 
    28 <sect2 role="installation">
    29 <title>Installation of LFS-Bootscripts</title>
    30 
    31 <para>Install the package:</para>
     9  <?dbhtml filename="bootscripts.html"?>
     10
     11  <title>LFS-Bootscripts-&lfs-bootscripts-version;</title>
     12
     13  <indexterm zone="ch-scripts-bootscripts">
     14    <primary sortas="a-Bootscripts">Bootscripts</primary>
     15  </indexterm>
     16
     17  <sect2 role="package">
     18    <title/>
     19
     20    <para>The LFS-Bootscripts package contains a set of scripts to start/stop the
     21    LFS system at bootup/shutdown.</para>
     22
     23    <segmentedlist>
     24      <segtitle>&buildtime;</segtitle>
     25      <segtitle>&diskspace;</segtitle>
     26
     27      <seglistitem>
     28        <seg>0.1 SBU</seg>
     29        <seg>516 KB</seg>
     30      </seglistitem>
     31    </segmentedlist>
     32
     33    <segmentedlist>
     34      <segtitle>&dependencies;</segtitle>
     35
     36      <seglistitem>
     37        <seg>Bash and Coreutils</seg>
     38      </seglistitem>
     39    </segmentedlist>
     40
     41  </sect2>
     42
     43  <sect2 role="installation">
     44    <title>Installation of LFS-Bootscripts</title>
     45
     46    <para>Install the package:</para>
    3247
    3348<screen><userinput>make install</userinput></screen>
    3449
    35 </sect2>
    36 
    37 <sect2 id="contents-bootscripts" role="content"><title>Contents of LFS-Bootscripts</title>
    38 
    39 <segmentedlist>
    40 <segtitle>Installed scripts</segtitle>
    41 <seglistitem><seg>checkfs, cleanfs, console, functions, halt, hotplug, ifdown, ifup,
    42 localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals, setclock, static,
    43 swap, sysklogd, template, and udev</seg></seglistitem>
    44 </segmentedlist>
    45 
    46 <variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
    47 <?dbfo list-presentation="list"?>
    48 <?dbhtml list-presentation="table"?>
    49 
    50 <varlistentry id="checkfs-bootscripts">
    51 <term><command>checkfs</command></term>
    52 <listitem>
    53 <para>Checks the integrity of the file systems before they are mounted (with the
    54 exception of journal and network based file systems)</para>
    55 <indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm>
    56 </listitem>
    57 </varlistentry>
    58 
    59 <varlistentry id="cleanfs-bootscripts">
    60 <term><command>cleanfs</command></term>
    61 <listitem>
    62 <para>Removes files that should not be
    63 preserved between reboots, such as those in <filename class="directory">/var/run/</filename> and
    64 <filename class="directory">/var/lock/</filename>; it re-creates <filename>/var/run/utmp</filename>
    65 and removes the possibly present <filename>/etc/nologin</filename>,
    66 <filename>/fastboot</filename>, and <filename>/forcefsck</filename> files</para>
    67 <indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts"><primary sortas="d-cleanfs">cleanfs</primary></indexterm>
    68 </listitem>
    69 </varlistentry>
    70 
    71 <varlistentry id="console-bootscripts">
    72 <term><command>console</command></term>
    73 <listitem>
    74 <para>Loads the correct keymap table for the desired keyboard layout; it also
    75 sets the screen font</para>
    76 <indexterm zone="ch-scripts-bootscripts console-bootscripts"><primary sortas="d-console">console</primary></indexterm>
    77 </listitem>
    78 </varlistentry>
    79 
    80 <varlistentry id="functions-bootscripts">
    81 <term><command>functions</command></term>
    82 <listitem>
    83 <para>Contains common functions, such as error and status checking, that are
    84 used by several bootscripts</para>
    85 <indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm>
    86 </listitem>
    87 </varlistentry>
    88 
    89 <varlistentry id="halt-bootscripts">
    90 <term><command>halt</command></term>
    91 <listitem>
    92 <para>Halts the system</para>
    93 <indexterm zone="ch-scripts-bootscripts halt-bootscripts"><primary sortas="d-halt">halt</primary></indexterm>
    94 </listitem>
    95 </varlistentry>
    96 
    97 <varlistentry id="hotplug-bootscripts">
    98 <term><command>hotplug</command></term>
    99 <listitem>
    100 <para>Loads modules for system devices</para>
    101 <indexterm zone="ch-scripts-bootscripts hotplug-bootscripts"><primary sortas="d-hotplug">hotplug</primary></indexterm>
    102 </listitem>
    103 </varlistentry>
    104 
    105 <varlistentry id="ifdown-bootscripts">
    106 <term><command>ifdown</command></term>
    107 <listitem>
    108 <para>Assists the network script with stopping network devices</para>
    109 <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm>
    110 </listitem>
    111 </varlistentry>
    112 
    113 <varlistentry id="ifup-bootscripts">
    114 <term><command>ifup</command></term>
    115 <listitem>
    116 <para>Assists the network script with starting network devices</para>
    117 <indexterm zone="ch-scripts-bootscripts ifup-bootscripts"><primary sortas="d-ifup">ifup</primary></indexterm>
    118 </listitem>
    119 </varlistentry>
    120 
    121 <varlistentry id="localnet-bootscripts">
    122 <term><command>localnet</command></term>
    123 <listitem>
    124 <para>Sets up the system's hostname and local loopback device</para>
    125 <indexterm zone="ch-scripts-bootscripts localnet-bootscripts"><primary sortas="d-localnet">localnet</primary></indexterm>
    126 </listitem>
    127 </varlistentry>
    128 
    129 <varlistentry id="mountfs-bootscripts">
    130 <term><command>mountfs</command></term>
    131 <listitem>
    132 <para>Mounts all file systems, except ones that are marked
    133 <emphasis>noauto</emphasis> or are network based</para>
    134 <indexterm zone="ch-scripts-bootscripts mountfs-bootscripts"><primary sortas="d-mountfs">mountfs</primary></indexterm>
    135 </listitem>
    136 </varlistentry>
    137 
    138 <varlistentry id="mountkernfs-bootscripts">
    139 <term><command>mountkernfs</command></term>
    140 <listitem>
    141 <para>Mounts virtual kernel file systems, such as <systemitem
    142 class="filesystem">proc</systemitem></para>
    143 <indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm>
    144 </listitem>
    145 </varlistentry>
    146 
    147 <varlistentry id="network-bootscripts">
    148 <term><command>network</command></term>
    149 <listitem>
    150 <para>Sets up network interfaces, such as network cards, and sets up
    151 the default gateway (where applicable)</para>
    152 <indexterm zone="ch-scripts-bootscripts network-bootscripts"><primary sortas="d-network">network</primary></indexterm>
    153 </listitem>
    154 </varlistentry>
    155 
    156 <varlistentry id="rc-bootscripts">
    157 <term><command>rc</command></term>
    158 <listitem>
    159 <para>The master run-level control script; it is responsible for running all the
    160 other bootscripts one-by-one, in a sequence determined by the name of the
    161 symbolic links being processed</para>
    162 <indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm>
    163 </listitem>
    164 </varlistentry>
    165 
    166 <varlistentry id="reboot-bootscripts">
    167 <term><command>reboot</command></term>
    168 <listitem>
    169 <para>Reboots the system</para>
    170 <indexterm zone="ch-scripts-bootscripts reboot-bootscripts"><primary sortas="d-reboot">reboot</primary></indexterm>
    171 </listitem>
    172 </varlistentry>
    173 
    174 <varlistentry id="sendsignals-bootscripts">
    175 <term><command>sendsignals</command></term>
    176 <listitem>
    177 <para>Makes sure every process is terminated before the system reboots
    178 or halts</para>
    179 <indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts"><primary sortas="d-sendsignals">sendsignals</primary></indexterm>
    180 </listitem>
    181 </varlistentry>
    182 
    183 <varlistentry id="setclock-bootscripts">
    184 <term><command>setclock</command></term>
    185 <listitem>
    186 <para>Resets the kernel clock to local time in case the hardware clock
    187 is not set to UTC time</para>
    188 <indexterm zone="ch-scripts-bootscripts setclock-bootscripts"><primary sortas="d-setclock">setclock</primary></indexterm>
    189 </listitem>
    190 </varlistentry>
    191 
    192 <varlistentry id="static-bootscripts">
    193 <term><command>static</command></term>
    194 <listitem>
    195 <para>Provides the functionality needed to assign a static Internet
    196 Protocol (IP) address to a network interface</para>
    197 <indexterm zone="ch-scripts-bootscripts static-bootscripts"><primary sortas="d-static">static</primary></indexterm>
    198 </listitem>
    199 </varlistentry>
    200 
    201 <varlistentry id="swap-bootscripts">
    202 <term><command>swap</command></term>
    203 <listitem>
    204 <para>Enables and disables swap files and partitions</para>
    205 <indexterm zone="ch-scripts-bootscripts swap-bootscripts"><primary sortas="d-swap">swap</primary></indexterm>
    206 </listitem>
    207 </varlistentry>
    208 
    209 <varlistentry id="sysklogd-bootscripts">
    210 <term><command>sysklogd</command></term>
    211 <listitem>
    212 <para>Starts and stops the system and kernel log daemons</para>
    213 <indexterm zone="ch-scripts-bootscripts sysklogd-bootscripts"><primary sortas="d-sysklogd">sysklogd</primary></indexterm>
    214 </listitem>
    215 </varlistentry>
    216 
    217 <varlistentry id="template-bootscripts">
    218 <term><command>template</command></term>
    219 <listitem>
    220 <para>A template to create custom bootscripts for other
    221 daemons</para>
    222 <indexterm zone="ch-scripts-bootscripts template-bootscripts"><primary sortas="d-template">template</primary></indexterm>
    223 </listitem>
    224 </varlistentry>
    225 
    226 <varlistentry id="udev-bootscripts">
    227 <term><command>udev</command></term>
    228 <listitem>
    229 <para>Prepares the <filename class="directory">/dev</filename> directory and
    230 starts Udev</para>
    231 <indexterm zone="ch-scripts-bootscripts udev-bootscripts"><primary sortas="d-udev">udev</primary></indexterm>
    232 </listitem>
    233 </varlistentry>
    234 </variablelist>
    235 
    236 </sect2>
     50  </sect2>
     51
     52  <sect2 id="contents-bootscripts" role="content">
     53    <title>Contents of LFS-Bootscripts</title>
     54
     55    <segmentedlist>
     56      <segtitle>Installed scripts</segtitle>
     57
     58      <seglistitem>
     59        <seg>checkfs, cleanfs, console, functions, halt, hotplug, ifdown, ifup,
     60        localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals,
     61        setclock, static, swap, sysklogd, template, and udev</seg>
     62      </seglistitem>
     63    </segmentedlist>
     64
     65    <variablelist>
     66      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
     67      <?dbfo list-presentation="list"?>
     68      <?dbhtml list-presentation="table"?>
     69
     70      <varlistentry id="checkfs-bootscripts">
     71        <term><command>checkfs</command></term>
     72        <listitem>
     73          <para>Checks the integrity of the file systems before they are mounted
     74          (with the exception of journal and network based file systems)</para>
     75          <indexterm zone="ch-scripts-bootscripts checkfs-bootscripts">
     76            <primary sortas="d-checkfs">checkfs</primary>
     77          </indexterm>
     78        </listitem>
     79      </varlistentry>
     80
     81      <varlistentry id="cleanfs-bootscripts">
     82        <term><command>cleanfs</command></term>
     83        <listitem>
     84          <para>Removes files that should not be preserved between reboots, such
     85          as those in <filename class="directory">/var/run/</filename> and
     86          <filename class="directory">/var/lock/</filename>; it re-creates
     87          <filename>/var/run/utmp</filename> and removes the possibly present
     88          <filename>/etc/nologin</filename>, <filename>/fastboot</filename>, and
     89          <filename>/forcefsck</filename> files</para>
     90          <indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts">
     91            <primary sortas="d-cleanfs">cleanfs</primary>
     92          </indexterm>
     93        </listitem>
     94      </varlistentry>
     95
     96      <varlistentry id="console-bootscripts">
     97        <term><command>console</command></term>
     98        <listitem>
     99          <para>Loads the correct keymap table for the desired keyboard layout;
     100          it also sets the screen font</para>
     101          <indexterm zone="ch-scripts-bootscripts console-bootscripts">
     102            <primary sortas="d-console">console</primary>
     103          </indexterm>
     104        </listitem>
     105      </varlistentry>
     106
     107      <varlistentry id="functions-bootscripts">
     108        <term><command>functions</command></term>
     109        <listitem>
     110          <para>Contains common functions, such as error and status checking,
     111          that are used by several bootscripts</para>
     112          <indexterm zone="ch-scripts-bootscripts functions-bootscripts">
     113            <primary sortas="d-functions">functions</primary>
     114          </indexterm>
     115        </listitem>
     116      </varlistentry>
     117
     118      <varlistentry id="halt-bootscripts">
     119        <term><command>halt</command></term>
     120        <listitem>
     121          <para>Halts the system</para>
     122          <indexterm zone="ch-scripts-bootscripts halt-bootscripts">
     123            <primary sortas="d-halt">halt</primary>
     124          </indexterm>
     125        </listitem>
     126      </varlistentry>
     127
     128      <varlistentry id="hotplug-bootscripts">
     129        <term><command>hotplug</command></term>
     130        <listitem>
     131          <para>Loads modules for system devices</para>
     132            <indexterm zone="ch-scripts-bootscripts hotplug-bootscripts">
     133          <primary sortas="d-hotplug">hotplug</primary>
     134          </indexterm>
     135        </listitem>
     136      </varlistentry>
     137
     138      <varlistentry id="ifdown-bootscripts">
     139        <term><command>ifdown</command></term>
     140        <listitem>
     141          <para>Assists the network script with stopping network devices</para>
     142          <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts">
     143            <primary sortas="d-ifdown">ifdown</primary>
     144          </indexterm>
     145        </listitem>
     146      </varlistentry>
     147
     148      <varlistentry id="ifup-bootscripts">
     149        <term><command>ifup</command></term>
     150        <listitem>
     151          <para>Assists the network script with starting network devices</para>
     152          <indexterm zone="ch-scripts-bootscripts ifup-bootscripts">
     153            <primary sortas="d-ifup">ifup</primary>
     154          </indexterm>
     155        </listitem>
     156      </varlistentry>
     157
     158      <varlistentry id="localnet-bootscripts">
     159        <term><command>localnet</command></term>
     160        <listitem>
     161          <para>Sets up the system's hostname and local loopback device</para>
     162          <indexterm zone="ch-scripts-bootscripts localnet-bootscripts">
     163            <primary sortas="d-localnet">localnet</primary>
     164          </indexterm>
     165        </listitem>
     166      </varlistentry>
     167
     168      <varlistentry id="mountfs-bootscripts">
     169        <term><command>mountfs</command></term>
     170        <listitem>
     171          <para>Mounts all file systems, except ones that are marked
     172          <emphasis>noauto</emphasis> or are network based</para>
     173          <indexterm zone="ch-scripts-bootscripts mountfs-bootscripts">
     174            <primary sortas="d-mountfs">mountfs</primary>
     175          </indexterm>
     176        </listitem>
     177      </varlistentry>
     178
     179      <varlistentry id="mountkernfs-bootscripts">
     180        <term><command>mountkernfs</command></term>
     181        <listitem>
     182          <para>Mounts virtual kernel file systems, such as <systemitem
     183          class="filesystem">proc</systemitem></para>
     184          <indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts">
     185            <primary sortas="d-mountkernfs">mountkernfs</primary>
     186          </indexterm>
     187        </listitem>
     188      </varlistentry>
     189
     190      <varlistentry id="network-bootscripts">
     191        <term><command>network</command></term>
     192        <listitem>
     193          <para>Sets up network interfaces, such as network cards, and sets up
     194          the default gateway (where applicable)</para>
     195          <indexterm zone="ch-scripts-bootscripts network-bootscripts">
     196            <primary sortas="d-network">network</primary>
     197          </indexterm>
     198        </listitem>
     199      </varlistentry>
     200
     201      <varlistentry id="rc-bootscripts">
     202        <term><command>rc</command></term>
     203        <listitem>
     204          <para>The master run-level control script; it is responsible for
     205          running all the other bootscripts one-by-one, in a sequence determined
     206          by the name of the symbolic links being processed</para>
     207          <indexterm zone="ch-scripts-bootscripts rc-bootscripts">
     208            <primary sortas="d-rc">rc</primary>
     209          </indexterm>
     210        </listitem>
     211      </varlistentry>
     212
     213      <varlistentry id="reboot-bootscripts">
     214        <term><command>reboot</command></term>
     215        <listitem>
     216          <para>Reboots the system</para>
     217          <indexterm zone="ch-scripts-bootscripts reboot-bootscripts">
     218            <primary sortas="d-reboot">reboot</primary>
     219          </indexterm>
     220        </listitem>
     221      </varlistentry>
     222
     223      <varlistentry id="sendsignals-bootscripts">
     224        <term><command>sendsignals</command></term>
     225        <listitem>
     226          <para>Makes sure every process is terminated before the system reboots
     227          or halts</para>
     228          <indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts">
     229            <primary sortas="d-sendsignals">sendsignals</primary>
     230          </indexterm>
     231        </listitem>
     232      </varlistentry>
     233
     234      <varlistentry id="setclock-bootscripts">
     235        <term><command>setclock</command></term>
     236        <listitem>
     237          <para>Resets the kernel clock to local time in case the hardware clock
     238          is not set to UTC time</para>
     239          <indexterm zone="ch-scripts-bootscripts setclock-bootscripts">
     240            <primary sortas="d-setclock">setclock</primary>
     241          </indexterm>
     242        </listitem>
     243      </varlistentry>
     244
     245      <varlistentry id="static-bootscripts">
     246        <term><command>static</command></term>
     247        <listitem>
     248          <para>Provides the functionality needed to assign a static Internet
     249          Protocol (IP) address to a network interface</para>
     250          <indexterm zone="ch-scripts-bootscripts static-bootscripts">
     251            <primary sortas="d-static">static</primary>
     252          </indexterm>
     253        </listitem>
     254      </varlistentry>
     255
     256      <varlistentry id="swap-bootscripts">
     257        <term><command>swap</command></term>
     258        <listitem>
     259          <para>Enables and disables swap files and partitions</para>
     260          <indexterm zone="ch-scripts-bootscripts swap-bootscripts">
     261            <primary sortas="d-swap">swap</primary>
     262          </indexterm>
     263        </listitem>
     264      </varlistentry>
     265
     266      <varlistentry id="sysklogd-bootscripts">
     267        <term><command>sysklogd</command></term>
     268        <listitem>
     269          <para>Starts and stops the system and kernel log daemons</para>
     270          <indexterm zone="ch-scripts-bootscripts sysklogd-bootscripts">
     271            <primary sortas="d-sysklogd">sysklogd</primary>
     272          </indexterm>
     273        </listitem>
     274      </varlistentry>
     275
     276      <varlistentry id="template-bootscripts">
     277        <term><command>template</command></term>
     278        <listitem>
     279          <para>A template to create custom bootscripts for other
     280          daemons</para>
     281          <indexterm zone="ch-scripts-bootscripts template-bootscripts">
     282            <primary sortas="d-template">template</primary>
     283          </indexterm>
     284        </listitem>
     285      </varlistentry>
     286
     287      <varlistentry id="udev-bootscripts">
     288        <term><command>udev</command></term>
     289        <listitem>
     290          <para>Prepares the <filename class="directory">/dev</filename>
     291          directory and starts Udev</para>
     292          <indexterm zone="ch-scripts-bootscripts udev-bootscripts">
     293            <primary sortas="d-udev">udev</primary>
     294          </indexterm>
     295        </listitem>
     296      </varlistentry>
     297
     298    </variablelist>
     299
     300  </sect2>
    237301
    238302</sect1>
    239 
  • chapter07/chapter07.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<chapter id="chapter-bootscripts" xreflabel="Chapter 7">
    7 <?dbhtml dir="chapter07"?>
    8 <title>Setting Up System Bootscripts</title>
    9 <?dbhtml filename="chapter07.html"?>
     9  <?dbhtml dir="chapter07"?>
     10  <?dbhtml filename="chapter07.html"?>
    1011
    11 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
    12 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bootscripts.xml"/>
    13 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="usage.xml"/>
    14 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
    15 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="setclock.xml"/>
    16 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="console.xml"/>
    17 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
    18 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inputrc.xml"/>
    19 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="profile.xml"/>
    20 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostname.xml"/>
    21 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hosts.xml"/>
    22 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="network.xml"/>
     12  <title>Setting Up System Bootscripts</title>
     13
     14  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
     15  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bootscripts.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="usage.xml"/>
     17  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="setclock.xml"/>
     19  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="console.xml"/>
     20  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
     21  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inputrc.xml"/>
     22  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="profile.xml"/>
     23  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostname.xml"/>
     24  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hosts.xml"/>
     25  <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="network.xml"/>
    2326
    2427</chapter>
  • chapter07/console.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-console">
    7 <title>Configuring the Linux Console</title>
    8 <?dbhtml filename="console.html"?>
     9  <?dbhtml filename="console.html"?>
    910
    10 <indexterm zone="ch-scripts-console">
    11 <primary sortas="d-console">console</primary>
    12 <secondary>configuring</secondary></indexterm>
     11  <title>Configuring the Linux Console</title>
    1312
    14 <para>This section discusses how to configure the <command>console</command>
    15 bootscript that sets up the keyboard map and the console font. If non-ASCII
    16 characters (e.g., the British pound sign and Euro character) will not be used
    17 and the keyboard is a U.S. one, skip this section. Without the configuration
    18 file, the <command>console</command> bootscript will do nothing.</para>
     13  <indexterm zone="ch-scripts-console">
     14    <primary sortas="d-console">console</primary>
     15    <secondary>configuring</secondary>
     16  </indexterm>
    1917
    20 <para>The <command>console</command> script reads the
    21 <filename>/etc/sysconfig/console</filename> file for configuration information.
    22 Decide which keymap and screen font will be used. Various language-specific
    23 HOWTO's can also help with this (see <ulink
    24 url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
    25 <filename>/etc/sysconfig/console</filename> file with known settings for several
    26 countries was installed with the LFS-Bootscripts package, so the relevant
    27 section can be uncommented if the country is supported. If still in doubt, look
    28 in the <filename class="directory">/usr/share/kbd</filename> directory for valid
    29 keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
    30 <filename>setfont(8)</filename> to determine the correct arguments for
    31 these programs. Once decided, create the configuration file with the following
    32 command:</para>
     18  <para>This section discusses how to configure the <command>console</command>
     19  bootscript that sets up the keyboard map and the console font. If non-ASCII
     20  characters (e.g., the British pound sign and Euro character) will not be used
     21  and the keyboard is a U.S. one, skip this section. Without the configuration
     22  file, the <command>console</command> bootscript will do nothing.</para>
     23
     24  <para>The <command>console</command> script reads the
     25  <filename>/etc/sysconfig/console</filename> file for configuration information.
     26  Decide which keymap and screen font will be used. Various language-specific
     27  HOWTO's can also help with this (see <ulink
     28  url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. A pre-made
     29  <filename>/etc/sysconfig/console</filename> file with known settings for several
     30  countries was installed with the LFS-Bootscripts package, so the relevant
     31  section can be uncommented if the country is supported. If still in doubt, look
     32  in the <filename class="directory">/usr/share/kbd</filename> directory for valid
     33  keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and
     34  <filename>setfont(8)</filename> to determine the correct arguments for
     35  these programs. Once decided, create the configuration file with the following
     36  command:</para>
    3337
    3438<screen><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
     
    3741EOF</userinput></screen>
    3842
    39 <para>For example, for Spanish users who also want to use the Euro
    40 character (accessible by pressing AltGr+E), the following settings are
    41 correct:</para>
     43  <para>For example, for Spanish users who also want to use the Euro
     44  character (accessible by pressing AltGr+E), the following settings are
     45  correct:</para>
    4246
    4347<screen role="nodump"><userinput>cat &gt;/etc/sysconfig/console &lt;&lt;"EOF"
     
    4650EOF</userinput></screen>
    4751
    48 <note><para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
    49 character set. If using ISO 8859-1 and, therefore, a pound sign
    50 instead of Euro, the correct <envar>FONT</envar> line would be:</para>
     52  <note>
     53    <para>The <envar>FONT</envar> line above is correct only for the ISO 8859-15
     54    character set. If using ISO 8859-1 and, therefore, a pound sign
     55    instead of Euro, the correct <envar>FONT</envar> line would be:</para>
    5156
    52 <screen role="nodump"><userinput>FONT="lat1-16"</userinput></screen></note>
     57<screen role="nodump"><userinput>FONT="lat1-16"</userinput></screen>
     58  </note>
    5359
    54 <para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set, the
    55 <command>console</command> initscript will not run the corresponding
    56 program.</para>
     60  <para>If the <envar>KEYMAP</envar> or <envar>FONT</envar> variable is not set,
     61  the <command>console</command> initscript will not run the corresponding
     62  program.</para>
    5763
    58 <para>In some keymaps, the Backspace and Delete keys send characters different
    59 from ones in the default keymap built into the kernel. This confuses some
    60 applications. For example, Emacs displays its help (instead of erasing the
    61 character before the cursor) when Backspace is pressed. To check if the keymap
    62 in use is affected (this works only for i386 keymaps):</para>
     64  <para>In some keymaps, the Backspace and Delete keys send characters different
     65  from ones in the default keymap built into the kernel. This confuses some
     66  applications. For example, Emacs displays its help (instead of erasing the
     67  character before the cursor) when Backspace is pressed. To check if the keymap
     68  in use is affected (this works only for i386 keymaps):</para>
    6369
    6470<screen role="nodump"><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>
    6571
    66 <para>If the keycode 14 is Backspace instead of Delete, create the
    67 following keymap snippet to fix this issue:</para>
     72  <para>If the keycode 14 is Backspace instead of Delete, create the
     73  following keymap snippet to fix this issue:</para>
    6874
    6975<screen role="nodump"><userinput>mkdir -pv /etc/kbd &amp;&amp; cat &gt; /etc/kbd/bs-sends-del &lt;&lt;"EOF"
     
    7783EOF</userinput></screen>
    7884
    79 <para>Tell the <command>console</command> script to load this
    80 snippet after the main keymap:</para>
     85  <para>Tell the <command>console</command> script to load this
     86  snippet after the main keymap:</para>
    8187
    8288<screen role="nodump"><userinput>cat &gt;&gt;/etc/sysconfig/console &lt;&lt;"EOF"
     
    8490EOF</userinput></screen>
    8591
    86 <para>To compile the keymap directly into the kernel instead of
    87 setting it every time from the <command>console</command> bootscript,
    88 follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
    89 Doing this ensures that the keyboard will always work as expected,
    90 even when booting into maintenance mode (by passing
    91 <parameter>init=/bin/sh</parameter> to the kernel), because the
    92 <command>console</command> bootscript will not be run in that
    93 situation. Additionally, the kernel will not set the screen font
    94 automatically. This should not pose many problems because ASCII characters
    95 will be handled correctly, and it is unlikely that a user would need
    96 to rely on non-ASCII characters while in maintenance mode.</para>
     92  <para>To compile the keymap directly into the kernel instead of
     93  setting it every time from the <command>console</command> bootscript,
     94  follow the instructions given in <xref linkend="ch-bootable-kernel" role="."/>
     95  Doing this ensures that the keyboard will always work as expected,
     96  even when booting into maintenance mode (by passing
     97  <parameter>init=/bin/sh</parameter> to the kernel), because the
     98  <command>console</command> bootscript will not be run in that
     99  situation. Additionally, the kernel will not set the screen font
     100  automatically. This should not pose many problems because ASCII characters
     101  will be handled correctly, and it is unlikely that a user would need
     102  to rely on non-ASCII characters while in maintenance mode.</para>
    97103
    98 <para>Since the kernel will set up the keymap, it is possible to omit
    99 the <envar>KEYMAP</envar> variable from the
    100 <filename>/etc/sysconfig/console</filename> configuration file. It can
    101 also be left in place, if desired, without consequence.  Keeping it
    102 could be beneficial if running several different kernels where it is
    103 difficult to ensure that the keymap is compiled into every one of
    104 them.</para>
     104  <para>Since the kernel will set up the keymap, it is possible to omit
     105  the <envar>KEYMAP</envar> variable from the
     106  <filename>/etc/sysconfig/console</filename> configuration file. It can
     107  also be left in place, if desired, without consequence.  Keeping it
     108  could be beneficial if running several different kernels where it is
     109  difficult to ensure that the keymap is compiled into every one of
     110  them.</para>
    105111
    106112</sect1>
    107 
  • chapter07/hostname.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-hostname">
    7 <title>Configuring the localnet Script</title>
    8 <?dbhtml filename="hostname.html"?>
     9  <?dbhtml filename="hostname.html"?>
    910
    10 <indexterm zone="ch-scripts-hostname">
    11 <primary sortas="d-localnet">localnet</primary>
    12 <secondary>configuring</secondary></indexterm>
     11  <title>Configuring the localnet Script</title>
    1312
    14 <para>Part of the job of the <command>localnet</command> script is setting the
    15 system's hostname. This needs to be configured in the
    16 <filename>/etc/sysconfig/network</filename> file.</para>
     13  <indexterm zone="ch-scripts-hostname">
     14    <primary sortas="d-localnet">localnet</primary>
     15    <secondary>configuring</secondary>
     16  </indexterm>
    1717
    18 <para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
    19 hostname by running:</para>
     18  <para>Part of the job of the <command>localnet</command> script is setting the
     19  system's hostname. This needs to be configured in the
     20  <filename>/etc/sysconfig/network</filename> file.</para>
     21
     22  <para>Create the <filename>/etc/sysconfig/network</filename> file and enter a
     23  hostname by running:</para>
    2024
    2125<screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" &gt; /etc/sysconfig/network</userinput></screen>
    2226
    23 <para><replaceable>[lfs]</replaceable> needs to be replaced with the name given
    24 to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That
    25 information will be put in the <filename>/etc/hosts</filename> file in the next
    26 section.</para>
     27  <para><replaceable>[lfs]</replaceable> needs to be replaced with the name given
     28  to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That
     29  information will be put in the <filename>/etc/hosts</filename> file in the next
     30  section.</para>
    2731
    2832</sect1>
    29 
  • chapter07/hosts.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-hosts">
    7 <title>Creating the /etc/hosts File</title>
    8 <?dbhtml filename="hosts.html"?>
     9  <?dbhtml filename="hosts.html"?>
    910
    10 <indexterm zone="ch-scripts-hosts"><primary sortas="e-/etc/hosts">/etc/hosts</primary></indexterm>
     11  <title>Creating the /etc/hosts File</title>
    1112
    12 <indexterm zone="ch-scripts-hosts">
    13 <primary sortas="d-localnet">localnet</primary>
    14 <secondary>/etc/hosts</secondary></indexterm>
     13  <indexterm zone="ch-scripts-hosts">
     14    <primary sortas="e-/etc/hosts">/etc/hosts</primary>
     15  </indexterm>
    1516
    16 <indexterm zone="ch-scripts-hosts">
    17 <primary sortas="d-network">network</primary>
    18 <secondary>/etc/hosts</secondary></indexterm>
     17  <indexterm zone="ch-scripts-hosts">
     18    <primary sortas="d-localnet">localnet</primary>
     19  <secondary>/etc/hosts</secondary></indexterm>
    1920
    20 <para>If a network card is to be configured, decide on the IP address,
    21 FQDN, and possible aliases for use in the
    22 <filename>/etc/hosts</filename> file. The syntax is:</para>
     21  <indexterm zone="ch-scripts-hosts">
     22    <primary sortas="d-network">network</primary>
     23  <secondary>/etc/hosts</secondary></indexterm>
    2324
    24 <screen>&lt;IP address&gt; myhost.example.org aliases</screen>
     25  <para>If a network card is to be configured, decide on the IP address,
     26  FQDN, and possible aliases for use in the
     27  <filename>/etc/hosts</filename> file. The syntax is:</para>
    2528
    26 <para>Unless the computer is to be visible to the Internet (i.e.,
    27 there is a registered domain and a valid block of assigned IP
    28 addresses&mdash;most users do not have this), make sure that the IP
    29 address is in the private network IP address range. Valid ranges
    30 are:</para>
     29<screen><literal>&lt;IP address&gt; myhost.example.org aliases</literal></screen>
    3130
    32 <screen>        Class Networks
     31  <para>Unless the computer is to be visible to the Internet (i.e.,
     32  there is a registered domain and a valid block of assigned IP
     33  addresses&mdash;most users do not have this), make sure that the IP
     34  address is in the private network IP address range. Valid ranges
     35  are:</para>
     36
     37<screen><literal>       Class Networks
    3338        A     10.0.0.0
    3439        B     172.16.0.0 through 172.31.0.255
    35         C     192.168.0.0 through 192.168.255.255</screen>
     40        C     192.168.0.0 through 192.168.255.255</literal></screen>
    3641
    37 <para>A valid IP address could be 192.168.1.1. A valid FQDN for this
    38 IP could be www.linuxfromscratch.org (not recommended because this is
    39 a valid registered domain address and could cause domain name server
    40 issues).</para>
     42  <para>A valid IP address could be 192.168.1.1. A valid FQDN for this
     43  IP could be www.linuxfromscratch.org (not recommended because this is
     44  a valid registered domain address and could cause domain name server
     45  issues).</para>
    4146
    42 <para>Even if not using a network card, an FQDN is still required.
    43 This is necessary for certain programs to operate correctly.</para>
     47  <para>Even if not using a network card, an FQDN is still required.
     48  This is necessary for certain programs to operate correctly.</para>
    4449
    45 <para>Create the  <filename>/etc/hosts</filename> file by running:</para>
     50  <para>Create the  <filename>/etc/hosts</filename> file by running:</para>
    4651
    4752<screen><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"
     
    5459EOF</userinput></screen>
    5560
    56 <para>The <replaceable>[192.168.1.1]</replaceable> and
    57 <replaceable>[&lt;HOSTNAME&gt;.example.org]</replaceable>
    58 values need to be changed for specific users or requirements (if
    59 assigned an IP address by a network/system administrator and the
    60 machine will be connected to an existing network).</para>
     61  <para>The <replaceable>[192.168.1.1]</replaceable> and
     62  <replaceable>[&lt;HOSTNAME&gt;.example.org]</replaceable>
     63  values need to be changed for specific users or requirements (if
     64  assigned an IP address by a network/system administrator and the
     65  machine will be connected to an existing network).</para>
    6166
    62 <para>If a network card is not going to be configured, create the
    63 <filename>/etc/hosts</filename> file by running:</para>
     67  <para>If a network card is not going to be configured, create the
     68  <filename>/etc/hosts</filename> file by running:</para>
    6469
    6570<screen role="nodump"><userinput>cat &gt; /etc/hosts &lt;&lt; "EOF"
     
    7277
    7378</sect1>
    74 
  • chapter07/inputrc.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34   <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-inputrc">
    7 <title>Creating the /etc/inputrc File</title>
    8 <?dbhtml filename="inputrc.html"?>
     9  <?dbhtml filename="inputrc.html"?>
    910
    10 <indexterm zone="ch-scripts-inputrc"><primary sortas="e-/etc/inputrc">/etc/inputrc</primary></indexterm>
     11  <title>Creating the /etc/inputrc File</title>
    1112
    12 <para>The <filename>inputrc</filename> file handles keyboard mapping for
    13 specific situations. This file is the startup file used by Readline &mdash; the
    14 input-related library &mdash; used by Bash and most other shells.</para>
     13  <indexterm zone="ch-scripts-inputrc">
     14    <primary sortas="e-/etc/inputrc">/etc/inputrc</primary>
     15  </indexterm>
    1516
    16 <para>Most people do not need user-specific keyboard mappings so the command
    17 below creates a global <filename>/etc/inputrc</filename> used by everyone who
    18 logs in. If you later decide you need to override the defaults on a per-user
    19 basis, you can create a <filename>.inputrc</filename> file in the user's home
    20 directory with the modified mappings.</para>
     17  <para>The <filename>inputrc</filename> file handles keyboard mapping for
     18  specific situations. This file is the startup file used by Readline &mdash; the
     19  input-related library &mdash; used by Bash and most other shells.</para>
    2120
    22 <para>For more information on how to edit the <filename>inputrc</filename> file,
    23 see <command>info bash</command> under the <emphasis>Readline Init File</emphasis>
    24 section. <command>info readline</command> is also a good source of information.</para>
     21  <para>Most people do not need user-specific keyboard mappings so the command
     22  below creates a global <filename>/etc/inputrc</filename> used by everyone who
     23  logs in. If you later decide you need to override the defaults on a per-user
     24  basis, you can create a <filename>.inputrc</filename> file in the user's home
     25  directory with the modified mappings.</para>
    2526
    26 <para>Below is a generic global <filename>inputrc</filename> along with comments
    27 to explain what the various options do. Note that comments cannot be on the same
    28 line as commands. Create the file using the following command:</para>
     27  <para>For more information on how to edit the <filename>inputrc</filename>
     28  file, see <command>info bash</command> under the <emphasis>Readline Init
     29  File</emphasis> section. <command>info readline</command> is also a good
     30  source of information.</para>
     31
     32  <para>Below is a generic global <filename>inputrc</filename> along with comments
     33  to explain what the various options do. Note that comments cannot be on the same
     34  line as commands. Create the file using the following command:</para>
    2935
    3036<screen><userinput>cat &gt; /etc/inputrc &lt;&lt; "EOF"
     
    7581
    7682</sect1>
    77 
  • chapter07/introduction.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-introduction">
    7 <title>Introduction</title>
    8 <?dbhtml filename="introduction.html"?>
     9  <?dbhtml filename="introduction.html"?>
    910
    10 <para>This chapter details how to install and configure the LFS-Bootscripts
    11 package. Most of these scripts will work without modification, but a few require
    12 additional configuration files because they deal with hardware-dependent
    13 information.</para>
     11  <title>Introduction</title>
    1412
    15 <para>System-V style init scripts are employed in this book because they are
    16 widely used. For additional options, a hint detailing the BSD style
    17 init setup is available at
    18 <ulink
    19 url="http://www.linuxfromscratch.org/hints/downloads/files/bsd-init.txt"/>.
    20 Searching the LFS mailing lists for <quote>depinit</quote> will also offer
    21 additional choices.</para>
     13  <para>This chapter details how to install and configure the LFS-Bootscripts
     14  package. Most of these scripts will work without modification, but a few require
     15  additional configuration files because they deal with hardware-dependent
     16  information.</para>
    2217
    23 <para>If using an alternative style of init scripts, skip this chapter
    24 and move on to <xref linkend="chapter-bootable"/>.</para>
     18  <para>System-V style init scripts are employed in this book because they are
     19  widely used. For additional options, a hint detailing the BSD style init setup
     20  is available at <ulink
     21  url="http://www.linuxfromscratch.org/hints/downloads/files/bsd-init.txt"/>.
     22  Searching the LFS mailing lists for <quote>depinit</quote> will also offer
     23  additional choices.</para>
     24
     25  <para>If using an alternative style of init scripts, skip this chapter
     26  and move on to <xref linkend="chapter-bootable"/>.</para>
    2527
    2628</sect1>
    27 
  • chapter07/network.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-network">
    7 <title>Configuring the network Script</title>
    8 <?dbhtml filename="network.html"?>
     9  <?dbhtml filename="network.html"?>
    910
    10 <indexterm zone="ch-scripts-network">
    11 <primary sortas="d-network">network</primary>
    12 <secondary>configuring</secondary></indexterm>
     11  <title>Configuring the network Script</title>
    1312
    14 <para>This section only applies if a network card is to be
    15 configured.</para>
     13  <indexterm zone="ch-scripts-network">
     14    <primary sortas="d-network">network</primary>
     15  <secondary>configuring</secondary></indexterm>
    1616
    17 <para>If a network card will not be used, there is likely no need to
    18 create any configuration files relating to network cards. If that is
    19 the case, remove the <filename class="symlink">network</filename>
    20 symlinks from all run-level directories (<filename
    21 class="directory">/etc/rc.d/rc*.d</filename>).</para>
     17  <para>This section only applies if a network card is to be
     18  configured.</para>
    2219
    23 <sect2>
    24 <title>Creating Network Interface Configuration Files</title>
     20  <para>If a network card will not be used, there is likely no need to
     21  create any configuration files relating to network cards. If that is
     22  the case, remove the <filename class="symlink">network</filename>
     23  symlinks from all run-level directories (<filename
     24  class="directory">/etc/rc.d/rc*.d</filename>).</para>
    2525
    26 <!-- Edit Me -->
    27 <para>Which interfaces are brought up and down by the network script
    28 depends on the files and directories in the <filename
    29 class="directory">/etc/sysconfig/network-devices</filename> hierarchy.
    30 This directory should contain a sub-directory for each interface to be configured,
    31 such as <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a
    32 network interface name. Inside this directory would be files defining
    33 the attributes to this interface, such as its IP address(es), subnet
    34 masks, and so forth.</para>
     26  <sect2>
     27    <title>Creating Network Interface Configuration Files</title>
    3528
    36 <para>The following command creates a sample <filename>ipv4</filename> file for
    37 the <emphasis>eth0</emphasis> device:</para>
     29    <para>Which interfaces are brought up and down by the network script
     30    depends on the files and directories in the <filename
     31    class="directory">/etc/sysconfig/network-devices</filename> hierarchy.
     32    This directory should contain a sub-directory for each interface to be
     33    configured, such as <filename>ifconfig.xyz</filename>, where
     34    <quote>xyz</quote> is a network interface name. Inside this directory
     35    would be files defining the attributes to this interface, such as its IP
     36    address(es), subnet masks, and so forth.</para>
     37
     38    <para>The following command creates a sample <filename>ipv4</filename>
     39    file for the <emphasis>eth0</emphasis> device:</para>
    3840
    3941<screen><userinput>cd /etc/sysconfig/network-devices &amp;&amp;
     
    4850EOF</userinput></screen>
    4951
    50 <para>The values of these variables must be changed in every file to match the
    51 proper setup. If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote>
    52 the network script will bring up the Network Interface Card (NIC) during booting
    53 of the system. If set to anything but <quote>yes</quote> the NIC will be ignored
    54 by the network script and not be brought up.</para>
     52    <para>The values of these variables must be changed in every file to match
     53    the proper setup. If the <envar>ONBOOT</envar> variable is set to
     54    <quote>yes</quote> the network script will bring up the Network Interface
     55    Card (NIC) during booting of the system. If set to anything but
     56    <quote>yes</quote> the NIC will be ignored by the network script and not
     57    be brought up.</para>
    5558
    56 <para>The <envar>SERVICE</envar> variable defines the method used for obtaining
    57 the IP address. The LFS-Bootscripts package has a modular IP assignment format,
    58 and creating additional files in the <filename
    59 class="directory">/etc/sysconfig/network-devices/services</filename> directory
    60 allows other IP assignment methods. This is commonly used for Dynamic Host
    61 Configuration Protocol (DHCP), which is addressed in the BLFS book.</para>
     59    <para>The <envar>SERVICE</envar> variable defines the method used for
     60    obtaining the IP address. The LFS-Bootscripts package has a modular IP
     61    assignment format, and creating additional files in the <filename
     62    class="directory">/etc/sysconfig/network-devices/services</filename>
     63    directory allows other IP assignment methods. This is commonly used for
     64    Dynamic Host Configuration Protocol (DHCP), which is addressed in the
     65    BLFS book.</para>
    6266
    63 <para>The <envar>GATEWAY</envar> variable should contain
    64 the default gateway IP address, if one is present. If not, then comment out
    65 the variable entirely.</para>
     67    <para>The <envar>GATEWAY</envar> variable should contain the default
     68    gateway IP address, if one is present. If not, then comment out the
     69    variable entirely.</para>
    6670
    67 <para>The <envar>PREFIX</envar> variable needs to contain the number of bits
    68 used in the subnet. Each octet in an IP address is 8 bits. If the subnet's
    69 netmask is 255.255.255.0, then it is using the first three octets (24 bits) to
    70 specify the network number. If the netmask is 255.255.255.240, it would be using
    71 the first 28 bits.  Prefixes longer than 24 bits are commonly used by DSL and
    72 cable-based Internet Service Providers (ISPs). In this example (PREFIX=24), the
    73 netmask is 255.255.255.0. Adjust the <envar>PREFIX</envar> variable according to
    74 your specific subnet.</para>
     71    <para>The <envar>PREFIX</envar> variable needs to contain the number of
     72    bits used in the subnet. Each octet in an IP address is 8 bits. If the
     73    subnet's netmask is 255.255.255.0, then it is using the first three octets
     74    (24 bits) to specify the network number. If the netmask is 255.255.255.240,
     75    it would be using the first 28 bits.  Prefixes longer than 24 bits are
     76    commonly used by DSL and cable-based Internet Service Providers (ISPs).
     77    In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the
     78    <envar>PREFIX</envar> variable according to your specific subnet.</para>
    7579
    76 </sect2>
     80  </sect2>
    7781
    78 <sect2 id="resolv.conf">
    79 <title>Creating the /etc/resolv.conf File</title>
    80 <indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm>
     82  <sect2 id="resolv.conf">
     83    <title>Creating the /etc/resolv.conf File</title>
    8184
    82 <para>If the system is going to be connected to the Internet, it will
    83 need some means of Domain Name Service (DNS) name resolution to
    84 resolve Internet domain names to IP addresses, and vice versa. This is
    85 best achieved by placing the IP address of the DNS server, available
    86 from the ISP or network administrator, into
    87 <filename>/etc/resolv.conf</filename>. Create the file by running the
    88 following:</para>
     85    <indexterm zone="resolv.conf">
     86      <primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary>
     87    </indexterm>
     88
     89    <para>If the system is going to be connected to the Internet, it will
     90    need some means of Domain Name Service (DNS) name resolution to
     91    resolve Internet domain names to IP addresses, and vice versa. This is
     92    best achieved by placing the IP address of the DNS server, available
     93    from the ISP or network administrator, into
     94    <filename>/etc/resolv.conf</filename>. Create the file by running the
     95    following:</para>
    8996
    9097<screen><userinput>cat &gt; /etc/resolv.conf &lt;&lt; "EOF"
     
    98105EOF</userinput></screen>
    99106
    100 <para>Replace <replaceable>[IP address of the
    101 nameserver]</replaceable> with the IP address of the DNS most
    102 appropriate for the setup. There will often be more than one entry
    103 (requirements demand secondary servers for fallback capability). If
    104 you only need or want one DNS server, remove the second
    105 <emphasis>nameserver</emphasis> line from the file. The IP address may
    106 also be a router on the local network.</para>
    107 </sect2>
     107    <para>Replace <replaceable>[IP address of the nameserver]</replaceable>
     108    with the IP address of the DNS most appropriate for the setup. There will
     109    often be more than one entry (requirements demand secondary servers for
     110    fallback capability). If you only need or want one DNS server, remove the
     111    second <emphasis>nameserver</emphasis> line from the file. The IP address
     112    may also be a router on the local network.</para>
     113
     114  </sect2>
    108115
    109116</sect1>
    110 
  • chapter07/profile.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-profile">
    7 <title>The Bash Shell Startup Files</title>
    8 <?dbhtml filename="profile.html"?>
     9  <?dbhtml filename="profile.html"?>
    910
    10 <indexterm zone="ch-scripts-profile"><primary sortas="e-/etc/profile">/etc/profile</primary></indexterm>
     11  <title>The Bash Shell Startup Files</title>
    1112
    12 <para>The shell program <command>/bin/bash</command> (hereafter
    13 referred to as <quote>the shell</quote>) uses a collection of startup
    14 files to help create an environment to run in. Each file has a
    15 specific use and may affect login and interactive environments
    16 differently. The files in the <filename
    17 class="directory">/etc</filename> directory provide global settings.
    18 If an equivalent file exists in the home directory, it may override
    19 the global settings.</para>
     13  <indexterm zone="ch-scripts-profile">
     14    <primary sortas="e-/etc/profile">/etc/profile</primary>
     15  </indexterm>
    2016
    21 <para>An interactive login shell is started after a successful login,
    22 using <command>/bin/login</command>, by reading the
    23 <filename>/etc/passwd</filename> file. An interactive non-login shell
    24 is started at the command-line (e.g.,
    25 <prompt>[prompt]$</prompt><command>/bin/bash</command>). A
    26 non-interactive shell is usually present when a shell script is
    27 running. It is non-interactive because it is processing a script and
    28 not waiting for user input between commands.</para>
     17  <para>The shell program <command>/bin/bash</command> (hereafter referred to
     18  as <quote>the shell</quote>) uses a collection of startup files to help
     19  create an environment to run in. Each file has a specific use and may affect
     20  login and interactive environments differently. The files in the <filename
     21  class="directory">/etc</filename> directory provide global settings. If an
     22  equivalent file exists in the home directory, it may override the global
     23  settings.</para>
    2924
    30 <para>For more information, see <command>info bash</command> under the
    31 <emphasis>Bash Startup Files and Interactive Shells</emphasis> section.</para>
     25  <para>An interactive login shell is started after a successful login, using
     26  <command>/bin/login</command>, by reading the <filename>/etc/passwd</filename>
     27  file. An interactive non-login shell is started at the command-line (e.g.,
     28  <prompt>[prompt]$</prompt><command>/bin/bash</command>). A non-interactive
     29  shell is usually present when a shell script is running. It is non-interactive
     30  because it is processing a script and not waiting for user input between
     31  commands.</para>
    3232
    33 <para>The files <filename>/etc/profile</filename> and
    34 <filename>~/.bash_profile</filename> are read when the shell is
    35 invoked as an interactive login shell.</para>
     33  <para>For more information, see <command>info bash</command> under the
     34  <emphasis>Bash Startup Files and Interactive Shells</emphasis> section.</para>
    3635
    37 <para>The base <filename>/etc/profile</filename> below sets some
    38 environment variables necessary for native language support. Setting
    39 them properly results in:</para>
     36  <para>The files <filename>/etc/profile</filename> and
     37  <filename>~/.bash_profile</filename> are read when the shell is
     38  invoked as an interactive login shell.</para>
    4039
    41 <itemizedlist>
    42 <listitem><para>The output of programs translated into the native
    43 language</para></listitem>
    44 <listitem><para>Correct classification of characters into letters, digits and
    45 other classes. This is necessary for <command>bash</command> to properly accept
    46 non-ASCII characters in command lines in non-English locales</para></listitem>
    47 <listitem><para>The correct alphabetical sorting order for the
    48 country</para></listitem>
    49 <listitem><para>Appropriate default paper size</para></listitem>
    50 <listitem><para>Correct formatting of monetary, time, and date
    51 values</para></listitem>
    52 </itemizedlist>
     40  <para>The base <filename>/etc/profile</filename> below sets some
     41  environment variables necessary for native language support. Setting
     42  them properly results in:</para>
    5343
    54 <para>This script also sets the <envar>INPUTRC</envar> environment variable that
    55 makes Bash and Readline use the <filename>/etc/inputrc</filename> file created
    56 earlier.</para>
     44  <itemizedlist>
     45    <listitem>
     46      <para>The output of programs translated into the native language</para>
     47    </listitem>
     48    <listitem>
     49      <para>Correct classification of characters into letters, digits and other
     50      classes. This is necessary for <command>bash</command> to properly accept
     51      non-ASCII characters in command lines in non-English locales</para>
     52    </listitem>
     53    <listitem>
     54      <para>The correct alphabetical sorting order for the country</para>
     55    </listitem>
     56    <listitem>
     57      <para>Appropriate default paper size</para>
     58    </listitem>
     59    <listitem>
     60      <para>Correct formatting of monetary, time, and date values</para>
     61    </listitem>
     62  </itemizedlist>
    5763
    58 <para>Replace <replaceable>[ll]</replaceable> below with the
    59 two-letter code for the desired language (e.g., <quote>en</quote>) and
    60 <replaceable>[CC]</replaceable> with the two-letter code for the
    61 appropriate country (e.g., <quote>GB</quote>).
    62 <replaceable>[charmap]</replaceable> should be replaced with the
    63 canonical charmap for your chosen locale.</para>
     64  <para>This script also sets the <envar>INPUTRC</envar> environment variable that
     65  makes Bash and Readline use the <filename>/etc/inputrc</filename> file created
     66  earlier.</para>
    6467
    65 <para>The list of all locales supported by Glibc can be obtained by running
    66 the following command:</para>
     68  <para>Replace <replaceable>[ll]</replaceable> below with the two-letter code
     69  for the desired language (e.g., <quote>en</quote>) and
     70  <replaceable>[CC]</replaceable> with the two-letter code for the appropriate
     71  country (e.g., <quote>GB</quote>). <replaceable>[charmap]</replaceable> should
     72  be replaced with the canonical charmap for your chosen locale.</para>
     73
     74  <para>The list of all locales supported by Glibc can be obtained by running
     75  the following command:</para>
    6776
    6877<screen role="nodump"><userinput>locale -a</userinput></screen>
    6978
    70 <para>Locales can have a number of synonyms, e.g. <quote>ISO-8859-1</quote> is
    71 also referred to as <quote>iso8859-1</quote> and <quote>iso88591</quote>.
    72 Some applications cannot handle the various synonyms correctly, so it is safest
    73 to choose the canonical name for a particular locale.  To determine the
    74 canonical name, run the following command, where
    75 <replaceable>[locale name]</replaceable> is the output given by
    76 <command>locale -a</command> for your preferred locale
    77 (<quote>en_GB.iso88591</quote> in our example).</para>
     79  <para>Locales can have a number of synonyms, e.g. <quote>ISO-8859-1</quote>
     80  is also referred to as <quote>iso8859-1</quote> and <quote>iso88591</quote>.
     81  Some applications cannot handle the various synonyms correctly, so it is
     82  safest to choose the canonical name for a particular locale. To determine
     83  the canonical name, run the following command, where <replaceable>[locale
     84  name]</replaceable> is the output given by <command>locale -a</command> for
     85  your preferred locale (<quote>en_GB.iso88591</quote> in our example).</para>
    7886
    7987<screen role="nodump"><userinput>LC_ALL=<replaceable>[locale name]</replaceable> locale charmap</userinput></screen>
    8088
    81 <para>For the <quote>en_GB.iso88591</quote> locale, the above command
    82 will print:</para>
     89  <para>For the <quote>en_GB.iso88591</quote> locale, the above command
     90  will print:</para>
    8391
    84 <screen>ISO-8859-1</screen>
     92<screen><computeroutput>ISO-8859-1</computeroutput></screen>
    8593
    86 <para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.
    87 It is important that the locale found using the heuristic above is tested prior
    88 to it being added to the Bash startup files:</para>
     94  <para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>.
     95  It is important that the locale found using the heuristic above is tested prior
     96  to it being added to the Bash startup files:</para>
    8997
    9098<screen role="nodump"><userinput>LC_ALL=[locale name] locale country
     
    94102LC_ALL=[locale name] locale int_prefix</userinput></screen>
    95103
    96 <para>The above commands should print the country and language names, the
    97 character encoding used by the locale, the local currency and the prefix to dial
    98 before the telephone number in order to get into the country. If any of the
    99 commands above fail with a message similar to the one shown below, this means
    100 that your locale was either not installed in Chapter 6 or is not supported by
    101 the default installation of Glibc.</para>
     104  <para>The above commands should print the country and language names, the
     105  character encoding used by the locale, the local currency and the prefix to dial
     106  before the telephone number in order to get into the country. If any of the
     107  commands above fail with a message similar to the one shown below, this means
     108  that your locale was either not installed in Chapter 6 or is not supported by
     109  the default installation of Glibc.</para>
    102110
    103111<screen><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></screen>
    104112
    105 <para>If this happens, you should either install the desired locale using the <command>localedef</command> command, or consider choosing a different locale.
    106 Further instructions assume that there are no such error messages from Glibc.
    107 </para>
     113  <para>If this happens, you should either install the desired locale using the
     114  <command>localedef</command> command, or consider choosing a different locale.
     115  Further instructions assume that there are no such error messages from
     116  Glibc.</para>
    108117
    109 <para>Some packages beyond LFS may also lack support for your chosen locale. One
    110 example is the X library (part of the X Window System), which outputs the
    111 following error message:</para>
     118  <para>Some packages beyond LFS may also lack support for your chosen locale. One
     119  example is the X library (part of the X Window System), which outputs the
     120  following error message:</para>
    112121
    113122<screen><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></screen>
    114123
    115 <para>Sometimes it is possible to fix this by removing the charmap part of the
    116 locale specification, as long as that does not change the character map that
    117 Glibc associates with the locale (this can be checked by running the
    118 <command>locale charmap</command> command in both locales).  For example, one
    119 would have to change &quot;de_DE.ISO-8859-15@euro&quot; to
    120 &quot;de_DE@euro&quot; in order to get this locale recognized by Xlib.</para>
     124  <para>Sometimes it is possible to fix this by removing the charmap part of the
     125  locale specification, as long as that does not change the character map that
     126  Glibc associates with the locale (this can be checked by running the
     127  <command>locale charmap</command> command in both locales).  For example, one
     128  would have to change &quot;de_DE.ISO-8859-15@euro&quot; to
     129  &quot;de_DE@euro&quot; in order to get this locale recognized by Xlib.</para>
    121130
    122 <para>Other packages can also function incorrectly (but may not necessarily
    123 display any error messages) if the locale name does not meet their expectations.
    124 In those cases, investigating how other Linux distributions support your locale
    125 might provide some useful information.</para>
     131  <para>Other packages can also function incorrectly (but may not necessarily
     132  display any error messages) if the locale name does not meet their expectations.
     133  In those cases, investigating how other Linux distributions support your locale
     134  might provide some useful information.</para>
    126135
    127 <para>Once the proper locale settings have been determined, create the
    128 <filename>/etc/profile</filename> file:</para>
     136  <para>Once the proper locale settings have been determined, create the
     137  <filename>/etc/profile</filename> file:</para>
    129138
    130139<screen><userinput>cat &gt; /etc/profile &lt;&lt; "EOF"
     
    137146EOF</userinput></screen>
    138147
    139 <note><para>The <quote>C</quote> (default) and <quote>en_US</quote>
    140 (the recommended one for United States English users) locales are
    141 different.</para></note>
     148  <note>
     149    <para>The <quote>C</quote> (default) and <quote>en_US</quote> (the
     150    recommended one for United States English users) locales are different.</para>
     151  </note>
    142152
    143 <para>Setting the keyboard layout, screen font, and
    144 locale-related environment variables are the only internationalization
    145 steps needed to support locales that use ordinary single-byte
    146 encodings and left-to-right writing direction. More complex cases
    147 (including UTF-8 based locales) require additional steps and
    148 additional patches because many applications tend to not work properly
    149 under such conditions.  These steps and patches are not included in
    150 the LFS book and such locales are not yet supported by LFS.</para>
     153  <para>Setting the keyboard layout, screen font, and locale-related environment
     154  variables are the only internationalization steps needed to support locales
     155  that use ordinary single-byte encodings and left-to-right writing direction.
     156  More complex cases (including UTF-8 based locales) require additional steps
     157  and additional patches because many applications tend to not work properly
     158  under such conditions. These steps and patches are not included in the LFS
     159  book and such locales are not yet supported by LFS.</para>
    151160
    152161</sect1>
    153 
  • chapter07/setclock.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-setclock">
    7 <title>Configuring the setclock Script</title>
    8 <?dbhtml filename="setclock.html"?>
     9  <?dbhtml filename="setclock.html"?>
    910
    10 <indexterm zone="ch-scripts-setclock">
    11 <primary sortas="d-setclock">setclock</primary>
    12 <secondary>configuring</secondary></indexterm>
     11  <title>Configuring the setclock Script</title>
    1312
    14 <para>The <command>setclock</command> script reads the time from the hardware
    15 clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
    16 (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
    17 hardware clock's time to the local time using the
    18 <filename>/etc/localtime</filename> file (which tells the
    19 <command>hwclock</command> program which timezone the user is in). There is no
    20 way to detect whether or not the hardware clock is set to UTC, so this
    21 needs to be configured manually.</para>
     13  <indexterm zone="ch-scripts-setclock">
     14    <primary sortas="d-setclock">setclock</primary>
     15  <secondary>configuring</secondary></indexterm>
    2216
    23 <para>If you cannot remember whether or not the hardware clock is set to UTC,
    24 find out by running the <userinput>hwclock --localtime --show</userinput>
    25 command. This will display what the current time is according to the hardware
    26 clock. If this time matches whatever your watch says, then the hardware clock is
    27 set to local time. If the output from <command>hwclock</command> is not local
    28 time, chances are it is set to UTC time. Verify this by adding or subtracting
    29 the proper amount of hours for the timezone to the time shown by
    30 <command>hwclock</command>. For example, if you are currently in the MST
    31 timezone, which is also known as GMT -0700, add seven hours to the local
    32 time.</para>
     17  <para>The <command>setclock</command> script reads the time from the hardware
     18  clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor
     19  (CMOS) clock. If the hardware clock is set to UTC, this script will convert the
     20  hardware clock's time to the local time using the
     21  <filename>/etc/localtime</filename> file (which tells the
     22  <command>hwclock</command> program which timezone the user is in). There is no
     23  way to detect whether or not the hardware clock is set to UTC, so this
     24  needs to be configured manually.</para>
    3325
    34 <para>Change the value of the <envar>UTC</envar> variable below
    35 to a value of <parameter>0</parameter> (zero) if the hardware clock
    36 is <emphasis>not</emphasis> set to UTC time.</para>
     26  <para>If you cannot remember whether or not the hardware clock is set to UTC,
     27  find out by running the <userinput>hwclock --localtime --show</userinput>
     28  command. This will display what the current time is according to the hardware
     29  clock. If this time matches whatever your watch says, then the hardware clock is
     30  set to local time. If the output from <command>hwclock</command> is not local
     31  time, chances are it is set to UTC time. Verify this by adding or subtracting
     32  the proper amount of hours for the timezone to the time shown by
     33  <command>hwclock</command>. For example, if you are currently in the MST
     34  timezone, which is also known as GMT -0700, add seven hours to the local
     35  time.</para>
    3736
    38 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
    39 the following:</para>
     37  <para>Change the value of the <envar>UTC</envar> variable below
     38  to a value of <parameter>0</parameter> (zero) if the hardware clock
     39  is <emphasis>not</emphasis> set to UTC time.</para>
     40
     41  <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running
     42  the following:</para>
    4043
    4144<screen><userinput>cat &gt; /etc/sysconfig/clock &lt;&lt; "EOF"
     
    4750EOF</userinput></screen>
    4851
    49 <para>A good hint explaining how to deal with time on LFS is available
    50 at <ulink url="&hints-root;time.txt"/>. It explains issues such as
    51 time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
     52  <para>A good hint explaining how to deal with time on LFS is available
     53  at <ulink url="&hints-root;time.txt"/>. It explains issues such as
     54  time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
    5255
    5356</sect1>
    54 
  • chapter07/sysklogd.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-sysklogd">
    7 <title>Configuring the sysklogd script</title>
    8 <?dbhtml filename="sysklogd.html"?>
     9  <?dbhtml filename="sysklogd.html"?>
    910
    10 <indexterm zone="ch-scripts-sysklogd">
    11 <primary sortas="d-sysklogd">sysklogd</primary>
    12 <secondary>configuring</secondary></indexterm>
     11  <title>Configuring the sysklogd script</title>
    1312
    14 <para>The <filename>sysklogd</filename> script invokes the
    15 <command>syslogd</command> program with the <parameter>-m 0</parameter> option.
    16 This option turns off the periodic timestamp mark that
    17 <command>syslogd</command> writes to the log files every 20 minutes by default.
    18 If you want to turn on this periodic timestamp mark, edit the
    19 <filename>sysklogd</filename> script and make the changes accordingly. See
    20 <userinput>man syslogd</userinput> for more information.</para>
     13  <indexterm zone="ch-scripts-sysklogd">
     14    <primary sortas="d-sysklogd">sysklogd</primary>
     15    <secondary>configuring</secondary>
     16  </indexterm>
     17
     18  <para>The <filename>sysklogd</filename> script invokes the
     19  <command>syslogd</command> program with the <parameter>-m 0</parameter> option.
     20  This option turns off the periodic timestamp mark that
     21  <command>syslogd</command> writes to the log files every 20 minutes by default.
     22  If you want to turn on this periodic timestamp mark, edit the
     23  <filename>sysklogd</filename> script and make the changes accordingly. See
     24  <userinput>man syslogd</userinput> for more information.</para>
    2125
    2226</sect1>
  • chapter07/udev.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-udev">
    7 <title>Device and Module Handling on an LFS System</title>
    8 <?dbhtml filename="udev.html"?>
    9 
    10 <indexterm zone="ch-scripts-udev">
    11 <primary sortas="a-Udev">Udev</primary>
    12 <secondary>usage</secondary></indexterm>
    13 
    14 <para>In <xref linkend="chapter-building-system"/>, we installed the Udev
    15 package. Before we go into the details regarding how this works,
    16 a brief history of previous methods of handling devices is in
    17 order.</para>
    18 
    19 <para>Linux systems in general traditionally use a static device creation
    20 method, whereby a great many device nodes are created under <filename
    21 class="directory">/dev</filename> (sometimes literally thousands of nodes),
    22 regardless of whether the corresponding hardware devices actually exist. This is
    23 typically done via a <command>MAKEDEV</command> script, which contains a number
    24 of calls to the <command>mknod</command> program with the relevant major and
    25 minor device numbers for every possible device that might exist in the world.
    26 Using the Udev method, only those devices which are detected by the kernel get
    27 device nodes created for them. Because these device nodes will be created each
    28 time the system boots, they will be stored on a <systemitem
    29 class="filesystem">tmpfs</systemitem> file system (a virtual file system that
    30 resides entirely in system memory). Device nodes do not require much space, so
    31 the memory that is used is negligible.</para>
    32 
    33 <sect2>
    34 <title>History</title>
    35 
    36 <para>In February 2000, a new filesystem called <systemitem
    37 class="filesystem">devfs</systemitem> was merged into the 2.3.46
    38 kernel and was made available during the 2.4 series of
    39 stable kernels.  Although it was present in the kernel source itself,
    40 this method of creating devices dynamically never received
    41 overwhelming support from the core kernel developers.</para>
    42 
    43 <para>The main problem with the approach adopted by <systemitem
    44 class="filesystem">devfs</systemitem> was the way it handled
    45 device detection, creation, and naming. The latter issue, that of
    46 device node naming, was perhaps the most critical. It is generally
    47 accepted that if device names are allowed to be configurable, then
    48 the device naming policy should be up to a system administrator, not
    49 imposed on them by any particular developer(s). The <systemitem
    50 class="filesystem">devfs</systemitem> file system also suffers from race
    51 conditions that are inherent in its design and cannot be fixed
    52 without a substantial revision to the kernel. It has also been marked
    53 as deprecated due to a lack of recent maintenance.</para>
    54 
    55 <para>With the development of the unstable 2.5 kernel tree, later released as
    56 the 2.6 series of stable kernels, a new virtual filesystem called <systemitem
    57 class="filesystem">sysfs</systemitem> came to be. The job of <systemitem
    58 class="filesystem">sysfs</systemitem> is to export a view of the system's
    59 hardrware configuration to userspace processes. With this userspace-visible
    60 representation, the possibility of seeing a userspace replacement for
    61 <systemitem class="filesystem">devfs</systemitem> became much more
    62 realistic.</para>
    63 
    64 </sect2>
    65 
    66 <sect2>
    67 <title>Udev Implementation</title>
    68 
    69 <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
    70 mentioned briefly above. One may wonder how <systemitem
    71 class="filesystem">sysfs</systemitem> knows about the devices present on a
    72 system and what device numbers should be used for them. Drivers that have been
    73 compiled into the kernel directly register their objects with <systemitem
    74 class="filesystem">sysfs</systemitem> as they are detected by the kernel. For
    75 drivers compiled as modules, this registration will happen when the module is
    76 loaded. Once the <systemitem class="filesystem">sysfs</systemitem> filesystem is
    77 mounted (on <filename class="directory">/sys</filename>), data which the
    78 built-in drivers registered with <systemitem
    79 class="filesystem">sysfs</systemitem> are available to userspace processes and
    80 to <command>udev</command> for device node creation.</para>
    81 
    82 <para>The <command>S10udev</command> initscript takes care of creating these
    83 device nodes when Linux is booted. This script starts by registering
    84 <command>/sbin/udevsend</command> as a hotplug event handler. Hotplug events
    85 (discussed below) are not usually generated during this stage, but
    86 <command>udev</command> is registered just in case they do occur. The
    87 <command>udevstart</command> program then walks through the <systemitem
    88 class="filesystem">/sys</systemitem> filesystem and creates devices under
    89 <filename class="directory">/dev</filename> that match the descriptions. For
    90 example, <filename>/sys/class/tty/vcs/dev</filename> contains the string
    91 <quote>7:0</quote> This string is used by <command>udevstart</command> to create
    92 <filename>/dev/vcs</filename> with major number <emphasis>7</emphasis> and minor
    93 <emphasis>0</emphasis>. The names and permissions of the nodes created under
    94 the <filename class="directory">/dev</filename> directory are configured
    95 according to the rules specified in the files within the <filename
    96 class="directory">/etc/udev/rules.d/</filename> directory. These are numbered in
    97 a similar fashion to the LFS-Bootscripts package. If <command>udev</command>
    98 can't find a rule for the device it is creating, it will default permissions to
    99 <emphasis>660</emphasis> and ownership to <emphasis>root:root</emphasis>.</para>
    100 
    101 <para>Once the above stage is complete, all devices that were already present
    102 and have compiled-in drivers will be available for use. This leads us to the
    103 devices that have modular drivers.</para>
    104 
    105 <para>Earlier, we mentioned the concept of a <quote>hotplug event
    106 handler.</quote> When a new device connection is detected by the kernel, the
    107 kernel will generate a hotplug event and look at the file
    108 <filename>/proc/sys/kernel/hotplug</filename> to determine the userspace program
    109 that handles the device's connection. The <command>udev</command> bootscript
    110 registered <command>udevsend</command> as this handler. When these hotplug
    111 events are generated, the kernel will tell <command>udev</command> to check the
    112 <filename class="directory">/sys</filename> filesystem for the information
    113 pertaining to this new device and create the <filename
    114 class="directory">/dev</filename> entry for it.</para>
    115 
    116 <para>This brings us to one problem that exists with <command>udev</command>,
    117 and likewise with <systemitem class="filesystem">devfs</systemitem> before it.
    118 It is commonly referred to as the <quote>chicken and egg</quote> problem. Most
    119 Linux distributions handle loading modules via entries in
    120 <filename>/etc/modules.conf</filename>. Access to a device node causes the
    121 appropriate kernel module to load. With <command>udev</command>, this method
    122 will not work because the device node does not exist until the module is loaded.
    123 To solve this, the <command>S05modules</command> bootscript was added to the
    124 LFS-Bootscripts package, along with the
    125 <filename>/etc/sysconfig/modules</filename> file. By adding module names to the
    126 <filename>modules</filename> file, these modules will be loaded when the
    127 computer starts up. This allows <command>udev</command> to detect the devices
    128 and create the appropriate device nodes.</para>
    129 
    130 <para>Note that on slower machines or for drivers that create a lot
    131 of device nodes, the process of creating devices may take a few
    132 seconds to complete. This means that some device nodes may not be
    133 immediately accessible.</para>
    134 </sect2>
    135 
    136 <sect2>
    137 <title>Handling Hotpluggable/Dynamic Devices</title>
    138 
    139 <para>When you plug in a device, such as a Universal Serial Bus (USB) MP3 player, the kernel
    140 recognizes that the device is now connected and generates a hotplug
    141 event. If the driver is already loaded (either because it was compiled
    142 into the kernel or because it was loaded via the
    143 <command>S05modules</command> bootscript), <command>udev</command> will
    144 be called upon to create the relevant device node(s) according to the
    145 <systemitem class="filesystem">sysfs</systemitem> data available in
    146 <filename class="directory">/sys</filename>.</para>
    147 
    148 <para>If the driver for the just plugged in device is available as a module but
    149 currently unloaded, the Hotplug package will load the appropriate module
    150 and make this device available by creating the device node(s) for it.</para>
    151 </sect2>
    152 
    153 <sect2>
    154 <title>Problems with Creating Devices</title>
    155 
    156 <para>There are a few known problems when it comes to automatically creating
    157 device nodes:</para>
    158 
    159 <para>1) A kernel driver may not export its data to <systemitem
    160 class="filesystem">sysfs</systemitem>.</para>
    161    
    162 <para>This is most common with third party drivers from outside the kernel tree.
    163 Udev will be unable to automatically create device nodes for such drivers. Use
    164 the <filename>/etc/sysconfig/createfiles</filename> configuration file to
    165 manually create the devices. Consult the <filename>devices.txt</filename> file
    166 inside the kernel documentation or the documentation for that driver to find the
    167 proper major/minor numbers.</para>
    168 
    169 <para>2) A non-hardware device is required.  This is most common with
    170 the Advanced Linux Sound Architecture (ALSA) project's Open Sound
    171 System (OSS) compatibility module.  These types of devices can be
    172 handled in one of two ways:</para>
    173 
    174 <itemizedlist>
    175 
    176 <listitem><para>Adding the module names to
    177 <filename>/etc/sysconfig/modules</filename></para></listitem>
    178 <listitem><para>Using an
    179 <quote>install</quote> line in
    180 <filename>/etc/modprobe.conf</filename>. This tells the
    181 <command>modprobe</command> command <quote>when loading this module,
    182 also load this other module, at the same time.</quote>  For example:</para>
     9  <?dbhtml filename="udev.html"?>
     10
     11  <title>Device and Module Handling on an LFS System</title>
     12
     13  <indexterm zone="ch-scripts-udev">
     14    <primary sortas="a-Udev">Udev</primary>
     15    <secondary>usage</secondary>
     16  </indexterm>
     17
     18  <para>In <xref linkend="chapter-building-system"/>, we installed the Udev
     19  package. Before we go into the details regarding how this works,
     20  a brief history of previous methods of handling devices is in
     21  order.</para>
     22
     23  <para>Linux systems in general traditionally use a static device creation
     24  method, whereby a great many device nodes are created under <filename
     25  class="directory">/dev</filename> (sometimes literally thousands of nodes),
     26  regardless of whether the corresponding hardware devices actually exist. This is
     27  typically done via a <command>MAKEDEV</command> script, which contains a number
     28  of calls to the <command>mknod</command> program with the relevant major and
     29  minor device numbers for every possible device that might exist in the world.
     30  Using the Udev method, only those devices which are detected by the kernel get
     31  device nodes created for them. Because these device nodes will be created each
     32  time the system boots, they will be stored on a <systemitem
     33  class="filesystem">tmpfs</systemitem> file system (a virtual file system that
     34  resides entirely in system memory). Device nodes do not require much space, so
     35  the memory that is used is negligible.</para>
     36
     37  <sect2>
     38    <title>History</title>
     39
     40    <para>In February 2000, a new filesystem called <systemitem
     41    class="filesystem">devfs</systemitem> was merged into the 2.3.46 kernel
     42    and was made available during the 2.4 series of stable kernels. Although
     43    it was present in the kernel source itself, this method of creating devices
     44    dynamically never received overwhelming support from the core kernel
     45    developers.</para>
     46
     47    <para>The main problem with the approach adopted by <systemitem
     48    class="filesystem">devfs</systemitem> was the way it handled device
     49    detection, creation, and naming. The latter issue, that of device node
     50    naming, was perhaps the most critical. It is generally accepted that if
     51    device names are allowed to be configurable, then the device naming policy
     52    should be up to a system administrator, not imposed on them by any
     53    particular developer(s). The <systemitem class="filesystem">devfs</systemitem>
     54    file system also suffers from race conditions that are inherent in its design
     55    and cannot be fixed without a substantial revision to the kernel. It has also
     56    been marked as deprecated due to a lack of recent maintenance.</para>
     57
     58    <para>With the development of the unstable 2.5 kernel tree, later released as
     59    the 2.6 series of stable kernels, a new virtual filesystem called <systemitem
     60    class="filesystem">sysfs</systemitem> came to be. The job of <systemitem
     61    class="filesystem">sysfs</systemitem> is to export a view of the system's
     62    hardrware configuration to userspace processes. With this userspace-visible
     63    representation, the possibility of seeing a userspace replacement for
     64    <systemitem class="filesystem">devfs</systemitem> became much more
     65    realistic.</para>
     66
     67  </sect2>
     68
     69  <sect2>
     70    <title>Udev Implementation</title>
     71
     72    <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem was
     73    mentioned briefly above. One may wonder how <systemitem
     74    class="filesystem">sysfs</systemitem> knows about the devices present on
     75    a system and what device numbers should be used for them. Drivers that have
     76    been compiled into the kernel directly register their objects with
     77    <systemitem class="filesystem">sysfs</systemitem> as they are detected by
     78    the kernel. For drivers compiled as modules, this registration will happen
     79    when the module is loaded. Once the <systemitem
     80    class="filesystem">sysfs</systemitem> filesystem is mounted (on <filename
     81    class="directory">/sys</filename>), data which the built-in drivers
     82    registered with <systemitem class="filesystem">sysfs</systemitem> are
     83    available to userspace processes and to <command>udev</command> for device
     84    node creation.</para>
     85
     86    <para>The <command>S10udev</command> initscript takes care of creating
     87    these device nodes when Linux is booted. This script starts by registering
     88    <command>/sbin/udevsend</command> as a hotplug event handler. Hotplug events
     89    (discussed below) are not usually generated during this stage, but
     90    <command>udev</command> is registered just in case they do occur. The
     91    <command>udevstart</command> program then walks through the <systemitem
     92    class="filesystem">/sys</systemitem> filesystem and creates devices under
     93    <filename class="directory">/dev</filename> that match the descriptions.
     94    For example, <filename>/sys/class/tty/vcs/dev</filename> contains the
     95    string <quote>7:0</quote> This string is used by <command>udevstart</command>
     96    to create <filename>/dev/vcs</filename> with major number
     97    <emphasis>7</emphasis> and minor <emphasis>0</emphasis>. The names and
     98    permissions of the nodes created under the <filename
     99    class="directory">/dev</filename> directory are configured according to the
     100    rules specified in the files within the <filename
     101    class="directory">/etc/udev/rules.d/</filename> directory. These are
     102    numbered in a similar fashion to the LFS-Bootscripts package. If
     103    <command>udev</command> can't find a rule for the device it is creating,
     104    it will default permissions to <emphasis>660</emphasis> and ownership to
     105    <emphasis>root:root</emphasis>.</para>
     106
     107    <para>Once the above stage is complete, all devices that were already present
     108    and have compiled-in drivers will be available for use. This leads us to the
     109    devices that have modular drivers.</para>
     110
     111    <para>Earlier, we mentioned the concept of a <quote>hotplug event
     112    handler.</quote> When a new device connection is detected by the kernel,
     113    the kernel will generate a hotplug event and look at the file
     114    <filename>/proc/sys/kernel/hotplug</filename> to determine the userspace
     115    program that handles the device's connection. The <command>udev</command>
     116    bootscript registered <command>udevsend</command> as this handler. When
     117    these hotplug events are generated, the kernel will tell
     118    <command>udev</command> to check the <filename
     119    class="directory">/sys</filename> filesystem for the information pertaining
     120    to this new device and create the <filename class="directory">/dev</filename>
     121    entry for it.</para>
     122
     123    <para>This brings us to one problem that exists with <command>udev</command>,
     124    and likewise with <systemitem class="filesystem">devfs</systemitem> before it.
     125    It is commonly referred to as the <quote>chicken and egg</quote> problem. Most
     126    Linux distributions handle loading modules via entries in
     127    <filename>/etc/modules.conf</filename>. Access to a device node causes the
     128    appropriate kernel module to load. With <command>udev</command>, this method
     129    will not work because the device node does not exist until the module is loaded.
     130    To solve this, the <command>S05modules</command> bootscript was added to the
     131    LFS-Bootscripts package, along with the
     132    <filename>/etc/sysconfig/modules</filename> file. By adding module names to the
     133    <filename>modules</filename> file, these modules will be loaded when the
     134    computer starts up. This allows <command>udev</command> to detect the devices
     135    and create the appropriate device nodes.</para>
     136
     137    <para>Note that on slower machines or for drivers that create a lot of device
     138    nodes, the process of creating devices may take a few seconds to complete.
     139    This means that some device nodes may not be immediately accessible.</para>
     140
     141  </sect2>
     142
     143  <sect2>
     144    <title>Handling Hotpluggable/Dynamic Devices</title>
     145
     146    <para>When you plug in a device, such as a Universal Serial Bus (USB) MP3
     147    player, the kernel recognizes that the device is now connected and generates
     148    a hotplug event. If the driver is already loaded (either because it was
     149    compiled into the kernel or because it was loaded via the
     150    <command>S05modules</command> bootscript), <command>udev</command> will be
     151    called upon to create the relevant device node(s) according to the
     152    <systemitem class="filesystem">sysfs</systemitem> data available in
     153    <filename class="directory">/sys</filename>.</para>
     154
     155    <para>If the driver for the just plugged in device is available as a module but
     156    currently unloaded, the Hotplug package will load the appropriate module
     157    and make this device available by creating the device node(s) for it.</para>
     158
     159  </sect2>
     160
     161  <sect2>
     162    <title>Problems with Creating Devices</title>
     163
     164    <para>There are a few known problems when it comes to automatically creating
     165    device nodes:</para>
     166
     167    <para>1) A kernel driver may not export its data to <systemitem
     168    class="filesystem">sysfs</systemitem>.</para>
     169
     170    <para>This is most common with third party drivers from outside the kernel
     171    tree. Udev will be unable to automatically create device nodes for such
     172    drivers. Use the <filename>/etc/sysconfig/createfiles</filename>
     173    configuration file to manually create the devices. Consult the
     174    <filename>devices.txt</filename> file inside the kernel documentation or
     175    the documentation for that driver to find the proper major/minor
     176    numbers.</para>
     177
     178    <para>2) A non-hardware device is required.  This is most common with
     179    the Advanced Linux Sound Architecture (ALSA) project's Open Sound
     180    System (OSS) compatibility module.  These types of devices can be
     181    handled in one of two ways:</para>
     182
     183    <itemizedlist>
     184
     185      <listitem>
     186        <para>Adding the module names to
     187        <filename>/etc/sysconfig/modules</filename></para>
     188      </listitem>
     189
     190      <listitem>
     191        <para>Using an <quote>install</quote> line in
     192        <filename>/etc/modprobe.conf</filename>. This tells the
     193        <command>modprobe</command> command <quote>when loading this module,
     194        also load this other module, at the same time.</quote>
     195        For example:</para>
    183196
    184197<screen role="nodump"><userinput>install snd-pcm modprobe -i snd-pcm ; modprobe \
    185198    snd-pcm-oss ; true</userinput></screen>
    186199
    187 <para>This will cause the system to load both the
    188 <emphasis>snd-pcm</emphasis> and <emphasis>snd-pcm-oss</emphasis>
    189 modules when any request is made to load the driver
    190 <emphasis>snd-pcm</emphasis>.</para></listitem>
    191 </itemizedlist>
    192 </sect2>
    193 
    194 <sect2>
    195 <title>Useful Reading</title>
    196 
    197 <para>Additional helpful documentation is available at the following
    198 sites:</para>
    199 
    200 <itemizedlist>
    201 <listitem><para>A Userspace Implementation of <systemitem class="filesystem">devfs</systemitem>
    202 <ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para></listitem>
    203 
    204 <listitem><para>udev FAQ
    205 <ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ"/></para></listitem>
    206 
    207 <listitem><para>The Linux Kernel Driver Model
    208 <ulink url="http://public.planetmirror.com/pub/lca/2003/proceedings/papers/Patrick_Mochel/Patrick_Mochel.pdf"/></para></listitem>
    209 </itemizedlist>
    210 </sect2>
     200        <para>This will cause the system to load both the
     201        <emphasis>snd-pcm</emphasis> and <emphasis>snd-pcm-oss</emphasis>
     202        modules when any request is made to load the driver
     203        <emphasis>snd-pcm</emphasis>.</para>
     204      </listitem>
     205
     206    </itemizedlist>
     207
     208  </sect2>
     209
     210  <sect2>
     211    <title>Useful Reading</title>
     212
     213    <para>Additional helpful documentation is available at the following
     214    sites:</para>
     215
     216    <itemizedlist>
     217
     218      <listitem>
     219        <para>A Userspace Implementation of <systemitem class="filesystem">devfs</systemitem>
     220        <ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para>
     221      </listitem>
     222
     223      <listitem>
     224        <para>udev FAQ
     225        <ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev-FAQ"/></para>
     226      </listitem>
     227
     228      <listitem>
     229        <para>The Linux Kernel Driver Model
     230        <ulink url="http://public.planetmirror.com/pub/lca/2003/proceedings/papers/Patrick_Mochel/Patrick_Mochel.pdf"/></para>
     231      </listitem>
     232
     233    </itemizedlist>
     234
     235  </sect2>
    211236
    212237</sect1>
    213 
  • chapter07/usage.xml

    rb78c747 rd781ffb  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    2 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
     2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
     3  "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
    34  <!ENTITY % general-entities SYSTEM "../general.ent">
    45  %general-entities;
    56]>
     7
    68<sect1 id="ch-scripts-usage">
    7 <title>How Do These Bootscripts Work?</title>
    8 <?dbhtml filename="usage.html"?>
     9  <?dbhtml filename="usage.html"?>
    910
    10 <indexterm zone="ch-scripts-usage">
    11 <primary sortas="a-Bootscripts">Bootscripts</primary>
    12 <secondary>usage</secondary></indexterm>
     11  <title>How Do These Bootscripts Work?</title>
    1312
    14 <para>Linux uses a special booting facility named SysVinit that is based on a
    15 concept of <emphasis>run-levels</emphasis>. It can be quite different from one
    16 system to another, so it cannot be assumed that because things worked in one
    17 particular Linux distribution, they should work the same in LFS too. LFS has its
    18 own way of doing things, but it respects generally accepted standards.</para>
     13  <indexterm zone="ch-scripts-usage">
     14    <primary sortas="a-Bootscripts">Bootscripts</primary>
     15    <secondary>usage</secondary>
     16  </indexterm>
    1917
    20 <para>SysVinit (which will be referred to as <quote>init</quote> from now on)
    21 works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels
    22 (actually, there are more run-levels, but they are for special cases and are
    23 generally not used. See <filename>init(8)</filename> for more details), and each one
    24 of those corresponds to the actions the computer is supposed to perform when it
    25 starts up. The default run-level is 3. Here are the descriptions of the
    26 different run-levels as they are implemented:</para>
     18  <para>Linux uses a special booting facility named SysVinit that is based on a
     19  concept of <emphasis>run-levels</emphasis>. It can be quite different from one
     20  system to another, so it cannot be assumed that because things worked in one
     21  particular Linux distribution, they should work the same in LFS too. LFS has its
     22  own way of doing things, but it respects generally accepted standards.</para>
     23
     24  <para>SysVinit (which will be referred to as <quote>init</quote> from now on)
     25  works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels
     26  (actually, there are more run-levels, but they are for special cases and are
     27  generally not used. See <filename>init(8)</filename> for more details), and
     28  each one of those corresponds to the actions the computer is supposed to
     29  perform when it starts up. The default run-level is 3. Here are the
     30  descriptions of the different run-levels as they are implemented:</para>
    2731
    2832<literallayout>0: halt the computer
     
    34386: reboot the computer</literallayout>
    3539
    36 <para>The command used to change run-levels is <command>init
    37 <replaceable>[runlevel]</replaceable></command>, where
    38 <replaceable>[runlevel]</replaceable> is the target run-level. For example, to
    39 reboot the computer, a user could issue the <command>init 6</command> command,
    40 which is an alias for the <command>reboot</command> command. Likewise,
    41 <command>init 0</command> is an alias for the <command>halt</command>
    42 command.</para>
     40  <para>The command used to change run-levels is <command>init
     41  <replaceable>[runlevel]</replaceable></command>, where
     42  <replaceable>[runlevel]</replaceable> is the target run-level. For example, to
     43  reboot the computer, a user could issue the <command>init 6</command> command,
     44  which is an alias for the <command>reboot</command> command. Likewise,
     45  <command>init 0</command> is an alias for the <command>halt</command>
     46  command.</para>
    4347
    44 <para>There are a number of directories under <filename
    45 class="directory">/etc/rc.d</filename> that look like <filename
    46 class="directory">rc?.d</filename> (where ? is the number of the run-level) and
    47 <filename class="directory">rcsysinit.d</filename>, all containing a number of
    48 symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with
    49 an <emphasis>S</emphasis>, and all of them have two numbers following the
    50 initial letter. The K means to stop (kill) a service and the S means to start a
    51 service. The numbers determine the order in which the scripts are run, from 00
    52 to 99&mdash;the lower the number the earlier it gets executed. When
    53 <command>init</command> switches to another run-level, the appropriate services
    54 are either started or stopped, depending on the runlevel chosen.</para>
     48  <para>There are a number of directories under <filename
     49  class="directory">/etc/rc.d</filename> that look like <filename
     50  class="directory">rc?.d</filename> (where ? is the number of the run-level) and
     51  <filename class="directory">rcsysinit.d</filename>, all containing a number of
     52  symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with
     53  an <emphasis>S</emphasis>, and all of them have two numbers following the
     54  initial letter. The K means to stop (kill) a service and the S means to start a
     55  service. The numbers determine the order in which the scripts are run, from 00
     56  to 99&mdash;the lower the number the earlier it gets executed. When
     57  <command>init</command> switches to another run-level, the appropriate services
     58  are either started or stopped, depending on the runlevel chosen.</para>
    5559
    56 <para>The real scripts are in <filename
    57 class="directory">/etc/rc.d/init.d</filename>. They do the actual
    58 work, and the symlinks all point to them. Killing links and starting
    59 links point to the same script in <filename
    60 class="directory">/etc/rc.d/init.d</filename>. This is because the
    61 scripts can be called with different parameters like
    62 <parameter>start</parameter>, <parameter>stop</parameter>,
    63 <parameter>restart</parameter>, <parameter>reload</parameter>, and
    64 <parameter>status</parameter>. When a K link is encountered, the
    65 appropriate script is run with the <parameter>stop</parameter>
    66 argument. When an S link is encountered, the appropriate script is run
    67 with the <parameter>start</parameter> argument.</para>
     60  <para>The real scripts are in <filename
     61  class="directory">/etc/rc.d/init.d</filename>. They do the actual work, and
     62  the symlinks all point to them. Killing links and starting links point to
     63  the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
     64  This is because the scripts can be called with different parameters like
     65  <parameter>start</parameter>, <parameter>stop</parameter>,
     66  <parameter>restart</parameter>, <parameter>reload</parameter>, and
     67  <parameter>status</parameter>. When a K link is encountered, the appropriate
     68  script is run with the <parameter>stop</parameter> argument. When an S link
     69  is encountered, the appropriate script is run with the
     70  <parameter>start</parameter> argument.</para>
    6871
    69 <para>There is one exception to this explanation. Links that start
    70 with an <emphasis>S</emphasis> in the <filename
    71 class="directory">rc0.d</filename> and <filename
    72 class="directory">rc6.d</filename> directories will not cause anything
    73 to be started. They will be called with the parameter
    74 <parameter>stop</parameter> to stop something. The logic behind this
    75 is that when a user is going to reboot or halt the system, nothing
    76 needs to be started.  The system only needs to be stopped.</para>
     72  <para>There is one exception to this explanation. Links that start
     73  with an <emphasis>S</emphasis> in the <filename
     74  class="directory">rc0.d</filename> and <filename
     75  class="directory">rc6.d</filename> directories will not cause anything
     76  to be started. They will be called with the parameter
     77  <parameter>stop</parameter> to stop something. The logic behind this
     78  is that when a user is going to reboot or halt the system, nothing
     79  needs to be started.  The system only needs to be stopped.</para>
    7780
    78 <para>These are descriptions of what the arguments make the scripts
    79 do:</para>
     81  <para>These are descriptions of what the arguments make the scripts
     82  do:</para>
    8083
    81 <variablelist>
    82 <varlistentry>
    83 <term><parameter>start</parameter></term>
    84 <listitem><para>The service is started.</para></listitem>
    85 </varlistentry>
     84  <variablelist>
    8685
    87 <varlistentry>
    88 <term><parameter>stop</parameter></term>
    89 <listitem><para>The service is stopped.</para></listitem>
    90 </varlistentry>
     86    <varlistentry>
     87      <term><parameter>start</parameter></term>
     88      <listitem>
     89        <para>The service is started.</para>
     90      </listitem>
     91    </varlistentry>
    9192
    92 <varlistentry>
    93 <term><parameter>restart</parameter></term>
    94 <listitem><para>The service is stopped and then started again.</para></listitem>
    95 </varlistentry>
     93    <varlistentry>
     94      <term><parameter>stop</parameter></term>
     95      <listitem>
     96        <para>The service is stopped.</para>
     97      </listitem>
     98    </varlistentry>
    9699
    97 <varlistentry>
    98 <term><parameter>reload</parameter></term>
    99 <listitem><para>The configuration of the service is updated.
    100 This is used after the configuration file of a service was modified, when
    101 the service does not need to be restarted.</para></listitem>
    102 </varlistentry>
     100    <varlistentry>
     101      <term><parameter>restart</parameter></term>
     102      <listitem>
     103        <para>The service is stopped and then started again.</para>
     104      </listitem>
     105    </varlistentry>
    103106
    104 <varlistentry>
    105 <term><parameter>status</parameter></term>
    106 <listitem><para>Tells if the service is running and with which PIDs.</para></listitem>
    107 </varlistentry>
    108 </variablelist>
     107    <varlistentry>
     108      <term><parameter>reload</parameter></term>
     109      <listitem>
     110        <para>The configuration of the service is updated.
     111        This is used after the configuration file of a service was modified, when
     112        the service does not need to be restarted.</para>
     113      </listitem>
     114    </varlistentry>
    109115
    110 <para>Feel free to modify the way the boot process works (after all,
    111 it is your own LFS system). The files given here are an example of how
    112 it can be done.</para>
     116    <varlistentry>
     117      <term><parameter>status</parameter></term>
     118      <listitem>
     119        <para>Tells if the service is running and with which PIDs.</para>
     120      </listitem>
     121    </varlistentry>
     122
     123  </variablelist>
     124
     125  <para>Feel free to modify the way the boot process works (after all,
     126  it is your own LFS system). The files given here are an example of how
     127  it can be done.</para>
    113128
    114129</sect1>
    115 
Note: See TracChangeset for help on using the changeset viewer.