Changeset 1d317bb
- Timestamp:
- 12/20/2004 07:09:48 PM (20 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, 12.2, 12.2-rc1, 6.1, 6.1.1, 6.3, 6.4, 6.5, 6.6, 6.7, 6.8, 7.0, 7.1, 7.2, 7.3, 7.4, 7.5, 7.5-systemd, 7.6, 7.6-systemd, 7.7, 7.7-systemd, 7.8, 7.8-systemd, 7.9, 7.9-systemd, 8.0, 8.1, 8.2, 8.3, 8.4, 9.0, 9.1, arm, bdubbs/gcc13, ml-11.0, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/loongarch-12.2, xry111/mips64el, xry111/multilib, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
- Children:
- d16b694b
- Parents:
- e0a04e8
- Location:
- chapter07
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter07/bootscripts.xml
re0a04e8 r1d317bb 11 11 12 12 <sect2 role="package"><title/> 13 <para>The LFS-Bootscripts package contains a set of bootscripts.</para>14 13 15 14 <segmentedlist> … … 19 18 </segmentedlist> 20 19 21 <segmentedlist>22 <segtitle>LFS-Bootscripts installation depends on</segtitle>23 <seglistitem><seg>Bash, Coreutils</seg></seglistitem>24 </segmentedlist>25 20 </sect2> 26 21 … … 43 38 <sect2 id="contents-bootscripts" role="content"><title>Contents of LFS-bootscripts</title> 44 39 45 <segmentedlist> 46 <segtitle>Installed scripts</segtitle> 47 <seglistitem><seg>checkfs, cleanfs, console, functions, halt, ifdown, ifup, 48 localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals, setclock, static, 49 swap, sysklogd and template</seg></seglistitem> 50 </segmentedlist> 51 52 <variablelist><title>Short descriptions</title> 53 54 <varlistentry id="checkfs-bootscripts"> 55 <term><command>checkfs</command></term> 56 <listitem> 57 <indexterm zone="ch-scripts-bootscripts checkfs-bootscripts"><primary sortas="d-checkfs">checkfs</primary></indexterm> 58 <para>checks the file systems just before they are mounted (with the exception of journal 59 and network based file systems).</para> 60 </listitem> 61 </varlistentry> 62 63 <varlistentry id="cleanfs-bootscripts"> 64 <term><command>cleanfs</command></term> 65 <listitem> 66 <indexterm zone="ch-scripts-bootscripts cleanfs-bootscripts"><primary sortas="d-cleanfs">cleanfs</primary></indexterm> 67 <para>removes files that shouldn't be 68 preserved between reboots, such as those in <filename class="directory">/var/run/</filename> and 69 <filename class="directory">/var/lock/</filename>. It re-creates <filename>/var/run/utmp</filename> 70 and removes the possibly present <filename>/etc/nologin</filename>, 71 <filename>/fastboot</filename> and <filename>/forcefsck</filename> files.</para> 72 </listitem> 73 </varlistentry> 74 75 <varlistentry id="console-bootscripts"> 76 <term><command>console</command></term> 77 <listitem> 78 <indexterm zone="ch-scripts-bootscripts console-bootscripts"><primary sortas="d-console">console</primary></indexterm> 79 <para>loads the keymap table you specified as proper for your keyboard layout. 80 It also sets the screen font.</para> 81 </listitem> 82 </varlistentry> 83 84 <varlistentry id="functions-bootscripts"> 85 <term><command>functions</command></term> 86 <listitem> 87 <indexterm zone="ch-scripts-bootscripts functions-bootscripts"><primary sortas="d-functions">functions</primary></indexterm> 88 <para>contains functions shared among 89 different scripts, such as error and status checking.</para> 90 </listitem> 91 </varlistentry> 92 93 <varlistentry id="halt-bootscripts"> 94 <term><command>halt</command></term> 95 <listitem> 96 <indexterm zone="ch-scripts-bootscripts halt-bootscripts"><primary sortas="d-halt">halt</primary></indexterm> 97 <para>halts the system.</para> 98 </listitem> 99 </varlistentry> 100 101 <varlistentry id="ifdown-bootscripts"> 102 <term><command>ifdown</command> and <command>ifup</command></term> 103 <listitem> 104 <indexterm zone="ch-scripts-bootscripts ifdown-bootscripts"><primary sortas="d-ifdown">ifdown</primary></indexterm> 105 <para>assist the network script with network devices.</para> 106 </listitem> 107 </varlistentry> 108 109 <varlistentry id="localnet-bootscripts"> 110 <term><command>localnet</command></term> 111 <listitem> 112 <indexterm zone="ch-scripts-bootscripts localnet-bootscripts"><primary sortas="d-localnet">localnet</primary></indexterm> 113 <para>sets up the system's hostname and local loopback device.</para> 114 </listitem> 115 </varlistentry> 116 117 <varlistentry id="mountfs-bootscripts"> 118 <term><command>mountfs</command></term> 119 <listitem> 120 <indexterm zone="ch-scripts-bootscripts mountfs-bootscripts"><primary sortas="d-mountfs">mountfs</primary></indexterm> 121 <para>mounts all file systems that 122 aren't marked <emphasis>noauto</emphasis> or aren't network based.</para> 123 </listitem> 124 </varlistentry> 125 126 <varlistentry id="mountkernfs-bootscripts"> 127 <term><command>mountkernfs</command></term> 128 <listitem> 129 <indexterm zone="ch-scripts-bootscripts mountkernfs-bootscripts"><primary sortas="d-mountkernfs">mountkernfs</primary></indexterm> 130 <para>is used to mount kernel-provided file systems, such as <systemitem class="filesystem">proc</systemitem>.</para> 131 </listitem> 132 </varlistentry> 133 134 <varlistentry id="network-bootscripts"> 135 <term><command>network</command></term> 136 <listitem> 137 <indexterm zone="ch-scripts-bootscripts network-bootscripts"><primary sortas="d-network">network</primary></indexterm> 138 <para>sets up network interfaces, such 139 as network cards, and sets up the default gateway where applicable.</para> 140 </listitem> 141 </varlistentry> 142 143 <varlistentry id="rc-bootscripts"> 144 <term><command>rc</command></term> 145 <listitem> 146 <indexterm zone="ch-scripts-bootscripts rc-bootscripts"><primary sortas="d-rc">rc</primary></indexterm> 147 <para>is the master run-level control script. 148 It is responsible for running all the other scripts one-by-one, in a sequence 149 determined by the name of the symbolic links being processed.</para> 150 </listitem> 151 </varlistentry> 152 153 <varlistentry id="reboot-bootscripts"> 154 <term><command>reboot</command></term> 155 <listitem> 156 <indexterm zone="ch-scripts-bootscripts reboot-bootscripts"><primary sortas="d-reboot">reboot</primary></indexterm> 157 <para>reboots the system.</para> 158 </listitem> 159 </varlistentry> 160 161 <varlistentry id="sendsignals-bootscripts"> 162 <term><command>sendsignals</command></term> 163 <listitem> 164 <indexterm zone="ch-scripts-bootscripts sendsignals-bootscripts"><primary sortas="d-sendsignals">sendsignals</primary></indexterm> 165 <para>makes sure every process is terminated before the system reboots or halts.</para> 166 </listitem> 167 </varlistentry> 168 169 <varlistentry id="setclock-bootscripts"> 170 <term><command>setclock</command></term> 171 <listitem> 172 <indexterm zone="ch-scripts-bootscripts setclock-bootscripts"><primary sortas="d-setclock">setclock</primary></indexterm> 173 <para>resets the kernel clock to 174 localtime in case the hardware clock isn't set to GMT time.</para> 175 </listitem> 176 </varlistentry> 177 178 <varlistentry id="static-bootscripts"> 179 <term><command>static</command></term> 180 <listitem> 181 <indexterm zone="ch-scripts-bootscripts static-bootscripts"><primary sortas="d-static">static</primary></indexterm> 182 <para>provides the functionality needed 183 to assign a static IP address to a network interface.</para> 184 </listitem> 185 </varlistentry> 186 187 <varlistentry id="swap-bootscripts"> 188 <term><command>swap</command></term> 189 <listitem> 190 <indexterm zone="ch-scripts-bootscripts swap-bootscripts"><primary sortas="d-swap">swap</primary></indexterm> 191 <para>enables and disables swap files and partitions.</para> 192 </listitem> 193 </varlistentry> 194 195 <varlistentry id="syslogng-bootscripts"> 196 <term><command>sysklogd</command></term> 197 <listitem> 198 <indexterm zone="ch-scripts-bootscripts syslogng-bootscripts"><primary sortas="d-syslogng">syslog-ng</primary></indexterm> 199 <para>starts and stops the system and kernel log daemons.</para> 200 </listitem> 201 </varlistentry> 202 203 <varlistentry id="template-bootscripts"> 204 <term><command>template</command></term> 205 <listitem> 206 <indexterm zone="ch-scripts-bootscripts template-bootscripts"><primary sortas="d-template">template</primary></indexterm> 207 <para>is a template you can use to 208 create your own bootscripts for your other daemons.</para> 209 </listitem> 210 </varlistentry> 211 </variablelist> 40 <para>See testing</para> 212 41 213 42 </sect2> -
chapter07/console.xml
re0a04e8 r1d317bb 12 12 <secondary>configuring</secondary></indexterm> 13 13 14 <para>In this section we will configure the <command>console</command>15 initscript that sets up the keyboard16 map and the console font. If you17 don't need to use any non-ASCII characters18 (British pound and Euro character are not ASCII),19 and your keyboard is a US one, you can skip this section.20 Without the configuration file,21 the <command>console</command> initscript will do nothing.</para>22 23 <para>The <command>console</command> script uses the24 <filename>/etc/sysconfig/console</filename>25 as a configuration file. You need to decide which keymap and screen font you26 will use. The language-specific HOWTO can help you.27 A pre-made28 <filename>/etc/sysconfig/console</filename> file with known29 good settings for several countries was installed with the LFS-Bootscripts30 package, and you just have to uncomment31 the relevant section if your country is supported (but read the rest32 of this section anyway).33 If still in doubt,34 look into <filename class="directory">/usr/share/kbd</filename>35 for valid keymaps and screen fonts. Then read the <command>loadkeys</command>36 and <command>setfont</command> manual pages and figure out the correct37 arguments for these programs.38 Once you decided, create the39 configuration file with the following command:</para>40 41 14 <screen><userinput>cat >/etc/sysconfig/console <<"EOF" 42 15 KEYMAP="<replaceable>[arguments for loadkeys]</replaceable>" 43 16 FONT="<replaceable>[arguments for setfont]</replaceable>" 44 17 EOF</userinput></screen> 45 46 <para>E.g., for Spanish users who also want to use the Euro character47 (accessible by pressing AltGr+E),48 the following settings are correct:</para>49 50 <screen><userinput>cat >/etc/sysconfig/console <<"EOF"51 KEYMAP="es euro2"52 FONT="lat9-16 -u iso01"53 EOF</userinput></screen>54 55 <note><para>The FONT line above is correct only for the ISO-8859-1556 character set. If you prefer ISO-8859-1 and therefore use a pound sign57 instead of Euro, the correct FONT line is:</para>58 59 <screen><userinput>FONT="lat1-16"</userinput></screen></note>60 61 <para>If the KEYMAP or FONT variable is not set, the62 <command>console</command> initscript will not run the corresponding63 program.</para>64 65 <para>In some keymaps, the Backspace and Delete keys send characters66 different form ones in the default keymap built into the kernel.67 This confuses some applications, e.g., <application>Emacs</application>68 displays its help (instead of erasing the character before the cursor)69 when you press Backspace. To check if your keymap is affected (this works70 only for i386 keymaps):</para>71 72 <screen><userinput>zgrep '\W14\W' <replaceable>[/path/to/your/keymap]</replaceable></userinput></screen>73 18 74 19 <para>If you see that keycode 14 is Backspace and not Delete, … … 92 37 EOF</userinput></screen> 93 38 94 <para>If you want to compile your keymap directly into the kernel instead of95 setting it every time from the <command>console</command> bootscript, then96 instructions are given in <xref linkend="ch-bootable-kernel"/>. Doing this97 ensures that your keyboard will always work as expected, even when you boot into98 maintenance mode (by passing <parameter>init=/bin/sh</parameter> to the kernel),99 as in that situation, the <command>console</command> bootscript won't be run.100 Additionally, the kernel will not set the screen font automatically. Again,101 this shouldn't pose too many problems as ASCII characters will still be handled102 correctly, and it is unlikely that you would need to rely on non-ASCII103 characters whilst in maintenance mode.</para>104 105 <para>Since the kernel will set up the keymap, you can omit the KEYMAP variable106 from the <filename>/etc/sysconfig/console</filename> configuration file. If you107 wish, you can still have it, this isn't going to hurt you. Keeping it could even108 be beneficial, in case you run a lot of different kernels and can't be sure that109 the keymap is compiled into every one of them.</para>110 111 39 </sect1> 112 40 -
chapter07/hostname.xml
re0a04e8 r1d317bb 12 12 <secondary>configuring</secondary></indexterm> 13 13 14 <para>Part of the localnet script is setting up the system's hostname. This15 needs to be configured in the <filename>/etc/sysconfig/network</filename>.</para>16 17 14 <para>Create the <filename>/etc/sysconfig/network</filename> file and enter a hostname by 18 15 running:</para> … … 20 17 <screen><userinput>echo "HOSTNAME=<replaceable>[lfs]</replaceable>" > /etc/sysconfig/network</userinput></screen> 21 18 22 <para><replaceable>[lfs]</replaceable> needs to be replaced with the name the computer is23 to be called. You should not enter the FQDN (Fully Qualified Domain24 Name) here. That information will be put in the25 <filename>/etc/hosts</filename> file later on.</para>26 27 19 </sect1> -
chapter07/hosts.xml
re0a04e8 r1d317bb 17 17 <primary sortas="d-network">network</primary> 18 18 <secondary>/etc/hosts</secondary></indexterm> 19 20 <para>If a network card is to be configured, you have to decide on the21 IP-address, FQDN and possible aliases for use in the <filename>/etc/hosts</filename> file. The22 syntax is:</para>23 24 <screen><IP address> myhost.example.org aliases</screen>25 26 <para>Unless your computer is to be visible to the Internet (e.g., you have a27 registered domain and a valid block of assigned IP addresses - most of us don't28 have this) you should make sure that the IP-address is in the private network29 IP-address range. Valid ranges are:</para>30 31 <screen> Class Networks32 A 10.0.0.033 B 172.16.0.0 through 172.31.0.034 C 192.168.0.0 through 192.168.255.0</screen>35 36 <para>A valid IP address could be 192.168.1.1. A valid FQDN for this IP could37 be www.linuxfromscratch.org (not recommended as this is a valid registered domain38 address and could cause your domain name server problems).</para>39 40 <para>If you aren't going to use a network card, you still need to41 come up with a FQDN. This is necessary for certain programs to operate42 correctly.</para>43 19 44 20 <para>If a network card is not going to be configured, create the … … 65 41 EOF</userinput></screen> 66 42 67 <para>Of course, the <replaceable>[192.168.1.1]</replaceable> and <replaceable>[<value of HOSTNAME>.example.org]</replaceable>68 have to be changed to your liking (or requirements if assigned an IP-address69 by a network/system administrator and this machine is planned to be connected70 to an existing network).</para>71 72 43 </sect1> -
chapter07/inputrc.xml
re0a04e8 r1d317bb 9 9 10 10 <indexterm zone="ch-scripts-inputrc"><primary sortas="e-/etc/inputrc">/etc/inputrc</primary></indexterm> 11 12 <para><filename>/etc/inputrc</filename> deals with the mapping of the keyboard for13 certain situations. This file is the start-up file used by14 <application>readline</application> - the input related library used by15 <application>Bash</application> and most other shells.</para>16 17 <para>For more information see <command>info bash</command> -- <emphasis18 role="strong">Node: Readline Init</emphasis> file as well as19 <command>info readline</command>. There is a lot that can be done with this20 one rc file.</para>21 22 <para>Global values are set in <filename>/etc/inputrc</filename>.23 Personal user values are set in <filename>~/.inputrc</filename>. The24 <filename>~/.inputrc</filename> file will override the global settings25 file. A later page sets up <application>Bash</application> to use26 <filename>/etc/inputrc</filename> if there is no27 <filename>.inputrc</filename> for a user when28 <filename>/etc/profile</filename> is read (usually at login). If you29 want your system to use both, or don't want <emphasis>global</emphasis>30 keyboard handling, it is a good idea to place a default31 <filename>.inputrc</filename> into the <filename class="directory">/etc/skel</filename>32 directory for use with new users.</para>33 34 <para>35 Below is a base <filename>/etc/inputrc</filename> along with36 comments to explain what the various options do. Note that comments37 can <emphasis>not</emphasis> be on the same line as commands.38 </para>39 40 <para>If you will create an <filename>.inputrc</filename> in41 <filename class="directory">/etc/skel</filename> using the command below, change the42 command's output to <filename>/etc/skel/.inputrc</filename> and be43 sure to check/set permissions afterward. Then you can just copy that44 file to <filename>/etc/inputrc</filename> and the home directory45 of any user already existing in the system, including root, that needs46 a private version of the file. Be sure to use the <parameter>-p</parameter> parameter47 of <command>cp</command> to maintain permissions and be sure to change owner and group48 appropriately.49 </para>50 11 51 12 <screen><userinput>cat > /etc/inputrc << "EOF" -
chapter07/introduction.xml
re0a04e8 r1d317bb 8 8 <?dbhtml filename="introduction.html"?> 9 9 10 <para>In this chapter we will install the bootscripts and set them up 11 properly. Most of these scripts will work without needing to modify them, but 12 a few require additional configuration files, since they deal with hardware 13 dependent information.</para> 14 15 <para>We have chosen to use System-V style init scripts simply because they 16 are widely used and we feel comfortable with them. If you would prefer to try 17 something else: Marc Heerdink has written a hint about BSD style init scripts, 18 to be found at <ulink url="&hints-root;bsd-init.txt"/>. And if you'd like 19 something more radical, search the LFS mailing lists for <quote>depinit</quote>. 20 </para> 21 22 <para>If you decide to use some other style of init scripts, you can skip this 23 chapter and move on to <xref linkend="chapter-bootable"/>.</para> 10 <para>See testing</para> 24 11 25 12 </sect1> -
chapter07/network.xml
re0a04e8 r1d317bb 12 12 <secondary>configuring</secondary></indexterm> 13 13 14 <para>This section only applies if you're going to configure a network15 card.</para>16 17 <para>If you don't have any network cards, you are most likely not going to18 create any configuration files relating to network cards. If that is the19 case, you must remove the <filename class="symlink">network</filename> symlinks from all the20 run-level directories21 (<filename class="directory">/etc/rc.d/rc*.d</filename>)</para>22 23 14 <sect2> 24 15 <title>Creating network interface configuration files</title> 25 16 26 <para>Which interfaces are brought up and down by the network script depends on 27 the files in the <filename class="directory">/etc/sysconfig/network-devices</filename> directory. This 28 directory should contain subdirectories in the form of 29 <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> is a network 30 interface name (such as eth0)</para> 31 32 <para>If you decide to rename or move this 33 <filename class="directory">/etc/sysconfig/network-devices</filename> directory, 34 make sure you update the <filename>/etc/sysconfig/rc</filename> file as well and 35 update the <quote>network_devices</quote> by providing it with the new path.</para> 36 37 <para>Now, new files are created in that directory. The following command 38 creates a sample <filename>ipv4</filename> file for the 17 <para>The following command creates a sample <filename>ipv4</filename> file for the 39 18 <filename>eth0</filename> device:</para> 40 19 … … 50 29 EOF</userinput></screen> 51 30 52 <para>Of course, the values of those variables have to be changed in every file53 to match the proper setup. If the ONBOOT variable is set to <quote>yes</quote>,54 the network script will bring up the equivalent interface during the booting of55 the system. If set to anything but <quote>yes</quote>, the equivalent interface56 will be ignored by the network script and not brought up.</para>57 58 <para>The SERVICE entry defines the method of obtaining the IP address. The LFS59 bootscripts have a modular IP assignment format, and by creating additional60 files in61 <filename class="directory">/etc/sysconfig/network-devices/services</filename>,62 you can allow other IP assignment methods. This would commonly be used if you63 need DHCP, which is addressed in the BLFS book.</para>64 65 <para>Of course, GATEWAY should contain the IP of your default gateway, if you66 have one. If not, then don't include the GATEWAY line in the configuration67 file.</para>68 69 31 </sect2> 70 32 … … 73 35 <indexterm zone="resolv.conf"><primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary></indexterm> 74 36 75 <para>If you're going to be connected to the Internet then most likely you'll 76 need some means of DNS name resolution to resolve Internet domain names to IP 77 addresses. This is best achieved by placing the IP address of your assigned DNS 78 resolver, available from your ISP (Internet Service Provider) or network 79 administrator, into <filename>/etc/resolv.conf</filename>. Create the file by 80 running the following:</para> 37 <para>Create the file by running the following:</para> 81 38 82 39 <screen><userinput>cat > /etc/resolv.conf << "EOF" … … 89 46 EOF</userinput></screen> 90 47 91 <para>Of course, replace92 <replaceable>[IP address of your nameserver]</replaceable> with the IP address93 of the DNS resolver assigned for your use. There will often be more than one94 entry (requirements demand secondary servers for fallback capability). The IP95 address may even be a router on your local network.</para>96 97 48 </sect2> 98 49 -
chapter07/profile.xml
re0a04e8 r1d317bb 10 10 <indexterm zone="ch-scripts-profile"><primary sortas="e-/etc/profile">/etc/profile</primary></indexterm> 11 11 12 <para>The shell program <command>/bin/bash</command> (hereafter 13 referred to as just <quote>the shell</quote>) uses a collection of startup files to 14 help create an environment to run in. Each file has a specific use and 15 may affect login and interactive environments differently. The files in 16 the <filename class="directory">/etc</filename> directory generally provide global 17 settings. If an equivalent file exists in your home directory it may 18 override the global settings. 19 </para> 20 21 <para>An interactive login shell is started after a successful login, using 22 <command>/bin/login</command>, by reading the 23 <filename>/etc/passwd</filename> file. An 24 interactive non-login shell is started at the command-line (e.g., 25 <prompt>[prompt]$</prompt><command>/bin/bash</command>). A non-interactive 26 shell is usually present when a shell script is running. It is non-interactive 27 because it is processing a script and not waiting for user input between 28 commands.</para> 29 30 <para>For more information see <command>info bash</command> -- 31 <emphasis role="strong">Nodes: Bash Startup Files and Interactive 32 Shells.</emphasis></para> 33 34 <para>The files <filename>/etc/profile</filename> and 35 <filename>~/.bash_profile</filename> are read when the shell is invoked 36 as an interactive login shell.</para> 37 38 <para>A base <filename>/etc/profile</filename> created below sets some 39 environment variables necessary for native language support. By setting them 40 properly, you get: 41 </para> 42 <itemizedlist> 43 <listitem><para>the output of programs translated into your native 44 language;</para></listitem> 45 <listitem><para>correct classification of characters into letters, digits and 46 other classes - this is necessary for Bash to accept non-ASCII characters 47 in command lines properly in non-English locales;</para></listitem> 48 <listitem><para>the alphabetical sorting order correct for your 49 country;</para></listitem> 50 <listitem><para>good default paper size;</para></listitem> 51 <listitem><para>correct formatting of monetary, time and date 52 values.</para></listitem> 53 </itemizedlist> 54 55 <para>This script also sets the INPUTRC environment variable that makes 56 <application>Bash</application> and <application>Readline</application> use 57 the <filename>/etc/inputrc</filename> file we created earlier.</para> 58 59 <para>Replace <replaceable>[ll]</replaceable> below with the 60 two-letter code for your language (e.g., <quote>en</quote>) and 61 <replaceable>[CC]</replaceable> with the two-letter code for your country 62 (e.g., <quote>GB</quote>). Also you may need to specify 63 (and this is actually the preferred form) your 64 character encoding (e.g. <quote>iso8859-1</quote>) after a dot 65 (so that the result is <quote>en_GB.iso8859-1</quote>). 66 Issue the following command for more information:</para> 67 68 <screen><userinput>man 3 setlocale</userinput></screen> 69 70 <para>The list of all locales supported by Glibc can be obtained by running 71 the following command:</para> 72 73 <screen><userinput>locale -a</userinput></screen> 74 75 <para>Now, when you are sure about your locale settings, create the 76 <filename>/etc/profile</filename> file:</para> 12 <para>Create the <filename>/etc/profile</filename> file:</para> 77 13 78 14 <screen><userinput>cat > /etc/profile << "EOF" … … 86 22 EOF</userinput></screen> 87 23 88 <note><para>The <quote>C</quote> (default) and <quote>en_US</quote>89 (the recommended one for US English users) locales are90 different.</para></note>91 92 <para>Setting the keyboard layout,93 the screen font and the locale-related environment variables94 are the only internationalization steps needed to support95 locales that use ordinary single-byte encodings and left-to-right96 writing direction. More complex cases (including UTF-8 based locales)97 require additional steps and additional patches because many applications98 tend to break in such conditions. Because of too little educational99 value for a typical reader, these steps and patches are not included100 in the LFS book and such locales are not supported by LFS in any way.101 </para>102 24 </sect1> -
chapter07/setclock.xml
re0a04e8 r1d317bb 12 12 <secondary>configuring</secondary></indexterm> 13 13 14 <para>This <command>setclock</command> script reads the time from your hardware clock, also15 known as BIOS or CMOS (Complementry Metal-Oxide Semiconductor) clock, and either converts that time to localtime16 using the <filename>/etc/localtime</filename> file (if the hardware clock17 is set to GMT) or not (if the hardware clock is already set to localtime).18 There is no way to auto-detect whether the hardware clock is set to GMT or19 not, so we need to configure that here ourselves.</para>20 21 <para>Change the value of the <emphasis>UTC</emphasis> variable below to a22 <parameter>0</parameter> (zero) if your hardware clock is not set to GMT23 time.</para>24 25 14 <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running 26 15 the following:</para> … … 34 23 EOF</userinput></screen> 35 24 36 <para>Now, you may want to take a look at a very good hint explaining how we37 deal with time on LFS at <ulink url="&hints-root;time.txt"/>.38 It explains issues such as time zones, UTC, and the TZ environment39 variable.</para>40 41 25 </sect1> -
chapter07/usage.xml
re0a04e8 r1d317bb 12 12 <secondary>usage</secondary></indexterm> 13 13 14 <para>Linux uses a special booting facility named SysVinit. It's based on a 15 concept of <emphasis>run-levels</emphasis>. It can be widely different 16 from one system to another, so it can't be assumed that because things 17 worked in <insert distro name> they should work like that in LFS 18 too. LFS has its own way of doing things, but it respects generally 19 accepted standards.</para> 20 21 <para>SysVinit (which we'll call <emphasis>init</emphasis> from now on) works 22 using a run-levels scheme. There are 7 (from 0 to 6) run-levels 23 (actually, there are more run-levels but they are for special cases and 24 generally not used. The <command>init</command> man page describes those details), and each 25 one of those corresponds to the things the computer is supposed to do when 26 it starts up. The default run-level is 3. Here are the descriptions of the 27 different run-levels as they are often implemented:</para> 28 29 <literallayout>0: halt the computer 30 1: single-user mode 31 2: multi-user mode without networking 32 3: multi-user mode with networking 33 4: reserved for customization, otherwise does the same as 3 34 5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm) 35 6: reboot the computer</literallayout> 36 37 <para>The command used to change run-levels is <command>init 38 <runlevel></command> where <runlevel> is the target run-level. For 39 example, to reboot the computer, a user would issue the <userinput>init 40 6</userinput> command. The <command>reboot</command> command is just an alias for 41 it, as is the <command>halt</command> command an alias for <command>init 42 0</command>.</para> 43 44 <para>There are a number of directories under <filename class="directory">/etc/rc.d</filename> 45 that look like like <filename class="directory">rc?.d</filename> (where ? is the 46 number of the run-level) and <filename class="directory">rcsysinit.d</filename> 47 all containing a number of symbolic links. Some begin with a K, the others begin 48 with an S, and all of them have two numbers following the initial letter. The K 49 means to stop (kill) a service, and the S means to start a service. The numbers 50 determine the order in which the scripts are run, from 00 to 99; the lower the 51 number the sooner it gets executed. When init switches to another run-level, the 52 appropriate services get killed and others get started.</para> 53 54 <para>The real scripts are in <filename class="directory">/etc/rc.d/init.d</filename>. 55 They do all the work, and the symlinks all point to them. Killing links and starting links 56 point to the same script in <filename class="directory">/etc/rc.d/init.d</filename>. 57 That's because the scripts can be called with different parameters like 58 <parameter>start</parameter>, <parameter>stop</parameter>, 59 <parameter>restart</parameter>, <parameter>reload</parameter>, 60 <parameter>status</parameter>. When a K link is encountered, the appropriate 61 script is run with the <parameter>stop</parameter> argument. When an S link is 62 encountered, the appropriate script is run with the <parameter>start</parameter> 63 argument.</para> 64 65 <para>There is one exception. Links that start with an S in the 66 rc0.d and rc6.d directories will not cause anything to be started. They 67 will be called with the parameter <parameter>stop</parameter> to stop 68 something. The logic behind it is that when you are going to reboot or 69 halt the system, you don't want to start anything, only stop the 70 system.</para> 71 72 <para>These are descriptions of what the arguments make the 73 scripts do:</para> 74 75 <variablelist> 76 <varlistentry> 77 <term><parameter>start</parameter></term> 78 <listitem><para>The service is started.</para></listitem> 79 </varlistentry> 80 81 <varlistentry> 82 <term><parameter>stop</parameter></term> 83 <listitem><para>The service is stopped.</para></listitem> 84 </varlistentry> 85 86 <varlistentry> 87 <term><parameter>restart</parameter></term> 88 <listitem><para>The service is stopped and then started again.</para></listitem> 89 </varlistentry> 90 91 <varlistentry> 92 <term><parameter>reload</parameter></term> 93 <listitem><para>The configuration of the service is updated. 94 This is used after the configuration file of a service was modified, when 95 the service doesn't need to be restarted.</para></listitem> 96 </varlistentry> 97 98 <varlistentry> 99 <term><parameter>status</parameter></term> 100 <listitem><para>Tells if the service is running and with which PIDs.</para></listitem> 101 </varlistentry> 102 </variablelist> 103 104 <para>Feel free to modify the way the boot process works (after all, it's your 105 own LFS system). The files given here are just an example of how it can be 106 done in a nice way (well, what we consider nice -- you may hate it).</para> 14 <para>See testing</para> 107 15 108 16 </sect1>
Note:
See TracChangeset
for help on using the changeset viewer.