Changeset bf58c1e
- Timestamp:
- 04/21/2014 09:44:04 PM (9 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, 7.10, 7.10-rc1, 7.6, 7.6-rc1, 7.7, 7.7-rc1, 7.8, 7.8-rc1, 7.9, 7.9-rc1, 7.9-rc2, 8.0, 8.0-rc1, 8.1, 8.1-rc1, 8.1-rc2, 8.2, 8.2-rc1, 8.3, 8.3-rc1, 8.3-rc2, 8.4, 8.4-rc1, 9.0, 9.0-rc1, 9.1, 9.1-rc1, BOOK.old, arm, bdubbs/gcc13, cross-chap5, hybrid, ml-11.0, multilib, nosym, old-trunk, s6-init, trunk, xry111/arm64, xry111/clfs-ng, xry111/git-transition, xry111/glibc-2.34, xry111/glibc-2.37, xry111/kcfg-revise, xry111/lfs-next, xry111/pip3, xry111/queue-11.3, xry111/rust-wip-20221008, xry111/tester-nohack, xry111/usr-move
- Children:
- 5af3f9e
- Parents:
- c65dd23e
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter01/changelog.xml
rc65dd23e rbf58c1e 37 37 --> 38 38 <listitem> 39 <para>2014-03-21</para> 40 <itemizedlist> 41 <listitem> 42 <para>[bdubbs] - Rewrote and reorganized Chapter 7. 43 Updated systemd customization.</para> 44 </listitem> 45 </itemizedlist> 46 </listitem> 47 48 <listitem> 39 49 <para>2014-04-18</para> 40 50 <itemizedlist> -
chapter07/bootscripts.xml
rc65dd23e rbf58c1e 25 25 26 26 <para>The LFS-Bootscripts package contains a set of scripts to start/stop 27 the LFS system at bootup/shutdown. The networking systemd unit file is 28 also installed.</para> 27 the LFS system at bootup/shutdown. A networking systemd unit file is 28 also installed. The configuration files and procedures needed to 29 customize the boot process are described in the following sections.</para> 29 30 30 31 <segmentedlist> -
chapter07/chapter07.xml
rc65dd23e rbf58c1e 14 14 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/> 15 15 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/> 16 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/>17 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>18 16 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/> 19 17 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/> 18 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/> 19 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hosts.xml"/>--> 20 20 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/> 21 21 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysd-custom.xml"/> 22 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>23 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setclock.xml"/>24 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="console.xml"/>25 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>26 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="site.xml"/>22 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hostname.xml"/>--> 23 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="setclock.xml"/>--> 24 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="console.xml"/>--> 25 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sysklogd.xml"/>--> 26 <!-- <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="site.xml"/>--> 27 27 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="profile.xml"/> 28 28 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inputrc.xml"/> -
chapter07/introduction.xml
rc65dd23e rbf58c1e 40 40 can be run by the user:</para> 41 41 42 <itemizedlist>43 <listitem><para>0 — halt</para></listitem> 44 <listitem><para>1 — Single user mode</para></listitem> 45 <listitem><para>2 — Multiuser, without networking</para></listitem> 46 <listitem><para>3 — Full multiuser mode</para></listitem> 47 <listitem><para>4 — User definable</para></listitem> 48 <listitem><para>5 — Full multiuser mode with display manager</para></listitem> 49 <listitem><para>6 — reboot</para></listitem> 50 </itemizedlist>42 <literallayout> 43 0 — halt 44 1 — Single user mode 45 2 — Multiuser, without networking 46 3 — Full multiuser mode 47 4 — User definable 48 5 — Full multiuser mode with display manager 49 6 — reboot 50 </literallayout> 51 51 52 52 <para>The usual default run level is 3 or 5.</para> … … 208 208 chmod 0744 /usr/sbin/set-sysv</userinput></screen> 209 209 210 <note><para>The comment about the correct command to reboot in the 211 above scripts is correct. The reboot command for the current boot 212 system must be used after the script changes the default reboot command. 213 </para></note> 214 210 215 <para>Now set the desired boot system. The default is System V:</para> 211 216 -
chapter07/network.xml
rc65dd23e rbf58c1e 25 25 installed in <xref linkend="ch-scripts-bootscripts"/>.</para> 26 26 27 <sect2 id='stable-net-names'>28 <title>Creating stable names for network interfaces</title>29 30 <para>If there is only one network interface in the system to be31 configured, this section is optional, although it will never be wrong to do32 it. In many cases (e.g. a laptop with a wireless and a wired interface),33 accomplishing the configuration in this section is necessary.</para>34 35 <para>With Udev and modular network drivers, the network interface numbering36 is not persistent across reboots by default, because the drivers are loaded37 in parallel and, thus, in random order. For example, on a computer having38 two network cards made by Intel and Realtek, the network card manufactured39 by Intel may become <filename class="devicefile">eth0</filename> and the40 Realtek card becomes <filename class="devicefile">eth1</filename>. In some41 cases, after a reboot the cards get renumbered the other way around. To42 avoid this, Udev comes with a script and some rules to assign stable names43 to network cards based on their MAC address.</para>44 45 <para>If using the traditional network interface names such as eth0 is desired,46 generate a custom Udev rule:</para>47 48 <screen><userinput>bash /lib/udev/init-net-rules.sh</userinput></screen>49 50 <para> Now, inspect the51 <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to52 find out which name was assigned to which network device:</para>53 54 <screen role="nodump"><userinput>cat /etc/udev/rules.d/70-persistent-net.rules</userinput></screen>55 56 <note><para>In some cases such as when MAC addresess have been assigned to57 a network card manually or in a virtual environment such as Xen,58 the network rules file may not have been generated because addresses59 are not consistently assigned. In these cases, just continue to60 the next section.</para></note>61 62 <para>The file begins with a comment block followed by two lines for each63 NIC. The first line for each NIC is a commented description showing its64 hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card),65 along with its driver in parentheses, if the driver can be found. Neither66 the hardware ID nor the driver is used to determine which name to give an67 interface; this information is only for reference. The second line is the68 Udev rule that matches this NIC and actually assigns it a name.</para>69 70 <para>All Udev rules are made up of several keys, separated by commas and71 optional whitespace. This rule's keys and an explanation of each of them72 are as follows:</para>73 74 <itemizedlist>75 <listitem>76 <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore77 devices that are not network cards.</para>78 </listitem>79 <listitem>80 <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this81 rule for a uevent that isn't an add ("remove" and "change" uevents also82 happen, but don't need to rename network interfaces).</para>83 </listitem>84 <listitem>85 <para><literal>DRIVERS=="?*"</literal> - This exists so that Udev will86 ignore VLAN or bridge sub-interfaces (because these sub-interfaces do87 not have drivers). These sub-interfaces are skipped because the name88 that would be assigned would collide with their parent devices.</para>89 </listitem>90 <listitem>91 <para><literal>ATTR{address}</literal> - The value of this key is the92 NIC's MAC address.</para>93 </listitem>94 <listitem>95 <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only96 matches the primary interface in the case of certain wireless drivers,97 which create multiple virtual interfaces. The secondary interfaces are98 skipped for the same reason that VLAN and bridge sub-interfaces are99 skipped: there would be a name collision otherwise.</para>100 </listitem>101 <listitem>102 <para><literal>KERNEL=="eth*"</literal> - This key was added to the103 Udev rule generator to handle machines that have multiple network104 interfaces, all with the same MAC address (the PS3 is one such105 machine). If the independent interfaces have different basenames,106 this key will allow Udev to tell them apart. This is generally not107 necessary for most Linux From Scratch users, but does not hurt.</para>108 </listitem>109 <listitem>110 <para><literal>NAME</literal> - The value of this key is the name that111 Udev will assign to this interface.</para>112 </listitem>113 </itemizedlist>114 115 <para>The value of <literal>NAME</literal> is the important part. Make sure116 you know which name has been assigned to each of your network cards before117 proceeding, and be sure to use that <literal>NAME</literal> value when118 creating your configuration files below.</para>119 120 </sect2>121 122 27 <sect2> 123 28 <title>Creating Network Interface Configuration Files</title> 124 29 125 30 <para>Which interfaces are brought up and down by the network script 126 depends on the files in <filename31 usually depends on the files in <filename 127 32 class="directory">/etc/sysconfig/</filename>. This directory should 128 33 contain a file for each interface to be configured, such as … … 217 122 name as described on the beginning of this page.</para> 218 123 124 <note><para>These procedures require the configuartion files as specified 125 in the previous section.</para></note> 126 219 127 <note><para>The network card can also be started or stopped 220 128 with the traditional <command>ifup <device></command> or 221 129 <command>ifdown <device></command> commands.</para></note> 130 131 </sect2> 132 133 <sect2 id="systemd2-net-enable"> 134 <title>Configuring the Network Interface Card for systemd-networkd</title> 135 136 <para>An alternative way to configure a NIC when booting with with 137 systemd is to create a configuration file recognized by the 138 systemd-networkd daemon. To configure the device create a file similar 139 to this:</para> 140 141 <screen role="nodump"><userinput>cat > /etc/systemd/network/10-static-eth0.network << "EOF" 142 [Match] 143 Name=eth0 144 145 [Network] 146 Address=192.168.0.2/24 147 Gateway=192.168.0.1 148 EOF</userinput></screen> 149 150 <para>You can use multiple .network files if desired. You can also specify 151 DHCP=yes instead of the Address and Gateway settings. See the man page for 152 systemd.network for more details,</para> 222 153 223 154 </sect2> … … 263 194 </sect2> 264 195 196 <sect2 id="ch-scripts-hostname"> 197 <title>Configuring the system hostname</title> 198 199 <indexterm zone="ch-scripts-hostname"> 200 <primary sortas="d-hostname">hostname</primary> 201 <secondary>configuring</secondary> 202 </indexterm> 203 204 <para>During the boot process, both Systemd and System V use the same file 205 for establishing the system's hostname. This needs to be configured by 206 creating <filename>/etc/hostname</filename>.</para> 207 208 <para>Create the <filename>/etc/hostname</filename> file and enter a 209 hostname by running:</para> 210 211 <screen><userinput>echo "<replaceable><lfs></replaceable>" > /etc/hostname</userinput></screen> 212 213 <para><replaceable><lfs></replaceable> needs to be replaced with the 214 name given to the computer. Do not enter the Fully Qualified Domain Name 215 (FQDN) here. That information is put in the 216 <filename>/etc/hosts</filename> file.</para> 217 218 </sect2> 219 220 <sect2 id="ch-scripts-hosts"> 221 <title>Customizing the /etc/hosts File</title> 222 223 <indexterm zone="ch-scripts-hosts"> 224 <primary sortas="e-/etc/hosts">/etc/hosts</primary> 225 </indexterm> 226 227 <indexterm zone="ch-scripts-hosts"> 228 <primary sortas="d-localnet">localnet</primary> 229 <secondary>/etc/hosts</secondary> 230 </indexterm> 231 232 <indexterm zone="ch-scripts-hosts"> 233 <primary sortas="d-network">network</primary> 234 <secondary>/etc/hosts</secondary> 235 </indexterm> 236 237 <para>Decide on the IP address, fully-qualified domain name (FQDN), and 238 possible aliases for use in the <filename>/etc/hosts</filename> file. The 239 syntax is:</para> 240 241 <screen><literal>IP_address myhost.example.org aliases</literal></screen> 242 243 <para>Unless the computer is to be visible to the Internet (i.e., there is 244 a registered domain and a valid block of assigned IP addresses—most 245 users do not have this), make sure that the IP address is in the private 246 network IP address range. Valid ranges are:</para> 247 248 <screen><literal>Private Network Address Range Normal Prefix 249 10.0.0.1 - 10.255.255.254 8 250 172.x.0.1 - 172.x.255.254 16 251 192.168.y.1 - 192.168.y.254 24</literal></screen> 252 253 <para>x can be any number in the range 16-31. y can be any number in the 254 range 0-255.</para> 255 256 <para>A valid private IP address could be 192.168.1.1. A valid FQDN for 257 this IP could be lfs.example.org.</para> 258 259 <para>Even if not using a network card, a valid FQDN is still required. 260 This is necessary for certain programs to operate correctly.</para> 261 262 <para>Create the <filename>/etc/hosts</filename> file by running:</para> 263 264 <screen><userinput>cat > /etc/hosts << "EOF" 265 <literal># Begin /etc/hosts (network card version) 266 267 127.0.0.1 localhost 268 <replaceable><192.168.1.1></replaceable> <replaceable><HOSTNAME.example.org></replaceable> <replaceable>[alias1] [alias2 ...]</replaceable> 269 270 # End /etc/hosts (network card version)</literal> 271 EOF</userinput></screen> 272 273 <para>The <replaceable><192.168.1.1></replaceable> and 274 <replaceable><HOSTNAME.example.org></replaceable> values need to be 275 changed for specific uses or requirements (if assigned an IP address by a 276 network/system administrator and the machine will be connected to an 277 existing network). The optional alias name(s) can be omitted.</para> 278 279 <para>If a network card is not going to be configured, create the 280 <filename>/etc/hosts</filename> file by running:</para> 281 282 <screen role="nodump"><userinput>cat > /etc/hosts << "EOF" 283 <literal># Begin /etc/hosts (no network card version) 284 285 127.0.0.1 <replaceable><HOSTNAME.example.org></replaceable> <replaceable><HOSTNAME></replaceable> localhost 286 287 # End /etc/hosts (no network card version)</literal> 288 EOF</userinput></screen> 289 290 </sect2> 291 265 292 </sect1> -
chapter07/symlinks.xml
rc65dd23e rbf58c1e 9 9 <?dbhtml filename="symlinks.html"?> 10 10 11 <title>Creating Custom Symlinks to Devices</title> 11 <title>Managing Devices</title> 12 13 <sect2> 14 15 <title>Network Devices</title> 16 17 <para>Udev, by default, names network devices according to Firmware/BIOS 18 data or physical characteristics like the bus, slot, or MAC address. The 19 purpose of this naming convention is to ensure that network devices are 20 named consistently and not based on the time the network card was 21 discovered. For example, on a computer having two network cards made by 22 Intel and Realtek, the network card manufactured by Intel may become eth0 23 and the Realtek card becomes eth1. In some cases, after a reboot the cards 24 get renumbered the other way around.</para> 25 26 <para>In the new naming scheme, typical network device names would then 27 be something like enp5s0 or wlp3s0. If this naming convention is not 28 desired, the traditional naming scheme or a custom scheme can be 29 implemented.</para> 30 31 <sect3> 32 <title>Disabling Persistent Naming on the Kernel Command Line</title> 33 34 <para>The traditional naming scheme using eth0, eth1, etc can be 35 restored by adding <userinput>net.ifnames=0</userinput> on the 36 kernel command line. This is most appropriate for those systems 37 that have only one ethernet device of the same type. Laptops 38 often have multiple ethernet connections that are named eth0 and 39 wlan0 and are also candidates for this method. The command line 40 is passed in the GRUB configuration file. 41 See <xref linkend="grub-cfg"/>.</para> 42 </sect3> 43 44 <sect3> 45 <title>Creating Custom Udev Rules</title> 46 47 <para>The naming scheme can be customized by creating custom Udev 48 rules. A script has been included that generates the initial rules. 49 Generate these rules by running:</para> 50 51 <screen role="nodump"><userinput>bash /lib/udev/init-net-rules.sh</userinput></screen> 52 53 <para> Now, inspect th 54 <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to 55 find out which name was assigned to which network device:</para> 56 57 <screen role="nodump"><userinput>cat /etc/udev/rules.d/70-persistent-net.rules</userinput></screen> 58 59 <note><para>In some cases such as when MAC addresess have been assigned to 60 a network card manually or in a virtual environment such as Qemu or Xen, 61 the network rules file may not have been generated because addresses 62 are not consistently assigned. In these cases, this method cannot 63 be used.</para></note> 64 65 <para>The file begins with a comment block followed by two lines for each 66 NIC. The first line for each NIC is a commented description showing its 67 hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card), 68 along with its driver in parentheses, if the driver can be found. Neither 69 the hardware ID nor the driver is used to determine which name to give an 70 interface; this information is only for reference. The second line is the 71 Udev rule that matches this NIC and actually assigns it a name.</para> 72 73 <para>All Udev rules are made up of several keys, separated by commas and 74 optional whitespace. This rule's keys and an explanation of each of them 75 are as follows:</para> 76 77 <itemizedlist> 78 <listitem> 79 <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore 80 devices that are not network cards.</para> 81 </listitem> 82 <listitem> 83 <para><literal>ACTION=="add"</literal> - This tells Udev to ignore this 84 rule for a uevent that isn't an add ("remove" and "change" uevents also 85 happen, but don't need to rename network interfaces).</para> 86 </listitem> 87 <listitem> 88 <para><literal>DRIVERS=="?*"</literal> - This exists so that Udev will 89 ignore VLAN or bridge sub-interfaces (because these sub-interfaces do 90 not have drivers). These sub-interfaces are skipped because the name 91 that would be assigned would collide with their parent devices.</para> 92 </listitem> 93 <listitem> 94 <para><literal>ATTR{address}</literal> - The value of this key is the 95 NIC's MAC address.</para> 96 </listitem> 97 <listitem> 98 <para><literal>ATTR{type}=="1"</literal> - This ensures the rule only 99 matches the primary interface in the case of certain wireless drivers, 100 which create multiple virtual interfaces. The secondary interfaces are 101 skipped for the same reason that VLAN and bridge sub-interfaces are 102 skipped: there would be a name collision otherwise.</para> 103 </listitem> 104 <listitem> 105 <para><literal>NAME</literal> - The value of this key is the name that 106 Udev will assign to this interface.</para> 107 </listitem> 108 </itemizedlist> 109 110 <para>The value of <literal>NAME</literal> is the important part. Make sure 111 you know which name has been assigned to each of your network cards before 112 proceeding, and be sure to use that <literal>NAME</literal> value when 113 creating your configuration files below.</para> 114 115 </sect3> 116 117 <sect3> 118 <title>Custom Naming in Systemd</title> 119 120 <para>Network interface names can also be customized with a set of 121 files spcific to systemd. A file with a name such as 10-eth0.link 122 in the /etc/systemd/network directory can set an interface name. All 123 files in the directory will be applied in lexical order. Files 124 in the /lib/systemd/network directory with the same name as those 125 in /etc/systemd/network will be overridden. See the man page 126 for systemd.link for a full explanation.</para> 127 128 <para>An example file looks like:</para> 129 130 <screen role="nodump">[Match] 131 MACAddress=12:34:56:78:9a:bc 132 Driver=brcmsmac 133 Path=pci-0000:02:00.0-* 134 Type=wlan 135 Virtualization=no 136 Host=my-laptop 137 Architecture=x86-64 138 139 [Link] 140 Name=wireless0 141 MTUBytes=1450 142 BitsPerSecond=10M 143 WakeOnLan=magic 144 MACAddress=cb:a9:87:65:43:21</screen> 145 146 <para>The [Match] section specifies when to apply the rule. In 147 the example above, the entries can be shortened to the minimum 148 needed to uniquely identify the network device. Similarly, 149 the [Link] section only needs to specify the changes from the 150 default that are desired. In many cases, the only thing needed is 151 the Name entry.</para> 152 153 </sect3> 154 155 </sect2> 12 156 13 157 <sect2> … … 109 253 after a reboot the order changes to the opposite one. 110 254 For all classes of hardware except sound cards and network cards, this is 111 fixable by creating udev rules for custom persistent symlinks.255 fixable by creating Udev rules for custom persistent symlinks. 112 256 The case of network cards is covered separately in 113 257 <xref linkend="ch-scripts-network"/>, and sound card configuration can -
chapter07/sysd-custom.xml
rc65dd23e rbf58c1e 9 9 <?dbhtml filename="sysd-custom.html"?> 10 10 11 <title>Systemd Customization</title>11 <title>Systemd Usage and Confiuration</title> 12 12 13 13 <indexterm zone="ch-scripts-sysd-custom"> … … 99 99 </sect2> 100 100 101 <sect2 id="ch-scripts-systemd-console"> 102 <title>Setting Console Fonts and Keyboard</title> 103 104 <indexterm zone="ch-scripts-systemd-console"> 105 <primary sortas="d-console">systemd console</primary> 106 <secondary>configuring</secondary> 107 </indexterm> 108 109 <para>This section discusses how to configure the 110 <command>systemd-vconsole-setup</command> system service, which configures 111 the virtual console font and console keymap.</para> 112 113 <para>The <command>systemd-vconsole-setup</command> service reads the 114 <filename>/etc/vconsole.conf</filename> file for configuration 115 information. Decide which keymap and screen font will be used. Various 116 language-specific HOWTOs can also help with this, see <ulink 117 url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. 118 Examine <command>localectl list-keymaps</command> output for a list of 119 valid console keymaps. Look in 120 <filename class="directory">/usr/share/consolefonts</filename> 121 directory for valid screen fonts.</para> 122 123 <para>The <filename>/etc/vconsole.conf</filename> file should contain lines 124 of the form: VARIABLE="value". The following variables are recognized:</para> 125 126 <variablelist> 127 128 <varlistentry> 129 <term>KEYMAP</term> 130 <listitem> 131 <para>This variable specifies the key mapping table for the keyboard. If 132 unset, it defaults to <literal>us</literal>.</para> 133 </listitem> 134 </varlistentry> 135 136 <varlistentry> 137 <term>KEYMAP_TOGGLE</term> 138 <listitem> 139 <para>This variable can be used to configure a second toggle keymap and 140 is unset by default.</para> 141 </listitem> 142 </varlistentry> 143 <varlistentry> 144 <term>FONT</term> 145 <listitem> 146 <para>This variable specifies the font used by the virtual 147 console.</para> 148 </listitem> 149 </varlistentry> 150 <varlistentry> 151 <term>FONT_MAP</term> 152 <listitem> 153 <para>This variable specifies the console map to be used.</para> 154 </listitem> 155 </varlistentry> 156 157 <varlistentry> 158 <term>FONT_UNIMAP</term> 159 <listitem> 160 <para>This variable specifies the unicode font map.</para> 161 </listitem> 162 </varlistentry> 163 164 </variablelist> 165 166 <para>An example for a German keyboard and console is given below:</para> 167 168 <screen role="nodump"><userinput>cat > /etc/vconsole.conf << "EOF" 169 <literal>KEYMAP=de-latin1 170 FONT=Lat2-Terminus16</literal> 171 EOF</userinput></screen> 172 173 <para>You can change KEYMAP value at runtime by using the 174 <command>localectl</command> utility:</para> 175 176 <screen role="nodump"><userinput>localectl set-keymap MAP</userinput></screen> 177 178 <note><para>Please note that <command>localectl</command> command can 179 be used only on a system booted with Systemd.</para></note> 180 181 </sect2> 182 183 <sect2> 184 <title>Clock Configuration</title> 185 186 <indexterm zone="ch-scripts-clock"> 187 <primary sortas="d-clock">clock</primary> 188 <secondary>configuring</secondary></indexterm> 189 190 <para>This section discusses how to configure the 191 <command>systemd-timedated</command> system service, which configures 192 system clock and timezone.</para> 193 194 <para><command>systemd-timedated</command> reads 195 <filename>/etc/adjtime</filename>, and depending on the contents of the file, 196 it sets the clock to either UTC or local time. Create the 197 <filename>/etc/adjtime</filename> file with the following contents <emphasis>if your 198 hardware clock is set to local time</emphasis>:</para> 199 200 <screen role="nodump"><userinput>cat > /etc/adjtime << "EOF" 201 <literal>0.0 0 0.0 202 0 203 LOCAL</literal> 204 EOF</userinput></screen> 205 206 <para>If <filename>/etc/adjtime</filename> isn't present at first boot, 207 <command>systemd-timedated</command> will assume that hardware clock is 208 set to UTC and create the file using that setting.</para> 209 210 <para>You can also use the <command>timedatectl</command> utility to tell 211 <command>systemd-timedated</command> if your hardware clock is set to 212 UTC or local time:</para> 213 214 <screen role="nodump"><userinput>timedatectl set-local-rtc 1</userinput></screen> 215 216 <para><command>timedatectl</command> can also be used to change system time and 217 time zone.</para> 218 219 <para>To change your current system time, issue:</para> 220 221 <screen role="nodump"><userinput>timedatectl set-time YYYY:MM:DD HH:MM:SS</userinput></screen> 222 223 <para>Hardware clock will also be updated accordingly.</para> 224 225 <para>To change your current time zone, issue:</para> 226 227 <screen role="nodump"><userinput>timedatectl set-timezone TIMEZONE</userinput></screen> 228 229 <para>You can get list of available time zones by running:</para> 230 231 <screen role="nodump"><userinput>timedatectl list-timezones</userinput></screen> 232 233 <note><para>The <command>timedatectl</command> command can 234 be used only on a system booted with Systemd.</para></note> 235 236 </sect2> 237 101 238 <sect2> 102 239 <title>Debugging the Boot Sequence</title> -
chapter07/udev.xml
rc65dd23e rbf58c1e 9 9 <?dbhtml filename="udev.html"?> 10 10 11 <title> Device and Module Handling on an LFS System</title>11 <title>Overview of Device and Module Handling</title> 12 12 13 13 <indexterm zone="ch-scripts-udev"> … … 17 17 18 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 in19 package as a part of systemd. Before we go into the details regarding how 20 this works, a brief history of previous methods of handling devices is in 21 21 order.</para> 22 22 23 <para>Linux systems in general traditionally use a static device creation24 method, whereby a great many device nodes are created under <filename23 <para>Linux systems in general traditionally used a static device creation 24 method, whereby a great many device nodes were created under <filename 25 25 class="directory">/dev</filename> (sometimes literally thousands of nodes), 26 regardless of whether the corresponding hardware devices actually exist . This27 is typically done via a <command>MAKEDEV</command> script, which contains a26 regardless of whether the corresponding hardware devices actually existed. This 27 was typically done via a <command>MAKEDEV</command> script, which contains a 28 28 number of calls to the <command>mknod</command> program with the relevant 29 29 major and minor device numbers for every possible device that might exist in … … 54 54 should be up to a system administrator, not imposed on them by any 55 55 particular developer(s). The <systemitem 56 class="filesystem">devfs</systemitem> file system also suffer sfrom race57 conditions that are inherent in its design and cannot be fixed without a56 class="filesystem">devfs</systemitem> file system also suffered from race 57 conditions that were inherent in its design and could not be fixed without a 58 58 substantial revision to the kernel. It was marked as deprecated for a long 59 59 period – due to a lack of maintenance – and was finally removed … … 65 65 <systemitem class="filesystem">sysfs</systemitem> is to export a view of 66 66 the system's hardware configuration to userspace processes. With this 67 userspace-visible representation, the possibility of seeing a userspace67 userspace-visible representation, the possibility of developing a userspace 68 68 replacement for <systemitem class="filesystem">devfs</systemitem> became 69 69 much more realistic.</para> … … 98 98 <para>Device files are created by the kernel by the <systemitem 99 99 class="filesystem">devtmpfs</systemitem> filesystem. Any driver that 100 wishes to register a device node will go through <systemitem100 wishes to register a device node will go through the <systemitem 101 101 class="filesystem">devtmpfs</systemitem> (via the driver core) to do it. 102 102 When a <systemitem class="filesystem">devtmpfs</systemitem> instance is … … 114 114 <command>udevd</command> database entry (name) for that object.</para> 115 115 116 <para>The rules in these three directories are numbered in a similar 117 fashion to the LFS-Bootscripts package and all three directories are 118 merged together. If <command>udevd</command> can't find a rule for the 119 device it is creating, it will leave the permissions and ownership at 120 whatever <systemitem class="filesystem">devtmpfs</systemitem> used 121 initially.</para> </sect3> 122 123 <sect3> 124 <title>Udev Bootscripts</title> 125 126 <para>The first LFS bootscript, 127 <filename>/etc/init.d/mountvirtfs</filename> will copy any devices 128 located in <filename class="directory">/lib/udev/devices</filename> to 129 <filename class="directory">/dev</filename>. This is necessary because 130 some devices, directories, and symlinks are needed before the dynamic 131 device handling processes are available during the early stages of 132 booting a system, or are required by <command>udevd</command> itself. 133 Creating static device nodes in <filename 134 class="directory">/lib/udev/devices</filename> also provides an easy 135 workaround for devices that are not supported by the dynamic device 136 handling infrastructure.</para> 137 138 <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts 139 <command>udevd</command>, triggers any "coldplug" devices that have 140 already been created by the kernel and waits for any rules to complete. 141 The script also unsets the uevent handler from the default of 142 <filename>/sbin/hotplug </filename>. This is done because the kernel no 143 longer needs to call out to an external binary. Instead 144 <command>udevd</command> will listen on a netlink socket for uevents that 145 the kernel raises.</para> 146 147 <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes 148 care of re-triggering events for subsystems whose rules may rely on 149 filesystems that are not mounted until the <command>mountfs</command> 150 script is run (in particular, <filename class="directory">/usr</filename> 151 and <filename class="directory">/var</filename> may cause this). This 152 script runs after the <command>mountfs</command> script, so those rules 153 (if re-triggered) should succeed the second time around. It is 154 configured from the <filename>/etc/sysconfig/udev_retry</filename> file; 155 any words in this file other than comments are considered subsystem names 156 to trigger at retry time. To find the subsystem of a device, use 157 <command>udevadm info --attribute-walk <device></command> where 158 <device> is an absolute path in /dev or /sys such as /dev/sr0 or 159 /sys/class/rtc.</para> 160 161 </sect3> 162 116 <para>The rules in these three directories are numbered and all three 117 directories are merged together. If <command>udevd</command> can't find a 118 rule for the device it is creating, it will leave the permissions and 119 ownership at whatever <systemitem 120 class="filesystem">devtmpfs</systemitem> used initially.</para> </sect3> 121 163 122 <sect3> 164 123 <title>Module Loading</title> … … 315 274 316 275 <sect3> 317 <title>Udev does not create a device</title>318 319 <para>Further text assumes that the driver is built statically into the320 kernel or already loaded as a module, and that you have already checked321 that Udev doesn't create a misnamed device.</para>322 323 <para>Udev has no information needed to create a device node if a kernel324 driver does not export its data to <systemitem325 class="filesystem">sysfs</systemitem>.326 This is most common with third party drivers from outside the kernel327 tree. Create a static device node in328 <filename>/lib/udev/devices</filename> with the appropriate major/minor329 numbers (see the file <filename>devices.txt</filename> inside the kernel330 documentation or the documentation provided by the third party driver331 vendor). The static device node will be copied to332 <filename class="directory">/dev</filename> by the333 <command>udev</command> bootscript.</para>334 335 </sect3>336 337 <sect3>338 276 <title>Device naming order changes randomly after rebooting</title> 339 277 -
chapter07/usage.xml
rc65dd23e rbf58c1e 3 3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ 4 4 <!ENTITY % general-entities SYSTEM "../general.ent"> 5 <!ENTITY site SYSTEM "../appendices/rc.site.script"> 5 6 %general-entities; 6 7 ]> … … 9 10 <?dbhtml filename="usage.html"?> 10 11 11 <title> How Do the System V Bootscripts Work?</title>12 <title>System V Bootscript Usage and Configuration</title> 12 13 13 14 <indexterm zone="ch-scripts-usage"> … … 16 17 </indexterm> 17 18 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> 19 <sect2> 20 <title>How Do the System V Bootscripts Work?</title> 21 22 <para>Linux uses a special booting facility named SysVinit that is based on a 23 concept of <emphasis>run-levels</emphasis>. It can be quite different from one 24 system to another, so it cannot be assumed that because things worked in one 25 particular Linux distribution, they should work the same in LFS too. LFS has its 26 own way of doing things, but it respects generally accepted standards.</para> 27 28 <para>SysVinit (which will be referred to as <quote>init</quote> from now on) 29 works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels 30 (actually, there are more run-levels, but they are for special cases and are 31 generally not used. See <filename>init(8)</filename> for more details), and 32 each one of those corresponds to the actions the computer is supposed to 33 perform when it starts up. The default run-level is 3. Here are the 34 descriptions of the different run-levels as they are implemented:</para> 31 35 32 36 <literallayout>0: halt the computer … … 37 41 5: same as 4, it is usually used for GUI login (like X's <command>xdm</command> or KDE's <command>kdm</command>) 38 42 6: reboot the computer</literallayout> 43 44 </sect2> 39 45 40 46 <sect2 id="conf-sysvinit" role="configuration"> … … 107 113 <filename>/var/log/boot.log</filename> at the end of the boot process.</para> 108 114 109 </sect2> 110 111 <sect2 id="init-levels" > 115 <sect3 id="init-levels" > 112 116 <title>Changing Run Levels</title> 113 117 … … 201 205 it can be done.</para> 202 206 207 </sect3> 203 208 </sect2> 204 209 210 <sect2 id="ch-scripts-clock"> 211 <title>Configuring the System Clock</title> 212 213 <sect3 id="ch-scripts-setclock"> 214 <title>System V Clock Configuration</title> 215 216 <indexterm zone="ch-scripts-setclock"> 217 <primary sortas="d-setclock">setclock</primary> 218 <secondary>configuring</secondary></indexterm> 219 220 <para>The <command>setclock</command> script reads the time from the hardware 221 clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor 222 (CMOS) clock. If the hardware clock is set to UTC, this script will convert the 223 hardware clock's time to the local time using the 224 <filename>/etc/localtime</filename> file (which tells the 225 <command>hwclock</command> program which timezone the user is in). There is no 226 way to detect whether or not the hardware clock is set to UTC, so this 227 needs to be configured manually.</para> 228 229 <para>The <command>setclock</command> is run via 230 <application>udev</application> when the kernel detects the hardware 231 capability upon boot. It can also be run manually with the stop parameter to 232 store the system time to the CMOS clock.</para> 233 234 <para>If you cannot remember whether or not the hardware clock is set to UTC, 235 find out by running the <userinput>hwclock --localtime --show</userinput> 236 command. This will display what the current time is according to the hardware 237 clock. If this time matches whatever your watch says, then the hardware clock is 238 set to local time. If the output from <command>hwclock</command> is not local 239 time, chances are it is set to UTC time. Verify this by adding or subtracting 240 the proper amount of hours for the timezone to the time shown by 241 <command>hwclock</command>. For example, if you are currently in the MST 242 timezone, which is also known as GMT -0700, add seven hours to the local 243 time.</para> 244 245 <para>Change the value of the <envar>UTC</envar> variable below 246 to a value of <parameter>0</parameter> (zero) if the hardware clock 247 is <emphasis>not</emphasis> set to UTC time.</para> 248 249 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running 250 the following:</para> 251 252 <screen><userinput>cat > /etc/sysconfig/clock << "EOF" 253 <literal># Begin /etc/sysconfig/clock 254 255 UTC=1 256 257 # Set this to any options you might need to give to hwclock, 258 # such as machine hardware clock type for Alphas. 259 CLOCKPARAMS= 260 261 # End /etc/sysconfig/clock</literal> 262 EOF</userinput></screen> 263 264 <para>A good hint explaining how to deal with time on LFS is available 265 at <ulink url="&hints-root;time.txt"/>. It explains issues such as 266 time zones, UTC, and the <envar>TZ</envar> environment variable.</para> 267 268 <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set 269 in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note> 270 271 </sect3> 272 </sect2> 273 274 <sect2 id="ch-scripts-console"> 275 <?dbhtml filename="console.html"?> 276 277 <title>Configuring the Linux Console</title> 278 279 <indexterm zone="ch-scripts-console"> 280 <primary sortas="d-console">console</primary> 281 <secondary>configuring</secondary> 282 </indexterm> 283 284 <para>This section discusses how to configure the <command>console</command> 285 bootscript that sets up the keyboard map, console font and console kernel log 286 level. If non-ASCII characters (e.g., the copyright sign, the British pound 287 sign and Euro symbol) will not be used and the keyboard is a U.S. one, much 288 of this section can be skipped. Without the configuration file, (or 289 equivalent settings in <filename>rc.site</filename>), the 290 <command>console</command> bootscript will do nothing.</para> 291 292 <para>The <command>console</command> script reads the 293 <filename>/etc/sysconfig/console</filename> file for configuration 294 information. Decide which keymap and screen font will be used. Various 295 language-specific HOWTOs can also help with this, see <ulink 296 url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in 297 doubt, look in the <filename class="directory">/usr/share/keymaps</filename> 298 and <filename class="directory">/usr/share/consolefonts</filename> directories 299 for valid keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and 300 <filename>setfont(8)</filename> manual pages to determine the correct 301 arguments for these programs.</para> 302 303 <para>The <filename>/etc/sysconfig/console</filename> file should contain lines 304 of the form: VARIABLE="value". The following variables are recognized:</para> 305 <variablelist> 306 307 <varlistentry> 308 <term>LOGLEVEL</term> 309 <listitem> 310 <para>This variable specifies the log level for kernel messages sent 311 to the console as set by <command>dmesg</command>. Valid levels are 312 from "1" (no messages) to "8". The default level is "7".</para> 313 </listitem> 314 </varlistentry> 315 316 <varlistentry> 317 <term>KEYMAP</term> 318 <listitem> 319 <para>This variable specifies the arguments for the 320 <command>loadkeys</command> program, typically, the name of keymap 321 to load, e.g., <quote>es</quote>. If this variable is not set, the 322 bootscript will not run the <command>loadkeys</command> program, 323 and the default kernel keymap will be used.</para> 324 </listitem> 325 </varlistentry> 326 327 <varlistentry> 328 <term>KEYMAP_CORRECTIONS</term> 329 <listitem> 330 <para>This (rarely used) variable 331 specifies the arguments for the second call to the 332 <command>loadkeys</command> program. This is useful if the stock keymap 333 is not completely satisfactory and a small adjustment has to be made. E.g., 334 to include the Euro sign into a keymap that normally doesn't have it, 335 set this variable to <quote>euro2</quote>.</para> 336 </listitem> 337 </varlistentry> 338 339 <varlistentry> 340 <term>FONT</term> 341 <listitem> 342 <para>This variable specifies the arguments for the 343 <command>setfont</command> program. Typically, this includes the font 344 name, <quote>-m</quote>, and the name of the application character 345 map to load. E.g., in order to load the <quote>lat1-16</quote> font 346 together with the <quote>8859-1</quote> application character map 347 (as it is appropriate in the USA), 348 <!-- because of the copyright sign --> 349 set this variable to <quote>lat1-16 -m 8859-1</quote>. 350 In UTF-8 mode, the kernel uses the application character map for 351 conversion of composed 8-bit key codes in the keymap to UTF-8, and thus 352 the argument of the "-m" parameter should be set to the encoding of the 353 composed key codes in the keymap.</para> 354 355 </listitem> 356 </varlistentry> 357 358 <varlistentry> 359 <term>UNICODE</term> 360 <listitem> 361 <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or 362 <quote>true</quote> in order to put the 363 console into UTF-8 mode. This is useful in UTF-8 based locales and 364 harmful otherwise.</para> 365 </listitem> 366 </varlistentry> 367 368 <varlistentry> 369 <term>LEGACY_CHARSET</term> 370 <listitem> 371 <para>For many keyboard layouts, there is no stock Unicode keymap in 372 the Kbd package. The <command>console</command> bootscript will 373 convert an available keymap to UTF-8 on the fly if this variable is 374 set to the encoding of the available non-UTF-8 keymap.</para> 375 </listitem> 376 </varlistentry> 377 378 </variablelist> 379 380 <para>Some examples:</para> 381 382 <itemizedlist> 383 384 <listitem> 385 <para>For a non-Unicode setup, only the KEYMAP and FONT variables are 386 generally needed. E.g., for a Polish setup, one would use:</para> 387 <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" 388 <literal># Begin /etc/sysconfig/console 389 390 KEYMAP="pl2" 391 FONT="lat2a-16 -m 8859-2" 392 393 # End /etc/sysconfig/console</literal> 394 EOF</userinput></screen> 395 </listitem> 396 397 <listitem> 398 <para>As mentioned above, it is sometimes necessary to adjust a 399 stock keymap slightly. The following example adds the Euro symbol to the 400 German keymap:</para> 401 402 <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" 403 <literal># Begin /etc/sysconfig/console 404 405 KEYMAP="de-latin1" 406 KEYMAP_CORRECTIONS="euro2" 407 FONT="lat0-16 -m 8859-15" 408 409 # End /etc/sysconfig/console</literal> 410 EOF</userinput></screen> 411 </listitem> 412 413 <listitem> 414 <para>The following is a Unicode-enabled example for Bulgarian, where a 415 stock UTF-8 keymap exists:</para> 416 417 <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" 418 <literal># Begin /etc/sysconfig/console 419 420 UNICODE="1" 421 KEYMAP="bg_bds-utf8" 422 FONT="LatArCyrHeb-16" 423 424 # End /etc/sysconfig/console</literal> 425 EOF</userinput></screen> 426 </listitem> 427 428 <listitem> 429 <para>Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous 430 example, bright colors are no longer available on the Linux console unless 431 a framebuffer is used. If one wants to have bright colors without 432 framebuffer and can live without characters not belonging to his language, 433 it is still possible to use a language-specific 256-glyph font, as 434 illustrated below:</para> 435 436 <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" 437 <literal># Begin /etc/sysconfig/console 438 439 UNICODE="1" 440 KEYMAP="bg_bds-utf8" 441 FONT="cyr-sun16" 442 443 # End /etc/sysconfig/console</literal> 444 EOF</userinput></screen> 445 </listitem> 446 447 <listitem> 448 <para>The following example illustrates keymap autoconversion from 449 ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para> 450 451 <screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" 452 <literal># Begin /etc/sysconfig/console 453 454 UNICODE="1" 455 KEYMAP="de-latin1" 456 KEYMAP_CORRECTIONS="euro2" 457 LEGACY_CHARSET="iso-8859-15" 458 FONT="LatArCyrHeb-16 -m 8859-15" 459 460 # End /etc/sysconfig/console</literal> 461 EOF</userinput></screen> 462 </listitem> 463 464 <listitem> 465 <para>Some keymaps have dead keys (i.e., keys that don't produce a 466 character by themselves, but put an accent on the character produced 467 by the next key) or define composition rules (such as: <quote>press 468 Ctrl+. A E to get Æ</quote> in the default keymap). 469 Linux-&linux-version; interprets dead keys and composition rules in the 470 keymap correctly only when the source characters to be composed together 471 are not multibyte. This deficiency doesn't affect keymaps for European 472 languages, because there accents are added to unaccented ASCII 473 characters, or two ASCII characters are composed together. However, in 474 UTF-8 mode it is a problem, e.g., for the Greek language, where one 475 sometimes needs to put an accent on the letter <quote>alpha</quote>. 476 The solution is either to avoid the use of UTF-8, or to install the 477 X window system that doesn't have this limitation in its input 478 handling.</para> 479 </listitem> 480 481 <listitem> 482 <para>For Chinese, Japanese, Korean and some other languages, the Linux 483 console cannot be configured to display the needed characters. Users 484 who need such languages should install the X Window System, fonts that 485 cover the necessary character ranges, and the proper input method (e.g., 486 SCIM, it supports a wide variety of languages).</para> 487 </listitem> 488 489 </itemizedlist> 490 491 <!-- Added because folks keep posting their console file with X questions 492 to blfs-support list --> 493 <note> 494 <para>The <filename>/etc/sysconfig/console</filename> file only controls 495 the Linux text console localization. It has nothing to do with setting 496 the proper keyboard layout and terminal fonts in the X Window System, with 497 ssh sessions or with a serial console. In such situations, limitations 498 mentioned in the last two list items above do not apply.</para> 499 </note> 500 501 </sect2> 502 503 <sect2 id="ch-scripts-createfiles"> 504 <title>Creating Files at Boot</title> 505 506 <indexterm zone="ch-scripts-createfiles"> 507 <primary sortas="d-createfiles">File creation at boot</primary> 508 <secondary>configuring</secondary> 509 </indexterm> 510 511 <para>At times, it is desired to create files at boot time. For instance, 512 the <filename class="directory">/tmp/.ICE-unix</filename> directory 513 may be desired. This can be done by creating an entry in the 514 <filename>/etc/sysconfig/createfiles</filename> configuration script. 515 The format of this file is embedded in the comments of the default 516 configuration file.</para> 517 </sect2> 518 519 <sect2 id="ch-scripts-sysklogd"> 520 <title>Configuring the sysklogd Script</title> 521 522 <indexterm zone="ch-scripts-sysklogd"> 523 <primary sortas="d-sysklogd">sysklogd</primary> 524 <secondary>configuring</secondary> 525 </indexterm> 526 527 <para>The <filename>sysklogd</filename> script invokes the 528 <command>syslogd</command> program as a part of System V initialization. The 529 <parameter>-m 0</parameter> option turns off the periodic timestamp mark that 530 <command>syslogd</command> writes to the log files every 20 minutes by 531 default. If you want to turn on this periodic timestamp mark, edit 532 <filename>/etc/sysconfig/rc.site</filename> and define the variable 533 SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters, 534 set the variable to a null value:</para> 535 536 <screen role="nodump">SYSKLOGD_PARMS=</screen> 537 538 <para>See <userinput>man syslogd</userinput> for more options.</para> 539 540 </sect2> 541 542 <sect2 id="ch-scripts-site"> 543 <title>The rc.site File</title> 544 545 <indexterm zone="ch-scripts-site"> 546 <primary sortas="a-rc.site">rc.site</primary> 547 </indexterm> 548 549 <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains 550 settings that are automatically set for each SystemV boot script. It can 551 alternatively set the values specified in the <filename>hostname</filename>, 552 <filename>console</filename>, and <filename>clock</filename> files in the 553 <filename class='directory'>/etc/sysconfig/</filename> directory. If the 554 associated variables are present in both these separate files and 555 <filename>rc.site</filename>, the values in the script specific files have 556 precedence. </para> 557 558 <para><filename>rc.site</filename> also contains parameters that can 559 customize other aspects of the boot process. Setting the IPROMPT variable 560 will enable selective running of bootscripts. Other options are described 561 in the file comments. The default version of the file is as follows:</para> 562 563 <!-- Use role to fix a pdf generation problem --> 564 <screen role="auto">&site;</screen> 565 566 <sect3> 567 <title>Customizing the Boot and Shutdown Scripts</title> 568 569 <para>The LFS boot scripts boot and shut down a system in a fairly 570 efficient manner, but there are a few tweaks that you can make in the 571 rc.site file to improve speed even more and to adjust messages according 572 to your preferences. To do this, adjust the settings in 573 the <filename>/etc/sysconfig/rc.site</filename> file above.</para> 574 575 <itemizedlist> 576 577 <listitem><para>During the boot script <filename>udev</filename>, there is 578 a call to <command>udev settle</command> that requires some time to 579 complete. This time may or may not be required depending on devices present 580 in the system. If you only have simple partitions and a single ethernet 581 card, the boot process will probably not need to wait for this command. To 582 skip it, set the variable OMIT_UDEV_SETTLE=y.</para></listitem> 583 584 <listitem><para>The boot script <filename>udev_retry</filename> also runs 585 <command>udev settle</command> by default. This command is only needed by 586 default if the <filename class='directory'>/var</filename> directory is 587 separately mounted. This is because the clock needs the file 588 <filename>/var/lib/hwclock/adjtime</filename>. Other customizations may 589 also need to wait for udev to complete, but in many installations it is not 590 needed. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y. 591 </para></listitem> 592 593 <listitem><para>By default, the file system checks are silent. This can 594 appear to be a delay during the bootup process. To turn on the 595 <command>fsck</command> output, set the variable VERBOSE_FSCK=y. 596 </para></listitem> 597 598 <listitem><para>When rebooting, you may want to skip the filesystem check, 599 <command>fsck</command>, completely. To do this, either create the file 600 <filename>/fastboot</filename> or reboot the system with the command 601 <command>/sbin/shutdown -f -r now</command>. On the other hand, you can 602 force all file systems to be checked by creating 603 <filename>/forcefsck</filename> or running <command>shutdown</command> with 604 the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>. 605 </para> 606 607 <para>Setting the variable FASTBOOT=y will disable <command>fsck</command> 608 during the boot process until it is removed. This is not recommended 609 on a permanent basis.</para></listitem> 610 611 <listitem><para>Normally, all files in the <filename 612 class='directory'>/tmp</filename> directory are deleted at boot time. 613 Depending on the number of files or directories present, this can cause a 614 noticeable delay in the boot process. To skip removing these files set the 615 variable SKIPTMPCLEAN=y.</para></listitem> 616 617 <listitem><para>During shutdown, the <command>init</command> program sends 618 a TERM signal to each program it has started (e.g. agetty), waits for a set 619 time (default 3 seconds), and sends each process a KILL signal and waits 620 again. This process is repeated in the <command>sendsignals</command> 621 script for any processes that are not shut down by their own scripts. The 622 delay for <command>init</command> can be set by passing a parameter. For 623 example to remove the delay in <command>init</command>, pass the -t0 624 parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown 625 -t0 -r now</command>). The delay for the <command>sendsignals</command> 626 script can be skipped by setting the parameter 627 KILLDELAY=0.</para></listitem> 628 629 </itemizedlist> 630 631 </sect3> 632 </sect2> 205 633 </sect1> -
chapter08/grub.xml
rc65dd23e rbf58c1e 114 114 </sect2> 115 115 116 <sect2 >117 <title>Creating the Configuration File</title>116 <sect2 id="grub-cfg"> 117 <title>Creating the GRUB Configuration File</title> 118 118 119 119 <para>Generate <filename>/boot/grub/grub.cfg</filename>:</para> -
general.ent
rc65dd23e rbf58c1e 1 <!ENTITY version "SVN-201404 18">2 <!ENTITY releasedate "April 18, 2014">1 <!ENTITY version "SVN-20140421"> 2 <!ENTITY releasedate "April 21, 2014"> 3 3 <!ENTITY copyrightdate "1999-2014"><!-- jhalfs needs a literal dash, not – --> 4 4 <!ENTITY milestone "8.0">
Note:
See TracChangeset
for help on using the changeset viewer.