Changeset 0cda898 for chapter07


Ignore:
Timestamp:
08/02/2011 02:15:42 AM (13 years ago)
Author:
Bruce Dubbs <bdubbs@…>
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, 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:
a2e555d
Parents:
75fe599
Message:

Rewrite bootscripts and Chaper 7

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

Location:
chapter07
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • chapter07/bootscripts.xml

    r75fe599 r0cda898  
    5050  <sect2 id="contents-bootscripts" role="content">
    5151    <title>Contents of LFS-Bootscripts</title>
    52 
    5352    <segmentedlist>
    5453      <segtitle>Installed scripts</segtitle>
     
    6059        sendsignals, setclock, static, swap, sysctl, sysklogd, template,
    6160        udev, and udev_retry</seg>
    62         <seg>/etc/rc.d, /etc/sysconfig</seg>
     61        <seg>/etc/rc.d, /etc/sysconfig, /lib/boot</seg>
    6362      </seglistitem>
    6463    </segmentedlist>
     
    141140        <term><command>ifdown</command></term>
    142141        <listitem>
    143           <para>Assists the network script with stopping network devices</para>
     142          <para>Stops a network device</para>
    144143          <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts">
    145144            <primary sortas="d-ifdown">ifdown</primary>
     
    151150        <term><command>ifup</command></term>
    152151        <listitem>
    153           <para>Assists the network script with starting network devices</para>
     152          <para>Initializes a network device</para>
    154153          <indexterm zone="ch-scripts-bootscripts ifup-bootscripts">
    155154            <primary sortas="d-ifup">ifup</primary>
     
    326325        <listitem>
    327326          <para>Retries failed udev uevents, and copies generated rules
    328           files from <filename class="directory">/dev/.udev</filename> to
     327          files from to
    329328          <filename class="directory">/etc/udev/rules.d</filename> if required</para>
    330329          <indexterm zone="ch-scripts-bootscripts udev-retry-bootscripts">
  • chapter07/chapter07.xml

    r75fe599 r0cda898  
    1313
    1414  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/>
     15  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/>
     16  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>
     17  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/>
     18  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/>
    1519  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/>
    1620  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/>
     21  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>
    1722  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setclock.xml"/>
    1823  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="console.xml"/>
    1924  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>
     25  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="profile.xml"/>
    2026  <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inputrc.xml"/>
    21   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="profile.xml"/>
    22   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/>
    23   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/>
    24   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>
    25   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>
    26   <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/>
    2727
    2828</chapter>
  • chapter07/hostname.xml

    r75fe599 r0cda898  
    99  <?dbhtml filename="hostname.html"?>
    1010
    11   <title>Configuring the localnet Script</title>
     11  <title>Configuring the system hostname</title>
    1212
    1313  <indexterm zone="ch-scripts-hostname">
    14     <primary sortas="d-localnet">localnet</primary>
     14    <primary sortas="d-hostname">hostname</primary>
    1515    <secondary>configuring</secondary>
    1616  </indexterm>
     
    2727  <para><replaceable>&lt;lfs&gt;</replaceable> needs to be replaced with the name given
    2828  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>
     29  information is put in the <filename>/etc/hosts</filename> file.</para>
    3130
    3231</sect1>
  • chapter07/hosts.xml

    r75fe599 r0cda898  
    6262  <para>The <replaceable>&lt;192.168.1.1&gt;</replaceable> and
    6363  <replaceable>&lt;HOSTNAME.example.org&gt;</replaceable>
    64   values need to be changed for specific users or requirements (if
     64  values need to be changed for specific uses or requirements (if
    6565  assigned an IP address by a network/system administrator and the
    6666  machine will be connected to an existing network). The optional alias
  • chapter07/introduction.xml

    r75fe599 r0cda898  
    1111  <title>Introduction</title>
    1212
    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>
     13  <para>This chapter discusses configuration files and boot scripts. 
     14  First, the general configuration files needed to set up networking are
     15  presented.</para>
     16 
     17  <itemizedlist>
     18     <listitem>
     19       <para><xref linkend="ch-scripts-network" role="."/></para>
     20     </listitem>
     21     <listitem>
     22       <para><xref linkend="ch-scripts-hosts" role="."/></para>
     23     </listitem>
     24  </itemizedlist>
     25 
     26  <para>Second, issues that affect the proper setup of devices diescussed.</para>
    1727
     28  <itemizedlist>
     29     <listitem>
     30       <para><xref linkend="ch-scripts-udev" role="."/></para>
     31     </listitem>
     32     <listitem>
     33       <para><xref linkend="ch-scripts-symlinks" role="."/></para>
     34     </listitem>
     35  </itemizedlist>
     36
     37  <para>The next sections detail how to install and configure the LFS system
     38  scripts needed during the boot process. Most of these scripts will work
     39  without modification, but a few require additional configuration files
     40  because they deal with hardware-dependent information.</para>
     41 
    1842  <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 url="&hints-root;bsd-init.txt"/>.
    21   Searching the LFS mailing lists for <quote>depinit</quote> will also offer
    22   additional choices.</para>
     43  widely used and relatively simple. For additional options, a hint detailing
     44  the BSD style init setup is available at <ulink
     45  url="&hints-root;bsd-init.txt"/>.  Searching the LFS mailing lists for
     46  <quote>depinit</quote>, <quote>upstart</quote>, or <quote>systemd</quote>
     47  will also offer additional information.</para>
     48 
     49  <para>If using an alternative style of init scripts, skip these sections.</para>
    2350
    24   <para>If using an alternative style of init scripts, skip this chapter
    25   and move on to <xref linkend="chapter-bootable"/>.</para>
     51  <para>A listing of the boot scripts are found in <xref linkend="scripts"
     52  role="."/>.</para>
     53
     54
     55  <itemizedlist>
     56     <listitem>
     57       <para><xref linkend="ch-scripts-bootscripts" role="."/></para>
     58     </listitem>
     59     <listitem>
     60       <para><xref linkend="ch-scripts-usage" role="."/></para>
     61     </listitem>
     62     <listitem>
     63       <para><xref linkend="ch-scripts-hostname" role="."/></para>
     64     </listitem>
     65     <listitem>
     66       <para><xref linkend="ch-scripts-setclock" role="."/></para>
     67     </listitem>
     68     <listitem>
     69       <para><xref linkend="ch-scripts-console" role="."/></para>
     70     </listitem>
     71     <listitem>
     72       <para><xref linkend="ch-scripts-sysklogd" role="."/></para>
     73     </listitem>
     74  </itemizedlist>
     75 
     76 
     77  <para>Finally, there is a brief introduction to the scripts and configuration
     78  files used when the user logs into the system.</para>
     79
     80  <itemizedlist>
     81     <listitem>
     82       <para><xref linkend="ch-scripts-profile" role="."/></para>
     83     </listitem>
     84     <listitem>
     85       <para><xref linkend="ch-scripts-inputrc" role="."/></para>
     86     </listitem>
     87  </itemizedlist>
     88
    2689
    2790</sect1>
  • chapter07/network.xml

    r75fe599 r0cda898  
    99  <?dbhtml filename="network.html"?>
    1010
    11   <title>Configuring the network Script</title>
     11  <title>General Network Configuration</title>
    1212
    1313  <indexterm zone="ch-scripts-network">
     
    2626  <sect2>
    2727    <title>Creating stable names for network interfaces</title>
     28
     29    <para>If there is only one network interface in the system to be
     30    configured, this section is optional, although it will never be wrong to do
     31    it.  In many cases (e.g. a laptop with a wireless and a wired interface),
     32    accomplishing the configuration in this section is necessary.</para> 
    2833
    2934    <para>With Udev and modular network drivers, the network interface numbering
     
    113118
    114119    <para>Which interfaces are brought up and down by the network script
    115     depends on the files and directories in the <filename
    116     class="directory">/etc/sysconfig/network-devices</filename> hierarchy.
    117     This directory should contain a sub-directory for each interface to be
    118     configured, such as <filename>ifconfig.xyz</filename>, where
    119     <quote>xyz</quote> is a network interface name. Inside this directory
    120     would be files defining the attributes to this interface, such as its IP
    121     address(es), subnet masks, and so forth.</para>
    122 
    123     <para>The following command creates a sample <filename>ipv4</filename>
    124     file for the <emphasis>eth0</emphasis> device:</para>
    125 
    126 <screen><userinput>cd /etc/sysconfig/network-devices
    127 mkdir -v ifconfig.eth0
    128 cat &gt; ifconfig.eth0/ipv4 &lt;&lt; "EOF"
     120    depends on the files in <filename
     121    class="directory">/etc/sysconfig/</filename>.  This directory should
     122    contain a file for each interface to be configured, such as
     123    <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is is
     124    meaningful to the administrator such as the device name (e.g. eth0).
     125    Inside this file are attributes to this interface, such as its IP
     126    address(es), subnet masks, and so forth.  It is necessary that
     127    the stem of the filename be <emphasis>ifconfig</emphasis>.</para>
     128
     129    <para>The following command creates a sample file for the
     130    <emphasis>eth0</emphasis> device with a static IP address:</para>
     131
     132<screen><userinput>cd /etc/sysconfig/
     133cat &gt; ifconfig.eth0 &lt;&lt; "EOF"
    129134<literal>ONBOOT=yes
     135IFACE=eth0
    130136SERVICE=ipv4-static
    131137IP=192.168.1.1
     
    136142
    137143    <para>The values of these variables must be changed in every file to match
    138     the proper setup. If the <envar>ONBOOT</envar> variable is set to
    139     <quote>yes</quote> the network script will bring up the Network Interface
    140     Card (NIC) during booting of the system. If set to anything but
    141     <quote>yes</quote> the NIC will be ignored by the network script and not
    142     be brought up.</para>
     144    the proper setup.</para>
     145
     146    <para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the
     147    network script will bring up the Network Interface Card (NIC) during
     148    booting of the system. If set to anything but <quote>yes</quote> the NIC
     149    will be ignored by the network script and not be automatically brought up.
     150    The interface can be manually started or stopped with the
     151    <command>ifup</command> and <command>ifdown</command> commands.</para>
     152
     153    <para>The <envar>IFACE</envar> variable defines the interface name,
     154    for example, eth0.  It is required for all network device configuration
     155    files. </para>
    143156
    144157    <para>The <envar>SERVICE</envar> variable defines the method used for
    145158    obtaining the IP address. The LFS-Bootscripts package has a modular IP
    146159    assignment format, and creating additional files in the <filename
    147     class="directory">/etc/sysconfig/network-devices/services</filename>
    148     directory allows other IP assignment methods. This is commonly used for
    149     Dynamic Host Configuration Protocol (DHCP), which is addressed in the
    150     BLFS book.</para>
     160    class="directory">/lib/boot/</filename> directory allows other IP
     161    assignment methods. This is commonly used for Dynamic Host Configuration
     162    Protocol (DHCP), which is addressed in the BLFS book.</para>
    151163
    152164    <para>The <envar>GATEWAY</envar> variable should contain the default
     
    190202EOF</userinput></screen>
    191203
     204    <para>The <varname>domain</varname> statement can be omitted
     205    or replaced with a <varname>search</varname> statement.  See the man page for
     206    resolv.conf for more details.</para>
     207
    192208    <para>Replace <replaceable>&lt;IP address of the nameserver&gt;</replaceable>
    193209    with the IP address of the DNS most appropriate for the setup. There will
     
    197213    may also be a router on the local network.</para>
    198214
     215    <note><para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para></note>
     216
    199217  </sect2>
    200218
  • chapter07/setclock.xml

    r75fe599 r0cda898  
    6363  time zones, UTC, and the <envar>TZ</envar> environment variable.</para>
    6464
     65  <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set
     66  in the <filename>/etc/sysconfig/init_params</filename> file.</para></note>
     67
    6568</sect1>
  • chapter07/sysklogd.xml

    r75fe599 r0cda898  
    1717
    1818  <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>
     19  <command>syslogd</command> program with the <parameter>-m 0</parameter>
     20  option.  This option turns off the periodic timestamp mark that
     21  <command>syslogd</command> writes to the log files every 20 minutes by
     22  default.  If you want to turn on this periodic timestamp mark, create or edit
     23  <filename>/etc/sysconfig/init_params</filename> and define the variable
     24  SYSKLOGD_PARMS to the desired value.  For instance, to remove all parameters,
     25  set the variable to a null value:</para>
     26
     27<screen role="nodump">SYSKLOGD_PARMS=</screen>
     28
     29  <para>See <userinput>man syslogd</userinput> for more options.</para>
    2530
    2631</sect1>
  • chapter07/udev.xml

    r75fe599 r0cda898  
    9696      <title>Udev Bootscript</title>
    9797
    98       <para>The <command>S10udev</command> initscript takes care of creating
     98      <para>The <command>/etc/rc.d/init.d/udev</command> initscript takes care of creating
    9999      device nodes when Linux is booted. The script unsets the uevent handler
    100100      from the default of <command>/sbin/hotplug</command>.  This is done
     
    201201      arrange module loading by other means. With Linux-&linux-version;, Udev is
    202202      known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI,
    203       SERIO and FireWire devices.</para>
     203      SERIO, and FireWire devices.</para>
    204204
    205205      <para>To determine if the device driver you require has the necessary
     
    244244
    245245      <para>If the module in question is not a wrapper and is useful by itself,
    246       configure the <command>S05modules</command> bootscript to load this
     246      configure the <command>modules</command> bootscript to load this
    247247      module on system boot. To do this, add the module name to the
    248248      <filename>/etc/sysconfig/modules</filename> file on a separate line.
     
    307307      vendor). The static device node will be copied to
    308308      <filename class="directory">/dev</filename> by the
    309       <command>S10udev</command> bootscript.</para>
     309      <command>udev</command> bootscript.</para>
    310310
    311311    </sect3>
  • chapter07/usage.xml

    r75fe599 r0cda898  
    38386: reboot the computer</literallayout>
    3939
    40   <para>The command used to change run-levels is <command>init
     40  <sect2 id="conf-sysvinit" role="configuration">
     41  <title>Configuring Sysvinit</title>
     42
     43  <indexterm zone="conf-sysvinit">
     44    <primary sortas="a-Sysvinit">Sysvinit</primary>
     45    <secondary>configuring</secondary>
     46  </indexterm>
     47
     48  <indexterm zone="conf-sysvinit">
     49    <primary sortas="e-/etc/inittab">/etc/inittab</primary>
     50  </indexterm>
     51
     52  <para>During the kernel initialization, the first program that is run
     53  is either specified on the command line or, by default
     54  <command>init</command>.  This program reads the initialization file
     55  <filename>/etc/inittab</filename>.  Create this file with:</para>
     56
     57<screen><userinput>cat &gt; /etc/inittab &lt;&lt; "EOF"
     58<literal># Begin /etc/inittab
     59
     60id:3:initdefault:
     61
     62si::sysinit:/etc/rc.d/init.d/rc sysinit
     63
     64l0:0:wait:/etc/rc.d/init.d/rc 0
     65l1:S1:wait:/etc/rc.d/init.d/rc 1
     66l2:2:wait:/etc/rc.d/init.d/rc 2
     67l3:3:wait:/etc/rc.d/init.d/rc 3
     68l4:4:wait:/etc/rc.d/init.d/rc 4
     69l5:5:wait:/etc/rc.d/init.d/rc 5
     70l6:6:wait:/etc/rc.d/init.d/rc 6
     71
     72ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now
     73
     74su:S016:once:/sbin/sulogin
     75
     761:2345:respawn:/sbin/agetty tty1 9600
     772:2345:respawn:/sbin/agetty tty2 9600
     783:2345:respawn:/sbin/agetty tty3 9600
     794:2345:respawn:/sbin/agetty tty4 9600
     805:2345:respawn:/sbin/agetty tty5 9600
     816:2345:respawn:/sbin/agetty tty6 9600
     82
     83# End /etc/inittab</literal>
     84EOF</userinput></screen>
     85
     86  <para>An explanation of this initialization file is in the man page for
     87  <emphasis>inittab</emphasis>.  For LFS, the key command that is run is
     88  <command>rc</command>. The intialization file above will instruct
     89  <command>rc</command> to run all the scripts starting with an S in the
     90  <filename class="directory">/etc/rc.d/rcsysinit.d</filename> directory
     91  followed by all the scripts starting with an S in the <filename
     92  class="directory">/etc/rc.d/rc?.d</filename> directory where the question
     93  mark is specified by the initdefault value.</para>
     94
     95  <para>As a convenience, the <command>rc</command> script reads a library of
     96  functions in <filename class="directory">/lib/boot/functions</filename>.
     97  This library also reads an optional configuration file,
     98  <filename>/etc/sysconfig/init_params</filename>.  Any of the system
     99  configuration file parameters described in subsequent sections can be
     100  alternatively placed in this file allowing consolidation of all system
     101  parameters in thsi one file.</para>
     102
     103  <para>As a debugging convenience, the functions script also logs all output
     104  to <filename>/run/var/bootlog</filename>.  Since the <filename
     105  class="directory">/run</filename> directory is a tmpfs, this file is not
     106  persistent across boots.</para>
     107
     108  </sect2>
     109
     110  <sect2 id="init-levels" >
     111  <title>Changing Run Levels</title>
     112
     113  <para>Changing run-levels is done with <command>init
    41114  <replaceable>&lt;runlevel&gt;</replaceable></command>, where
    42115  <replaceable>&lt;runlevel&gt;</replaceable> is the target run-level. For example, to
     
    60133  <para>The real scripts are in <filename
    61134  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
     135  the symlinks all point to them. K links and S links point to
    63136  the same script in <filename class="directory">/etc/rc.d/init.d</filename>.
    64137  This is because the scripts can be called with different parameters like
     
    127200  it can be done.</para>
    128201
     202  </sect2>
     203
    129204</sect1>
Note: See TracChangeset for help on using the changeset viewer.