From fcc027677da55c41dcaea045f5b9ff8b088e6495 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Sun, 7 Jun 2020 20:16:00 +0000 Subject: Initial commit of alternative cross LFS git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11897 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter09/bootscripts.xml | 331 ++++++++++++++++++++ chapter09/chapter09.xml | 36 ++- chapter09/clock.xml | 104 +++++++ chapter09/consoled.xml | 139 +++++++++ chapter09/etcshells.xml | 49 +++ chapter09/getcounted.xml | 20 -- chapter09/inputrc.xml | 82 +++++ chapter09/introduction.xml | 225 ++++++++++++++ chapter09/introductiond.xml | 73 +++++ chapter09/locale.xml | 152 +++++++++ chapter09/network.xml | 247 +++++++++++++++ chapter09/networkd.xml | 335 ++++++++++++++++++++ chapter09/profile.xml | 162 ++++++++++ chapter09/reboot.xml | 113 ------- chapter09/symlinks.xml | 256 ++++++++++++++++ chapter09/systemd-custom.xml | 313 +++++++++++++++++++ chapter09/theend.xml | 84 ----- chapter09/udev.xml | 342 +++++++++++++++++++++ chapter09/usage.xml | 710 +++++++++++++++++++++++++++++++++++++++++++ chapter09/whatnow.xml | 92 ------ 20 files changed, 3550 insertions(+), 315 deletions(-) create mode 100644 chapter09/bootscripts.xml create mode 100644 chapter09/clock.xml create mode 100644 chapter09/consoled.xml create mode 100644 chapter09/etcshells.xml delete mode 100644 chapter09/getcounted.xml create mode 100644 chapter09/inputrc.xml create mode 100644 chapter09/introduction.xml create mode 100644 chapter09/introductiond.xml create mode 100644 chapter09/locale.xml create mode 100644 chapter09/network.xml create mode 100644 chapter09/networkd.xml create mode 100644 chapter09/profile.xml delete mode 100644 chapter09/reboot.xml create mode 100644 chapter09/symlinks.xml create mode 100644 chapter09/systemd-custom.xml delete mode 100644 chapter09/theend.xml create mode 100644 chapter09/udev.xml create mode 100644 chapter09/usage.xml delete mode 100644 chapter09/whatnow.xml (limited to 'chapter09') diff --git a/chapter09/bootscripts.xml b/chapter09/bootscripts.xml new file mode 100644 index 000000000..5c2b28d7c --- /dev/null +++ b/chapter09/bootscripts.xml @@ -0,0 +1,331 @@ + + + %general-entities; +]> + + + + + + bootscripts + &lfs-bootscripts-version; +
&lfs-bootscripts-url;
+
+ + LFS-Bootscripts-&lfs-bootscripts-version; + + + Bootscripts + + + + + + <para>The LFS-Bootscripts package contains a set of scripts to start/stop + the LFS system at bootup/shutdown. + The configuration files and procedures needed to + customize the boot process are described in the following sections.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&lfs-bootscripts-ch7-sbu;</seg> + <seg>&lfs-bootscripts-ch7-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of LFS-Bootscripts + + Install the package: + +make install + + + + + Contents of LFS-Bootscripts + + Installed scripts + Installed directories + + + checkfs, cleanfs, console, functions, halt, ifdown, + ifup, localnet, modules, mountfs, mountvirtfs, network, rc, reboot, + sendsignals, setclock, ipv4-static, swap, sysctl, sysklogd, template, + udev, and udev_retry + /etc/rc.d, /etc/init.d (symbolic link), /etc/sysconfig, + /lib/services, /lib/lsb (symbolic link) + + + + + Short Descriptions + + + + + checkfs + + Checks the integrity of the file systems before they are mounted + (with the exception of journal and network based file systems) + + checkfs + + + + + + cleanfs + + Removes files that should not 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 + + cleanfs + + + + + + console + + Loads the correct keymap table for the desired keyboard layout; + it also sets the screen font + + console + + + + + + functions + + Contains common functions, such as error and status checking, + that are used by several bootscripts + + functions + + + + + + halt + + Halts the system + + halt + + + + + + ifdown + + Stops a network device + + ifdown + + + + + + ifup + + Initializes a network device + + ifup + + + + + + localnet + + Sets up the system's hostname and local loopback device + + localnet + + + + + + modules + + Loads kernel modules listed in + /etc/sysconfig/modules, using arguments + that are also given there + + modules + + + + + + mountfs + + Mounts all file systems, except ones that are marked + noauto or are network based + + mountfs + + + + + + mountvirtfs + + Mounts virtual kernel file systems, such as proc + + mountvirtfs + + + + + + network + + Sets up network interfaces, such as network cards, and sets up + the default gateway (where applicable) + + network + + + + + + rc + + The master run-level control script; it is responsible for + running all the other bootscripts one-by-one, in a sequence determined + by the name of the symbolic links being processed + + rc + + + + + + reboot + + Reboots the system + + reboot + + + + + + sendsignals + + Makes sure every process is terminated before the system reboots + or halts + + sendsignals + + + + + + setclock + + Resets the kernel clock to local time in case the hardware clock + is not set to UTC time + + setclock + + + + + + ipv4-static + + Provides the functionality needed to assign a static Internet + Protocol (IP) address to a network interface + + ipv4-static + + + + + + swap + + Enables and disables swap files and partitions + + swap + + + + + + sysctl + + Loads system configuration values from + /etc/sysctl.conf, if that file exists, + into the running kernel + + sysctl + + + + + + sysklogd + + Starts and stops the system and kernel log daemons + + sysklogd + + + + + + template + + A template to create custom bootscripts for other + daemons + + template + + + + + + udev + + Prepares the /dev + directory and starts Udev + + udev + + + + + + udev_retry + + Retries failed udev uevents, and copies generated rules + files from /run/udev to + /etc/udev/rules.d if required + + udev_retry + + + + + + + + +
diff --git a/chapter09/chapter09.xml b/chapter09/chapter09.xml index c8deeb388..499e66a6f 100644 --- a/chapter09/chapter09.xml +++ b/chapter09/chapter09.xml @@ -5,15 +5,39 @@ %general-entities; ]> - + - The End + System Configuration - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chapter09/clock.xml b/chapter09/clock.xml new file mode 100644 index 000000000..872ba677c --- /dev/null +++ b/chapter09/clock.xml @@ -0,0 +1,104 @@ + + + %general-entities; +]> + + + + + Configuring the system clock + + + clock + configuring + + This section discusses how to configure the + systemd-timedated system service, which configures + system clock and timezone. + + If you cannot remember whether or not the hardware clock is set to UTC, + find out by running the hwclock --localtime --show + command. This will display what the current time is according to the hardware + clock. If this time matches whatever your watch says, then the hardware clock is + set to local time. If the output from hwclock is not local + time, chances are it is set to UTC time. Verify this by adding or subtracting + the proper amount of hours for the timezone to the time shown by + hwclock. For example, if you are currently in the MST + timezone, which is also known as GMT -0700, add seven hours to the local + time. + + systemd-timedated reads /etc/adjtime, + and depending on the contents of the file, it sets the clock to either UTC or + local time. + + Create the /etc/adjtime file with the following contents + if your hardware clock is set to local time: + +cat > /etc/adjtime << "EOF" +0.0 0 0.0 +0 +LOCAL +EOF + + If /etc/adjtime isn't present at first boot, + systemd-timedated will assume that hardware clock is + set to UTC and adjust the file according to that. + + You can also use the timedatectl utility to tell + systemd-timedated if your hardware clock is set to + UTC or local time: + +timedatectl set-local-rtc 1 + + timedatectl can also be used to change system time and + time zone. + + To change your current system time, issue: + +timedatectl set-time YYYY-MM-DD HH:MM:SS + + Hardware clock will also be updated accordingly. + + To change your current time zone, issue: + +timedatectl set-timezone TIMEZONE + + You can get a list of available time zones by running: + +timedatectl list-timezones + + Please note that the timedatectl command can + be used only on a system booted with systemd. + + + Network Time Synchronization + + Starting with version 213, systemd ships a daemon called + systemd-timesyncd which can be used to + synchronize the system time with remote NTP servers. + + The daemon is not intended as a replacement for the well + established NTP daemon, but as a client only implementation + of the SNTP protocol which can be used for less advanced + tasks and on resource limited systems. + + Starting with systemd version 216, the + systemd-timesyncd daemon is enabled by + default. If you want to disable it, issue the following + command: + +systemctl disable systemd-timesyncd + + The /etc/systemd/timesyncd.conf file + can be used to change the NTP servers that + systemd-timesyncd synchronizes with. + + Please note that when system clock is set to Local Time, + systemd-timesyncd won't update hardware + clock. + + + + diff --git a/chapter09/consoled.xml b/chapter09/consoled.xml new file mode 100644 index 000000000..bf1fdc8e0 --- /dev/null +++ b/chapter09/consoled.xml @@ -0,0 +1,139 @@ + + + %general-entities; +]> + + + + + Configuring the Linux Console + + + console + configuring + + + This section discusses how to configure the + systemd-vconsole-setup system service, which configures + the virtual console font and console keymap. + + The systemd-vconsole-setup service reads the + /etc/vconsole.conf file for configuration + information. Decide which keymap and screen font will be used. Various + language-specific HOWTOs can also help with this, see . + Examine localectl list-keymaps output for a list of + valid console keymaps. Look in + /usr/share/consolefonts + directory for valid screen fonts. + + The /etc/vconsole.conf file should contain lines + of the form: VARIABLE="value". The following variables are recognized: + + + + + KEYMAP + + This variable specifies the key mapping table for the keyboard. If + unset, it defaults to us. + + + + + KEYMAP_TOGGLE + + This variable can be used to configure a second toggle keymap and + is unset by default. + + + + + FONT + + This variable specifies the font used by the virtual + console. + + + + + FONT_MAP + + This variable specifies the console map to be used. + + + + + FONT_UNIMAP + + This variable specifies the Unicode font map. + + + + + + An example for a German keyboard and console is given below: + +cat > /etc/vconsole.conf << "EOF" +KEYMAP=de-latin1 +FONT=Lat2-Terminus16 +EOF + + You can change KEYMAP value at runtime by using the + localectl utility: + +localectl set-keymap MAP + + Please note that the localectl command can + be used only on a system booted with systemd. + + You can also use localectl utility with the + corresponding parameters to change X11 keyboard layout, model, variant + and options: + +localectl set-x11-keymap LAYOUT [MODEL] [VARIANT] [OPTIONS] + + To list possible values for localectl set-x11-keymap + parameters, run localectl with parameters listed below: + + + + + + list-x11-keymap-models + + Show known X11 keyboard mapping models. + + + + + list-x11-keymap-layouts + + Show known X11 keyboard mapping layouts. + + + + + list-x11-keymap-variants + + Show known X11 keyboard mapping variants. + + + + + list-x11-keymap-options + + Show known X11 keyboard mapping options. + + + + + + Using any of the parameters listed above requires the + XKeyboard Config package from BLFS. + + diff --git a/chapter09/etcshells.xml b/chapter09/etcshells.xml new file mode 100644 index 000000000..30961c80c --- /dev/null +++ b/chapter09/etcshells.xml @@ -0,0 +1,49 @@ + + + %general-entities; +]> + + + + + + Creating the /etc/shells File + + + /etc/shells + + + The shells file contains a list of + login shells on the system. Applications use this file to determine + whether a shell is valid. For each shell a single line should be + present, consisting of the shell's path, relative to the root of the + directory structure (/). + + For example, this file is consulted by chsh + to determine whether an unprivileged user may change the login shell for her + own account. If the command name is not listed, the user will be denied of + change. + + It is a requirement for applications such as + GDM which does not populate the + face browser if it can't find /etc/shells, or + FTP daemons which traditionally disallow access to users + with shells not included in this file. + +cat > /etc/shells << "EOF" +# Begin /etc/shells + +/bin/sh +/bin/bash + +# End /etc/shells +EOF + + diff --git a/chapter09/getcounted.xml b/chapter09/getcounted.xml deleted file mode 100644 index bc0ad8908..000000000 --- a/chapter09/getcounted.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - %general-entities; -]> - - - - - Get Counted - - Now that you have finished the book, do you want to be counted as an - LFS user? Head over to and - register as an LFS user by entering your name and the first LFS version you - have used. - - Let's reboot into LFS now. - - diff --git a/chapter09/inputrc.xml b/chapter09/inputrc.xml new file mode 100644 index 000000000..00d36877f --- /dev/null +++ b/chapter09/inputrc.xml @@ -0,0 +1,82 @@ + + + %general-entities; +]> + + + + + Creating the /etc/inputrc File + + + /etc/inputrc + + + The inputrc file is the configuration file for + the Readline library, which provides editing capabilities while the user is + entering a line from the terminal. It works by translating keyboard inputs + into specific actions. Readline is used by Bash and most other shells as + well as many other applications. + + Most people do not need user-specific functionality so the command + below creates a global /etc/inputrc used by everyone who + logs in. If you later decide you need to override the defaults on a per-user + basis, you can create a .inputrc file in the user's home + directory with the modified mappings. + + For more information on how to edit the inputrc + file, see info bash under the Readline Init + File section. info readline is also a good + source of information. + + Below is a generic global inputrc along with comments + to explain what the various options do. Note that comments cannot be on the same + line as commands. Create the file using the following command: + +cat > /etc/inputrc << "EOF" +# Begin /etc/inputrc +# Modified by Chris Lynn <roryo@roryo.dynup.net> + +# Allow the command prompt to wrap to the next line +set horizontal-scroll-mode Off + +# Enable 8bit input +set meta-flag On +set input-meta On + +# Turns off 8th bit stripping +set convert-meta Off + +# Keep the 8th bit for display +set output-meta On + +# none, visible or audible +set bell-style none + +# All of the following map the escape sequence of the value +# contained in the 1st argument to the readline specific functions +"\eOd": backward-word +"\eOc": forward-word + +# for linux console +"\e[1~": beginning-of-line +"\e[4~": end-of-line +"\e[5~": beginning-of-history +"\e[6~": end-of-history +"\e[3~": delete-char +"\e[2~": quoted-insert + +# for xterm +"\eOH": beginning-of-line +"\eOF": end-of-line + +# for Konsole +"\e[H": beginning-of-line +"\e[F": end-of-line + +# End /etc/inputrc +EOF + + diff --git a/chapter09/introduction.xml b/chapter09/introduction.xml new file mode 100644 index 000000000..cbc197a7b --- /dev/null +++ b/chapter09/introduction.xml @@ -0,0 +1,225 @@ + + + %general-entities; +]> + + + + + Introduction + + Booting a Linux system involves several tasks. The process must + mount both virtual and real file systems, initialize devices, activate swap, + check file systems for integrity, mount any swap partitions or files, set + the system clock, bring up networking, start any daemons required by the + system, and accomplish any other custom tasks needed by the user. This + process must be organized to ensure the tasks are performed in the correct + order but, at the same time, be executed as fast as possible. + + + + + System V + + System V is the classic boot process that has been used in Unix and + Unix-like systems such as Linux since about 1983. It consists of a small + program, init, that sets up basic programs such as + login (via getty) and runs a script. This script, + usually named rc, controls the execution of a set of + additional scripts that perform the tasks required to initialize the + system. + + The init program is controlled by the + /etc/inittab file and is organized into run levels that + can be run by the user: + + +0 — halt +1 — Single user mode +2 — Multiuser, without networking +3 — Full multiuser mode +4 — User definable +5 — Full multiuser mode with display manager +6 — reboot + + + The usual default run level is 3 or 5. + + Advantages + + + + Established, well understood system. + + + + Easy to customize. + + + + + + Disadvantages + + + + Slower to boot. A medium speed base LFS system + takes 8-12 seconds where the boot time is measured from the + first kernel message to the login prompt. Network + connectivity is typically established about 2 seconds + after the login prompt. + + + + Serial processing of boot tasks. This is related to the previous + point. A delay in any process such as a file system check, will + delay the entire boot process. + + + + Does not directly support advanced features like + control groups (cgroups), and per-user fair share scheduling. + + + + Adding scripts requires manual, static sequencing decisions. + + + + + + + + diff --git a/chapter09/introductiond.xml b/chapter09/introductiond.xml new file mode 100644 index 000000000..fa2403edb --- /dev/null +++ b/chapter09/introductiond.xml @@ -0,0 +1,73 @@ + + + %general-entities; +]> + + + + + Introduction + + This chapter discusses configuration files and systemd services. + First, the general configuration files needed to set up networking are + presented. + + + + + + + + + + + + + + Second, issues that affect the proper setup of devices are + discussed. + + + + + + + + + + + Third, configuring the system clock and keyboard layout. + + + + + + + + + + + + Fourth, a brief introduction to the scripts and configuration + files used when the user logs into the system. + + + + + + + + + + + And finally, configuring the systemd behavior. + + + + + + + + diff --git a/chapter09/locale.xml b/chapter09/locale.xml new file mode 100644 index 000000000..5f473ac72 --- /dev/null +++ b/chapter09/locale.xml @@ -0,0 +1,152 @@ + + + %general-entities; +]> + + + + + Configuring the System Locale + + + /etc/locale.conf + + + The /etc/locale.conf below sets some + environment variables necessary for native language support. Setting + them properly results in: + + + + The output of programs translated into the native language + + + Correct classification of characters into letters, digits and other + classes. This is necessary for bash to properly accept + non-ASCII characters in command lines in non-English locales + + + The correct alphabetical sorting order for the country + + + Appropriate default paper size + + + Correct formatting of monetary, time, and date values + + + + Replace <ll> below with the two-letter code + for the desired language (e.g., en) and + <CC> with the two-letter code for the appropriate + country (e.g., GB). <charmap> should + be replaced with the canonical charmap for your chosen locale. Optional + modifiers such as @euro may also be present. + + The list of all locales supported by Glibc can be obtained by running + the following command: + +locale -a + + Charmaps can have a number of aliases, e.g., ISO-8859-1 + is also referred to as iso8859-1 and iso88591. + Some applications cannot handle the various synonyms correctly (e.g., require + that UTF-8 is written as UTF-8, not + utf8), so it is safest in most + cases to choose the canonical name for a particular locale. To determine + the canonical name, run the following command, where <locale + name> is the output given by locale -a for + your preferred locale (en_GB.iso88591 in our example). + +LC_ALL=<locale name> locale charmap + + For the en_GB.iso88591 locale, the above command + will print: + +ISO-8859-1 + + This results in a final locale setting of en_GB.ISO-8859-1. + It is important that the locale found using the heuristic above is tested prior + to it being added to the Bash startup files: + +LC_ALL=<locale name> locale language +LC_ALL=<locale name> locale charmap +LC_ALL=<locale name> locale int_curr_symbol +LC_ALL=<locale name> locale int_prefix + + The above commands should print the language name, the character + encoding used by the locale, the local currency, and the prefix to dial + before the telephone number in order to get into the country. If any of the + commands above fail with a message similar to the one shown below, this means + that your locale was either not installed in Chapter 6 or is not supported by + the default installation of Glibc. + +locale: Cannot set LC_* to default locale: No such file or directory + + If this happens, you should either install the desired locale using the + localedef command, or consider choosing a different locale. + Further instructions assume that there are no such error messages from + Glibc. + + + Some packages beyond LFS may also lack support for your chosen locale. One + example is the X library (part of the X Window System), which outputs the + following error message if the locale does not exactly match one of the character + map names in its internal files: + +Warning: locale not supported by Xlib, locale set to C + + In several cases Xlib expects that the character map will be listed in + uppercase notation with canonical dashes. For instance, "ISO-8859-1" rather + than "iso88591". It is also possible to find an appropriate specification by + removing the charmap part of the locale specification. This can be checked + by running the locale charmap command in both locales. + For example, one would have to change "de_DE.ISO-8859-15@euro" to + "de_DE@euro" in order to get this locale recognized by Xlib. + + Other packages can also function incorrectly (but may not necessarily + display any error messages) if the locale name does not meet their expectations. + In those cases, investigating how other Linux distributions support your locale + might provide some useful information. + + Once the proper locale settings have been determined, create the + /etc/locale.conf file: + +cat > /etc/locale.conf << "EOF" +LANG=<ll>_<CC>.<charmap><@modifiers> +EOF + + Note that you can modify /etc/locale.conf with the + systemd localectl utility. To use + localectl for the example above, run: + +localectl set-locale LANG="<ll>_<CC>.<charmap><@modifiers>" + + You can also specify other language specific environment variables such + as LANG, LC_CTYPE, LC_NUMERIC or + any other environment variable from locale output. Just + separate them with a space. An example where LANG is set as + en_US.UTF-8 but LC_CTYPE is set as just en_US is: + +localectl set-locale LANG="en_US.UTF-8" LC_CTYPE="en_US" + + Please note that the localectl command can + be used only on a system booted with systemd. + + The C (default) and en_US (the recommended + one for United States English users) locales are different. C + uses the US-ASCII 7-bit character set, and treats bytes with the high bit set + as invalid characters. That's why, e.g., the ls command + substitutes them with question marks in that locale. Also, an attempt to send + mail with such characters from Mutt or Pine results in non-RFC-conforming + messages being sent (the charset in the outgoing mail is indicated as unknown + 8-bit). So you can use the C locale only if you are sure that + you will never need 8-bit characters. + + UTF-8 based locales are not supported well by many programs. + Work is in progress to document and, if possible, fix such problems, see + . + + diff --git a/chapter09/network.xml b/chapter09/network.xml new file mode 100644 index 000000000..b527258ee --- /dev/null +++ b/chapter09/network.xml @@ -0,0 +1,247 @@ + + + %general-entities; +]> + + + + + General Network Configuration + + + network + configuring + + + Creating Network Interface Configuration Files + + Which interfaces are brought up and down by the network script + usually depends on the files in /etc/sysconfig/. This directory should + contain a file for each interface to be configured, such as + ifconfig.xyz, where xyz should describe + the network card. The interface name (e.g. eth0) is usually appropriate. + Inside this file are attributes to this interface, such as its IP + address(es), subnet masks, and so forth. It is necessary that the stem of + the filename be ifconfig. + + If the procedure in the previous section was not used, Udev + will assign network card interface names based on system physical + characteristics such as enp2s1. If you are not sure what your interface + name is, you can always run ip link or ls + /sys/class/net after you have booted your system. + + + The following command creates a sample file for the + eth0 device with a static IP address: + +cd /etc/sysconfig/ +cat > ifconfig.eth0 << "EOF" +ONBOOT=yes +IFACE=eth0 +SERVICE=ipv4-static +IP=192.168.1.2 +GATEWAY=192.168.1.1 +PREFIX=24 +BROADCAST=192.168.1.255 +EOF + + The values in italics must be changed in every file to match + the proper setup. + + If the ONBOOT variable is set to yes the + System V network script will bring up the Network Interface Card (NIC) during + booting of the system. If set to anything but yes the NIC + will be ignored by the network script and not be automatically brought up. + The interface can be manually started or stopped with the + ifup and ifdown commands. + + The IFACE variable defines the interface name, + for example, eth0. It is required for all network device configuration + files. The filename extension must match this value. + + The SERVICE variable defines the method used for + obtaining the IP address. The LFS-Bootscripts package has a modular IP + assignment format, and creating additional files in the /lib/services/ directory allows other IP + assignment methods. This is commonly used for Dynamic Host Configuration + Protocol (DHCP), which is addressed in the BLFS book. + + The GATEWAY variable should contain the default + gateway IP address, if one is present. If not, then comment out the + variable entirely. + + The PREFIX variable contains the number of + bits used in the subnet. Each octet in an IP address is 8 bits. If the + subnet's netmask is 255.255.255.0, then it is using the first three octets + (24 bits) to specify the network number. If the netmask is 255.255.255.240, + it would be using the first 28 bits. Prefixes longer than 24 bits are + commonly used by DSL and cable-based Internet Service Providers (ISPs). + In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the + PREFIX variable according to your specific subnet. + If omitted, the PREFIX defaults to 24. + + For more information see the ifup man page. + + + + Creating the /etc/resolv.conf File + + + /etc/resolv.conf + + + The system will need some means of obtaining Domain Name Service + (DNS) name resolution to resolve Internet domain names to IP addresses, and + vice versa. This is best achieved by placing the IP address of the DNS + server, available from the ISP or network administrator, into + /etc/resolv.conf. Create the file by running the + following: + +cat > /etc/resolv.conf << "EOF" +# Begin /etc/resolv.conf + +domain <Your Domain Name> +nameserver <IP address of your primary nameserver> +nameserver <IP address of your secondary nameserver> + +# End /etc/resolv.conf +EOF + + The domain statement can be omitted + or replaced with a search statement. See the man page for + resolv.conf for more details. + + Replace <IP address of the nameserver> + with the IP address of the DNS most appropriate for the setup. There will + often be more than one entry (requirements demand secondary servers for + fallback capability). If you only need or want one DNS server, remove the + second nameserver line from the file. The IP address + may also be a router on the local network. + + + The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4. + + + + + + Configuring the system hostname + + + hostname + configuring + + + During the boot process, the file /etc/hostname + is used for establishing the system's hostname. + + Create the /etc/hostname file and enter a + hostname by running: + +echo "<lfs>" > /etc/hostname + + <lfs> needs to be replaced with the + name given to the computer. Do not enter the Fully Qualified Domain Name + (FQDN) here. That information is put in the + /etc/hosts file. + + + + + Customizing the /etc/hosts File + + + /etc/hosts + + + + localnet + /etc/hosts + + + + network + /etc/hosts + + + Decide on the IP address, fully-qualified domain name (FQDN), and + possible aliases for use in the /etc/hosts file. The + syntax is: + +IP_address myhost.example.org aliases + + Unless the computer is to be visible to the Internet (i.e., there is + a registered domain and a valid block of assigned IP addresses—most + users do not have this), make sure that the IP address is in the private + network IP address range. Valid ranges are: + +Private Network Address Range Normal Prefix +10.0.0.1 - 10.255.255.254 8 +172.x.0.1 - 172.x.255.254 16 +192.168.y.1 - 192.168.y.254 24 + + x can be any number in the range 16-31. y can be any number in the + range 0-255. + + A valid private IP address could be 192.168.1.1. A valid FQDN for + this IP could be lfs.example.org. + + Even if not using a network card, a valid FQDN is still required. + This is necessary for certain programs to operate correctly. + + Create the /etc/hosts file by running: + +cat > /etc/hosts << "EOF" +# Begin /etc/hosts + +127.0.0.1 localhost.localdomain localhost +127.0.1.1 <FQDN> <HOSTNAME> +<192.168.1.1> <FQDN> <HOSTNAME> [alias1] [alias2 ...] +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters + +# End /etc/hosts +EOF + + The <192.168.1.1>, + <FQDN>, and + <HOSTNAME> values need to be + changed for specific uses or requirements (if assigned an IP address by a + network/system administrator and the machine will be connected to an + existing network). The optional alias name(s) can be omitted. + + + + + + diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml new file mode 100644 index 000000000..688c315aa --- /dev/null +++ b/chapter09/networkd.xml @@ -0,0 +1,335 @@ + + + %general-entities; +]> + + + + + General Network Configuration + + + network + configuring + + This section only applies if a network card is to be + configured. + + + Network Interface Configuration Files + + Starting with version 209, systemd ships a network configuration + daemon called systemd-networkd which can be used for + basic network configuration. Additionally, since version 213, DNS name + resolution can be handled by systemd-resolved in place + of a static /etc/resolv.conf file. Both services are + enabled by default. + + Configuration files for systemd-networkd (and + systemd-resolved) can be placed in + /usr/lib/systemd/network + or /etc/systemd/network. Files in + /etc/systemd/network have a + higher priority than the ones in + /usr/lib/systemd/network. + There are three types of configuration files: + .link, + .netdev and + .network files. For detailed + descriptions and example contents of these configuration files, consult + the systemd-link(5), + systemd-netdev(5) and + systemd-network(5) manual pages. + + + Network Device Naming + + + Udev normally assigns network card interface names based + on system physical characteristics such as enp2s1. If you are + not sure what your interface name is, you can always run + ip link after you have booted your system. + + + + For most systems, there is only one network interface for + each type of connection. For example, the classic interface + name for a wired connection is eth0. A wireless connection + will usually have the name wifi0 or wlan0. + + + + If you prefer to use the classic or customized network interface names, + there are three alternative ways to do that: + + + + + Mask udev's .link file for the default policy: +ln -s /dev/null /etc/systemd/network/99-default.link + + + + + + Create a manual naming scheme, for example by naming the + interfaces something like "internet0", "dmz0", or "lan0". + For that, create .link + files in /etc/systemd/network/, that choose an explicit name or a + better naming scheme for one, some, or all of your interfaces. + For example: + + +cat > /etc/systemd/network/10-ether0.link << "EOF" +[Match] +# Change the MAC address as appropriate for your network device +MACAddress=12:34:45:78:90:AB + +[Link] +Name=ether0 +EOF + + + See the man page systemd.link(5) for more information. + + + + + + In /boot/grub/grub.cfg, pass the option net.ifnames=0 on the + kernel command line. + + + + + + + Static IP Configuration + + The command below creates a basic configuration file for a + Static IP setup (using both systemd-networkd and + systemd-resolved): + +cat > /etc/systemd/network/10-eth-static.network << "EOF" +[Match] +Name=<network-device-name> + +[Network] +Address=192.168.0.2/24 +Gateway=192.168.0.1 +DNS=192.168.0.1 +Domains=<Your Domain Name> +EOF + + Multiple DNS entries can be added if you have more than one DNS + server. Do not include DNS or Domains entries if you intend to use a + static /etc/resolv.conf file. + + + + + DHCP Configuration + + The command below creates a basic configuration file for an IPv4 + DHCP setup: + +cat > /etc/systemd/network/10-eth-dhcp.network << "EOF" +[Match] +Name=<network-device-name> + +[Network] +DHCP=ipv4 + +[DHCP] +UseDomains=true +EOF + + + + + + + Creating the /etc/resolv.conf File + + + /etc/resolv.conf + + + If the system is going to be connected to the Internet, it will + need some means of Domain Name Service (DNS) name resolution to + resolve Internet domain names to IP addresses, and vice versa. This is + best achieved by placing the IP address of the DNS server, available + from the ISP or network administrator, into + /etc/resolv.conf. + + + systemd-resolved Configuration + + If using another means to configure your network + interfaces (ex: ppp, network-manager, etc.), or if using any type of + local resolver (ex: bind, dnsmasq, etc.), or any other software that + generates an /etc/resolv.conf (ex: resolvconf), the + systemd-resolved service should not be + used. + + When using systemd-resolved for DNS + configuration, it creates the file + /run/systemd/resolve/resolv.conf. Create a + symlink in /etc to use the generated file: + +ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf + + + + + Static resolv.conf Configuration + + If a static /etc/resolv.conf is desired, + create it by running the following command: + +cat > /etc/resolv.conf << "EOF" +# Begin /etc/resolv.conf + +domain <Your Domain Name> +nameserver <IP address of your primary nameserver> +nameserver <IP address of your secondary nameserver> + +# End /etc/resolv.conf +EOF + + The domain statement can be omitted + or replaced with a search statement. See the man page + for resolv.conf for more details. + + Replace + <IP address of the nameserver> + with the IP address of the DNS most appropriate for the setup. There will + often be more than one entry (requirements demand secondary servers for + fallback capability). If you only need or want one DNS server, remove the + second nameserver line from the file. The IP address + may also be a router on the local network. + + The Google Public IPv4 DNS addresses are + 8.8.8.8 and 8.8.4.4 + for IPv4, and 2001:4860:4860::8888 and + 2001:4860:4860::8844 for IPv6. + + + + + + + Configuring the system hostname + + + hostname + configuring + + + During the boot process, the file /etc/hostname + is used for establishing the system's hostname. + + Create the /etc/hostname file and enter a + hostname by running: + +echo "<lfs>" > /etc/hostname + + <lfs> needs to be replaced with the + name given to the computer. Do not enter the Fully Qualified Domain Name + (FQDN) here. That information is put in the + /etc/hosts file. + + + + + Customizing the /etc/hosts File + + + /etc/hosts + + + + localnet + /etc/hosts + + + + network + /etc/hosts + + + Decide on a fully-qualified domain name (FQDN), and possible aliases + for use in the /etc/hosts file. If using static + addresses, you'll also need to decide on an IP address. The syntax + for a hosts file entry is: + +IP_address myhost.example.org aliases + + Unless the computer is to be visible to the Internet (i.e., there is + a registered domain and a valid block of assigned IP addresses—most + users do not have this), make sure that the IP address is in the private + network IP address range. Valid ranges are: + +Private Network Address Range Normal Prefix +10.0.0.1 - 10.255.255.254 8 +172.x.0.1 - 172.x.255.254 16 +192.168.y.1 - 192.168.y.254 24 + + x can be any number in the range 16-31. y can be any number in the + range 0-255. + + A valid private IP address could be 192.168.1.1. A valid FQDN for + this IP could be lfs.example.org. + + Even if not using a network card, a valid FQDN is still required. + This is necessary for certain programs to operate correctly. + + If using DHCP, DHCPv6, IPv6 Autoconfiguration, or if a network card + is not going to be configured, create the /etc/hosts + file by running the following command: + +cat > /etc/hosts << "EOF" +# Begin /etc/hosts + +127.0.0.1 localhost.localdomain localhost +127.0.1.1 <FQDN> <HOSTNAME> +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters + +# End /etc/hosts +EOF + + The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents + the IPv6 loopback interface. 127.0.1.1 is a loopback entry reserved + specifically for the FQDN. + + If using a static address, create the /etc/hosts + file by running this command instead: + +cat > /etc/hosts << "EOF" +# Begin /etc/hosts + +127.0.0.1 localhost +127.0.1.1 <FQDN> <HOSTNAME> +<192.168.0.2> <FQDN> <HOSTNAME> [alias1] [alias2] ... +::1 localhost ip6-localhost ip6-loopback +ff02::1 ip6-allnodes +ff02::2 ip6-allrouters + +# End /etc/hosts +EOF + + The <192.168.0.2>, + <FQDN>, and + <HOSTNAME> values need to be + changed for specific uses or requirements (if assigned an IP address by a + network/system administrator and the machine will be connected to an + existing network). The optional alias name(s) can be omitted. + + + + diff --git a/chapter09/profile.xml b/chapter09/profile.xml new file mode 100644 index 000000000..226dd9fac --- /dev/null +++ b/chapter09/profile.xml @@ -0,0 +1,162 @@ + + + %general-entities; +]> + + + + + The Bash Shell Startup Files + + + /etc/profile + + + The shell program /bin/bash (hereafter referred to + as 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 provide global settings. If an + equivalent file exists in the 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 under the + Bash Startup Files and Interactive Shells section. + + The files /etc/profile and + ~/.bash_profile are read when the shell is + invoked as an interactive login shell. + + The base /etc/profile below sets some + environment variables necessary for native language support. Setting + them properly results in: + + + + The output of programs translated into the native language + + + Correct classification of characters into letters, digits and other + classes. This is necessary for bash to properly accept + non-ASCII characters in command lines in non-English locales + + + The correct alphabetical sorting order for the country + + + Appropriate default paper size + + + Correct formatting of monetary, time, and date values + + + + Replace <ll> below with the two-letter code + for the desired language (e.g., en) and + <CC> with the two-letter code for the appropriate + country (e.g., GB). <charmap> should + be replaced with the canonical charmap for your chosen locale. Optional + modifiers such as @euro may also be present. + + The list of all locales supported by Glibc can be obtained by running + the following command: + +locale -a + + Charmaps can have a number of aliases, e.g., ISO-8859-1 + is also referred to as iso8859-1 and iso88591. + Some applications cannot handle the various synonyms correctly (e.g., require + that UTF-8 is written as UTF-8, not + utf8), so it is safest in most + cases to choose the canonical name for a particular locale. To determine + the canonical name, run the following command, where <locale + name> is the output given by locale -a for + your preferred locale (en_GB.iso88591 in our example). + +LC_ALL=<locale name> locale charmap + + For the en_GB.iso88591 locale, the above command + will print: + +ISO-8859-1 + + This results in a final locale setting of en_GB.ISO-8859-1. + It is important that the locale found using the heuristic above is tested prior + to it being added to the Bash startup files: + +LC_ALL=<locale name> locale language +LC_ALL=<locale name> locale charmap +LC_ALL=<locale name> locale int_curr_symbol +LC_ALL=<locale name> locale int_prefix + + The above commands should print the language name, the character + encoding used by the locale, the local currency, and the prefix to dial + before the telephone number in order to get into the country. If any of the + commands above fail with a message similar to the one shown below, this means + that your locale was either not installed in Chapter 6 or is not supported by + the default installation of Glibc. + +locale: Cannot set LC_* to default locale: No such file or directory + + If this happens, you should either install the desired locale using the + localedef command, or consider choosing a different locale. + Further instructions assume that there are no such error messages from + Glibc. + + + Some packages beyond LFS may also lack support for your chosen locale. One + example is the X library (part of the X Window System), which outputs the + following error message if the locale does not exactly match one of the character + map names in its internal files: + +Warning: locale not supported by Xlib, locale set to C + + In several cases Xlib expects that the character map will be listed in + uppercase notation with canonical dashes. For instance, "ISO-8859-1" rather + than "iso88591". It is also possible to find an appropriate specification by + removing the charmap part of the locale specification. This can be checked + by running the locale charmap command in both locales. + For example, one would have to change "de_DE.ISO-8859-15@euro" to + "de_DE@euro" in order to get this locale recognized by Xlib. + + Other packages can also function incorrectly (but may not necessarily + display any error messages) if the locale name does not meet their expectations. + In those cases, investigating how other Linux distributions support your locale + might provide some useful information. + + Once the proper locale settings have been determined, create the + /etc/profile file: + +cat > /etc/profile << "EOF" +# Begin /etc/profile + +export LANG=<ll>_<CC>.<charmap><@modifiers> + +# End /etc/profile +EOF + + The C (default) and en_US (the recommended + one for United States English users) locales are different. C + uses the US-ASCII 7-bit character set, and treats bytes with the high bit set + as invalid characters. That's why, e.g., the ls command + substitutes them with question marks in that locale. Also, an attempt to send + mail with such characters from Mutt or Pine results in non-RFC-conforming + messages being sent (the charset in the outgoing mail is indicated as unknown + 8-bit). So you can use the C locale only if you are sure that + you will never need 8-bit characters. + + UTF-8 based locales are not supported well by some programs. + Work is in progress to document and, if possible, fix such problems, see + . + + diff --git a/chapter09/reboot.xml b/chapter09/reboot.xml deleted file mode 100644 index c6a857dbd..000000000 --- a/chapter09/reboot.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - %general-entities; -]> - - - - - Rebooting the System - - Now that all of the software has been installed, it is time to reboot - your computer. However, you should be aware of a few things. The system you - have created in this book is quite minimal, and most likely will not have - the functionality you would need to be able to continue forward. By installing - a few extra packages from the BLFS book while still in our current chroot - environment, you can leave yourself in a much better position to continue on - once you reboot into your new LFS installation. Here are some suggestions: - - - - A text mode browser such as Lynx - will allow you to easily view the BLFS book in one virtual terminal, while - building packages in another. - - The GPM package will allow - you to perform copy/paste actions in your virtual - terminals. - - If you are in a situation where static IP configuration - does not meet your networking requirements, installing a package - such as dhcpcd - or the client portion of dhcp may be - useful. - - Installing sudo may be useful for - building packages as a non-root user and easily installing the resulting - packages in your new system. - - If you want to access your new system from a remote system - within a comfortable GUI environment, install openssh. - - - To make fetching files over the internet easier, install - wget. - - - If one or more of your disk drives have a GUID partition - table (GPT), either gptfdisk or parted will be useful. - - - Finally, a review of the following configuration files - is also appropriate at this point. - - - /etc/bashrc - /etc/dircolors - /etc/fstab - /etc/hosts - /etc/inputrc - /etc/profile - /etc/resolv.conf - /etc/vimrc - /root/.bash_profile - /root/.bashrc - /etc/sysconfig/ifconfig.eth0 - - - - - Now that we have said that, let's move on to booting our shiny new LFS - installation for the first time! First exit from the chroot environment: - -logout - - Then unmount the virtual file systems: - -umount -v $LFS/dev/pts -umount -v $LFS/dev -umount -v $LFS/run -umount -v $LFS/proc -umount -v $LFS/sys - - Unmount the LFS file system itself: - -umount -v $LFS - - If multiple partitions were created, unmount the other - partitions before unmounting the main one, like this: - -umount -v $LFS/usr -umount -v $LFS/home -umount -v $LFS - - Now, reboot the system with: - -shutdown -r now - - Assuming the GRUB boot loader was set up as outlined earlier, the menu - is set to boot LFS &version; automatically. - - When the reboot is complete, the LFS system is ready for use and - more software may be added to suit your needs. - - diff --git a/chapter09/symlinks.xml b/chapter09/symlinks.xml new file mode 100644 index 000000000..951e6976d --- /dev/null +++ b/chapter09/symlinks.xml @@ -0,0 +1,256 @@ + + + %general-entities; +]> + + + + + Managing Devices + + + + Network Devices + + Udev, by default, names network devices according to Firmware/BIOS + data or physical characteristics like the bus, slot, or MAC address. The + purpose of this naming convention is to ensure that network devices are + named consistently and not based on the time the network card was + discovered. For example, on a computer having two network cards made by + Intel and Realtek, the network card manufactured by Intel may become eth0 + and the Realtek card becomes eth1. In some cases, after a reboot the cards + get renumbered the other way around. + + In the new naming scheme, typical network device names would then + be something like enp5s0 or wlp3s0. If this naming convention is not + desired, the traditional naming scheme or a custom scheme can be + implemented. + + + Disabling Persistent Naming on the Kernel Command Line + + The traditional naming scheme using eth0, eth1, etc can be + restored by adding net.ifnames=0 on the + kernel command line. This is most appropriate for those systems + that have only one ethernet device of the same type. Laptops + often have multiple ethernet connections that are named eth0 and + wlan0 and are also candidates for this method. The command line + is passed in the GRUB configuration file. + See . + + + + Creating Custom Udev Rules + + The naming scheme can be customized by creating custom Udev + rules. A script has been included that generates the initial rules. + Generate these rules by running: + +bash /lib/udev/init-net-rules.sh + + Now, inspect the + /etc/udev/rules.d/70-persistent-net.rules file, to + find out which name was assigned to which network device: + +cat /etc/udev/rules.d/70-persistent-net.rules + + In some cases such as when MAC addresses have been assigned to + a network card manually or in a virtual environment such as Qemu or Xen, + the network rules file may not have been generated because addresses + are not consistently assigned. In these cases, this method cannot + be used. + + The file begins with a comment block followed by two lines for each + NIC. The first line for each NIC is a commented description showing its + hardware IDs (e.g. its PCI vendor and device IDs, if it's a PCI card), + along with its driver in parentheses, if the driver can be found. Neither + the hardware ID nor the driver is used to determine which name to give an + interface; this information is only for reference. The second line is the + Udev rule that matches this NIC and actually assigns it a name. + + All Udev rules are made up of several keys, separated by commas and + optional whitespace. This rule's keys and an explanation of each of them + are as follows: + + + + SUBSYSTEM=="net" - This tells Udev to ignore + devices that are not network cards. + + + ACTION=="add" - This tells Udev to ignore this + rule for a uevent that isn't an add ("remove" and "change" uevents also + happen, but don't need to rename network interfaces). + + + DRIVERS=="?*" - This exists so that Udev will + ignore VLAN or bridge sub-interfaces (because these sub-interfaces do + not have drivers). These sub-interfaces are skipped because the name + that would be assigned would collide with their parent devices. + + + ATTR{address} - The value of this key is the + NIC's MAC address. + + + ATTR{type}=="1" - This ensures the rule only + matches the primary interface in the case of certain wireless drivers, + which create multiple virtual interfaces. The secondary interfaces are + skipped for the same reason that VLAN and bridge sub-interfaces are + skipped: there would be a name collision otherwise. + + + NAME - The value of this key is the name that + Udev will assign to this interface. + + + + The value of NAME is the important part. Make sure + you know which name has been assigned to each of your network cards before + proceeding, and be sure to use that NAME value when + creating your configuration files below. + + + + + + + + CD-ROM symlinks + + Some software that you may want to install later (e.g., various + media players) expect the /dev/cdrom + and /dev/dvd symlinks to exist, and + to point to a CD-ROM or DVD-ROM device. Also, it may be convenient to put + references to those symlinks into /etc/fstab. Udev + comes with a script that will generate rules files to create these symlinks + for you, depending on the capabilities of each device, but you need to + decide which of two modes of operation you wish to have the script use. + + First, the script can operate in by-path mode (used by + default for USB and FireWire devices), where the rules it creates depend on + the physical path to the CD or DVD device. Second, it can operate in + by-id mode (default for IDE and SCSI devices), where the + rules it creates depend on identification strings stored in the CD or DVD + device itself. The path is determined by Udev's path_id + script, and the identification strings are read from the hardware by its + ata_id or scsi_id programs, depending + on which type of device you have. + + There are advantages to each approach; the correct approach to use + will depend on what kinds of device changes may happen. If you expect the + physical path to the device (that is, the ports and/or slots that it plugs + into) to change, for example because you plan on moving the drive to a + different IDE port or a different USB connector, then you should use the + by-id mode. On the other hand, if you expect the device's + identification to change, for example because it may die, and you would + replace it with a different device with the same capabilities and which + is plugged into the same connectors, then you should use the + by-path mode. + + If either type of change is possible with your drive, then choose a + mode based on the type of change you expect to happen more often. + + + + External devices (for example, a USB-connected CD drive) + should not use by-path persistence, because each time the device is plugged + into a new external port, its physical path will change. All + externally-connected devices will have this problem if you write Udev rules + to recognize them by their physical path; the problem is not limited to CD + and DVD drives. + + If you wish to see the values that the Udev scripts will use, then + for the appropriate CD-ROM device, find the corresponding directory under + /sys (e.g., this can be + /sys/block/hdd) and + run a command similar to the following: + +udevadm test /sys/block/hdd + + Look at the lines containing the output of various *_id programs. + The by-id mode will use the ID_SERIAL value if it exists and + is not empty, otherwise it will use a combination of ID_MODEL and + ID_REVISION. The by-path mode will use the ID_PATH value. + + If the default mode is not suitable for your situation, then the + following modification can be made to the + /etc/udev/rules.d/83-cdrom-symlinks.rules file, + as follows (where mode is one of + by-id or by-path): + +sed -i -e 's/"write_cd_rules"/"write_cd_rules mode"/' \ + /etc/udev/rules.d/83-cdrom-symlinks.rules + + Note that it is not necessary to create the rules files or symlinks + at this time, because you have bind-mounted the host's + /dev directory into the LFS system, + and we assume the symlinks exist on the host. The rules and symlinks will + be created the first time you boot your LFS system. + + However, if you have multiple CD-ROM devices, then the symlinks + generated at that time may point to different devices than they point to on + your host, because devices are not discovered in a predictable order. The + assignments created when you first boot the LFS system will be stable, so + this is only an issue if you need the symlinks on both systems to point to + the same device. If you need that, then inspect (and possibly edit) the + generated /etc/udev/rules.d/70-persistent-cd.rules + file after booting, to make sure the assigned symlinks match what you need. + + + + + + Dealing with duplicate devices + + As explained in , the order in + which devices with the same function appear in + /dev is essentially random. + E.g., if you have a USB web camera and a TV tuner, sometimes + /dev/video0 refers to the camera and + /dev/video1 refers to the tuner, and sometimes + after a reboot the order changes to the opposite one. + For all classes of hardware except sound cards and network cards, this is + fixable by creating Udev rules for custom persistent symlinks. + The case of network cards is covered separately in + , and sound card configuration can + be found in BLFS. + + For each of your devices that is likely to have this problem + (even if the problem doesn't exist in your current Linux distribution), + find the corresponding directory under + /sys/class or + /sys/block. + For video devices, this may be + /sys/class/video4linux/videoX. + Figure out the attributes that identify the device uniquely (usually, + vendor and product IDs and/or serial numbers work): + +udevadm info -a -p /sys/class/video4linux/video0 + + Then write rules that create the symlinks, e.g.: + +cat > /etc/udev/rules.d/83-duplicate_devs.rules << "EOF" + +# Persistent symlinks for webcam and tuner +KERNEL=="video*", ATTRS{idProduct}=="1910", ATTRS{idVendor}=="0d81", \ + SYMLINK+="webcam" +KERNEL=="video*", ATTRS{device}=="0x036f", ATTRS{vendor}=="0x109e", \ + SYMLINK+="tvtuner" + +EOF + + The result is that /dev/video0 and + /dev/video1 devices still refer randomly to the tuner + and the web camera (and thus should never be used directly), but there are + symlinks /dev/tvtuner and + /dev/webcam that always point to the correct + device. + + + + diff --git a/chapter09/systemd-custom.xml b/chapter09/systemd-custom.xml new file mode 100644 index 000000000..787fd4572 --- /dev/null +++ b/chapter09/systemd-custom.xml @@ -0,0 +1,313 @@ + + + %general-entities; +]> + + + + + Systemd Usage and Configuration + + + Systemd Customization + + + + Basic Configuration + + The /etc/systemd/system.conf file contains a set + of options to control basic systemd operations. The default file has all + entries commented out with the default settings indicated. This file is + where the log level may be changed as well as some basic logging settings. + See the systemd-system.conf(5) manual page for details + on each configuration option. + + + + + Disabling Screen Clearing at Boot Time + + The normal behavior for systemd is to clear the screen at + the end of the boot sequence. If desired, this behavior may be + changed by running the following command: + +mkdir -pv /etc/systemd/system/getty@tty1.service.d + +cat > /etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF +[Service] +TTYVTDisallocate=no +EOF + + The boot messages can always be reviewed by using the + journalctl -b command as the root user. + + + + + Disabling tmpfs for /tmp + + By default, /tmp is created as + a tmpfs. If this is not desired, it can be overridden by the following: + +ln -sfv /dev/null /etc/systemd/system/tmp.mount + + Alternatively, if a a separate partition for + /tmp is desired, specify that + partition in an /etc/fstab entry. + + + + Do not create the symbolic link above if a separate partition is used + for /tmp. This will prevent the + root file system (/) from being remounted r/w and make the system + unusable when booted. + + + + + + + Configuring Automatic File Creation and Deletion + + There are several services that create or delete files or + directories: + + + systemd-tmpfiles-clean.service + systemd-tmpfiles-setup-dev.service + systemd-tmpfiles-setup.service + + + The system location for the configuration files is + /usr/lib/tmpfiles.d/*.conf. The local + configuration files are in + /etc/tmpfiles.d. Files in + /etc/tmpfiles.d override + files with the same name in + /usr/lib/tmpfiles.d. See + tmpfiles.d(5) manual page for file format + details. + + + Note that the syntax for the + /usr/lib/tmpfiles.d/*.conf files can be + confusing. For example, the default deletion of files in the /tmp directory + is located in /usr/lib/tmpfiles.d/tmp.conf with + the line: + +q /tmp 1777 root root 10d + + The type field, q, discusses creating a subvolume with quotas which + is really only applicable to btrfs filesystems. It references type v + which in turn references type d (directory). This then creates the + specified directory if is is not present and adjusts the permissions + and ownership as specified. Contents of the directory will be + subject to time based cleanup if the age argument is specified. + + + + If the default parameters are not desired, then the file should + be copied to /etc/tmpfiles.d + and edited as desired. For example: + +mkdir -p /etc/tmpfiles.d +cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d + + + + + + Overriding Default Services Behavior + + The parameter of a unit can be overriden by creating a directory + and a configuration file in /etc/systemd/system. For example: + +mkdir -pv /etc/systemd/system/foobar.service.d + +cat > /etc/systemd/system/foobar.service.d/foobar.conf << EOF +[Service] +Restart=always +RestartSec=30 +EOF + + See systemd.unit(5) manual page for more + information. After creating the configuration file, run + systemctl daemon-reload and systemctl + restart foobar to activate the changes to a service. + + + + + Debugging the Boot Sequence + + Rather than plain shell scripts used in SysVinit or BSD style init + systems, systemd uses a unified format for different types of startup + files (or units). The command systemctl is used to + enable, disable, control state, and obtain status of unit files. Here + are some examples of frequently used commands: + + + + systemctl list-units -t <service> [--all]: + lists loaded unit files of type service. + + + systemctl list-units -t <target> [--all]: + lists loaded unit files of type target. + + + systemctl show -p Wants <multi-user.target>: + shows all units that depend on the multi-user target. Targets are + special unit files that are anogalous to runlevels under + SysVinit. + + + systemctl status <servicename.service>: + shows the status of the servicename service. The .service extension + can be omitted if there are no other unit files with the same name, + such as .socket files (which create a listening socket that provides + similar functionality to inetd/xinetd). + + + + + + + Working with the Systemd Journal + + Logging on a system booted with systemd is handled with + systemd-journald (by default), rather than a typical unix syslog daemon. + You can also add a normal syslog daemon and have both work side by + side if desired. The systemd-journald program stores journal entries in a + binary format rather than a plain text log file. To assist with + parsing the file, the command journalctl is provided. + Here are some examples of frequently used commands: + + + + journalctl -r: shows all contents of the + journal in reverse chronological order. + + + journalctl -u UNIT: + shows the journal entries associated with the specified UNIT + file. + + + journalctl -b[=ID] -r: shows the journal + entries since last successful boot (or for boot ID) in reverse + chronological order. + + + journalctl -f: povides functionality similar + to tail -f (follow). + + + + + + + Working with Core Dumps + + Core dumps are useful to debug crashed programs, especially + when a daemon process crashes. On systemd booted systems the core + dumping is handled by systemd-coredump. It will + log the core dump into the journal and store the core dump itself in + /var/lib/systemd/coredump. + To retrieve and process core dumps, coredumpctl + tool is provided. Here are some examples of frequently used commands: + + + + + coredumpctl -r: lists all core dumps in + reversed chronological order. + + + coredumpctl -1 info: show the information + of the last core dump. + + + coredumpctl -1 debug: load the last core + dump into GDB. + + + + + Core dumps may use a lot of disk space. The maximum disk space + used by core dumps can be limited by creating a configuration file in + /etc/systemd/coredump.conf.d. + For example: + +mkdir -pv /etc/systemd/coredump.conf.d + +cat > /etc/systemd/coredump.conf.d/maxuse.conf << EOF +[Coredump] +MaxUse=5G +EOF + + See systemd-coredump(8), + coredumpctl(1), and + coredump.conf.d(5) manual pages for more + information. + + + + Long Running Processes + + Beginning with systemd-230, all user processes are killed when a user + session is ended, even if nohup is used, or the process uses the + daemon() or setsid() functions. + This is a deliberate change from a historically permissive environment to a + more restrictive one. The new behavior may cause issues if you depend on + long running programs (e.g., screen or + tmux) to remain active after ending your user session. + There are three ways to enable lingering processes to remain after a user + session is ended. + + + + + Enable process lingering for only selected users: + Normal users have permission to enable process lingering + with the command loginctl enable-linger for their + own user. System administrators can use the same command with a + user argument to enable for a user. That user + can then use the systemd-run command to start + long running processes. For example: systemd-run --scope + --user /usr/bin/screen. If you enable lingering for your + user, the user@.service will remain even after all login sessions are + closed, and will automatically start at system boot. This has the + advantage of explicitly allowing and disallowing processes to run + after the user session has ended, but breaks backwards compatibility + with tools like nohup and utilities that use + deamon(). + + + + + Enable system-wide process lingering: + You can set KillUserProcesses=no in + /etc/systemd/logind.conf to enable process lingering + globally for all users. This has the benefit of leaving the old + method available to all users at the expense of explicit control. + + + + + Disable at build-time: You can enable + lingering by default while building systemd by adding the switch + -Ddefault-kill-user-processes=false to the + meson command for systemd. This completely + disables the ability of systemd to kill user processes at session + end. + + + + + + + diff --git a/chapter09/theend.xml b/chapter09/theend.xml deleted file mode 100644 index 9f2ca17cc..000000000 --- a/chapter09/theend.xml +++ /dev/null @@ -1,84 +0,0 @@ - - - %general-entities; -]> - - - - - The End - - - /etc/lfs-release - - - - /etc/lsb-release - - - - /etc/os-release - - - Well done! The new LFS system is installed! We wish you much - success with your shiny new custom-built Linux system. - - It may be a good idea to create an - /etc/lfs-release file. By having this file, it is very - easy for you (and for us if you need to ask for help at some point) to find - out which LFS version is installed on the system. Create this file by - running: - -echo &version; > /etc/lfs-release - -echo &versiond; > /etc/lfs-release - - Two files describing the installed system may be used by packages - that will be installed on the system, either in binary form or by building - them. - - The first one shows the status of your - new system with respect to the Linux Standards Base (LSB). To create - this file, run: - -cat > /etc/lsb-release << "EOF" -DISTRIB_ID="Linux From Scratch" -DISTRIB_RELEASE="&version;" -DISTRIB_CODENAME="<your name here>" -DISTRIB_DESCRIPTION="Linux From Scratch" -EOF - -cat > /etc/lsb-release << "EOF" -DISTRIB_ID="Linux From Scratch" -DISTRIB_RELEASE="&versiond;" -DISTRIB_CODENAME="<your name here>" -DISTRIB_DESCRIPTION="Linux From Scratch" -EOF - - The second one contains roughly the same information, and is used - by systemd and some graphical desktop environments. To create - this file, run: - -cat > /etc/os-release << "EOF" -NAME="Linux From Scratch" -VERSION="&version;" -ID=lfs -PRETTY_NAME="Linux From Scratch &version;" -VERSION_CODENAME="<your name here>" -EOF - -cat > /etc/os-release << "EOF" -NAME="Linux From Scratch" -VERSION="&versiond;" -ID=lfs -PRETTY_NAME="Linux From Scratch &versiond;" -VERSION_CODENAME="<your name here>" -EOF - - Be sure to put some sort of customization for the fields - 'DISTRIB_CODENAME' and 'VERSION_CODENAME' to make the system uniquely - yours. - - diff --git a/chapter09/udev.xml b/chapter09/udev.xml new file mode 100644 index 000000000..6060849be --- /dev/null +++ b/chapter09/udev.xml @@ -0,0 +1,342 @@ + + + %general-entities; +]> + + + + + Overview of Device and Module Handling + + + Udev + usage + + + In , we installed the Udev + package when eudev + systemd was built. Before we go into the + details regarding how this works, a brief history of previous methods of + handling devices is in order. + + Linux systems in general traditionally used a static device creation + method, whereby a great many device nodes were created under /dev (sometimes literally thousands of nodes), + regardless of whether the corresponding hardware devices actually existed. This + was typically done via a MAKEDEV script, which contains a + number of calls to the mknod program with the relevant + major and minor device numbers for every possible device that might exist in + the world. + + Using the Udev method, only those devices which are detected by the + kernel get device nodes created for them. Because these device nodes will be + created each time the system boots, they will be stored on a devtmpfs file system (a virtual file system + that resides entirely in system memory). Device nodes do not require much + space, so the memory that is used is negligible. + + + History + + In February 2000, a new filesystem called devfs was merged into the 2.3.46 kernel + and was made available during the 2.4 series of stable kernels. Although + it was present in the kernel source itself, this method of creating devices + dynamically never received overwhelming support from the core kernel + developers. + + The main problem with the approach adopted by devfs was the way it handled device + detection, creation, and naming. The latter issue, that of device node + naming, was perhaps the most critical. It is generally accepted that if + device names are allowed to be configurable, then the device naming policy + should be up to a system administrator, not imposed on them by any + particular developer(s). The devfs file system also suffered from race + conditions that were inherent in its design and could not be fixed without a + substantial revision to the kernel. It was marked as deprecated for a long + period – due to a lack of maintenance – and was finally removed + from the kernel in June, 2006. + + With the development of the unstable 2.5 kernel tree, later released + as the 2.6 series of stable kernels, a new virtual filesystem called + sysfs came to be. The job of + sysfs is to export a view of + the system's hardware configuration to userspace processes. With this + userspace-visible representation, the possibility of developing a userspace + replacement for devfs became + much more realistic. + + + + + Udev Implementation + + + Sysfs + + The sysfs filesystem + was mentioned briefly above. One may wonder how sysfs knows about the devices present on + a system and what device numbers should be used for them. Drivers that + have been compiled into the kernel directly register their objects with a + sysfs (devtmpfs internally) + as they are detected by the kernel. For drivers compiled as modules, this + registration will happen when the module is loaded. Once the sysfs filesystem is mounted (on /sys), + data which the drivers register with sysfs are available to userspace + processes and to udevd for processing (including modifications to device + nodes). + + + + + Device Node Creation + + Device files are created by the kernel by the devtmpfs filesystem. Any driver that + wishes to register a device node will go through the devtmpfs (via the driver core) to do it. + When a devtmpfs instance is + mounted on /dev, the device node + will initially be created with a fixed name, permissions, and + owner. + + A short time later, the kernel will send a uevent to + udevd. Based on the rules specified in the files within the + /etc/udev/rules.d, /lib/udev/rules.d, and /run/udev/rules.d directories, + udevd will create additional symlinks to the device node, or + change its permissions, owner, or group, or modify the internal + udevd database entry (name) for that object. + + The rules in these three directories are numbered and all three + directories are merged together. If udevd can't find a + rule for the device it is creating, it will leave the permissions and + ownership at whatever devtmpfs used initially. + + + Module Loading + + Device drivers compiled as modules may have aliases built into them. + Aliases are visible in the output of the modinfo + program and are usually related to the bus-specific identifiers of devices + supported by a module. For example, the snd-fm801 + driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801, + and has an alias of pci:v00001319d00000801sv*sd*bc04sc01i*. + For most devices, the bus driver exports the alias of the driver that + would handle the device via sysfs. E.g., the + /sys/bus/pci/devices/0000:00:0d.0/modalias file + might contain the string + pci:v00001319d00000801sv00001319sd00001319bc04sc01i00. + The default rules provided with Udev will cause udevd + to call out to /sbin/modprobe with the contents of the + MODALIAS uevent environment variable (which should be the + same as the contents of the modalias file in sysfs), + thus loading all modules whose aliases match this string after wildcard + expansion. + + In this example, this means that, in addition to + snd-fm801, the obsolete (and unwanted) + forte driver will be loaded if it is + available. See below for ways in which the loading of unwanted drivers can + be prevented. + + The kernel itself is also able to load modules for network + protocols, filesystems and NLS support on demand. + + + + + Handling Hotpluggable/Dynamic Devices + + When you plug in a device, such as a Universal Serial Bus (USB) MP3 + player, the kernel recognizes that the device is now connected and + generates a uevent. This uevent is then handled by + udevd as described above. + + + + + + + Problems with Loading Modules and Creating Devices + + There are a few possible problems when it comes to automatically + creating device nodes. + + + A kernel module is not loaded automatically + + Udev will only load a module if it has a bus-specific alias and the + bus driver properly exports the necessary aliases to sysfs. In other cases, one should + arrange module loading by other means. With Linux-&linux-version;, Udev is + known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI, + SERIO, and FireWire devices. + + To determine if the device driver you require has the necessary + support for Udev, run modinfo with the module name as + the argument. Now try locating the device directory under + /sys/bus and check whether there is + a modalias file there. + + If the modalias file exists in sysfs, the driver supports the device and + can talk to it directly, but doesn't have the alias, it is a bug in the + driver. Load the driver without the help from Udev and expect the issue + to be fixed later. + + If there is no modalias file in the relevant + directory under /sys/bus, this + means that the kernel developers have not yet added modalias support to + this bus type. With Linux-&linux-version;, this is the case with ISA + busses. Expect this issue to be fixed in later kernel versions. + + Udev is not intended to load wrapper drivers such as + snd-pcm-oss and non-hardware drivers such as + loop at all. + + + + + A kernel module is not loaded automatically, and Udev is not + intended to load it + + If the wrapper module only enhances the + functionality provided by some other module (e.g., + snd-pcm-oss enhances the functionality of + snd-pcm by making the sound cards available to OSS + applications), configure modprobe to load the wrapper + after Udev loads the wrapped module. To do this, add a + softdep line to the corresponding + /etc/modprobe.d/<filename>.conf + file. For example: + +softdep snd-pcm post: snd-pcm-oss + + Note that the softdep command also allows + pre: dependencies, or a mixture of both + pre: and post:. See the + modprobe.d(5) manual page for more information + on softdep syntax and capabilities. + + If the module in question is not a wrapper and is useful by itself, + configure the modules bootscript to load this + module on system boot. To do this, add the module name to the + /etc/sysconfig/modules file on a separate line. + This works for wrapper modules too, but is suboptimal in that case. + + + + + Udev loads some unwanted module + + Either don't build the module, or blacklist it in a + /etc/modprobe.d/blacklist.conf file as done with the + forte module in the example below: + +blacklist forte + + Blacklisted modules can still be loaded manually with the + explicit modprobe command. + + + + + Udev creates a device incorrectly, or makes a wrong symlink + + This usually happens if a rule unexpectedly matches a device. For + example, a poorly-written rule can match both a SCSI disk (as desired) + and the corresponding SCSI generic device (incorrectly) by vendor. + Find the offending rule and make it more specific, with the help of the + udevadm info command. + + + + + Udev rule works unreliably + + This may be another manifestation of the previous problem. If not, + and your rule uses sysfs + attributes, it may be a kernel timing issue, to be fixed in later kernels. + For now, you can work around it by creating a rule that waits for the used + sysfs attribute and appending + it to the /etc/udev/rules.d/10-wait_for_sysfs.rules + file (create this file if it does not exist). Please notify the LFS + Development list if you do so and it helps. + + + + + Udev does not create a device + + Further text assumes that the driver is built statically into the + kernel or already loaded as a module, and that you have already checked + that Udev doesn't create a misnamed device. + + Udev has no information needed to create a device node if a kernel + driver does not export its data to + sysfs. This is most common + with third party drivers from outside the kernel tree. Create a static + device node in /lib/udev/devices with the + appropriate major/minor numbers (see the file + devices.txt inside the kernel documentation or the + documentation provided by the third party driver vendor). The static + device node will be copied to /dev + by udev. + + + + + Device naming order changes randomly after rebooting + + This is due to the fact that Udev, by design, handles uevents and + loads modules in parallel, and thus in an unpredictable order. This will + never be fixed. You should not rely upon the kernel device + names being stable. Instead, create your own rules that make symlinks with + stable names based on some stable attributes of the device, such as a + serial number or the output of various *_id utilities installed by Udev. + See and + for examples. + + + + + + + Useful Reading + + Additional helpful documentation is available at the following + sites: + + + + + A Userspace Implementation of devfs + + + + + The sysfs Filesystem + + + + + + + + + diff --git a/chapter09/usage.xml b/chapter09/usage.xml new file mode 100644 index 000000000..4a4cf6c36 --- /dev/null +++ b/chapter09/usage.xml @@ -0,0 +1,710 @@ + + + + %general-entities; +]> + + + + + System V Bootscript Usage and Configuration + + + Bootscripts + usage + + + + How Do the System V Bootscripts Work? + + Linux uses a special booting facility named SysVinit that is based on a + concept of run-levels. It can be quite different from one + system to another, so it cannot be assumed that because things worked in one + particular Linux distribution, they should work the same in LFS too. LFS has its + own way of doing things, but it respects generally accepted standards. + + SysVinit (which will be referred to as init from now on) + works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels + (actually, there are more run-levels, but they are for special cases and are + generally not used. See init(8) for more details), and + each one of those corresponds to the actions the computer is supposed to + perform when it starts up. The default run-level is 3. Here are the + descriptions of the different run-levels as they are 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 + + + + + Configuring Sysvinit + + + Sysvinit + configuring + + + + /etc/inittab + + + During the kernel initialization, the first program that is run + is either specified on the command line or, by default + init. This program reads the initialization file + /etc/inittab. Create this file with: + +cat > /etc/inittab << "EOF" +# Begin /etc/inittab + +id:3:initdefault: + +si::sysinit:/etc/rc.d/init.d/rc S + +l0:0:wait:/etc/rc.d/init.d/rc 0 +l1:S1:wait:/etc/rc.d/init.d/rc 1 +l2:2:wait:/etc/rc.d/init.d/rc 2 +l3:3:wait:/etc/rc.d/init.d/rc 3 +l4:4:wait:/etc/rc.d/init.d/rc 4 +l5:5:wait:/etc/rc.d/init.d/rc 5 +l6:6:wait:/etc/rc.d/init.d/rc 6 + +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +su:S016:once:/sbin/sulogin + +1:2345:respawn:/sbin/agetty --noclear tty1 9600 +2:2345:respawn:/sbin/agetty tty2 9600 +3:2345:respawn:/sbin/agetty tty3 9600 +4:2345:respawn:/sbin/agetty tty4 9600 +5:2345:respawn:/sbin/agetty tty5 9600 +6:2345:respawn:/sbin/agetty tty6 9600 + +# End /etc/inittab +EOF + + An explanation of this initialization file is in the man page for + inittab. For LFS, the key command that is run is + rc. The initialization file above will instruct + rc to run all the scripts starting with an S in the + /etc/rc.d/rcS.d directory + followed by all the scripts starting with an S in the /etc/rc.d/rc?.d directory where the question + mark is specified by the initdefault value. + + As a convenience, the rc script reads a library of + functions in /lib/lsb/init-functions. + This library also reads an optional configuration file, + /etc/sysconfig/rc.site. Any of the system + configuration file parameters described in subsequent sections can be + alternatively placed in this file allowing consolidation of all system + parameters in this one file. + + As a debugging convenience, the functions script also logs all output + to /run/var/bootlog. Since the /run directory is a tmpfs, this file is not + persistent across boots, however it is appended to the more permanent file + /var/log/boot.log at the end of the boot process. + + + Changing Run Levels + + Changing run-levels is done with init + <runlevel>, where + <runlevel> is the target run-level. For example, to + reboot the computer, a user could issue the init 6 command, + which is an alias for the reboot command. Likewise, + init 0 is an alias for the halt + command. + + There are a number of directories under /etc/rc.d that look 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 earlier it gets executed. When + init switches to another run-level, the appropriate services + are either started or stopped, depending on the runlevel chosen. + + The real scripts are in /etc/rc.d/init.d. They do the actual work, and + the symlinks all point to them. K links and S links point to + the same script in /etc/rc.d/init.d. + This is because the scripts can be called with different parameters like + start, stop, + restart, reload, and + 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 to this explanation. 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 this + is that when a user is going to reboot or halt the system, nothing + needs to be started. The system only needs to be stopped. + + 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 does not 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 is your own LFS system). The files given here are an example of how + it can be done. + + + + + + Udev Bootscripts + + The /etc/rc.d/init.d/udev initscript starts + udevd, triggers any "coldplug" devices that have + already been created by the kernel and waits for any rules to complete. + The script also unsets the uevent handler from the default of + /sbin/hotplug . This is done because the kernel no + longer needs to call out to an external binary. Instead + udevd will listen on a netlink socket for uevents that + the kernel raises. + + The /etc/rc.d/init.d/udev_retry initscript takes + care of re-triggering events for subsystems whose rules may rely on + filesystems that are not mounted until the mountfs + script is run (in particular, /usr + and /var may cause this). This + script runs after the mountfs script, so those rules + (if re-triggered) should succeed the second time around. It is + configured from the /etc/sysconfig/udev_retry file; + any words in this file other than comments are considered subsystem names + to trigger at retry time. To find the subsystem of a device, use + udevadm info --attribute-walk <device> where + <device> is an absolute path in /dev or /sys such as /dev/sr0 or + /sys/class/rtc. + + For information on kernel module loading and udev, see + . + + + + + Configuring the System Clock + + + setclock + configuring + + The setclock script reads the time from the hardware + clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor + (CMOS) clock. If the hardware clock is set to UTC, this script will convert the + hardware clock's time to the local time using the + /etc/localtime file (which tells the + hwclock program which timezone the user is in). There is no + way to detect whether or not the hardware clock is set to UTC, so this + needs to be configured manually. + + The setclock is run via + udev when the kernel detects the hardware + capability upon boot. It can also be run manually with the stop parameter to + store the system time to the CMOS clock. + + If you cannot remember whether or not the hardware clock is set to UTC, + find out by running the hwclock --localtime --show + command. This will display what the current time is according to the hardware + clock. If this time matches whatever your watch says, then the hardware clock is + set to local time. If the output from hwclock is not local + time, chances are it is set to UTC time. Verify this by adding or subtracting + the proper amount of hours for the timezone to the time shown by + hwclock. For example, if you are currently in the MST + timezone, which is also known as GMT -0700, add seven hours to the local + time. + + Change the value of the UTC variable below + to a value of 0 (zero) if the hardware clock + is not set to UTC time. + + Create a new file /etc/sysconfig/clock by running + the following: + +cat > /etc/sysconfig/clock << "EOF" +# Begin /etc/sysconfig/clock + +UTC=1 + +# Set this to any options you might need to give to hwclock, +# such as machine hardware clock type for Alphas. +CLOCKPARAMS= + +# End /etc/sysconfig/clock +EOF + + A good hint explaining how to deal with time on LFS is available + at . It explains issues such as + time zones, UTC, and the TZ environment variable. + + The CLOCKPARAMS and UTC paramaters may be alternatively set + in the /etc/sysconfig/rc.site file. + + + + + + + Configuring the Linux Console + + + console + configuring + + + This section discusses how to configure the console + bootscript that sets up the keyboard map, console font and console kernel log + level. If non-ASCII characters (e.g., the copyright sign, the British pound + sign and Euro symbol) will not be used and the keyboard is a U.S. one, much + of this section can be skipped. Without the configuration file, (or + equivalent settings in rc.site), the + console bootscript will do nothing. + + The console script reads the + /etc/sysconfig/console file for configuration + information. Decide which keymap and screen font will be used. Various + language-specific HOWTOs can also help with this, see . If still in + doubt, look in the /usr/share/keymaps + and /usr/share/consolefonts directories + for valid keymaps and screen fonts. Read loadkeys(1) and + setfont(8) manual pages to determine the correct + arguments for these programs. + + The /etc/sysconfig/console file should contain lines + of the form: VARIABLE="value". The following variables are recognized: + + + + LOGLEVEL + + This variable specifies the log level for kernel messages sent + to the console as set by dmesg -n. Valid levels are + from "1" (no messages) to "8". The default level is "7". + + + + + KEYMAP + + This variable specifies the arguments for the + loadkeys program, typically, the name of keymap + to load, e.g., it. If this variable is not set, the + bootscript will not run the loadkeys program, + and the default kernel keymap will be used. Note that a few keymaps + have multiple versions with the same name (cz and its variants in + qwerty/ and qwertz/, es in olpc/ and qwerty/, and trf in fgGIod/ and + qwerty/). In these cases the parent directory should also be specified + (e.g. qwerty/es) to ensure the proper keymap is loaded. + + + + + + KEYMAP_CORRECTIONS + + This (rarely used) variable + specifies the arguments for the second call to the + loadkeys program. This is useful if the stock keymap + is not completely satisfactory and a small adjustment has to be made. E.g., + to include the Euro sign into a keymap that normally doesn't have it, + set this variable to euro2. + + + + + FONT + + This variable specifies the arguments for the + setfont program. Typically, this includes the font + name, -m, and the name of the application character + map to load. E.g., in order to load the lat1-16 font + together with the 8859-1 application character map + (as it is appropriate in the USA), + + set this variable to lat1-16 -m 8859-1. + In UTF-8 mode, the kernel uses the application character map for + conversion of composed 8-bit key codes in the keymap to UTF-8, and thus + the argument of the "-m" parameter should be set to the encoding of the + composed key codes in the keymap. + + + + + + UNICODE + + Set this variable to 1, yes or + true in order to put the + console into UTF-8 mode. This is useful in UTF-8 based locales and + harmful otherwise. + + + + + LEGACY_CHARSET + + For many keyboard layouts, there is no stock Unicode keymap in + the Kbd package. The console bootscript will + convert an available keymap to UTF-8 on the fly if this variable is + set to the encoding of the available non-UTF-8 keymap. + + + + + + Some examples: + + + + + For a non-Unicode setup, only the KEYMAP and FONT variables are + generally needed. E.g., for a Polish setup, one would use: +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +KEYMAP="pl2" +FONT="lat2a-16 -m 8859-2" + +# End /etc/sysconfig/console +EOF + + + + As mentioned above, it is sometimes necessary to adjust a + stock keymap slightly. The following example adds the Euro symbol to the + German keymap: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +KEYMAP="de-latin1" +KEYMAP_CORRECTIONS="euro2" +FONT="lat0-16 -m 8859-15" +UNICODE="1" + +# End /etc/sysconfig/console +EOF + + + + The following is a Unicode-enabled example for Bulgarian, where a + stock UTF-8 keymap exists: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +KEYMAP="bg_bds-utf8" +FONT="LatArCyrHeb-16" + +# End /etc/sysconfig/console +EOF + + + + Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous + example, bright colors are no longer available on the Linux console unless + a framebuffer is used. If one wants to have bright colors without + framebuffer and can live without characters not belonging to his language, + it is still possible to use a language-specific 256-glyph font, as + illustrated below: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +KEYMAP="bg_bds-utf8" +FONT="cyr-sun16" + +# End /etc/sysconfig/console +EOF + + + + The following example illustrates keymap autoconversion from + ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +KEYMAP="de-latin1" +KEYMAP_CORRECTIONS="euro2" +LEGACY_CHARSET="iso-8859-15" +FONT="LatArCyrHeb-16 -m 8859-15" + +# End /etc/sysconfig/console +EOF + + + + Some keymaps have dead keys (i.e., keys that don't produce a + character by themselves, but put an accent on the character produced + by the next key) or define composition rules (such as: press + Ctrl+. A E to get Æ in the default keymap). + Linux-&linux-version; interprets dead keys and composition rules in the + keymap correctly only when the source characters to be composed together + are not multibyte. This deficiency doesn't affect keymaps for European + languages, because there accents are added to unaccented ASCII + characters, or two ASCII characters are composed together. However, in + UTF-8 mode it is a problem, e.g., for the Greek language, where one + sometimes needs to put an accent on the letter alpha. + The solution is either to avoid the use of UTF-8, or to install the + X window system that doesn't have this limitation in its input + handling. + + + + For Chinese, Japanese, Korean and some other languages, the Linux + console cannot be configured to display the needed characters. Users + who need such languages should install the X Window System, fonts that + cover the necessary character ranges, and the proper input method (e.g., + SCIM, it supports a wide variety of languages). + + + + + + + The /etc/sysconfig/console file only controls + the Linux text console localization. It has nothing to do with setting + the proper keyboard layout and terminal fonts in the X Window System, with + ssh sessions or with a serial console. In such situations, limitations + mentioned in the last two list items above do not apply. + + + + + + Creating Files at Boot + + + File creation at boot + configuring + + + At times, it is desired to create files at boot time. For instance, + the /tmp/.ICE-unix directory + may be desired. This can be done by creating an entry in the + /etc/sysconfig/createfiles configuration script. + The format of this file is embedded in the comments of the default + configuration file. + + + + Configuring the sysklogd Script + + + sysklogd + configuring + + + The sysklogd script invokes the + syslogd program as a part of System V initialization. The + -m 0 option turns off the periodic timestamp mark that + syslogd writes to the log files every 20 minutes by + default. If you want to turn on this periodic timestamp mark, edit + /etc/sysconfig/rc.site and define the variable + SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters, + set the variable to a null value: + +SYSKLOGD_PARMS= + + See man syslogd for more options. + + + + + The rc.site File + + + rc.site + + + The optional /etc/sysconfig/rc.site file contains + settings that are automatically set for each SystemV boot script. It can + alternatively set the values specified in the hostname, + console, and clock files in the + /etc/sysconfig/ directory. If the + associated variables are present in both these separate files and + rc.site, the values in the script specific files have + precedence. + + rc.site also contains parameters that can + customize other aspects of the boot process. Setting the IPROMPT variable + will enable selective running of bootscripts. Other options are described + in the file comments. The default version of the file is as follows: + + + &site; + + + Customizing the Boot and Shutdown Scripts + + The LFS boot scripts boot and shut down a system in a fairly + efficient manner, but there are a few tweaks that you can make in the + rc.site file to improve speed even more and to adjust messages according + to your preferences. To do this, adjust the settings in + the /etc/sysconfig/rc.site file above. + + + + During the boot script udev, there is + a call to udev settle that requires some time to + complete. This time may or may not be required depending on devices present + in the system. If you only have simple partitions and a single ethernet + card, the boot process will probably not need to wait for this command. To + skip it, set the variable OMIT_UDEV_SETTLE=y. + + The boot script udev_retry also runs + udev settle by default. This command is only needed by + default if the /var directory is + separately mounted. This is because the clock needs the file + /var/lib/hwclock/adjtime. Other customizations may + also need to wait for udev to complete, but in many installations it is not + needed. Skip the command by setting the variable OMIT_UDEV_RETRY_SETTLE=y. + + + By default, the file system checks are silent. This can + appear to be a delay during the bootup process. To turn on the + fsck output, set the variable VERBOSE_FSCK=y. + + + When rebooting, you may want to skip the filesystem check, + fsck, completely. To do this, either create the file + /fastboot or reboot the system with the command + /sbin/shutdown -f -r now. On the other hand, you can + force all file systems to be checked by creating + /forcefsck or running shutdown with + the -F parameter instead of -f. + + + Setting the variable FASTBOOT=y will disable fsck + during the boot process until it is removed. This is not recommended + on a permanent basis. + + Normally, all files in the /tmp directory are deleted at boot time. + Depending on the number of files or directories present, this can cause a + noticeable delay in the boot process. To skip removing these files set the + variable SKIPTMPCLEAN=y. + + During shutdown, the init program sends + a TERM signal to each program it has started (e.g. agetty), waits for a set + time (default 3 seconds), and sends each process a KILL signal and waits + again. This process is repeated in the sendsignals + script for any processes that are not shut down by their own scripts. The + delay for init can be set by passing a parameter. For + example to remove the delay in init, pass the -t0 + parameter when shutting down or rebooting (e.g. /sbin/shutdown + -t0 -r now). The delay for the sendsignals + script can be skipped by setting the parameter + KILLDELAY=0. + + + + + + diff --git a/chapter09/whatnow.xml b/chapter09/whatnow.xml deleted file mode 100644 index 273eb7740..000000000 --- a/chapter09/whatnow.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - %general-entities; -]> - - - - - What Now? - - Thank you for reading this LFS book. We hope that you have - found this book helpful and have learned more about the system - creation process. - - Now that the LFS system is installed, you may be wondering - What next? To answer that question, we have compiled a - list of resources for you. - - - - - Maintenance - - Bugs and security notices are reported regularly for all software. - Since an LFS system is compiled from source, it is up to you to keep - abreast of such reports. There are several online resources that track - such reports, some of which are shown below: - - - - - CERT (Computer - Emergency Response Team) - - CERT has a mailing list that publishes security alerts concerning - various operating systems and applications. Subscription information is - available at . - - - - Bugtraq - - Bugtraq is a full-disclosure computer security mailing list. It - publishes newly discovered security issues, and occasionally potential - fixes for them. Subscription information is available at . - - - - - - - Beyond Linux From Scratch - - The Beyond Linux From Scratch book covers installation - procedures for a wide range of software beyond the scope of the LFS - Book. The BLFS project is located at . - - - - LFS Hints - - The LFS Hints are a collection of educational documents - submitted by volunteers in the LFS community. The hints are available - at . - - - - Mailing lists - - There are several LFS mailing lists you may subscribe to if you - are in need of help, want to stay current with the latest developments, - want to contribute to the project, and more. See for more - information. - - - - The Linux Documentation Project - - The goal of The Linux Documentation Project (TLDP) is to - collaborate on all of the issues of Linux documentation. The TLDP features - a large collection of HOWTOs, guides, and man pages. It is located at - . - - - - - -- cgit v1.2.3-54-g00ecf From fb386e05f17d44dc6322a1b3db172cc297ed5ce5 Mon Sep 17 00:00:00 2001 From: Thomas Trepl Date: Thu, 11 Jun 2020 12:55:28 +0000 Subject: Rename package entities to be independent of chapter numbering git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11921 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter05/binutils-pass1.xml | 4 +- chapter05/gcc-pass1.xml | 4 +- chapter05/glibc.xml | 4 +- chapter05/libstdc++.xml | 4 +- chapter05/linux-headers.xml | 4 +- chapter06/bash.xml | 4 +- chapter06/binutils-pass2.xml | 4 +- chapter06/coreutils.xml | 4 +- chapter06/diffutils.xml | 4 +- chapter06/file.xml | 4 +- chapter06/findutils.xml | 4 +- chapter06/gawk.xml | 4 +- chapter06/gcc-pass2.xml | 4 +- chapter06/grep.xml | 4 +- chapter06/gzip.xml | 4 +- chapter06/m4.xml | 4 +- chapter06/make.xml | 4 +- chapter06/ncurses.xml | 4 +- chapter06/patch.xml | 4 +- chapter06/sed.xml | 4 +- chapter06/tar.xml | 4 +- chapter06/xz.xml | 4 +- chapter07/bison.xml | 4 +- chapter07/dejagnu.xml | 4 +- chapter07/expect.xml | 4 +- chapter07/gettext.xml | 4 +- chapter07/libstdc++-pass2.xml | 4 +- chapter07/perl.xml | 4 +- chapter07/python.xml | 4 +- chapter07/stripping.xml | 2 +- chapter07/tcl.xml | 4 +- chapter07/texinfo.xml | 4 +- chapter07/util-linux.xml | 4 +- chapter08/acl.xml | 4 +- chapter08/attr.xml | 4 +- chapter08/autoconf.xml | 6 +- chapter08/automake.xml | 4 +- chapter08/bash.xml | 4 +- chapter08/bc.xml | 4 +- chapter08/binutils.xml | 4 +- chapter08/bison.xml | 4 +- chapter08/bzip2.xml | 4 +- chapter08/check.xml | 4 +- chapter08/coreutils.xml | 4 +- chapter08/dbus.xml | 4 +- chapter08/diffutils.xml | 4 +- chapter08/e2fsprogs.xml | 4 +- chapter08/eudev.xml | 4 +- chapter08/expat.xml | 4 +- chapter08/file.xml | 4 +- chapter08/findutils.xml | 4 +- chapter08/flex.xml | 4 +- chapter08/gawk.xml | 4 +- chapter08/gcc.xml | 4 +- chapter08/gdbm.xml | 4 +- chapter08/gettext.xml | 4 +- chapter08/glibc.xml | 4 +- chapter08/gmp.xml | 4 +- chapter08/gperf.xml | 4 +- chapter08/grep.xml | 4 +- chapter08/groff.xml | 4 +- chapter08/grub.xml | 4 +- chapter08/gzip.xml | 4 +- chapter08/iana-etc.xml | 4 +- chapter08/inetutils.xml | 4 +- chapter08/intltool.xml | 4 +- chapter08/iproute2.xml | 4 +- chapter08/kbd.xml | 4 +- chapter08/kmod.xml | 4 +- chapter08/less.xml | 4 +- chapter08/libcap.xml | 4 +- chapter08/libelf.xml | 4 +- chapter08/libffi.xml | 4 +- chapter08/libpipeline.xml | 4 +- chapter08/libtool.xml | 4 +- chapter08/m4.xml | 4 +- chapter08/make.xml | 4 +- chapter08/man-db.xml | 4 +- chapter08/man-pages.xml | 4 +- chapter08/meson.xml | 4 +- chapter08/mpc.xml | 4 +- chapter08/mpfr.xml | 4 +- chapter08/ncurses.xml | 4 +- chapter08/ninja.xml | 4 +- chapter08/openssl.xml | 4 +- chapter08/patch.xml | 4 +- chapter08/perl.xml | 4 +- chapter08/pkgconfig.xml | 4 +- chapter08/procps.xml | 4 +- chapter08/psmisc.xml | 4 +- chapter08/python.xml | 4 +- chapter08/readline.xml | 4 +- chapter08/sed.xml | 4 +- chapter08/shadow.xml | 4 +- chapter08/sysklogd.xml | 4 +- chapter08/systemd.xml | 4 +- chapter08/sysvinit.xml | 4 +- chapter08/tar.xml | 4 +- chapter08/texinfo.xml | 4 +- chapter08/util-linux.xml | 4 +- chapter08/vim.xml | 4 +- chapter08/xml-parser.xml | 4 +- chapter08/xz.xml | 4 +- chapter08/zlib.xml | 4 +- chapter08/zstd.xml | 4 +- chapter09/bootscripts.xml | 4 +- chapter10/kernel.xml | 4 +- packages.ent | 443 +++++++++++++++++++++--------------------- 108 files changed, 439 insertions(+), 432 deletions(-) (limited to 'chapter09') diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml index 00816c94a..914e119b8 100644 --- a/chapter05/binutils-pass1.xml +++ b/chapter05/binutils-pass1.xml @@ -33,8 +33,8 @@ &diskspace; - &binutils-ch5p1-sbu; - &binutils-ch5p1-du; + &binutils-tmpp1-sbu; + &binutils-tmpp1-du; diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml index 2f8145713..e2a13a003 100644 --- a/chapter05/gcc-pass1.xml +++ b/chapter05/gcc-pass1.xml @@ -33,8 +33,8 @@ &diskspace; - &gcc-ch5p1-sbu; - &gcc-ch5p1-du; + &gcc-tmpp1-sbu; + &gcc-tmpp1-du; diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml index 361dd0e58..80d1638f5 100644 --- a/chapter05/glibc.xml +++ b/chapter05/glibc.xml @@ -33,8 +33,8 @@ &diskspace; - &glibc-ch5-sbu; - &glibc-ch5-du; + &glibc-tmp-sbu; + &glibc-tmp-du; diff --git a/chapter05/libstdc++.xml b/chapter05/libstdc++.xml index 5058be9a5..0153766c4 100644 --- a/chapter05/libstdc++.xml +++ b/chapter05/libstdc++.xml @@ -37,8 +37,8 @@ &diskspace; - &libstdcpp-ch5-sbu; - &libstdcpp-ch5-du; + &libstdcpp-tmp-sbu; + &libstdcpp-tmp-du; diff --git a/chapter05/linux-headers.xml b/chapter05/linux-headers.xml index 6c1af3173..213fe7dc3 100644 --- a/chapter05/linux-headers.xml +++ b/chapter05/linux-headers.xml @@ -32,8 +32,8 @@ &diskspace; - &linux-headers-ch5-sbu; - &linux-headers-ch5-du; + &linux-headers-tmp-sbu; + &linux-headers-tmp-du; diff --git a/chapter06/bash.xml b/chapter06/bash.xml index bc0b211af..6cb1dc728 100644 --- a/chapter06/bash.xml +++ b/chapter06/bash.xml @@ -33,8 +33,8 @@ &diskspace; - &bash-ch5-sbu; - &bash-ch5-du; + &bash-tmp-sbu; + &bash-tmp-du; diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml index d88bb84e2..5ccff98d8 100644 --- a/chapter06/binutils-pass2.xml +++ b/chapter06/binutils-pass2.xml @@ -33,8 +33,8 @@ &diskspace; - &binutils-ch5p2-sbu; - &binutils-ch5p2-du; + &binutils-tmpp2-sbu; + &binutils-tmpp2-du; diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 3ae765e85..fe036755e 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -33,8 +33,8 @@ &diskspace; - &coreutils-ch5-sbu; - &coreutils-ch5-du; + &coreutils-tmp-sbu; + &coreutils-tmp-du; diff --git a/chapter06/diffutils.xml b/chapter06/diffutils.xml index 6594058be..af4d95429 100644 --- a/chapter06/diffutils.xml +++ b/chapter06/diffutils.xml @@ -33,8 +33,8 @@ &diskspace; - &diffutils-ch5-sbu; - &diffutils-ch5-du; + &diffutils-tmp-sbu; + &diffutils-tmp-du; diff --git a/chapter06/file.xml b/chapter06/file.xml index a13553b19..2506f4432 100644 --- a/chapter06/file.xml +++ b/chapter06/file.xml @@ -33,8 +33,8 @@ &diskspace; - &file-ch5-sbu; - &file-ch5-du; + &file-tmp-sbu; + &file-tmp-du; diff --git a/chapter06/findutils.xml b/chapter06/findutils.xml index bf9f9c62a..e6a19202b 100644 --- a/chapter06/findutils.xml +++ b/chapter06/findutils.xml @@ -33,8 +33,8 @@ &diskspace; - &findutils-ch5-sbu; - &findutils-ch5-du; + &findutils-tmp-sbu; + &findutils-tmp-du; diff --git a/chapter06/gawk.xml b/chapter06/gawk.xml index 105abdb8e..efe7b4380 100644 --- a/chapter06/gawk.xml +++ b/chapter06/gawk.xml @@ -33,8 +33,8 @@ &diskspace; - &gawk-ch5-sbu; - &gawk-ch5-du; + &gawk-tmp-sbu; + &gawk-tmp-du; diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml index a5b7f1a26..532a8e8b4 100644 --- a/chapter06/gcc-pass2.xml +++ b/chapter06/gcc-pass2.xml @@ -33,8 +33,8 @@ &diskspace; - &gcc-ch5p2-sbu; - &gcc-ch5p2-du; + &gcc-tmpp2-sbu; + &gcc-tmpp2-du; diff --git a/chapter06/grep.xml b/chapter06/grep.xml index 6a8ada4b8..494b8616d 100644 --- a/chapter06/grep.xml +++ b/chapter06/grep.xml @@ -33,8 +33,8 @@ &diskspace; - &grep-ch5-sbu; - &grep-ch5-du; + &grep-tmp-sbu; + &grep-tmp-du; diff --git a/chapter06/gzip.xml b/chapter06/gzip.xml index e5b5d0a37..90d554b0d 100644 --- a/chapter06/gzip.xml +++ b/chapter06/gzip.xml @@ -33,8 +33,8 @@ &diskspace; - &gzip-ch5-sbu; - &gzip-ch5-du; + &gzip-tmp-sbu; + &gzip-tmp-du; diff --git a/chapter06/m4.xml b/chapter06/m4.xml index 79559f6da..7a28a08cc 100644 --- a/chapter06/m4.xml +++ b/chapter06/m4.xml @@ -33,8 +33,8 @@ &diskspace; - &m4-ch5-sbu; - &m4-ch5-du; + &m4-tmp-sbu; + &m4-tmp-du; diff --git a/chapter06/make.xml b/chapter06/make.xml index fef5555aa..cf0dbce18 100644 --- a/chapter06/make.xml +++ b/chapter06/make.xml @@ -32,8 +32,8 @@ &diskspace; - &make-ch5-sbu; - &make-ch5-du; + &make-tmp-sbu; + &make-tmp-du; diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index d96d7d0f3..83499f2eb 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -33,8 +33,8 @@ &diskspace; - &ncurses-ch5-sbu; - &ncurses-ch5-du; + &ncurses-tmp-sbu; + &ncurses-tmp-du; diff --git a/chapter06/patch.xml b/chapter06/patch.xml index ecd5b2c47..7032d6eea 100644 --- a/chapter06/patch.xml +++ b/chapter06/patch.xml @@ -33,8 +33,8 @@ &diskspace; - &patch-ch5-sbu; - &patch-ch5-du; + &patch-tmp-sbu; + &patch-tmp-du; diff --git a/chapter06/sed.xml b/chapter06/sed.xml index f146b5102..d079f836d 100644 --- a/chapter06/sed.xml +++ b/chapter06/sed.xml @@ -33,8 +33,8 @@ &diskspace; - &sed-ch5-sbu; - &sed-ch5-du; + &sed-tmp-sbu; + &sed-tmp-du; diff --git a/chapter06/tar.xml b/chapter06/tar.xml index e64379fc5..8a82cff5c 100644 --- a/chapter06/tar.xml +++ b/chapter06/tar.xml @@ -33,8 +33,8 @@ &diskspace; - &tar-ch5-sbu; - &tar-ch5-du; + &tar-tmp-sbu; + &tar-tmp-du; diff --git a/chapter06/xz.xml b/chapter06/xz.xml index 428053ed1..f8d397d1b 100644 --- a/chapter06/xz.xml +++ b/chapter06/xz.xml @@ -33,8 +33,8 @@ &diskspace; - &xz-ch5-sbu; - &xz-ch5-du; + &xz-tmp-sbu; + &xz-tmp-du; diff --git a/chapter07/bison.xml b/chapter07/bison.xml index 4e794eb44..a3718bf19 100644 --- a/chapter07/bison.xml +++ b/chapter07/bison.xml @@ -33,8 +33,8 @@ &diskspace; - &bison-ch5-sbu; - &bison-ch5-du; + &bison-tmp-sbu; + &bison-tmp-du; diff --git a/chapter07/dejagnu.xml b/chapter07/dejagnu.xml index 727173d0e..da6a44aa9 100644 --- a/chapter07/dejagnu.xml +++ b/chapter07/dejagnu.xml @@ -32,8 +32,8 @@ &diskspace; - &dejagnu-ch5-sbu; - &dejagnu-ch5-du; + &dejagnu-tmp-sbu; + &dejagnu-tmp-du; diff --git a/chapter07/expect.xml b/chapter07/expect.xml index 7e59bda8b..e73676857 100644 --- a/chapter07/expect.xml +++ b/chapter07/expect.xml @@ -38,8 +38,8 @@ &diskspace; - &expect-ch5-sbu; - &expect-ch5-du; + &expect-tmp-sbu; + &expect-tmp-du; diff --git a/chapter07/gettext.xml b/chapter07/gettext.xml index a8f5be287..12a8b5cfd 100644 --- a/chapter07/gettext.xml +++ b/chapter07/gettext.xml @@ -33,8 +33,8 @@ &diskspace; - &gettext-ch5-sbu; - &gettext-ch5-du; + &gettext-tmp-sbu; + &gettext-tmp-du; diff --git a/chapter07/libstdc++-pass2.xml b/chapter07/libstdc++-pass2.xml index a10309f4b..a98bfb282 100644 --- a/chapter07/libstdc++-pass2.xml +++ b/chapter07/libstdc++-pass2.xml @@ -35,8 +35,8 @@ &diskspace; - &libstdcpp-ch5-sbu; - &libstdcpp-ch5-du; + &libstdcpp-tmp-sbu; + &libstdcpp-tmp-du; diff --git a/chapter07/perl.xml b/chapter07/perl.xml index 62b7f4e12..d282fb4ba 100644 --- a/chapter07/perl.xml +++ b/chapter07/perl.xml @@ -33,8 +33,8 @@ &diskspace; - &perl-ch5-sbu; - &perl-ch5-du; + &perl-tmp-sbu; + &perl-tmp-du; diff --git a/chapter07/python.xml b/chapter07/python.xml index 17af90999..9354bb99e 100644 --- a/chapter07/python.xml +++ b/chapter07/python.xml @@ -33,8 +33,8 @@ &diskspace; - &python-ch5-sbu; - &python-ch5-du; + &python-tmp-sbu; + &python-tmp-du; diff --git a/chapter07/stripping.xml b/chapter07/stripping.xml index 88b44b883..2f62fd5f2 100644 --- a/chapter07/stripping.xml +++ b/chapter07/stripping.xml @@ -140,7 +140,7 @@ tar -cJpf $HOME/temp-tools.tar.xz . In case some mistakes have been made and you need to start over, you can - use this backup to restore the temporary tools and save some irecovery time. + use this backup to restore the temporary tools and save some recovery time. Since the sources are located under $LFS, they are included in the backup archive as well, so you need not to download them again. After diff --git a/chapter07/tcl.xml b/chapter07/tcl.xml index d64852d43..39219b06b 100644 --- a/chapter07/tcl.xml +++ b/chapter07/tcl.xml @@ -34,8 +34,8 @@ &diskspace; - &tcl-ch5-sbu; - &tcl-ch5-du; + &tcl-tmp-sbu; + &tcl-tmp-du; diff --git a/chapter07/texinfo.xml b/chapter07/texinfo.xml index b58c701e6..3ce3d08b9 100644 --- a/chapter07/texinfo.xml +++ b/chapter07/texinfo.xml @@ -33,8 +33,8 @@ &diskspace; - &texinfo-ch5-sbu; - &texinfo-ch5-du; + &texinfo-tmp-sbu; + &texinfo-tmp-du; diff --git a/chapter07/util-linux.xml b/chapter07/util-linux.xml index f9401c03a..05698ae66 100644 --- a/chapter07/util-linux.xml +++ b/chapter07/util-linux.xml @@ -31,8 +31,8 @@ &diskspace; - &util-linux-ch5-sbu; - &util-linux-ch5-du; + &util-linux-tmp-sbu; + &util-linux-tmp-du; diff --git a/chapter08/acl.xml b/chapter08/acl.xml index f9f2eddbe..03f057cb3 100644 --- a/chapter08/acl.xml +++ b/chapter08/acl.xml @@ -32,8 +32,8 @@ &diskspace; - &acl-ch6-sbu; - &acl-ch6-du; + &acl-fin-sbu; + &acl-fin-du; diff --git a/chapter08/attr.xml b/chapter08/attr.xml index 10c6eec53..0033ae58f 100644 --- a/chapter08/attr.xml +++ b/chapter08/attr.xml @@ -31,8 +31,8 @@ &diskspace; - &attr-ch6-sbu; - &attr-ch6-du; + &attr-fin-sbu; + &attr-fin-du; diff --git a/chapter08/autoconf.xml b/chapter08/autoconf.xml index 6652747fd..c490a3994 100644 --- a/chapter08/autoconf.xml +++ b/chapter08/autoconf.xml @@ -31,8 +31,8 @@ &diskspace; - &autoconf-ch6-sbu; - &autoconf-ch6-du; + &autoconf-fin-sbu; + &autoconf-fin-du; @@ -59,7 +59,7 @@ make check + Allowed deviation in disk usage : 2% + + Suffixes: + *-tmp-* Package info for Temporary Tools + *-fin-* Package info for Final System + *-cfg-* Package info for System Configuration + *-knl-* Package info for Kernel stuff +--> - - + + - - + + - - - + + + @@ -37,58 +44,58 @@ - - + + - - - - + + + + - - + + - - - - - - + + + + + + - - - - + + + + - - - - + + + + @@ -105,75 +112,75 @@ - - + + - - - - + + + + - - + + - - + + - - - - + + + + - - + + - - + + - - + + - - + + @@ -181,60 +188,60 @@ - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - + + + + - - - - - - + + + + + + @@ -243,36 +250,36 @@ - - + + - - + + - - - - + + + + - - - - + + + + @@ -280,148 +287,148 @@ - - + + - - + + - - - - + + + + - - + + - - + + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + @@ -435,143 +442,143 @@ - - + + - - - - + + + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + - - + + - - + + - - - - + + + + - - + + - - + + - - - - + + + + - - - - + + + + - - + + - - + + - - + + @@ -582,10 +589,10 @@ - - - - + + + + @@ -595,34 +602,34 @@ - - + + - - - - + + + + - - + + - - + + @@ -637,26 +644,26 @@ - - + + - - + + - - - - + + + + @@ -664,18 +671,18 @@ - - + + - - - - + + + + @@ -695,10 +702,10 @@ - - - - + + + + @@ -708,40 +715,40 @@ - - + + - - + + - - - - + + + + - - + + - - + + -- cgit v1.2.3-54-g00ecf From a3d0817020eee2b1ea6ebfe10f3a0ea9e26829be Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 12 Jun 2020 20:42:32 +0000 Subject: Text updated for cross2 chapter 9 git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11928 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter09/etcshells.xml | 2 +- chapter09/inputrc.xml | 6 +- chapter09/introduction.xml | 142 ++------------------------------------------- chapter09/network.xml | 16 +---- chapter09/profile.xml | 10 ++-- chapter09/symlinks.xml | 46 +++++++-------- chapter09/udev.xml | 24 ++++---- chapter09/usage.xml | 68 ++++------------------ 8 files changed, 62 insertions(+), 252 deletions(-) (limited to 'chapter09') diff --git a/chapter09/etcshells.xml b/chapter09/etcshells.xml index 30961c80c..a0d5f21a8 100644 --- a/chapter09/etcshells.xml +++ b/chapter09/etcshells.xml @@ -23,7 +23,7 @@ The shells file contains a list of login shells on the system. Applications use this file to determine whether a shell is valid. For each shell a single line should be - present, consisting of the shell's path, relative to the root of the + present, consisting of the shell's path relative to the root of the directory structure (/). For example, this file is consulted by chsh diff --git a/chapter09/inputrc.xml b/chapter09/inputrc.xml index 00d36877f..de5401d2c 100644 --- a/chapter09/inputrc.xml +++ b/chapter09/inputrc.xml @@ -15,14 +15,14 @@ The inputrc file is the configuration file for - the Readline library, which provides editing capabilities while the user is + the readline library, which provides editing capabilities while the user is entering a line from the terminal. It works by translating keyboard inputs - into specific actions. Readline is used by Bash and most other shells as + into specific actions. Readline is used by bash and most other shells as well as many other applications. Most people do not need user-specific functionality so the command below creates a global /etc/inputrc used by everyone who - logs in. If you later decide you need to override the defaults on a per-user + logs in. If you later decide you need to override the defaults on a per user basis, you can create a .inputrc file in the user's home directory with the modified mappings. diff --git a/chapter09/introduction.xml b/chapter09/introduction.xml index cbc197a7b..875003f14 100644 --- a/chapter09/introduction.xml +++ b/chapter09/introduction.xml @@ -18,12 +18,6 @@ process must be organized to ensure the tasks are performed in the correct order but, at the same time, be executed as fast as possible. - - System V @@ -39,15 +33,13 @@ /etc/inittab file and is organized into run levels that can be run by the user: - -0 — halt +0 — halt 1 — Single user mode 2 — Multiuser, without networking 3 — Full multiuser mode 4 — User definable 5 — Full multiuser mode with display manager -6 — reboot - +6 — reboot The usual default run level is 3 or 5. @@ -69,7 +61,7 @@ - Slower to boot. A medium speed base LFS system + May be slower to boot. A medium speed base LFS system takes 8-12 seconds where the boot time is measured from the first kernel message to the login prompt. Network connectivity is typically established about 2 seconds @@ -94,132 +86,6 @@ - - + diff --git a/chapter09/network.xml b/chapter09/network.xml index b527258ee..45cd1d438 100644 --- a/chapter09/network.xml +++ b/chapter09/network.xml @@ -13,17 +13,7 @@ network configuring - + Creating Network Interface Configuration Files @@ -37,7 +27,7 @@ address(es), subnet masks, and so forth. It is necessary that the stem of the filename be ifconfig. - If the procedure in the previous section was not used, Udev + If the procedure in the previous section was not used, udev will assign network card interface names based on system physical characteristics such as enp2s1. If you are not sure what your interface name is, you can always run ip link or ls @@ -64,7 +54,7 @@ EOF If the ONBOOT variable is set to yes the System V network script will bring up the Network Interface Card (NIC) during - booting of the system. If set to anything but yes the NIC + the system boot process. If set to anything but yes the NIC will be ignored by the network script and not be automatically brought up. The interface can be manually started or stopped with the ifup and ifdown commands. diff --git a/chapter09/profile.xml b/chapter09/profile.xml index 226dd9fac..ec39d3a30 100644 --- a/chapter09/profile.xml +++ b/chapter09/profile.xml @@ -103,8 +103,8 @@ LC_ALL=<locale name> locale int_prefix encoding used by the locale, the local currency, and the prefix to dial before the telephone number in order to get into the country. If any of the commands above fail with a message similar to the one shown below, this means - that your locale was either not installed in Chapter 6 or is not supported by - the default installation of Glibc. + that your locale was either not installed in + or is not supported by the default installation of Glibc. locale: Cannot set LC_* to default locale: No such file or directory @@ -114,7 +114,7 @@ LC_ALL=<locale name> locale int_prefix Glibc. - Some packages beyond LFS may also lack support for your chosen locale. One + Other packages can also function incorrectly (but may not necessarily display any error messages) if the locale name does not meet their expectations. In those cases, investigating how other Linux distributions support your locale @@ -145,7 +145,7 @@ export LANG=<ll>_<CC>.<charmap><@modifiers> # End /etc/profile EOF - The C (default) and en_US (the recommended + The C (default) and en_US.utf8 (the recommended one for United States English users) locales are different. C uses the US-ASCII 7-bit character set, and treats bytes with the high bit set as invalid characters. That's why, e.g., the ls command diff --git a/chapter09/symlinks.xml b/chapter09/symlinks.xml index 951e6976d..3b46a67b0 100644 --- a/chapter09/symlinks.xml +++ b/chapter09/symlinks.xml @@ -21,7 +21,7 @@ discovered. For example, on a computer having two network cards made by Intel and Realtek, the network card manufactured by Intel may become eth0 and the Realtek card becomes eth1. In some cases, after a reboot the cards - get renumbered the other way around. + could get renumbered the other way around. In the new naming scheme, typical network device names would then be something like enp5s0 or wlp3s0. If this naming convention is not @@ -44,7 +44,7 @@ Creating Custom Udev Rules - The naming scheme can be customized by creating custom Udev + The naming scheme can be customized by creating custom udev rules. A script has been included that generates the initial rules. Generate these rules by running: @@ -68,24 +68,24 @@ along with its driver in parentheses, if the driver can be found. Neither the hardware ID nor the driver is used to determine which name to give an interface; this information is only for reference. The second line is the - Udev rule that matches this NIC and actually assigns it a name. + udev rule that matches this NIC and actually assigns it a name. - All Udev rules are made up of several keys, separated by commas and + All udev rules are made up of several keys, separated by commas and optional whitespace. This rule's keys and an explanation of each of them are as follows: - SUBSYSTEM=="net" - This tells Udev to ignore + SUBSYSTEM=="net" - This tells udev to ignore devices that are not network cards. - ACTION=="add" - This tells Udev to ignore this + ACTION=="add" - This tells udev to ignore this rule for a uevent that isn't an add ("remove" and "change" uevents also happen, but don't need to rename network interfaces). - DRIVERS=="?*" - This exists so that Udev will + DRIVERS=="?*" - This exists so that udev will ignore VLAN or bridge sub-interfaces (because these sub-interfaces do not have drivers). These sub-interfaces are skipped because the name that would be assigned would collide with their parent devices. @@ -96,14 +96,14 @@ ATTR{type}=="1" - This ensures the rule only - matches the primary interface in the case of certain wireless drivers, + matches the primary interface in the case of certain wireless drivers which create multiple virtual interfaces. The secondary interfaces are skipped for the same reason that VLAN and bridge sub-interfaces are skipped: there would be a name collision otherwise. NAME - The value of this key is the name that - Udev will assign to this interface. + udev will assign to this interface. @@ -133,8 +133,8 @@ default for USB and FireWire devices), where the rules it creates depend on the physical path to the CD or DVD device. Second, it can operate in by-id mode (default for IDE and SCSI devices), where the - rules it creates depend on identification strings stored in the CD or DVD - device itself. The path is determined by Udev's path_id + rules it creates depend on identification strings stored on the CD or DVD + device itself. The path is determined by udev's path_id script, and the identification strings are read from the hardware by its ata_id or scsi_id programs, depending on which type of device you have. @@ -159,11 +159,11 @@ External devices (for example, a USB-connected CD drive) should not use by-path persistence, because each time the device is plugged into a new external port, its physical path will change. All - externally-connected devices will have this problem if you write Udev rules + externally-connected devices will have this problem if you write udev rules to recognize them by their physical path; the problem is not limited to CD and DVD drives. - If you wish to see the values that the Udev scripts will use, then + If you wish to see the values that the udev scripts will use, then for the appropriate CD-ROM device, find the corresponding directory under /sys (e.g., this can be /sys/block/hdd) and @@ -182,18 +182,18 @@ as follows (where mode is one of by-id or by-path): -sed -i -e 's/"write_cd_rules"/"write_cd_rules mode"/' \ - /etc/udev/rules.d/83-cdrom-symlinks.rules +sed -e 's/"write_cd_rules"/"write_cd_rules mode"/' \ + -i /etc/udev/rules.d/83-cdrom-symlinks.rules Note that it is not necessary to create the rules files or symlinks - at this time, because you have bind-mounted the host's - /dev directory into the LFS system, + at this time because you have bind-mounted the host's + /dev directory into the LFS system and we assume the symlinks exist on the host. The rules and symlinks will be created the first time you boot your LFS system. However, if you have multiple CD-ROM devices, then the symlinks generated at that time may point to different devices than they point to on - your host, because devices are not discovered in a predictable order. The + your host because devices are not discovered in a predictable order. The assignments created when you first boot the LFS system will be stable, so this is only an issue if you need the symlinks on both systems to point to the same device. If you need that, then inspect (and possibly edit) the @@ -212,9 +212,9 @@ E.g., if you have a USB web camera and a TV tuner, sometimes /dev/video0 refers to the camera and /dev/video1 refers to the tuner, and sometimes - after a reboot the order changes to the opposite one. + after a reboot the order changes. For all classes of hardware except sound cards and network cards, this is - fixable by creating Udev rules for custom persistent symlinks. + fixable by creating udev rules for custom persistent symlinks. The case of network cards is covered separately in , and sound card configuration can be found in BLFS. @@ -237,10 +237,8 @@ cat > /etc/udev/rules.d/83-duplicate_devs.rules << "EOF" # Persistent symlinks for webcam and tuner -KERNEL=="video*", ATTRS{idProduct}=="1910", ATTRS{idVendor}=="0d81", \ - SYMLINK+="webcam" -KERNEL=="video*", ATTRS{device}=="0x036f", ATTRS{vendor}=="0x109e", \ - SYMLINK+="tvtuner" +KERNEL=="video*", ATTRS{idProduct}=="1910", ATTRS{idVendor}=="0d81", SYMLINK+="webcam" +KERNEL=="video*", ATTRS{device}=="0x036f", ATTRS{vendor}=="0x109e", SYMLINK+="tvtuner" EOF diff --git a/chapter09/udev.xml b/chapter09/udev.xml index 6060849be..508795a03 100644 --- a/chapter09/udev.xml +++ b/chapter09/udev.xml @@ -15,7 +15,7 @@ usage - In , we installed the Udev + In , we installed the udev package when eudev systemd was built. Before we go into the details regarding how this works, a brief history of previous methods of @@ -30,7 +30,7 @@ major and minor device numbers for every possible device that might exist in the world. - Using the Udev method, only those devices which are detected by the + Using the udev method, only those devices which are detected by the kernel get device nodes created for them. Because these device nodes will be created each time the system boots, they will be stored on a devtmpfs file system (a virtual file system @@ -135,7 +135,7 @@ /sys/bus/pci/devices/0000:00:0d.0/modalias file might contain the string pci:v00001319d00000801sv00001319sd00001319bc04sc01i00. - The default rules provided with Udev will cause udevd + The default rules provided with udev will cause udevd to call out to /sbin/modprobe with the contents of the MODALIAS uevent environment variable (which should be the same as the contents of the modalias file in sysfs), @@ -149,7 +149,7 @@ be prevented. The kernel itself is also able to load modules for network - protocols, filesystems and NLS support on demand. + protocols, filesystems, and NLS support on demand. @@ -177,12 +177,12 @@ Udev will only load a module if it has a bus-specific alias and the bus driver properly exports the necessary aliases to sysfs. In other cases, one should - arrange module loading by other means. With Linux-&linux-version;, Udev is + arrange module loading by other means. With Linux-&linux-version;, udev is known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI, SERIO, and FireWire devices. To determine if the device driver you require has the necessary - support for Udev, run modinfo with the module name as + support for udev, run modinfo with the module name as the argument. Now try locating the device directory under /sys/bus and check whether there is a modalias file there. @@ -190,7 +190,7 @@ If the modalias file exists in sysfs, the driver supports the device and can talk to it directly, but doesn't have the alias, it is a bug in the - driver. Load the driver without the help from Udev and expect the issue + driver. Load the driver without the help from udev and expect the issue to be fixed later. If there is no modalias file in the relevant @@ -206,7 +206,7 @@ - A kernel module is not loaded automatically, and Udev is not + <title>A kernel module is not loaded automatically, and udev is not intended to load it If the wrapper module only enhances the @@ -214,7 +214,7 @@ snd-pcm-oss enhances the functionality of snd-pcm by making the sound cards available to OSS applications), configure modprobe to load the wrapper - after Udev loads the wrapped module. To do this, add a + after udev loads the wrapped module. To do this, add a softdep line to the corresponding /etc/modprobe.d/<filename>.conf file. For example: @@ -279,7 +279,7 @@ Further text assumes that the driver is built statically into the kernel or already loaded as a module, and that you have already checked - that Udev doesn't create a misnamed device. + that udev doesn't create a misnamed device. Udev has no information needed to create a device node if a kernel driver does not export its data to @@ -297,12 +297,12 @@ Device naming order changes randomly after rebooting - This is due to the fact that Udev, by design, handles uevents and + This is due to the fact that udev, by design, handles uevents and loads modules in parallel, and thus in an unpredictable order. This will never be fixed. You should not rely upon the kernel device names being stable. Instead, create your own rules that make symlinks with stable names based on some stable attributes of the device, such as a - serial number or the output of various *_id utilities installed by Udev. + serial number or the output of various *_id utilities installed by udev. See and for examples. diff --git a/chapter09/usage.xml b/chapter09/usage.xml index 4a4cf6c36..d59b38b29 100644 --- a/chapter09/usage.xml +++ b/chapter09/usage.xml @@ -235,50 +235,6 @@ EOF For information on kernel module loading and udev, see . - @@ -293,11 +249,11 @@ EOF (CMOS) clock. If the hardware clock is set to UTC, this script will convert the hardware clock's time to the local time using the /etc/localtime file (which tells the - hwclock program which timezone the user is in). There is no + hwclock program which timezone to use). There is no way to detect whether or not the hardware clock is set to UTC, so this needs to be configured manually. - The setclock is run via + The setclock program is run via udev when the kernel detects the hardware capability upon boot. It can also be run manually with the stop parameter to store the system time to the CMOS clock. @@ -315,7 +271,7 @@ EOF Change the value of the UTC variable below to a value of 0 (zero) if the hardware clock - is not set to UTC time. + is NOT set to UTC time. Create a new file /etc/sysconfig/clock by running the following: @@ -336,7 +292,7 @@ EOF at . It explains issues such as time zones, UTC, and the TZ environment variable. - The CLOCKPARAMS and UTC paramaters may be alternatively set + The CLOCKPARAMS and UTC paramaters may also be set in the /etc/sysconfig/rc.site file. @@ -352,7 +308,7 @@ EOF This section discusses how to configure the console - bootscript that sets up the keyboard map, console font and console kernel log + bootscript that sets up the keyboard map, console font, and console kernel log level. If non-ASCII characters (e.g., the copyright sign, the British pound sign and Euro symbol) will not be used and the keyboard is a U.S. one, much of this section can be skipped. Without the configuration file, (or @@ -505,7 +461,7 @@ EOF Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous example, bright colors are no longer available on the Linux console unless - a framebuffer is used. If one wants to have bright colors without + a framebuffer is used. If one wants to have bright colors without a framebuffer and can live without characters not belonging to his language, it is still possible to use a language-specific 256-glyph font, as illustrated below: @@ -548,7 +504,7 @@ EOF are not multibyte. This deficiency doesn't affect keymaps for European languages, because there accents are added to unaccented ASCII characters, or two ASCII characters are composed together. However, in - UTF-8 mode it is a problem, e.g., for the Greek language, where one + UTF-8 mode it is a problem; e.g., for the Greek language, where one sometimes needs to put an accent on the letter alpha. The solution is either to avoid the use of UTF-8, or to install the X window system that doesn't have this limitation in its input @@ -556,11 +512,11 @@ EOF - For Chinese, Japanese, Korean and some other languages, the Linux + For Chinese, Japanese, Korean, and some other languages, the Linux console cannot be configured to display the needed characters. Users who need such languages should install the X Window System, fonts that cover the necessary character ranges, and the proper input method (e.g., - SCIM, it supports a wide variety of languages). + SCIM, supports a wide variety of languages). @@ -571,7 +527,7 @@ EOF The /etc/sysconfig/console file only controls the Linux text console localization. It has nothing to do with setting the proper keyboard layout and terminal fonts in the X Window System, with - ssh sessions or with a serial console. In such situations, limitations + ssh sessions, or with a serial console. In such situations, limitations mentioned in the last two list items above do not apply. @@ -585,9 +541,9 @@ EOF configuring - At times, it is desired to create files at boot time. For instance, + At times, it is desirable to create files at boot time. For instance, the /tmp/.ICE-unix directory - may be desired. This can be done by creating an entry in the + is often needed. This can be done by creating an entry in the /etc/sysconfig/createfiles configuration script. The format of this file is embedded in the comments of the default configuration file. -- cgit v1.2.3-54-g00ecf From 9e7475a6c30cbc40d2cf69118ea65d682189b091 Mon Sep 17 00:00:00 2001 From: "Douglas R. Reno" Date: Fri, 12 Jun 2020 21:04:48 +0000 Subject: Updates to chapter09 for systemd git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11929 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter08/dbus.xml | 10 +-- chapter08/systemd.xml | 157 ++++++++++++++++++------------------------- chapter09/clock.xml | 6 +- chapter09/consoled.xml | 14 ++-- chapter09/etcshells.xml | 4 +- chapter09/introductiond.xml | 7 +- chapter09/locale.xml | 26 +++---- chapter09/networkd.xml | 40 +++++------ chapter09/systemd-custom.xml | 33 ++++----- chapter09/udev.xml | 10 +-- 10 files changed, 140 insertions(+), 167 deletions(-) (limited to 'chapter09') diff --git a/chapter08/dbus.xml b/chapter08/dbus.xml index 0b06ad3e0..211399207 100644 --- a/chapter08/dbus.xml +++ b/chapter08/dbus.xml @@ -63,7 +63,7 @@ --with-console-auth-dir=/run/console - This specifies the location of the ConsoleKit auth + This specifies the location of the ConsoleKit authorization directory. @@ -91,7 +91,7 @@ mv -v /usr/lib/libdbus-1.so.* /lib ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so - Create a symlink, so that D-Bus and systemd can use the same + Create a symlink so that D-Bus and systemd can use the same machine-id file: ln -sfv /etc/machine-id /var/lib/dbus @@ -130,7 +130,7 @@ ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so dbus-cleanup-sockets - Used to clean up leftover sockets in a directory + is used to remove leftover sockets in a directory dbus-cleanup-sockets @@ -140,7 +140,7 @@ ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so dbus-daemon - The D-Bus message bus daemon + Is the D-Bus message bus daemon dbus-daemon @@ -193,7 +193,7 @@ ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so dbus-test-tool - A tool to help packages test + Is a tool to help packages test D-Bus dbus-test-tool diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml index 319f107a1..4049d726d 100644 --- a/chapter08/systemd.xml +++ b/chapter08/systemd.xml @@ -44,8 +44,7 @@ patch -Np1 -i ../systemd-&systemd-version;-gcc_10-fixes-1.patch - - Create a symlink to work around missing xsltproc: + Create a symlink to work around the xsltproc command not being installed: ln -sf /bin/true /usr/bin/xsltproc @@ -96,22 +95,10 @@ meson --prefix=/usr \ The meaning of the meson options: - - -D*-path=* - These switches provide location of binaries needed by + These switches provide the location of binaries needed by systemd at runtime that have not yet been installed. @@ -154,7 +141,7 @@ meson --prefix=/usr \ -Droot* These switches ensure that core programs and - shared libraries are installed in the subdirectories + shared libraries are installed in subdirectories of the root partition. @@ -200,11 +187,7 @@ meson --prefix=/usr \ Compile the package: LANG=en_US.UTF-8 ninja - Install the package: LANG=en_US.UTF-8 ninja install @@ -232,16 +215,8 @@ meson --prefix=/usr \ Prevent systemd from resetting the maximum PID value which causes some problems with packages and units in BLFS: - rm -f /usr/lib/sysctl.d/50-pid-max.conf - @@ -290,7 +265,7 @@ meson --prefix=/usr \ bootctl - Used to query the firmware and boot manager settings + Is used to query the firmware and boot manager settings bootctl @@ -300,7 +275,7 @@ meson --prefix=/usr \ busctl - Used to introspect and monitor the D-Bus bus + Is used to introspect and monitor the D-Bus bus busctl @@ -310,7 +285,7 @@ meson --prefix=/usr \ coredumpctl - Used to retrieve coredumps from the systemd journal + Is used to retrieve coredumps from the systemd journal coredumpctl @@ -334,7 +309,7 @@ meson --prefix=/usr \ hostnamectl - Used to query and change the system hostname and related + Is used to query and change the system hostname and related settings hostnamectl @@ -345,9 +320,10 @@ meson --prefix=/usr \ init - The first process to be started when the kernel has initialized + Is the first process to be started when the kernel has initialized the hardware which takes over the boot process and starts all - processes according to its configuration files + processes according to its configuration files. In this case, it starts + systemd. init @@ -357,7 +333,7 @@ meson --prefix=/usr \ journalctl - Used to query the contents of the systemd journal + Is used to query the contents of the systemd journal journalctl @@ -367,8 +343,8 @@ meson --prefix=/usr \ kernel-install - Used to add and remove kernel and initramfs images to and - from /boot + Is used to add and remove kernel and initramfs images to and + from /boot. In LFS, this is done manually. kernel-install @@ -378,7 +354,7 @@ meson --prefix=/usr \ localectl - Used to query and change the system locale and keyboard layout + Is used to query and change the system locale and keyboard layout settings localectl @@ -389,7 +365,7 @@ meson --prefix=/usr \ loginctl - Used to introspect and control the state of the systemd Login + Is used to introspect and control the state of the systemd Login Manager loginctl @@ -400,7 +376,7 @@ meson --prefix=/usr \ machinectl - Used to introspect and control the state of the systemd Virtual + Is used to introspect and control the state of the systemd Virtual Machine and Container Registration Manager machinectl @@ -411,8 +387,8 @@ meson --prefix=/usr \ networkctl - Used to introspect the state of the network links as seen by - systemd-networkd + Is used to introspect and configure the state of the network + links configured by systemd-networkd networkctl @@ -422,7 +398,7 @@ meson --prefix=/usr \ portablectl - Used to attach or detach portable services from the local + Is used to attach or detach portable services from the local system portablectl @@ -433,7 +409,7 @@ meson --prefix=/usr \ poweroff - Tells the kernel to halt the system and switch off the computer + Instructs the kernel to halt the system and switch off the computer (see halt) poweroff @@ -444,7 +420,7 @@ meson --prefix=/usr \ reboot - Tells the kernel to reboot the system (see + Instructs the kernel to reboot the system (see halt) reboot @@ -455,7 +431,7 @@ meson --prefix=/usr \ resolvconf - Register DNS server and domain configuration with + Registers DNS server and domain configuration with systemd-resolved resolvconf @@ -466,8 +442,8 @@ meson --prefix=/usr \ resolvectl - Send control commands to the network name resolution - manager, or resolve domain names, IPv4 and IPv6 addresses, + Sends control commands to the network name resolution + manager, or resolves domain names, IPv4 and IPv6 addresses, DNS records, and services. resolvectl @@ -478,7 +454,7 @@ meson --prefix=/usr \ runlevel - Reports the previous and the current run-level, as noted in the + Outputs the previous and the current run-level, as noted in the last run-level record in /var/run/utmp runlevel @@ -489,8 +465,8 @@ meson --prefix=/usr \ shutdown - Brings the system down in a secure way, signaling all processes - and notifying all logged-in users + Brings the system down in a safe and secure manner, signaling + all processes and notifying all logged-in users shutdown @@ -500,7 +476,7 @@ meson --prefix=/usr \ systemctl - Used to introspect and control the state of the systemd system + Is used to introspect and control the state of the systemd system and service manager systemctl @@ -511,8 +487,8 @@ meson --prefix=/usr \ systemd-analyze - Used to determine system boot-up performance of the current - boot + Is used to determine system startup performance of the current + boot, as well as identify troublesome systemd units systemd-analyze @@ -522,7 +498,7 @@ meson --prefix=/usr \ systemd-ask-password - Used to query a system password or passphrase from the user, + Is used to query a system password or passphrase from the user, using a question message specified on the command line systemd-ask-password @@ -533,7 +509,8 @@ meson --prefix=/usr \ systemd-cat - Used to connect STDOUT and STDERR of a process with the Journal + Is used to connect the STDOUT and STDERR outputs of a process + with the systemd journal. systemd-cat @@ -566,7 +543,7 @@ meson --prefix=/usr \ systemd-delta - Used to identify and compare configuration files in + Is used to identify and compare configuration files in /etc that override default counterparts in /usr @@ -578,7 +555,8 @@ meson --prefix=/usr \ systemd-detect-virt - Detects execution in a virtualized environment + Detects whether the system is being run in a virtual + environment, and adjusts udev accordingly. systemd-detect-virt @@ -588,7 +566,7 @@ meson --prefix=/usr \ systemd-escape - Used to escape strings for inclusion in systemd unit + Is used to escape strings for inclusion in systemd unit names systemd-escape @@ -599,7 +577,7 @@ meson --prefix=/usr \ systemd-hwdb - Used to manage hardware database (hwdb) + Is used to manage the hardware database (hwdb) systemd-hwdb @@ -609,7 +587,7 @@ meson --prefix=/usr \ systemd-id128 - Generate and print id128 strings + Generates and prints id128 strings systemd-id128 @@ -619,8 +597,9 @@ meson --prefix=/usr \ systemd-inhibit - Used to execute a program with a shutdown, sleep or idle - inhibitor lock taken + Is used to execute a program with a shutdown, sleep or idle + inhibitor lock taken, preventing an action such as a system shutdown + until the process is completed. systemd-inhibit @@ -630,7 +609,7 @@ meson --prefix=/usr \ systemd-machine-id-setup - Used by system installer tools to initialize the machine ID + Is used by system installer tools to initialize the machine ID stored in /etc/machine-id at install time with a randomly generated ID @@ -642,7 +621,7 @@ meson --prefix=/usr \ systemd-mount - A tool to temporarily mount or auto-mount a drive. + Is used to temporarily mount or automount disks. systemd-mount @@ -652,7 +631,7 @@ meson --prefix=/usr \ systemd-notify - Used by daemon scripts to notify the init system about status + Is used by daemon scripts to notify the init system about status changes systemd-notify @@ -663,7 +642,7 @@ meson --prefix=/usr \ systemd-nspawn - Used to run a command or OS in a light-weight namespace + Is used to run a command or OS in a light-weight namespace container systemd-nspawn @@ -674,7 +653,7 @@ meson --prefix=/usr \ systemd-path - Used to query system and user paths + Is used to query system and user paths systemd-path @@ -684,7 +663,7 @@ meson --prefix=/usr \ systemd-repart - Used go grow and add partitions to a partition table when + Is used to grow and add partitions to a partition table when systemd is used in an OS image (e.g. a container). systemd-repart @@ -695,7 +674,7 @@ meson --prefix=/usr \ systemd-resolve - Used to resolve domain names, IPV4 and IPv6 addresses, DNS + Is used to resolve domain names, IPV4 and IPv6 addresses, DNS resource records, and services systemd-resolve @@ -706,29 +685,20 @@ meson --prefix=/usr \ systemd-run - Used to create and start a transient .service or a .scope unit - and run the specified command in it + Is used to create and start a transient .service or a .scope + unit and run the specified command in it. This is useful for + validating systemd units. systemd-run - - systemd-socket-activate - A tool to listen on socket devices and launch a process upon - connection. + Is used to listen on socket devices and launch a process upon + a successful connection to the socket. systemd-socket-activate @@ -751,7 +721,7 @@ meson --prefix=/usr \ systemd-umount - Unmount mount points + Unmounts mount points systemd-umount @@ -761,7 +731,8 @@ meson --prefix=/usr \ systemd-tty-ask-password-agent - Used to list or process pending systemd password requests + Is used to list and/or process pending systemd password + requests systemd-tty-ask-password-agent @@ -782,7 +753,7 @@ meson --prefix=/usr \ timedatectl - Used to query and change the system clock and its settings + Is used to query and change the system clock and its settings timedatectl @@ -793,10 +764,10 @@ meson --prefix=/usr \ udevadm - Generic udev administration tool: controls the udevd daemon, - provides info from the Udev database, monitors uevents, waits for - uevents to finish, tests udev configuration, and triggers uevents - for a given device + Is a generic udev administration tool which controls the udevd + daemon, provides info from the Udev hardware database, monitors + uevents, waits for uevents to finish, tests udev configuration, and + triggers uevents for a given device udevadm @@ -806,7 +777,7 @@ meson --prefix=/usr \ libsystemd - The main systemd utility library + Is the main systemd utility library libsystemd @@ -816,7 +787,7 @@ meson --prefix=/usr \ libudev - A library to access Udev device information + Is a library to access Udev device information libudev diff --git a/chapter09/clock.xml b/chapter09/clock.xml index 872ba677c..585017e35 100644 --- a/chapter09/clock.xml +++ b/chapter09/clock.xml @@ -16,7 +16,7 @@ This section discusses how to configure the systemd-timedated system service, which configures - system clock and timezone. + the system clock and timezone. If you cannot remember whether or not the hardware clock is set to UTC, find out by running the hwclock --localtime --show @@ -30,7 +30,7 @@ time. systemd-timedated reads /etc/adjtime, - and depending on the contents of the file, it sets the clock to either UTC or + and depending on the contents of the file, sets the clock to either UTC or local time. Create the /etc/adjtime file with the following contents @@ -59,7 +59,7 @@ EOF timedatectl set-time YYYY-MM-DD HH:MM:SS - Hardware clock will also be updated accordingly. + The hardware clock will also be updated accordingly. To change your current time zone, issue: diff --git a/chapter09/consoled.xml b/chapter09/consoled.xml index bf1fdc8e0..76d304d44 100644 --- a/chapter09/consoled.xml +++ b/chapter09/consoled.xml @@ -24,8 +24,8 @@ information. Decide which keymap and screen font will be used. Various language-specific HOWTOs can also help with this, see . - Examine localectl list-keymaps output for a list of - valid console keymaps. Look in + Examine the output of localectl list-keymaps for a list of + valid console keymaps. Look in the /usr/share/consolefonts directory for valid screen fonts. @@ -106,34 +106,34 @@ EOF list-x11-keymap-models - Show known X11 keyboard mapping models. + Shows known X11 keyboard mapping models. list-x11-keymap-layouts - Show known X11 keyboard mapping layouts. + Shows known X11 keyboard mapping layouts. list-x11-keymap-variants - Show known X11 keyboard mapping variants. + Shows known X11 keyboard mapping variants. list-x11-keymap-options - Show known X11 keyboard mapping options. + Shows known X11 keyboard mapping options. Using any of the parameters listed above requires the - XKeyboard Config package from BLFS. + XKeyboard-Config package from BLFS. diff --git a/chapter09/etcshells.xml b/chapter09/etcshells.xml index a0d5f21a8..b9d299c93 100644 --- a/chapter09/etcshells.xml +++ b/chapter09/etcshells.xml @@ -28,8 +28,8 @@ For example, this file is consulted by chsh to determine whether an unprivileged user may change the login shell for her - own account. If the command name is not listed, the user will be denied of - change. + own account. If the command name is not listed, the user will be denied the + ability to change shells. It is a requirement for applications such as GDM which does not populate the diff --git a/chapter09/introductiond.xml b/chapter09/introductiond.xml index fa2403edb..f0be70cec 100644 --- a/chapter09/introductiond.xml +++ b/chapter09/introductiond.xml @@ -38,7 +38,7 @@ - Third, configuring the system clock and keyboard layout. + Third, configuring the system clock and keyboard layout is shown. @@ -49,9 +49,8 @@ - Fourth, a brief introduction to the scripts and configuration - files used when the user logs into the system. + files used when the user logs into the system is presented. @@ -62,7 +61,7 @@ - And finally, configuring the systemd behavior. + And finally, configuring the behavior of systemd is discussed. diff --git a/chapter09/locale.xml b/chapter09/locale.xml index 5f473ac72..23442a513 100644 --- a/chapter09/locale.xml +++ b/chapter09/locale.xml @@ -14,16 +14,16 @@ /etc/locale.conf - The /etc/locale.conf below sets some + The /etc/locale.conf file below sets some environment variables necessary for native language support. Setting them properly results in: - The output of programs translated into the native language + The output of programs being translated into your native language - Correct classification of characters into letters, digits and other + The correct classification of characters into letters, digits and other classes. This is necessary for bash to properly accept non-ASCII characters in command lines in non-English locales @@ -31,15 +31,15 @@ The correct alphabetical sorting order for the country - Appropriate default paper size + The appropriate default paper size - Correct formatting of monetary, time, and date values + The correct formatting of monetary, time, and date values Replace <ll> below with the two-letter code - for the desired language (e.g., en) and + for your desired language (e.g., en) and <CC> with the two-letter code for the appropriate country (e.g., GB). <charmap> should be replaced with the canonical charmap for your chosen locale. Optional @@ -54,7 +54,7 @@ is also referred to as iso8859-1 and iso88591. Some applications cannot handle the various synonyms correctly (e.g., require that UTF-8 is written as UTF-8, not - utf8), so it is safest in most + utf8), so it is the safest in most cases to choose the canonical name for a particular locale. To determine the canonical name, run the following command, where <locale name> is the output given by locale -a for @@ -80,8 +80,8 @@ LC_ALL=<locale name> locale int_prefix encoding used by the locale, the local currency, and the prefix to dial before the telephone number in order to get into the country. If any of the commands above fail with a message similar to the one shown below, this means - that your locale was either not installed in Chapter 6 or is not supported by - the default installation of Glibc. + that your locale was either not installed in Chapter 6 or is not + supported by the default installation of Glibc. locale: Cannot set LC_* to default locale: No such file or directory @@ -90,7 +90,7 @@ LC_ALL=<locale name> locale int_prefix Further instructions assume that there are no such error messages from Glibc. - + Some packages beyond LFS may also lack support for your chosen locale. One example is the X library (part of the X Window System), which outputs the following error message if the locale does not exactly match one of the character @@ -142,11 +142,13 @@ EOF substitutes them with question marks in that locale. Also, an attempt to send mail with such characters from Mutt or Pine results in non-RFC-conforming messages being sent (the charset in the outgoing mail is indicated as unknown - 8-bit). So you can use the C locale only if you are sure that - you will never need 8-bit characters. + 8-bit). It's suggested that you use the C locale only + if you are certain that you will never need 8-bit characters. + diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index 688c315aa..1acc215b9 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -48,7 +48,7 @@ Udev normally assigns network card interface names based - on system physical characteristics such as enp2s1. If you are + on physical system characteristics such as enp2s1. If you are not sure what your interface name is, you can always run ip link after you have booted your system. @@ -76,10 +76,9 @@ Create a manual naming scheme, for example by naming the interfaces something like "internet0", "dmz0", or "lan0". - For that, create .link - files in /etc/systemd/network/, that choose an explicit name or a - better naming scheme for one, some, or all of your interfaces. - For example: + To do that, create .link files in /etc/systemd/network/ that + select an explicit name or a better naming scheme for your + network interfaces. For example: cat > /etc/systemd/network/10-ether0.link << "EOF" @@ -170,9 +169,9 @@ EOF If using another means to configure your network interfaces (ex: ppp, network-manager, etc.), or if using any type of - local resolver (ex: bind, dnsmasq, etc.), or any other software that - generates an /etc/resolv.conf (ex: resolvconf), the - systemd-resolved service should not be + local resolver (ex: bind, dnsmasq, unbound, etc.), or any other software + that generates an /etc/resolv.conf (ex: resolvconf), + the systemd-resolved service should not be used. When using systemd-resolved for DNS @@ -206,11 +205,13 @@ EOF Replace <IP address of the nameserver> - with the IP address of the DNS most appropriate for the setup. There will - often be more than one entry (requirements demand secondary servers for - fallback capability). If you only need or want one DNS server, remove the - second nameserver line from the file. The IP address - may also be a router on the local network. + with the IP address of the DNS server most appropriate for your setup. + There will often be more than one entry (requirements demand secondary + servers for fallback capability). If you only need or want one DNS server, + remove the second nameserver line from the file. + The IP address may also be a router on the local network. Another option + is to use the Google Public DNS service using the IP addresses below as + nameservers. The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4 @@ -262,7 +263,7 @@ EOF Decide on a fully-qualified domain name (FQDN), and possible aliases - for use in the /etc/hosts file. If using static + for use in the /etc/hosts file. If using static IP addresses, you'll also need to decide on an IP address. The syntax for a hosts file entry is: @@ -285,11 +286,9 @@ EOF this IP could be lfs.example.org. Even if not using a network card, a valid FQDN is still required. - This is necessary for certain programs to operate correctly. + This is necessary for certain programs, such as MTAs, to operate properly. - If using DHCP, DHCPv6, IPv6 Autoconfiguration, or if a network card - is not going to be configured, create the /etc/hosts - file by running the following command: + Create the /etc/hosts file using the following command: cat > /etc/hosts << "EOF" # Begin /etc/hosts @@ -307,13 +306,14 @@ EOF the IPv6 loopback interface. 127.0.1.1 is a loopback entry reserved specifically for the FQDN. + diff --git a/chapter09/systemd-custom.xml b/chapter09/systemd-custom.xml index 787fd4572..809c1a273 100644 --- a/chapter09/systemd-custom.xml +++ b/chapter09/systemd-custom.xml @@ -49,13 +49,14 @@ EOF Disabling tmpfs for /tmp By default, /tmp is created as - a tmpfs. If this is not desired, it can be overridden by the following: + a tmpfs. If this is not desired, it can be overridden by executing the + following command: ln -sfv /dev/null /etc/systemd/system/tmp.mount Alternatively, if a a separate partition for /tmp is desired, specify that - partition in an /etc/fstab entry. + partition in a /etc/fstab entry. @@ -87,7 +88,7 @@ EOF /etc/tmpfiles.d override files with the same name in /usr/lib/tmpfiles.d. See - tmpfiles.d(5) manual page for file format + tmpfiles.d(5) manual page for file format details. @@ -103,7 +104,7 @@ EOF is really only applicable to btrfs filesystems. It references type v which in turn references type d (directory). This then creates the specified directory if is is not present and adjusts the permissions - and ownership as specified. Contents of the directory will be + and ownership as specified. Contents of the directory will be subject to time based cleanup if the age argument is specified. @@ -121,7 +122,7 @@ cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d Overriding Default Services Behavior - The parameter of a unit can be overriden by creating a directory + The parameters of a unit can be overriden by creating a directory and a configuration file in /etc/systemd/system. For example: @@ -180,7 +181,7 @@ EOF Logging on a system booted with systemd is handled with systemd-journald (by default), rather than a typical unix syslog daemon. - You can also add a normal syslog daemon and have both work side by + You can also add a normal syslog daemon and have both operate side by side if desired. The systemd-journald program stores journal entries in a binary format rather than a plain text log file. To assist with parsing the file, the command journalctl is provided. @@ -202,7 +203,7 @@ EOF chronological order. - journalctl -f: povides functionality similar + journalctl -f: provides functionality similar to tail -f (follow). @@ -215,23 +216,23 @@ EOF Core dumps are useful to debug crashed programs, especially when a daemon process crashes. On systemd booted systems the core dumping is handled by systemd-coredump. It will - log the core dump into the journal and store the core dump itself in + log the core dump in the journal and store the core dump itself in /var/lib/systemd/coredump. - To retrieve and process core dumps, coredumpctl + To retrieve and process core dumps, the coredumpctl tool is provided. Here are some examples of frequently used commands: coredumpctl -r: lists all core dumps in - reversed chronological order. + reverse chronological order. - coredumpctl -1 info: show the information - of the last core dump. + coredumpctl -1 info: shows the information + from the last core dump. - coredumpctl -1 debug: load the last core + coredumpctl -1 debug: loads the last core dump into GDB. @@ -249,7 +250,7 @@ cat > /etc/systemd/coredump.conf.d/maxuse.conf << EOF MaxUse=5G EOF - See systemd-coredump(8), + See the systemd-coredump(8), coredumpctl(1), and coredump.conf.d(5) manual pages for more information. @@ -284,7 +285,7 @@ EOF advantage of explicitly allowing and disallowing processes to run after the user session has ended, but breaks backwards compatibility with tools like nohup and utilities that use - deamon(). + daemon(). @@ -298,7 +299,7 @@ EOF - Disable at build-time: You can enable + Disable at build-time: You can disable lingering by default while building systemd by adding the switch -Ddefault-kill-user-processes=false to the meson command for systemd. This completely diff --git a/chapter09/udev.xml b/chapter09/udev.xml index 508795a03..a3a7c0cf9 100644 --- a/chapter09/udev.xml +++ b/chapter09/udev.xml @@ -223,13 +223,13 @@ Note that the softdep command also allows pre: dependencies, or a mixture of both - pre: and post:. See the - modprobe.d(5) manual page for more information + pre: and post: dependencies. See + the modprobe.d(5) manual page for more information on softdep syntax and capabilities. - If the module in question is not a wrapper and is useful by itself, - configure the modules bootscript to load this - module on system boot. To do this, add the module name to the + If the module in question is not a wrapper and is + useful by itself, configure the modules bootscript to + load this module on system boot. To do this, add the module name to the /etc/sysconfig/modules file on a separate line. This works for wrapper modules too, but is suboptimal in that case. -- cgit v1.2.3-54-g00ecf From 4234aea63245034ea9c2eb5081e22cbe75d27571 Mon Sep 17 00:00:00 2001 From: "Douglas R. Reno" Date: Fri, 12 Jun 2020 21:30:19 +0000 Subject: Fix the /etc/hosts file on systemd git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11930 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter09/networkd.xml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'chapter09') diff --git a/chapter09/networkd.xml b/chapter09/networkd.xml index 1acc215b9..229b313b1 100644 --- a/chapter09/networkd.xml +++ b/chapter09/networkd.xml @@ -288,6 +288,7 @@ EOF Even if not using a network card, a valid FQDN is still required. This is necessary for certain programs, such as MTAs, to operate properly. + - The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents - the IPv6 loopback interface. 127.0.1.1 is a loopback entry reserved - specifically for the FQDN. - - + existing network). The optional alias name(s) can be omitted, and the + <192.168.0.2 line can be omitted if you + are using a connection configured with DHCP or IPv6 Autoconfiguration. + + The ::1 entry is the IPv6 counterpart of 127.0.0.1 and represents + the IPv6 loopback interface. 127.0.1.1 is a loopback entry reserved + specifically for the FQDN. + -- cgit v1.2.3-54-g00ecf