- Timestamp:
- 08/02/2011 02:15:42 AM (13 years ago)
- 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
- Location:
- chapter07
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/bootscripts.xml
r75fe599 r0cda898 50 50 <sect2 id="contents-bootscripts" role="content"> 51 51 <title>Contents of LFS-Bootscripts</title> 52 53 52 <segmentedlist> 54 53 <segtitle>Installed scripts</segtitle> … … 60 59 sendsignals, setclock, static, swap, sysctl, sysklogd, template, 61 60 udev, and udev_retry</seg> 62 <seg>/etc/rc.d, /etc/sysconfig </seg>61 <seg>/etc/rc.d, /etc/sysconfig, /lib/boot</seg> 63 62 </seglistitem> 64 63 </segmentedlist> … … 141 140 <term><command>ifdown</command></term> 142 141 <listitem> 143 <para> Assists the network script with stopping network devices</para>142 <para>Stops a network device</para> 144 143 <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"> 145 144 <primary sortas="d-ifdown">ifdown</primary> … … 151 150 <term><command>ifup</command></term> 152 151 <listitem> 153 <para> Assists the network script with starting network devices</para>152 <para>Initializes a network device</para> 154 153 <indexterm zone="ch-scripts-bootscripts ifup-bootscripts"> 155 154 <primary sortas="d-ifup">ifup</primary> … … 326 325 <listitem> 327 326 <para>Retries failed udev uevents, and copies generated rules 328 files from <filename class="directory">/dev/.udev</filename>to327 files from to 329 328 <filename class="directory">/etc/udev/rules.d</filename> if required</para> 330 329 <indexterm zone="ch-scripts-bootscripts udev-retry-bootscripts"> -
chapter07/chapter07.xml
r75fe599 r0cda898 13 13 14 14 <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"/> 15 19 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/> 16 20 <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"/> 17 22 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setclock.xml"/> 18 23 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="console.xml"/> 19 24 <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"/> 20 26 <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"/>27 27 28 28 </chapter> -
chapter07/hostname.xml
r75fe599 r0cda898 9 9 <?dbhtml filename="hostname.html"?> 10 10 11 <title>Configuring the localnet Script</title>11 <title>Configuring the system hostname</title> 12 12 13 13 <indexterm zone="ch-scripts-hostname"> 14 <primary sortas="d- localnet">localnet</primary>14 <primary sortas="d-hostname">hostname</primary> 15 15 <secondary>configuring</secondary> 16 16 </indexterm> … … 27 27 <para><replaceable><lfs></replaceable> needs to be replaced with the name given 28 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> 29 information is put in the <filename>/etc/hosts</filename> file.</para> 31 30 32 31 </sect1> -
chapter07/hosts.xml
r75fe599 r0cda898 62 62 <para>The <replaceable><192.168.1.1></replaceable> and 63 63 <replaceable><HOSTNAME.example.org></replaceable> 64 values need to be changed for specific use rs or requirements (if64 values need to be changed for specific uses or requirements (if 65 65 assigned an IP address by a network/system administrator and the 66 66 machine will be connected to an existing network). The optional alias -
chapter07/introduction.xml
r75fe599 r0cda898 11 11 <title>Introduction</title> 12 12 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> 17 27 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 18 42 <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> 23 50 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 26 89 27 90 </sect1> -
chapter07/network.xml
r75fe599 r0cda898 9 9 <?dbhtml filename="network.html"?> 10 10 11 <title> Configuring the network Script</title>11 <title>General Network Configuration</title> 12 12 13 13 <indexterm zone="ch-scripts-network"> … … 26 26 <sect2> 27 27 <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> 28 33 29 34 <para>With Udev and modular network drivers, the network interface numbering … … 113 118 114 119 <para>Which interfaces are brought up and down by the network script 115 depends on the files and directories in the<filename116 class="directory">/etc/sysconfig/ network-devices</filename> hierarchy.117 This directory should contain a sub-directory for each interface to be118 configured, such as <filename>ifconfig.xyz</filename>, where119 <quote>xyz</quote> is a network interface name. Inside this directory120 would be files defining the attributes to this interface, such as its IP121 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 > ifconfig.eth0 /ipv4<< "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/ 133 cat > ifconfig.eth0 << "EOF" 129 134 <literal>ONBOOT=yes 135 IFACE=eth0 130 136 SERVICE=ipv4-static 131 137 IP=192.168.1.1 … … 136 142 137 143 <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> 143 156 144 157 <para>The <envar>SERVICE</envar> variable defines the method used for 145 158 obtaining the IP address. The LFS-Bootscripts package has a modular IP 146 159 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> 151 163 152 164 <para>The <envar>GATEWAY</envar> variable should contain the default … … 190 202 EOF</userinput></screen> 191 203 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 192 208 <para>Replace <replaceable><IP address of the nameserver></replaceable> 193 209 with the IP address of the DNS most appropriate for the setup. There will … … 197 213 may also be a router on the local network.</para> 198 214 215 <note><para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para></note> 216 199 217 </sect2> 200 218 -
chapter07/setclock.xml
r75fe599 r0cda898 63 63 time zones, UTC, and the <envar>TZ</envar> environment variable.</para> 64 64 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 65 68 </sect1> -
chapter07/sysklogd.xml
r75fe599 r0cda898 17 17 18 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> 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> 25 30 26 31 </sect1> -
chapter07/udev.xml
r75fe599 r0cda898 96 96 <title>Udev Bootscript</title> 97 97 98 <para>The <command> S10udev</command> initscript takes care of creating98 <para>The <command>/etc/rc.d/init.d/udev</command> initscript takes care of creating 99 99 device nodes when Linux is booted. The script unsets the uevent handler 100 100 from the default of <command>/sbin/hotplug</command>. This is done … … 201 201 arrange module loading by other means. With Linux-&linux-version;, Udev is 202 202 known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI, 203 SERIO and FireWire devices.</para>203 SERIO, and FireWire devices.</para> 204 204 205 205 <para>To determine if the device driver you require has the necessary … … 244 244 245 245 <para>If the module in question is not a wrapper and is useful by itself, 246 configure the <command> S05modules</command> bootscript to load this246 configure the <command>modules</command> bootscript to load this 247 247 module on system boot. To do this, add the module name to the 248 248 <filename>/etc/sysconfig/modules</filename> file on a separate line. … … 307 307 vendor). The static device node will be copied to 308 308 <filename class="directory">/dev</filename> by the 309 <command> S10udev</command> bootscript.</para>309 <command>udev</command> bootscript.</para> 310 310 311 311 </sect3> -
chapter07/usage.xml
r75fe599 r0cda898 38 38 6: reboot the computer</literallayout> 39 39 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 > /etc/inittab << "EOF" 58 <literal># Begin /etc/inittab 59 60 id:3:initdefault: 61 62 si::sysinit:/etc/rc.d/init.d/rc sysinit 63 64 l0:0:wait:/etc/rc.d/init.d/rc 0 65 l1:S1:wait:/etc/rc.d/init.d/rc 1 66 l2:2:wait:/etc/rc.d/init.d/rc 2 67 l3:3:wait:/etc/rc.d/init.d/rc 3 68 l4:4:wait:/etc/rc.d/init.d/rc 4 69 l5:5:wait:/etc/rc.d/init.d/rc 5 70 l6:6:wait:/etc/rc.d/init.d/rc 6 71 72 ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now 73 74 su:S016:once:/sbin/sulogin 75 76 1:2345:respawn:/sbin/agetty tty1 9600 77 2:2345:respawn:/sbin/agetty tty2 9600 78 3:2345:respawn:/sbin/agetty tty3 9600 79 4:2345:respawn:/sbin/agetty tty4 9600 80 5:2345:respawn:/sbin/agetty tty5 9600 81 6:2345:respawn:/sbin/agetty tty6 9600 82 83 # End /etc/inittab</literal> 84 EOF</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 41 114 <replaceable><runlevel></replaceable></command>, where 42 115 <replaceable><runlevel></replaceable> is the target run-level. For example, to … … 60 133 <para>The real scripts are in <filename 61 134 class="directory">/etc/rc.d/init.d</filename>. They do the actual work, and 62 the symlinks all point to them. K illing links and startinglinks point to135 the symlinks all point to them. K links and S links point to 63 136 the same script in <filename class="directory">/etc/rc.d/init.d</filename>. 64 137 This is because the scripts can be called with different parameters like … … 127 200 it can be done.</para> 128 201 202 </sect2> 203 129 204 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.