From 1d317bbf0530462f7963d100291de7c2775c9c10 Mon Sep 17 00:00:00 2001 From: Manuel Canales Esparcia Date: Mon, 20 Dec 2004 19:09:48 +0000 Subject: [PATCH] Removed text in chapter 07. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4440 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter07/bootscripts.xml | 173 +------------------------------------ chapter07/console.xml | 72 --------------- chapter07/hostname.xml | 8 -- chapter07/hosts.xml | 29 ------- chapter07/inputrc.xml | 39 --------- chapter07/introduction.xml | 15 +--- chapter07/network.xml | 53 +----------- chapter07/profile.xml | 80 +---------------- chapter07/setclock.xml | 16 ---- chapter07/usage.xml | 94 +------------------- 10 files changed, 6 insertions(+), 573 deletions(-) diff --git a/chapter07/bootscripts.xml b/chapter07/bootscripts.xml index 15375460f..c8e358326 100644 --- a/chapter07/bootscripts.xml +++ b/chapter07/bootscripts.xml @@ -10,7 +10,6 @@ Bootscripts -<para>The LFS-Bootscripts package contains a set of bootscripts.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -18,10 +17,6 @@ <seglistitem><seg>0.1 SBU</seg><seg>0.3 MB</seg></seglistitem> </segmentedlist> -<segmentedlist> -<segtitle>LFS-Bootscripts installation depends on</segtitle> -<seglistitem><seg>Bash, Coreutils</seg></seglistitem> -</segmentedlist> </sect2> <sect2 role="installation"> @@ -42,173 +37,7 @@ make install-syslog-ng</userinput></screen> <sect2 id="contents-bootscripts" role="content"><title>Contents of LFS-bootscripts - -Installed scripts -checkfs, cleanfs, console, functions, halt, ifdown, ifup, -localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals, setclock, static, -swap, sysklogd and template - - -Short descriptions - - -checkfs - -checkfs -checks the file systems just before they are mounted (with the exception of journal -and network based file systems). - - - - -cleanfs - -cleanfs -removes files that shouldn't be -preserved between reboots, such as those in /var/run/ and -/var/lock/. It re-creates /var/run/utmp -and removes the possibly present /etc/nologin, -/fastboot and /forcefsck files. - - - - -console - -console -loads the keymap table you specified as proper for your keyboard layout. -It also sets the screen font. - - - - -functions - -functions -contains functions shared among -different scripts, such as error and status checking. - - - - -halt - -halt -halts the system. - - - - -ifdown and ifup - -ifdown -assist the network script with network devices. - - - - -localnet - -localnet -sets up the system's hostname and local loopback device. - - - - -mountfs - -mountfs -mounts all file systems that -aren't marked noauto or aren't network based. - - - - -mountkernfs - -mountkernfs -is used to mount kernel-provided file systems, such as proc. - - - - -network - -network -sets up network interfaces, such -as network cards, and sets up the default gateway where applicable. - - - - -rc - -rc -is the master run-level control script. -It is responsible for running all the other scripts one-by-one, in a sequence -determined by the name of the symbolic links being processed. - - - - -reboot - -reboot -reboots the system. - - - - -sendsignals - -sendsignals -makes sure every process is terminated before the system reboots or halts. - - - - -setclock - -setclock -resets the kernel clock to -localtime in case the hardware clock isn't set to GMT time. - - - - -static - -static -provides the functionality needed -to assign a static IP address to a network interface. - - - - -swap - -swap -enables and disables swap files and partitions. - - - - -sysklogd - -syslog-ng -starts and stops the system and kernel log daemons. - - - - -template - -template -is a template you can use to -create your own bootscripts for your other daemons. - - - +See testing diff --git a/chapter07/console.xml b/chapter07/console.xml index dd6103f51..9469cc94a 100644 --- a/chapter07/console.xml +++ b/chapter07/console.xml @@ -11,66 +11,11 @@ console configuring -In this section we will configure the console -initscript that sets up the keyboard -map and the console font. If you -don't need to use any non-ASCII characters -(British pound and Euro character are not ASCII), -and your keyboard is a US one, you can skip this section. -Without the configuration file, -the console initscript will do nothing. - -The console script uses the -/etc/sysconfig/console -as a configuration file. You need to decide which keymap and screen font you -will use. The language-specific HOWTO can help you. -A pre-made -/etc/sysconfig/console file with known -good settings for several countries was installed with the LFS-Bootscripts -package, and you just have to uncomment -the relevant section if your country is supported (but read the rest -of this section anyway). -If still in doubt, -look into /usr/share/kbd -for valid keymaps and screen fonts. Then read the loadkeys -and setfont manual pages and figure out the correct -arguments for these programs. -Once you decided, create the -configuration file with the following command: - cat >/etc/sysconfig/console <<"EOF" KEYMAP="[arguments for loadkeys]" FONT="[arguments for setfont]" EOF -E.g., for Spanish users who also want to use the Euro character -(accessible by pressing AltGr+E), -the following settings are correct: - -cat >/etc/sysconfig/console <<"EOF" -KEYMAP="es euro2" -FONT="lat9-16 -u iso01" -EOF - -The FONT line above is correct only for the ISO-8859-15 -character set. If you prefer ISO-8859-1 and therefore use a pound sign -instead of Euro, the correct FONT line is: - -FONT="lat1-16" - -If the KEYMAP or FONT variable is not set, the -console initscript will not run the corresponding -program. - -In some keymaps, the Backspace and Delete keys send characters -different form ones in the default keymap built into the kernel. -This confuses some applications, e.g., Emacs -displays its help (instead of erasing the character before the cursor) -when you press Backspace. To check if your keymap is affected (this works -only for i386 keymaps): - -zgrep '\W14\W' [/path/to/your/keymap] - If you see that keycode 14 is Backspace and not Delete, create the following keymap snippet to fix this issue: @@ -91,22 +36,5 @@ after the main keymap: KEYMAP_CORRECTION="/etc/kbd/bs-sends-del" EOF -If you want to compile your keymap directly into the kernel instead of -setting it every time from the console bootscript, then -instructions are given in . Doing this -ensures that your keyboard will always work as expected, even when you boot into -maintenance mode (by passing init=/bin/sh to the kernel), -as in that situation, the console bootscript won't be run. -Additionally, the kernel will not set the screen font automatically. Again, -this shouldn't pose too many problems as ASCII characters will still be handled -correctly, and it is unlikely that you would need to rely on non-ASCII -characters whilst in maintenance mode. - -Since the kernel will set up the keymap, you can omit the KEYMAP variable -from the /etc/sysconfig/console configuration file. If you -wish, you can still have it, this isn't going to hurt you. Keeping it could even -be beneficial, in case you run a lot of different kernels and can't be sure that -the keymap is compiled into every one of them. - diff --git a/chapter07/hostname.xml b/chapter07/hostname.xml index 9320fee1d..f51f08a62 100644 --- a/chapter07/hostname.xml +++ b/chapter07/hostname.xml @@ -11,17 +11,9 @@ localnet configuring -Part of the localnet script is setting up the system's hostname. This -needs to be configured in the /etc/sysconfig/network. - Create the /etc/sysconfig/network file and enter a hostname by running: echo "HOSTNAME=[lfs]" > /etc/sysconfig/network -[lfs] needs to be replaced with the name the computer is -to be called. You should not enter the FQDN (Fully Qualified Domain -Name) here. That information will be put in the -/etc/hosts file later on. - diff --git a/chapter07/hosts.xml b/chapter07/hosts.xml index a9cbd4b3e..b945d9c21 100644 --- a/chapter07/hosts.xml +++ b/chapter07/hosts.xml @@ -17,30 +17,6 @@ network /etc/hosts -If a network card is to be configured, you have to decide on the -IP-address, FQDN and possible aliases for use in the /etc/hosts file. The -syntax is: - -<IP address> myhost.example.org aliases - -Unless your computer is to be visible to the Internet (e.g., you have a -registered domain and a valid block of assigned IP addresses - most of us don't -have this) you should make sure that the IP-address is in the private network -IP-address range. Valid ranges are: - - Class Networks - A 10.0.0.0 - B 172.16.0.0 through 172.31.0.0 - C 192.168.0.0 through 192.168.255.0 - -A valid IP address could be 192.168.1.1. A valid FQDN for this IP could -be www.linuxfromscratch.org (not recommended as this is a valid registered domain -address and could cause your domain name server problems). - -If you aren't going to use a network card, you still need to -come up with a FQDN. This is necessary for certain programs to operate -correctly. - If a network card is not going to be configured, create the /etc/hosts file by running: @@ -64,9 +40,4 @@ EOF # End /etc/hosts (network card version) EOF -Of course, the [192.168.1.1] and [<value of HOSTNAME>.example.org] -have to be changed to your liking (or requirements if assigned an IP-address -by a network/system administrator and this machine is planned to be connected -to an existing network). - diff --git a/chapter07/inputrc.xml b/chapter07/inputrc.xml index 977e9755f..2f8a33912 100644 --- a/chapter07/inputrc.xml +++ b/chapter07/inputrc.xml @@ -9,45 +9,6 @@ /etc/inputrc -/etc/inputrc deals with the mapping of the keyboard for -certain situations. This file is the start-up file used by -readline - the input related library used by -Bash and most other shells. - -For more information see info bash -- Node: Readline Init file as well as -info readline. There is a lot that can be done with this -one rc file. - -Global values are set in /etc/inputrc. -Personal user values are set in ~/.inputrc. The -~/.inputrc file will override the global settings -file. A later page sets up Bash to use -/etc/inputrc if there is no -.inputrc for a user when -/etc/profile is read (usually at login). If you -want your system to use both, or don't want global -keyboard handling, it is a good idea to place a default -.inputrc into the /etc/skel -directory for use with new users. - - -Below is a base /etc/inputrc along with -comments to explain what the various options do. Note that comments -can not be on the same line as commands. - - -If you will create an .inputrc in -/etc/skel using the command below, change the -command's output to /etc/skel/.inputrc and be -sure to check/set permissions afterward. Then you can just copy that -file to /etc/inputrc and the home directory -of any user already existing in the system, including root, that needs -a private version of the file. Be sure to use the -p parameter -of cp to maintain permissions and be sure to change owner and group -appropriately. - - cat > /etc/inputrc << "EOF" # Begin /etc/inputrc diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml index 9f1343c54..144cdfce4 100644 --- a/chapter07/introduction.xml +++ b/chapter07/introduction.xml @@ -7,19 +7,6 @@ Introduction -In this chapter we will install the bootscripts and set them up -properly. Most of these scripts will work without needing to modify them, but -a few require additional configuration files, since they deal with hardware -dependent information. - -We have chosen to use System-V style init scripts simply because they -are widely used and we feel comfortable with them. If you would prefer to try -something else: Marc Heerdink has written a hint about BSD style init scripts, -to be found at . And if you'd like -something more radical, search the LFS mailing lists for depinit. - - -If you decide to use some other style of init scripts, you can skip this -chapter and move on to . +See testing diff --git a/chapter07/network.xml b/chapter07/network.xml index 8ccb09318..44e5ad01b 100644 --- a/chapter07/network.xml +++ b/chapter07/network.xml @@ -11,31 +11,10 @@ network configuring -This section only applies if you're going to configure a network -card. - -If you don't have any network cards, you are most likely not going to -create any configuration files relating to network cards. If that is the -case, you must remove the network symlinks from all the -run-level directories -(/etc/rc.d/rc*.d) - Creating network interface configuration files -Which interfaces are brought up and down by the network script depends on -the files in the /etc/sysconfig/network-devices directory. This -directory should contain subdirectories in the form of -ifconfig.xyz, where xyz is a network -interface name (such as eth0) - -If you decide to rename or move this -/etc/sysconfig/network-devices directory, -make sure you update the /etc/sysconfig/rc file as well and -update the network_devices by providing it with the new path. - -Now, new files are created in that directory. The following command -creates a sample ipv4 file for the +The following command creates a sample ipv4 file for the eth0 device: cd /etc/sysconfig/network-devices && @@ -49,35 +28,13 @@ PREFIX=24 BROADCAST=192.168.1.255 EOF -Of course, the values of those variables have to be changed in every file -to match the proper setup. If the ONBOOT variable is set to yes, -the network script will bring up the equivalent interface during the booting of -the system. If set to anything but yes, the equivalent interface -will be ignored by the network script and not brought up. - -The SERVICE entry defines the method of obtaining the IP address. The LFS -bootscripts have a modular IP assignment format, and by creating additional -files in -/etc/sysconfig/network-devices/services, -you can allow other IP assignment methods. This would commonly be used if you -need DHCP, which is addressed in the BLFS book. - -Of course, GATEWAY should contain the IP of your default gateway, if you -have one. If not, then don't include the GATEWAY line in the configuration -file. - Creating the /etc/resolv.conf file /etc/resolv.conf -If you're going to be connected to the Internet then most likely you'll -need some means of DNS name resolution to resolve Internet domain names to IP -addresses. This is best achieved by placing the IP address of your assigned DNS -resolver, available from your ISP (Internet Service Provider) or network -administrator, into /etc/resolv.conf. Create the file by -running the following: +Create the file by running the following: cat > /etc/resolv.conf << "EOF" # Begin /etc/resolv.conf @@ -88,12 +45,6 @@ nameserver [IP address of your nameserver] # End /etc/resolv.conf EOF -Of course, replace -[IP address of your nameserver] with the IP address -of the DNS resolver assigned for your use. There will often be more than one -entry (requirements demand secondary servers for fallback capability). The IP -address may even be a router on your local network. - diff --git a/chapter07/profile.xml b/chapter07/profile.xml index 35bb9e70c..5bf3c281c 100644 --- a/chapter07/profile.xml +++ b/chapter07/profile.xml @@ -9,71 +9,7 @@ /etc/profile -The shell program /bin/bash (hereafter -referred to as just the shell) uses a collection of startup files to -help create an environment to run in. Each file has a specific use and -may affect login and interactive environments differently. The files in -the /etc directory generally provide global -settings. If an equivalent file exists in your home directory it may -override the global settings. - - -An interactive login shell is started after a successful login, using -/bin/login, by reading the -/etc/passwd file. An -interactive non-login shell is started at the command-line (e.g., -[prompt]$/bin/bash). A non-interactive -shell is usually present when a shell script is running. It is non-interactive -because it is processing a script and not waiting for user input between -commands. - -For more information see info bash -- -Nodes: Bash Startup Files and Interactive -Shells. - -The files /etc/profile and -~/.bash_profile are read when the shell is invoked -as an interactive login shell. - -A base /etc/profile created below sets some -environment variables necessary for native language support. By setting them -properly, you get: - - -the output of programs translated into your native -language; -correct classification of characters into letters, digits and -other classes - this is necessary for Bash to accept non-ASCII characters -in command lines properly in non-English locales; -the alphabetical sorting order correct for your -country; -good default paper size; -correct formatting of monetary, time and date -values. - - -This script also sets the INPUTRC environment variable that makes -Bash and Readline use -the /etc/inputrc file we created earlier. - -Replace [ll] below with the -two-letter code for your language (e.g., en) and -[CC] with the two-letter code for your country -(e.g., GB). Also you may need to specify -(and this is actually the preferred form) your -character encoding (e.g. iso8859-1) after a dot -(so that the result is en_GB.iso8859-1). -Issue the following command for more information: - -man 3 setlocale - -The list of all locales supported by Glibc can be obtained by running -the following command: - -locale -a - -Now, when you are sure about your locale settings, create the -/etc/profile file: +Create the /etc/profile file: cat > /etc/profile << "EOF" # Begin /etc/profile @@ -85,18 +21,4 @@ export INPUTRC=/etc/inputrc # End /etc/profile EOF -The C (default) and en_US -(the recommended one for US English users) locales are -different. - -Setting the keyboard layout, -the screen font and the locale-related environment variables -are the only internationalization steps needed to support -locales that use ordinary single-byte encodings and left-to-right -writing direction. More complex cases (including UTF-8 based locales) -require additional steps and additional patches because many applications -tend to break in such conditions. Because of too little educational -value for a typical reader, these steps and patches are not included -in the LFS book and such locales are not supported by LFS in any way. - diff --git a/chapter07/setclock.xml b/chapter07/setclock.xml index ad794cb9e..fd15f66de 100644 --- a/chapter07/setclock.xml +++ b/chapter07/setclock.xml @@ -11,17 +11,6 @@ setclock configuring -This setclock script reads the time from your hardware clock, also -known as BIOS or CMOS (Complementry Metal-Oxide Semiconductor) clock, and either converts that time to localtime -using the /etc/localtime file (if the hardware clock -is set to GMT) or not (if the hardware clock is already set to localtime). -There is no way to auto-detect whether the hardware clock is set to GMT or -not, so we need to configure that here ourselves. - -Change the value of the UTC variable below to a -0 (zero) if your hardware clock is not set to GMT -time. - Create a new file /etc/sysconfig/clock by running the following: @@ -33,9 +22,4 @@ UTC=1 # End /etc/sysconfig/clock EOF -Now, you may want to take a look at a very good hint explaining how we -deal with time on LFS at . -It explains issues such as time zones, UTC, and the TZ environment -variable. - diff --git a/chapter07/usage.xml b/chapter07/usage.xml index 6893762ba..9382a7226 100644 --- a/chapter07/usage.xml +++ b/chapter07/usage.xml @@ -11,98 +11,6 @@ Bootscripts usage -Linux uses a special booting facility named SysVinit. It's based on a -concept of run-levels. It can be widely different -from one system to another, so it can't be assumed that because things -worked in <insert distro name> they should work like that in LFS -too. LFS has its own way of doing things, but it respects generally -accepted standards. - -SysVinit (which we'll call init from now on) works -using a run-levels scheme. There are 7 (from 0 to 6) run-levels -(actually, there are more run-levels but they are for special cases and -generally not used. The init man page describes those details), and each -one of those corresponds to the things the computer is supposed to do when -it starts up. The default run-level is 3. Here are the descriptions of the -different run-levels as they are often implemented: - -0: halt the computer -1: single-user mode -2: multi-user mode without networking -3: multi-user mode with networking -4: reserved for customization, otherwise does the same as 3 -5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm) -6: reboot the computer - -The command used to change run-levels is init -<runlevel> where <runlevel> is the target run-level. For -example, to reboot the computer, a user would issue the init -6 command. The reboot command is just an alias for -it, as is the halt command an alias for init -0. - -There are a number of directories under /etc/rc.d -that look like like rc?.d (where ? is the -number of the run-level) and rcsysinit.d -all containing a number of symbolic links. Some begin with a K, the others begin -with an S, and all of them have two numbers following the initial letter. The K -means to stop (kill) a service, and the S means to start a service. The numbers -determine the order in which the scripts are run, from 00 to 99; the lower the -number the sooner it gets executed. When init switches to another run-level, the -appropriate services get killed and others get started. - -The real scripts are in /etc/rc.d/init.d. -They do all the work, and the symlinks all point to them. Killing links and starting links -point to the same script in /etc/rc.d/init.d. -That's because the scripts can be called with different parameters like -start, stop, -restart, reload, -status. When a K link is encountered, the appropriate -script is run with the stop argument. When an S link is -encountered, the appropriate script is run with the start -argument. - -There is one exception. Links that start with an S in the -rc0.d and rc6.d directories will not cause anything to be started. They -will be called with the parameter stop to stop -something. The logic behind it is that when you are going to reboot or -halt the system, you don't want to start anything, only stop the -system. - -These are descriptions of what the arguments make the -scripts do: - - - -start -The service is started. - - - -stop -The service is stopped. - - - -restart -The service is stopped and then started again. - - - -reload -The configuration of the service is updated. -This is used after the configuration file of a service was modified, when -the service doesn't need to be restarted. - - - -status -Tells if the service is running and with which PIDs. - - - -Feel free to modify the way the boot process works (after all, it's your -own LFS system). The files given here are just an example of how it can be -done in a nice way (well, what we consider nice -- you may hate it). +See testing