diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2020-06-16 11:56:28 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2020-06-16 11:56:28 +0000 |
commit | 675606bde2ba53946537b42a5aa576692a311621 (patch) | |
tree | af20c20ce3841c16b24d0b9903af6878a4a0f5a6 /chapter07 | |
parent | 560065f976e371779928dbf8b9428217f3f57331 (diff) | |
parent | 1cd59612d00603c9ce773ad821a15d20bc4fa0b7 (diff) |
Split Chapter 5 into three separate chapters.
Implement a new method of cross-building the LFS tool chain
and other tools to simplify the method of isolating the
new system from the original host. This will be the start of
LFS-10.0.
Move old trunk/BOOK to branches/old-trunk.
git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@11946 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter07')
32 files changed, 1771 insertions, 3536 deletions
diff --git a/chapter07/bison.xml b/chapter07/bison.xml new file mode 100644 index 000000000..a3718bf19 --- /dev/null +++ b/chapter07/bison.xml @@ -0,0 +1,82 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-bison" role="wrap"> + <?dbhtml filename="bison.html"?> + + <sect1info condition="script"> + <productname>bison</productname> + <productnumber>&bison-version;</productnumber> + <address>&bison-url;</address> + </sect1info> + + <title>Bison-&bison-version;</title> + + <indexterm zone="ch-tools-bison"> + <primary sortas="a-Bison">Bison</primary> + <secondary>tools</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/bison.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bison-tmp-sbu;</seg> + <seg>&bison-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bison</title> + + <para>Prepare Bison for compilation:</para> + +<screen><userinput remap="configure">./configure --prefix=/usr \ + --docdir=/usr/share/doc/bison-&bison-version;</userinput></screen> + + <variablelist> + <title>The meaning of the new configure option:</title> + + <varlistentry> + <term><parameter>--docdir=/usr/share/doc/bison-&bison-version;</parameter></term> + <listitem> + <para>This tells the build system to install bison documentation + into a versioned directory.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput remap="install">make install</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in + <xref linkend="contents-bison" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter07/bootscripts.xml b/chapter07/bootscripts.xml deleted file mode 100644 index 5c2b28d7c..000000000 --- a/chapter07/bootscripts.xml +++ /dev/null @@ -1,331 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-bootscripts" role="wrap" revision="sysv"> - <?dbhtml filename="bootscripts.html"?> - - <sect1info condition="script"> - <productname>bootscripts</productname> - <productnumber>&lfs-bootscripts-version;</productnumber> - <address>&lfs-bootscripts-url;</address> - </sect1info> - - <title>LFS-Bootscripts-&lfs-bootscripts-version;</title> - - <indexterm zone="ch-config-bootscripts"> - <primary sortas="a-Bootscripts">Bootscripts</primary> - </indexterm> - - <sect2 role="package"> - <title/> - - <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</title> - - <para>Install the package:</para> - -<screen><userinput remap="install">make install</userinput></screen> - - </sect2> - - <sect2 id="contents-bootscripts" role="content"> - <title>Contents of LFS-Bootscripts</title> - <segmentedlist> - <segtitle>Installed scripts</segtitle> - <segtitle>Installed directories</segtitle> - - <seglistitem> - <seg>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</seg> - <seg>/etc/rc.d, /etc/init.d (symbolic link), /etc/sysconfig, - /lib/services, /lib/lsb (symbolic link)</seg> - </seglistitem> - </segmentedlist> - - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="checkfs-bootscripts"> - <term><command>checkfs</command></term> - <listitem> - <para>Checks the integrity of the file systems before they are mounted - (with the exception of journal and network based file systems)</para> - <indexterm zone="ch-config-bootscripts checkfs-bootscripts"> - <primary sortas="d-checkfs">checkfs</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="cleanfs-bootscripts"> - <term><command>cleanfs</command></term> - <listitem> - <para>Removes files that should not be preserved between reboots, such - as those in <filename class="directory">/var/run/</filename> and - <filename class="directory">/var/lock/</filename>; it re-creates - <filename>/var/run/utmp</filename> and removes the possibly present - <filename>/etc/nologin</filename>, <filename>/fastboot</filename>, and - <filename>/forcefsck</filename> files</para> - <indexterm zone="ch-config-bootscripts cleanfs-bootscripts"> - <primary sortas="d-cleanfs">cleanfs</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="console-bootscripts"> - <term><command>console</command></term> - <listitem> - <para>Loads the correct keymap table for the desired keyboard layout; - it also sets the screen font</para> - <indexterm zone="ch-config-bootscripts console-bootscripts"> - <primary sortas="d-console">console</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="functions-bootscripts"> - <term><command>functions</command></term> - <listitem> - <para>Contains common functions, such as error and status checking, - that are used by several bootscripts</para> - <indexterm zone="ch-config-bootscripts functions-bootscripts"> - <primary sortas="d-functions">functions</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="halt-bootscripts"> - <term><command>halt</command></term> - <listitem> - <para>Halts the system</para> - <indexterm zone="ch-config-bootscripts halt-bootscripts"> - <primary sortas="d-halt">halt</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="ifdown-bootscripts"> - <term><command>ifdown</command></term> - <listitem> - <para>Stops a network device</para> - <indexterm zone="ch-config-bootscripts ifdown-bootscripts"> - <primary sortas="d-ifdown">ifdown</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="ifup-bootscripts"> - <term><command>ifup</command></term> - <listitem> - <para>Initializes a network device</para> - <indexterm zone="ch-config-bootscripts ifup-bootscripts"> - <primary sortas="d-ifup">ifup</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="localnet-bootscripts"> - <term><command>localnet</command></term> - <listitem> - <para>Sets up the system's hostname and local loopback device</para> - <indexterm zone="ch-config-bootscripts localnet-bootscripts"> - <primary sortas="d-localnet">localnet</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="modules-bootscripts"> - <term><command>modules</command></term> - <listitem> - <para>Loads kernel modules listed in - <filename>/etc/sysconfig/modules</filename>, using arguments - that are also given there</para> - <indexterm zone="ch-config-bootscripts modules-bootscripts"> - <primary sortas="d-modules">modules</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="mountfs-bootscripts"> - <term><command>mountfs</command></term> - <listitem> - <para>Mounts all file systems, except ones that are marked - <emphasis>noauto</emphasis> or are network based</para> - <indexterm zone="ch-config-bootscripts mountfs-bootscripts"> - <primary sortas="d-mountfs">mountfs</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="mountvirtfs-bootscripts"> - <term><command>mountvirtfs</command></term> - <listitem> - <para>Mounts virtual kernel file systems, such as <systemitem - class="filesystem">proc</systemitem></para> - <indexterm zone="ch-config-bootscripts mountvirtfs-bootscripts"> - <primary sortas="d-mountvirtfs">mountvirtfs</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="network-bootscripts"> - <term><command>network</command></term> - <listitem> - <para>Sets up network interfaces, such as network cards, and sets up - the default gateway (where applicable)</para> - <indexterm zone="ch-config-bootscripts network-bootscripts"> - <primary sortas="d-network">network</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="rc-bootscripts"> - <term><command>rc</command></term> - <listitem> - <para>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</para> - <indexterm zone="ch-config-bootscripts rc-bootscripts"> - <primary sortas="d-rc">rc</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="reboot-bootscripts"> - <term><command>reboot</command></term> - <listitem> - <para>Reboots the system</para> - <indexterm zone="ch-config-bootscripts reboot-bootscripts"> - <primary sortas="d-reboot">reboot</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="sendsignals-bootscripts"> - <term><command>sendsignals</command></term> - <listitem> - <para>Makes sure every process is terminated before the system reboots - or halts</para> - <indexterm zone="ch-config-bootscripts sendsignals-bootscripts"> - <primary sortas="d-sendsignals">sendsignals</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="setclock-bootscripts"> - <term><command>setclock</command></term> - <listitem> - <para>Resets the kernel clock to local time in case the hardware clock - is not set to UTC time</para> - <indexterm zone="ch-config-bootscripts setclock-bootscripts"> - <primary sortas="d-setclock">setclock</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="ipv4-static-bootscripts"> - <term><command>ipv4-static</command></term> - <listitem> - <para>Provides the functionality needed to assign a static Internet - Protocol (IP) address to a network interface</para> - <indexterm zone="ch-config-bootscripts ipv4-static-bootscripts"> - <primary sortas="d-ipv4-static">ipv4-static</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="swap-bootscripts"> - <term><command>swap</command></term> - <listitem> - <para>Enables and disables swap files and partitions</para> - <indexterm zone="ch-config-bootscripts swap-bootscripts"> - <primary sortas="d-swap">swap</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="sysctl-bootscripts"> - <term><command>sysctl</command></term> - <listitem> - <para>Loads system configuration values from - <filename>/etc/sysctl.conf</filename>, if that file exists, - into the running kernel</para> - <indexterm zone="ch-config-bootscripts sysctl-bootscripts"> - <primary sortas="d-sysctl">sysctl</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="sysklogd-bootscripts"> - <term><command>sysklogd</command></term> - <listitem> - <para>Starts and stops the system and kernel log daemons</para> - <indexterm zone="ch-config-bootscripts sysklogd-bootscripts"> - <primary sortas="d-sysklogd">sysklogd</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="template-bootscripts"> - <term><command>template</command></term> - <listitem> - <para>A template to create custom bootscripts for other - daemons</para> - <indexterm zone="ch-config-bootscripts template-bootscripts"> - <primary sortas="d-template">template</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="udev-bootscripts"> - <term><command>udev</command></term> - <listitem> - <para>Prepares the <filename class="directory">/dev</filename> - directory and starts Udev</para> - <indexterm zone="ch-config-bootscripts udev-bootscripts"> - <primary sortas="d-udev">udev</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="udev-retry-bootscripts"> - <term><command>udev_retry</command></term> - <listitem> - <para>Retries failed udev uevents, and copies generated rules - files from <filename class="directory">/run/udev</filename> to - <filename class="directory">/etc/udev/rules.d</filename> if required</para> - <indexterm zone="ch-config-bootscripts udev-retry-bootscripts"> - <primary sortas="d-udev-retry">udev_retry</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> - - </sect2> - -</sect1> diff --git a/chapter07/changingowner.xml b/chapter07/changingowner.xml new file mode 100644 index 000000000..3c39e4214 --- /dev/null +++ b/chapter07/changingowner.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-changingowner"> + <?dbhtml filename="changingowner.html"?> + + <title>Changing Ownership</title> + + <note> + <para>The commands in the remainder of this book must be performed while + logged in as user <systemitem class="username">root</systemitem> and no + longer as user <systemitem class="username">lfs</systemitem>. Also, double + check that <envar>$LFS</envar> is set in <systemitem + class="username">root</systemitem>'s environment.</para> + </note> + + <para>Currently, the whole directory hierarchy in <filename + class="directory">$LFS</filename> + is owned by the user <systemitem class="username">lfs</systemitem>, a user + that exists only on the host system. If the directories under <filename + class="directory">$LFS</filename> are kept as they are, the files are + owned by a user ID without a corresponding account. This is dangerous because + a user account created later could get this same user ID and would own all + the files under <filename class="directory">$LFS</filename>, thus exposing + these files to possible malicious manipulation.</para> + + <para>To address this issue, change the + ownership of the <filename class="directory">$LFS/*</filename> directories to + user <systemitem class="username">root</systemitem> by running the following + command:</para> + +<screen><userinput>chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools} +case $(uname -m) in + x86_64) chown -R root:root $LFS/lib64 ;; +esac</userinput></screen> + +</sect1> diff --git a/chapter07/chapter07.xml b/chapter07/chapter07.xml index b745594da..df114396e 100644 --- a/chapter07/chapter07.xml +++ b/chapter07/chapter07.xml @@ -5,39 +5,28 @@ %general-entities; ]> -<chapter id="chapter-config" xreflabel="Chapter 7"> +<chapter id="chapter-chroot-temporary-tools" xreflabel="Chapter 7"> <?dbhtml dir="chapter07"?> <?dbhtml filename="chapter07.html"?> - <title>System Configuration</title> + <title>Entering Chroot and Building Additional Tools</title> - <!-- sysv --> <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introduction.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bootscripts.xml"/> - - <!-- systemd --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="introductiond.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="networkd.xml"/> - - <!-- common --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="udev.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="symlinks.xml"/> - - <!-- sysv --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="network.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="usage.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="profile.xml"/> - - <!-- systemd --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="clock.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="consoled.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="locale.xml"/> - - <!-- common --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="inputrc.xml"/> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="etcshells.xml"/> - - <!-- systemd --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="systemd-custom.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="changingowner.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="kernfs.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="chroot.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="creatingdirs.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="createfiles.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libstdc++-pass2.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="bison.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gettext.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="perl.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="python.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="texinfo.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="util-linux.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="tcl.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="expect.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="dejagnu.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="stripping.xml"/> </chapter> diff --git a/chapter07/chroot.xml b/chapter07/chroot.xml new file mode 100644 index 000000000..c0cd4fc96 --- /dev/null +++ b/chapter07/chroot.xml @@ -0,0 +1,66 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-chroot"> + <?dbhtml filename="chroot.html"?> + + <title>Entering the Chroot Environment</title> + + <para>Now that all the packages which are required to build the rest of the + needed tools are on the system, it is time to enter the chroot environment to + finish installing the remaining temporary tools. This environment will be in + use also for installing the final system. As user <systemitem + class="username">root</systemitem>, run the following command to enter the + environment that is, at the moment, populated with only the temporary + tools:</para> + +<screen role="nodump"><userinput>chroot "$LFS" /usr/bin/env -i \ + HOME=/root \ + TERM="$TERM" \ + PS1='(lfs chroot) \u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /bin/bash --login +h</userinput></screen> + + <para>The <parameter>-i</parameter> option given to the <command>env</command> + command will clear all variables of the chroot environment. After that, only + the <envar>HOME</envar>, <envar>TERM</envar>, <envar>PS1</envar>, and + <envar>PATH</envar> variables are set again. The + <parameter>TERM=$TERM</parameter> construct will set the <envar>TERM</envar> + variable inside chroot to the same value as outside chroot. This variable is + needed for programs like <command>vim</command> and <command>less</command> + to operate properly. If other variables are desired, such as + <envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is a good place to set + them again.</para> + + <para>From this point on, there is no need to use the + <envar>LFS</envar> variable anymore because all work will be restricted + to the LFS file system. This is because the Bash shell is told that + <filename class="directory">$LFS</filename> is now the root + (<filename class="directory">/</filename>) directory.</para> + + <para>Notice that <filename class="directory">/tools/bin</filename> is not + in the <envar>PATH</envar>. This means that a temporary tool will no longer be + used once its final version is installed. This occurs when the shell does not + <quote>remember</quote> the locations of executed binaries—for this + reason, hashing is switched off by passing the <parameter>+h</parameter> option + to <command>bash</command>.</para> + + <para>Note that the <command>bash</command> prompt will say + <computeroutput>I have no name!</computeroutput> This is normal because the + <filename>/etc/passwd</filename> file has not been created yet.</para> + + <note> + <para>It is important that all the commands throughout the remainder of this + chapter and the following chapters are run from within the chroot + environment. If you leave this environment for any reason (rebooting for + example), ensure that the virtual kernel filesystems are mounted as + explained in <xref linkend="ch-system-bindmount"/> and <xref + linkend="ch-system-kernfsmount"/> and enter chroot again before continuing + with the installation.</para> + </note> + +</sect1> diff --git a/chapter07/clock.xml b/chapter07/clock.xml deleted file mode 100644 index 872ba677c..000000000 --- a/chapter07/clock.xml +++ /dev/null @@ -1,104 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-clock" revision="systemd"> - <?dbhtml filename="clock.html"?> - - <title>Configuring the system clock</title> - - <indexterm zone="ch-config-clock"> - <primary sortas="d-clock">clock</primary> - <secondary>configuring</secondary></indexterm> - - <para>This section discusses how to configure the - <command>systemd-timedated</command> system service, which configures - system clock and timezone.</para> - - <para>If you cannot remember whether or not the hardware clock is set to UTC, - find out by running the <userinput>hwclock --localtime --show</userinput> - 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 <command>hwclock</command> 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 - <command>hwclock</command>. For example, if you are currently in the MST - timezone, which is also known as GMT -0700, add seven hours to the local - time.</para> - - <para><command>systemd-timedated</command> reads <filename>/etc/adjtime</filename>, - and depending on the contents of the file, it sets the clock to either UTC or - local time.</para> - - <para>Create the <filename>/etc/adjtime</filename> file with the following contents - if your hardware clock is set to local time:</para> - -<screen><userinput>cat > /etc/adjtime << "EOF" -<literal>0.0 0 0.0 -0 -LOCAL</literal> -EOF</userinput></screen> - - <para>If <filename>/etc/adjtime</filename> isn't present at first boot, - <command>systemd-timedated</command> will assume that hardware clock is - set to UTC and adjust the file according to that.</para> - - <para>You can also use the <command>timedatectl</command> utility to tell - <command>systemd-timedated</command> if your hardware clock is set to - UTC or local time:</para> - -<screen role="nodump"><userinput>timedatectl set-local-rtc 1</userinput></screen> - - <para><command>timedatectl</command> can also be used to change system time and - time zone.</para> - - <para>To change your current system time, issue:</para> - -<screen role="nodump"><userinput>timedatectl set-time YYYY-MM-DD HH:MM:SS</userinput></screen> - - <para>Hardware clock will also be updated accordingly.</para> - - <para>To change your current time zone, issue:</para> - -<screen role="nodump"><userinput>timedatectl set-timezone TIMEZONE</userinput></screen> - - <para>You can get a list of available time zones by running:</para> - -<screen role="nodump"><userinput>timedatectl list-timezones</userinput></screen> - - <note><para>Please note that the <command>timedatectl</command> command can - be used only on a system booted with systemd.</para></note> - - <sect2> - <title>Network Time Synchronization</title> - - <para>Starting with version 213, systemd ships a daemon called - <command>systemd-timesyncd</command> which can be used to - synchronize the system time with remote NTP servers.</para> - - <para>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.</para> - - <para>Starting with systemd version 216, the - <command>systemd-timesyncd</command> daemon is enabled by - default. If you want to disable it, issue the following - command:</para> - -<screen role="nodump"><userinput>systemctl disable systemd-timesyncd</userinput></screen> - - <para>The <filename>/etc/systemd/timesyncd.conf</filename> file - can be used to change the NTP servers that - <command>systemd-timesyncd</command> synchronizes with.</para> - - <para>Please note that when system clock is set to Local Time, - <command>systemd-timesyncd</command> won't update hardware - clock.</para> - - </sect2> - -</sect1> diff --git a/chapter07/consoled.xml b/chapter07/consoled.xml deleted file mode 100644 index bf1fdc8e0..000000000 --- a/chapter07/consoled.xml +++ /dev/null @@ -1,139 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-console" revision="systemd"> - <?dbhtml filename="console.html"?> - - <title>Configuring the Linux Console</title> - - <indexterm zone="ch-config-console"> - <primary sortas="d-console">console</primary> - <secondary>configuring</secondary> - </indexterm> - - <para>This section discusses how to configure the - <command>systemd-vconsole-setup</command> system service, which configures - the virtual console font and console keymap.</para> - - <para>The <command>systemd-vconsole-setup</command> service reads the - <filename>/etc/vconsole.conf</filename> file for configuration - information. Decide which keymap and screen font will be used. Various - language-specific HOWTOs can also help with this, see <ulink - url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. - Examine <command>localectl list-keymaps</command> output for a list of - valid console keymaps. Look in - <filename class="directory">/usr/share/consolefonts</filename> - directory for valid screen fonts.</para> - - <para>The <filename>/etc/vconsole.conf</filename> file should contain lines - of the form: VARIABLE="value". The following variables are recognized:</para> - - <variablelist> - - <varlistentry> - <term>KEYMAP</term> - <listitem> - <para>This variable specifies the key mapping table for the keyboard. If - unset, it defaults to <literal>us</literal>.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>KEYMAP_TOGGLE</term> - <listitem> - <para>This variable can be used to configure a second toggle keymap and - is unset by default.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>FONT</term> - <listitem> - <para>This variable specifies the font used by the virtual - console.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>FONT_MAP</term> - <listitem> - <para>This variable specifies the console map to be used.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>FONT_UNIMAP</term> - <listitem> - <para>This variable specifies the Unicode font map.</para> - </listitem> - </varlistentry> - - </variablelist> - - <para>An example for a German keyboard and console is given below:</para> -<!-- This is what is used by jhalfs for creating the vconsole.conf file. - Whenever you want to change the following, please inform the jhalfs - maintainer(s). --> -<screen><userinput>cat > /etc/vconsole.conf << "EOF" -<literal>KEYMAP=de-latin1 -FONT=Lat2-Terminus16</literal> -EOF</userinput></screen> - - <para>You can change KEYMAP value at runtime by using the - <command>localectl</command> utility:</para> - -<screen role="nodump"><userinput>localectl set-keymap MAP</userinput></screen> - - <note><para>Please note that the <command>localectl</command> command can - be used only on a system booted with systemd.</para></note> - - <para>You can also use <command>localectl</command> utility with the - corresponding parameters to change X11 keyboard layout, model, variant - and options:</para> - -<screen role="nodump"><userinput>localectl set-x11-keymap LAYOUT [MODEL] [VARIANT] [OPTIONS]</userinput></screen> - - <para>To list possible values for <command>localectl set-x11-keymap</command> - parameters, run <command>localectl</command> with parameters listed below: - </para> - - <variablelist> - - <varlistentry> - <term>list-x11-keymap-models</term> - <listitem> - <para>Show known X11 keyboard mapping models.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>list-x11-keymap-layouts</term> - <listitem> - <para>Show known X11 keyboard mapping layouts.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>list-x11-keymap-variants</term> - <listitem> - <para>Show known X11 keyboard mapping variants.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>list-x11-keymap-options</term> - <listitem> - <para>Show known X11 keyboard mapping options.</para> - </listitem> - </varlistentry> - - </variablelist> - - <note><para>Using any of the parameters listed above requires the - XKeyboard Config package from BLFS.</para></note> - -</sect1> diff --git a/chapter07/createfiles.xml b/chapter07/createfiles.xml new file mode 100644 index 000000000..c81ec9b1c --- /dev/null +++ b/chapter07/createfiles.xml @@ -0,0 +1,210 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-createfiles"> + <?dbhtml filename="createfiles.html"?> + + <title>Creating Essential Files and Symlinks</title> + + <indexterm zone="ch-tools-createfiles"> + <primary sortas="e-/etc/passwd">/etc/passwd</primary> + </indexterm> + + <indexterm zone="ch-tools-createfiles"> + <primary sortas="e-/etc/group">/etc/group</primary> + </indexterm> + + <indexterm zone="ch-tools-createfiles"> + <primary sortas="e-/var/run/utmp">/var/run/utmp</primary> + </indexterm> + + <indexterm zone="ch-tools-createfiles"> + <primary sortas="e-/var/log/btmp">/var/log/btmp</primary> + </indexterm> + + <indexterm zone="ch-tools-createfiles"> + <primary sortas="e-/var/log/lastlog">/var/log/lastlog</primary> + </indexterm> + + <indexterm zone="ch-tools-createfiles"> + <primary sortas="e-/var/log/wtmp">/var/log/wtmp</primary> + </indexterm> + + <para>Historically, Linux maintains a list of the mounted file systems in the + file <filename>/etc/mtab</filename>. Modern kernels maintain this list + internally and exposes it to the user via the <filename + class="directory">/proc</filename> filesystem. To satisfy utilities that + expect the presence of <filename>/etc/mtab</filename>, create the following + symbolic link:</para> + +<screen><userinput>ln -sv /proc/self/mounts /etc/mtab</userinput></screen> + + <para>Create a basic <filename>/etc/hosts</filename> file to be + referenced in some test suites, and in one of Perl's configuration files + as well:</para> + +<screen><userinput>echo "127.0.0.1 localhost $(hostname)" > /etc/hosts</userinput></screen> + + <para>In order for user <systemitem class="username">root</systemitem> to be + able to login and for the name <quote>root</quote> to be recognized, there + must be relevant entries in the <filename>/etc/passwd</filename> and + <filename>/etc/group</filename> files.</para> + + <para>Create the <filename>/etc/passwd</filename> file by running the following + command:</para> + +<screen revision="sysv"><userinput>cat > /etc/passwd << "EOF" +<literal>root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/dev/null:/bin/false +daemon:x:6:6:Daemon User:/dev/null:/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal> +EOF</userinput></screen> + +<screen revision="systemd"><userinput>cat > /etc/passwd << "EOF" +<literal>root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/dev/null:/bin/false +daemon:x:6:6:Daemon User:/dev/null:/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false +systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false +systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false +systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false +systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false +systemd-network:x:76:76:systemd Network Management:/:/bin/false +systemd-resolve:x:77:77:systemd Resolver:/:/bin/false +systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false +systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/bin/false</literal> +EOF</userinput></screen> + + <para>The actual password for <systemitem class="username">root</systemitem> + will be set later.</para> + + <para>Create the <filename>/etc/group</filename> file by running the following + command:</para> + +<screen revision="sysv"><userinput>cat > /etc/group << "EOF" +<literal>root:x:0: +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +input:x:24: +mail:x:34: +kvm:x:61: +wheel:x:97: +nogroup:x:99: +users:x:999:</literal> +EOF</userinput></screen> + +<screen revision="systemd"><userinput>cat > /etc/group << "EOF" +<literal>root:x:0: +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +systemd-journal:x:23: +input:x:24: +mail:x:34: +kvm:x:61: +systemd-bus-proxy:x:72: +systemd-journal-gateway:x:73: +systemd-journal-remote:x:74: +systemd-journal-upload:x:75: +systemd-network:x:76: +systemd-resolve:x:77: +systemd-timesync:x:78: +systemd-coredump:x:79: +wheel:x:97: +nogroup:x:99: +users:x:999:</literal> +EOF</userinput></screen> + + <para>The created groups are not part of any standard—they are groups + decided on in part by the requirements of the Udev configuration in Chapter + 9, and in part by common convention employed by a number of existing Linux + distributions. In addition, some test suites rely on specific users or + groups. The Linux Standard Base (LSB, available at <ulink + url="http://refspecs.linuxfoundation.org/lsb.shtml"/>) only recommends that, + besides the group <systemitem class="groupname">root</systemitem> with a + Group ID (GID) of 0, a group <systemitem class="groupname">bin</systemitem> + with a GID of 1 be present. All other group names and GIDs can be chosen + freely by the system administrator since well-written programs do not depend + on GID numbers, but rather use the group's name.</para> + + <para>Some tests in <xref linkend="chapter-building-system"/> need a regular + user. We add this user here and delete this account at the end of that + chapter.</para> + +<screen><userinput>echo "tester:x:$(ls -n $(tty) | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd +echo "tester:x:101:" >> /etc/group +install -o tester -d /home/tester</userinput></screen> + + <para>To remove the <quote>I have no name!</quote> prompt, start a new + shell. Since the + <filename>/etc/passwd</filename> and <filename>/etc/group</filename> + files have been created, user name and group name resolution will now + work:</para> + +<screen role="nodump"><userinput>exec /bin/bash --login +h</userinput></screen> + + <para>Note the use of the <parameter>+h</parameter> directive. This tells + <command>bash</command> not to use its internal path hashing. Without this + directive, <command>bash</command> would remember the paths to binaries it has + executed. To ensure the use of the newly compiled binaries as soon as they are + installed, the <parameter>+h</parameter> directive will be used for the duration + of this and the next chapter.</para> + + <para>The <command>login</command>, <command>agetty</command>, and + <command>init</command> programs (and others) use a number of log + files to record information such as who was logged into the system and + when. However, these programs will not write to the log files if they + do not already exist. Initialize the log files and give them + proper permissions:</para> + +<screen><userinput>touch /var/log/{btmp,lastlog,faillog,wtmp} +chgrp -v utmp /var/log/lastlog +chmod -v 664 /var/log/lastlog +chmod -v 600 /var/log/btmp</userinput></screen> + + <para>The <filename>/var/log/wtmp</filename> file records all logins and + logouts. The <filename>/var/log/lastlog</filename> file records when each + user last logged in. The <filename>/var/log/faillog</filename> file records + failed login attempts. The <filename>/var/log/btmp</filename> file records + the bad login attempts.</para> + + <note><para>The <filename>/run/utmp</filename> file records the users that + are currently logged in. This file is created dynamically in the boot + scripts.</para></note> + +</sect1> diff --git a/chapter07/creatingdirs.xml b/chapter07/creatingdirs.xml new file mode 100644 index 000000000..91b43a3a0 --- /dev/null +++ b/chapter07/creatingdirs.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-creatingdirs"> + <?dbhtml filename="creatingdirs.html"?> + + <title>Creating Directories</title> + + <para>It is time to create the full structure in the LFS file system. Create + a standard directory tree by issuing the following commands:</para> + +<screen><userinput>mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt} +mkdir -pv /{media/{floppy,cdrom},srv,var} +mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} +mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man} +mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo} +mkdir -pv /usr/{,local/}share/man/man{1..8} +install -dv -m 1777 /tmp /var/tmp +install -dv -m 0750 /root + +mkdir -v /var/{log,mail,spool} +ln -sv /run /var/run +ln -sv /run/lock /var/lock +mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local}</userinput></screen> + + <para>Directories are, by default, created with permission mode 755, but + this is not desirable for all directories. In the commands above, two + changes are made—one to the home directory of user <systemitem + class="username">root</systemitem>, and another to the directories for + temporary files.</para> + + <para>The first mode change ensures that not just anybody can enter + the <filename class="directory">/root</filename> directory—the + same as a normal user would do with his or her home directory. The + second mode change makes sure that any user can write to the + <filename class="directory">/tmp</filename> and <filename + class="directory">/var/tmp</filename> directories, but cannot remove + another user's files from them. The latter is prohibited by the so-called + <quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para> + + <sect2> + <title>FHS Compliance Note</title> + + <para>The directory tree is based on the Filesystem Hierarchy Standard + (FHS) (available at <ulink + url="https://refspecs.linuxfoundation.org/fhs.shtml"/>). The FHS also specifies + the optional existence of some directories such as <filename + class="directory">/usr/local/games</filename> and <filename + class="directory">/usr/share/games</filename>. We create only the + directories that are needed. However, feel free to create these + directories. </para> + + </sect2> + +</sect1> diff --git a/chapter07/dejagnu.xml b/chapter07/dejagnu.xml new file mode 100644 index 000000000..da6a44aa9 --- /dev/null +++ b/chapter07/dejagnu.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-dejagnu" role="wrap"> + <?dbhtml filename="dejagnu.html"?> + + <sect1info condition="script"> + <productname>dejagnu</productname> + <productnumber>&dejagnu-version;</productnumber> + <address>&dejagnu-url;</address> + </sect1info> + + <title>DejaGNU-&dejagnu-version;</title> + + <indexterm zone="ch-tools-dejagnu"> + <primary sortas="a-DejaGNU">DejaGNU</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The <application>DejaGnu</application> package contains a framework for running test + suites on GNU tools. It is written in <command>expect</command>, which itself + uses <application>Tcl</application> (Tool Command Language).</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&dejagnu-tmp-sbu;</seg> + <seg>&dejagnu-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of DejaGNU</title> + + <para>Prepare DejaGNU for compilation:</para> + +<screen><userinput remap="configure">./configure --prefix=/usr +makeinfo --html --no-split -o doc/dejagnu.html doc/dejagnu.texi +makeinfo --plaintext -o doc/dejagnu.txt doc/dejagnu.texi</userinput></screen> + + <para>Build and install the package:</para> + +<screen><userinput remap="install">make install +install -v -dm755 /usr/share/doc/dejagnu-&dejagnu-version; +install -v -m644 doc/dejagnu.{html,txt} /usr/share/doc/dejagnu-&dejagnu-version;</userinput></screen> + + <para>To test the results, issue:</para> + +<screen><userinput remap="test">make check</userinput></screen> + + </sect2> + + + <sect2 id="contents-dejagnu" role="content"> + <title>Contents of DejaGNU</title> + + <segmentedlist> + <segtitle>Installed program</segtitle> + + <seglistitem> + <seg>runtest</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="runtest"> + <term><command>runtest</command></term> + <listitem> + <para>A wrapper script that locates the proper + <command>expect</command> shell and then runs DejaGNU</para> + <indexterm zone="ch-tools-dejagnu runtest"> + <primary sortas="b-runtest">runtest</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter07/etcshells.xml b/chapter07/etcshells.xml deleted file mode 100644 index 30961c80c..000000000 --- a/chapter07/etcshells.xml +++ /dev/null @@ -1,49 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE part PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-shells" xreflabel="Creating the /etc/shells File"> - <?dbhtml filename="etcshells.html"?> - -<!-- - <sect1info> - <othername>$LastChangedBy$</othername> - <date>$Date$</date> - </sect1info> ---> - <title>Creating the /etc/shells File</title> - - <indexterm zone="ch-config-shells"> - <primary sortas="e-etc-shells">/etc/shells</primary> - </indexterm> - - <para>The <filename>shells</filename> 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 (/).</para> - - <para>For example, this file is consulted by <command>chsh</command> - 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.</para> - - <para>It is a requirement for applications such as - <application>GDM</application> which does not populate the - face browser if it can't find <filename>/etc/shells</filename>, or - FTP daemons which traditionally disallow access to users - with shells not included in this file.</para> - -<screen role="root"><userinput>cat > /etc/shells << "EOF" -<literal># Begin /etc/shells - -/bin/sh -/bin/bash - -# End /etc/shells</literal> -EOF</userinput></screen> - -</sect1> diff --git a/chapter07/expect.xml b/chapter07/expect.xml new file mode 100644 index 000000000..e73676857 --- /dev/null +++ b/chapter07/expect.xml @@ -0,0 +1,136 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-expect" role="wrap"> + <?dbhtml filename="expect.html"?> + + <sect1info condition="script"> + <productname>expect</productname> + <productnumber>&expect-version;</productnumber> + <address>&expect-url;</address> + </sect1info> + + <title>Expect-&expect-version;</title> + + <indexterm zone="ch-tools-expect"> + <primary sortas="a-Expect">Expect</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The <application>Expect</application> package contains tools for + automating, via scripted dialogues, interactive applications such as + <command>telnet</command>, <command>ftp</command>, + <command>passwd</command>, <command>fsck</command>, + <command>rlogin</command>, and <command>tip</command>. + <application>Expect</application> is also useful for testing these same + applications as well as easing all sorts of tasks that are prohibitively + difficult with anything else. The <application>DejaGnu</application> + framework is written in <application>Expect</application>.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&expect-tmp-sbu;</seg> + <seg>&expect-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Expect</title> + + <para>Prepare Expect for compilation:</para> + +<screen><userinput remap="configure">./configure --prefix=/usr \ + --with-tcl=/usr/lib \ + --enable-shared \ + --mandir=/usr/share/man \ + --with-tclinclude=/usr/include</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--with-tcl=/usr/lib</parameter></term> + <listitem> + <para>This parameter is needed to tell + <command>configure</command> where the + <command>tclConfig.sh</command> script is located.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--with-tclinclude=/usr/include</parameter></term> + <listitem> + <para>This explicitly tells Expect where to find Tcl's internal + headers.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Build the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput remap="install">make install +ln -svf expect&expect-version;/libexpect&expect-version;.so /usr/lib</userinput></screen> + + </sect2> + + <sect2 id="contents-expect" role="content"> + <title>Contents of Expect</title> + + <segmentedlist> + <segtitle>Installed program</segtitle> + <segtitle>Installed library</segtitle> + + <seglistitem> + <seg>expect</seg> + <seg>libexpect-&expect-lib-version;.so</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="expect"> + <term><command>expect</command></term> + <listitem> + <para>Communicates with other interactive programs according + to a script</para> + <indexterm zone="ch-tools-expect expect"> + <primary sortas="b-expect">expect</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libexpect"> + <term><filename class="libraryfile">libexpect-&expect-lib-version;.so</filename></term> + <listitem> + <para>Contains functions that allow Expect to be used as a Tcl + extension or to be used directly from C or C++ (without Tcl)</para> + <indexterm zone="ch-tools-expect libexpect"> + <primary sortas="c-libexpect-&expect-lib-version;">libexpect-&expect-lib-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter07/gettext.xml b/chapter07/gettext.xml new file mode 100644 index 000000000..12a8b5cfd --- /dev/null +++ b/chapter07/gettext.xml @@ -0,0 +1,84 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gettext" role="wrap"> + <?dbhtml filename="gettext.html"?> + + <sect1info condition="script"> + <productname>gettext</productname> + <productnumber>&gettext-version;</productnumber> + <address>&gettext-url;</address> + </sect1info> + + <title>Gettext-&gettext-version;</title> + + <indexterm zone="ch-tools-gettext"> + <primary sortas="a-Gettext">Gettext</primary> + <secondary>tools</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/gettext.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gettext-tmp-sbu;</seg> + <seg>&gettext-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gettext</title> + + <para>For our temporary set of tools, we only need to install + three programs from Gettext.</para> + + <para>Prepare Gettext for compilation:</para> + +<screen><userinput remap="configure">./configure --disable-shared</userinput></screen> + + <variablelist> + <title>The meaning of the configure option:</title> + + <varlistentry> + <term><parameter>--disable-shared</parameter></term> + <listitem> + <para>We do not need to install any of the shared Gettext libraries at + this time, therefore there is no need to build them.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the <command>msgfmt</command>, <command>msgmerge</command>, and + <command>xgettext</command> programs:</para> + +<screen><userinput remap="install">cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in <xref linkend="contents-gettext" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter07/inputrc.xml b/chapter07/inputrc.xml deleted file mode 100644 index 00d36877f..000000000 --- a/chapter07/inputrc.xml +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-inputrc"> - <?dbhtml filename="inputrc.html"?> - - <title>Creating the /etc/inputrc File</title> - - <indexterm zone="ch-config-inputrc"> - <primary sortas="e-/etc/inputrc">/etc/inputrc</primary> - </indexterm> - - <para>The <filename>inputrc</filename> 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.</para> - - <para>Most people do not need user-specific functionality so the command - below creates a global <filename>/etc/inputrc</filename> 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 <filename>.inputrc</filename> file in the user's home - directory with the modified mappings.</para> - - <para>For more information on how to edit the <filename>inputrc</filename> - file, see <command>info bash</command> under the <emphasis>Readline Init - File</emphasis> section. <command>info readline</command> is also a good - source of information.</para> - - <para>Below is a generic global <filename>inputrc</filename> 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:</para> - -<screen><userinput>cat > /etc/inputrc << "EOF" -<literal># 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</literal> -EOF</userinput></screen> - -</sect1> diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml index cbc197a7b..1d53f6987 100644 --- a/chapter07/introduction.xml +++ b/chapter07/introduction.xml @@ -5,221 +5,29 @@ %general-entities; ]> -<sect1 id="ch-config-introduction" revision="sysv"> +<sect1 id="ch-tools-introduction-chroot"> <?dbhtml filename="introduction.html"?> <title>Introduction</title> - <para>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.</para> + <para>This chapter shows how to build the last missing bits of the temporary + system: first, the tools needed by the build machinery of various packages, + then three packages needed to run tests. Now that all circular dependencies + have been resolved, we can use a <quote>chroot</quote> environment, + completely isolated the host operating system used for the build, except + for the running kernel.</para> + + <para>For proper operation of the isolated environment, some communication + with the running kernel must be established. This is done through the + so-called <emphasis>Virtual Kernel File Systems</emphasis>, which must be + mounted when entering the chroot environment. You may want to check + that they are mounted by issuing <command>findmnt</command>.</para> + + <para>Until <xref linkend="ch-tools-chroot"/>, the commands must be + run as <systemitem class="username">root</systemitem>, with the + <envar>LFS</envar> variable set. After entering chroot, all commands + are run as root, fortunately without access to the OS of the computer + you built LFS on. Be careful anyway, as it is easy to destroy the whole + LFS system with badly formed commands.</para> -<!-- <para>In the packages that were installed in Chapter 6, there were two - different boot systems installed. LFS provides the ability to easily - select which system the user wants to use and to compare and contrast the - two systems by actually running each system on the local computer. The - advantages and disadvantages of these systems is presented below.</para>--> - - <sect2 id='sysv-desc'> - <title>System V</title> - - <para>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, <command>init</command>, that sets up basic programs such as - <command>login</command> (via getty) and runs a script. This script, - usually named <command>rc</command>, controls the execution of a set of - additional scripts that perform the tasks required to initialize the - system.</para> - - <para>The <command>init</command> program is controlled by the - <filename>/etc/inittab</filename> file and is organized into run levels that - can be run by the user:</para> - -<literallayout> -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 -</literallayout> - - <para>The usual default run level is 3 or 5.</para> - - <bridgehead renderas="sect3">Advantages</bridgehead> - - <itemizedlist> - <listitem> - <para>Established, well understood system.</para> - </listitem> - - <listitem> - <para>Easy to customize.</para> - </listitem> - - </itemizedlist> - - - <bridgehead renderas="sect3">Disadvantages</bridgehead> - - <itemizedlist> - <listitem> - <para>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.</para> - </listitem> - - <listitem> - <para>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.</para> - </listitem> - - <listitem> - <para>Does not directly support advanced features like - control groups (cgroups), and per-user fair share scheduling.</para> - </listitem> - - <listitem> - <para>Adding scripts requires manual, static sequencing decisions.</para> - </listitem> - - </itemizedlist> - - </sect2> -<!-- - <sect2 id='sysd-desc'> - <title>Systemd</title> - - <para>Systemd is a group of interconnected programs that handles system and - individual process requests. It provides a dependency system between - various entities called "units". It automatically addresses dependencies - between units and can execute several startup tasks in parallel. It - provides login, inetd, logging, time, and networking services. </para> - - <bridgehead renderas="sect3">Advantages</bridgehead> - - <itemizedlist> - <listitem> - <para>Used on many established distributions by default.</para> - </listitem> - - <listitem> - <para>There is extensive documentation. - See <ulink url="http://www.freedesktop.org/wiki/Software/systemd/"/>.</para> - </listitem> - - <listitem> - <para>Parallel execution of boot processes. A medium speed - base LFS system takes 6-10 seconds from kernel start to a - login prompt. Network connectivity is typically established - about 2 seconds after the login prompt. More complex startup - procedures may show a greater speedup when compared to System V.</para> - </listitem> - - <listitem> - <para>Implements advanced features such as control groups to - manage related processes.</para> - </listitem> - - <listitem> - <para>Maintains backward compatibility with System V programs - and scripts.</para> - </listitem> - </itemizedlist> - - <bridgehead renderas="sect3">Disadvantages</bridgehead> - - <itemizedlist> - <listitem> - <para>There is a substantial learning curve.</para> - </listitem> - - <listitem> - <para>Some advanced features such as dbus or cgroups cannot be - disabled if they are not otherwise needed.</para> - </listitem> - - <listitem> - <para>Although implemented as several executable programs - the user cannot choose to implement only the portions desired.</para> - </listitem> - - <listitem> - <para>Due to the nature of using compiled programs, systemd is - more difficult to debug.</para> - </listitem> - - <listitem> - <para>Logging is done in a binary format. Extra tools must - be used to process logs or additional processes must be implemented - to duplicate traditional logging programs.</para> - </listitem> - - </itemizedlist> - - </sect2> ---> -<!-- - <sect2 id='sysv'> - <title>Selecting a Boot Method</title> - - <para>Selecting a boot method in LFS is relatively easy. - Both systems are installed side-by-side. The only task needed is to - ensure the files that are needed by the system have the correct names. - The following scripts do that.</para> - -<screen><userinput remap="install">cat > /usr/sbin/set-systemd << "EOF" -#! /bin/bash - -ln -svfn init-systemd /sbin/init -ln -svfn init.d-systemd /etc/init.d - -for tool in halt poweroff reboot runlevel shutdown telinit; do - ln -sfvn ${tool}-systemd /sbin/${tool} - ln -svfn ${tool}-systemd.8 /usr/share/man/man8/${tool}.8 -done - -echo "Now reboot with /sbin/reboot-sysv" -EOF - -chmod 0744 /usr/sbin/set-systemd - -cat > /usr/sbin/set-sysv << "EOF" -#! /bin/bash - -ln -sfvn init-sysv /sbin/init -ln -svfn init.d-sysv /etc/init.d - -for tool in halt poweroff reboot runlevel shutdown telinit; do - ln -sfvn ${tool}-sysv /sbin/${tool} - ln -svfn ${tool}-sysv.8 /usr/share/man/man8/${tool}.8 -done - -echo "Now reboot with /sbin/reboot-systemd" -EOF - -chmod 0744 /usr/sbin/set-sysv</userinput></screen> - - <note><para>The comment about the correct command to reboot in the - above scripts is correct. The reboot command for the current boot - system must be used after the script changes the default reboot command. - </para></note> - - <para>Now set the desired boot system. The default is System V:</para> - -<screen><userinput remap="install">/usr/sbin/set-sysv</userinput></screen> - - <para>Changing the boot system can be done at any time by running the - appropriate script above and rebooting.</para> - - </sect2> ---> </sect1> diff --git a/chapter07/introductiond.xml b/chapter07/introductiond.xml deleted file mode 100644 index fa2403edb..000000000 --- a/chapter07/introductiond.xml +++ /dev/null @@ -1,73 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-introduction" revision="systemd"> - <?dbhtml filename="introduction.html"?> - - <title>Introduction</title> - - <para>This chapter discusses configuration files and systemd services. - First, the general configuration files needed to set up networking are - presented.</para> - - <itemizedlist> - <listitem> - <para><xref linkend="ch-config-network" role="."/></para> - </listitem> - <listitem> - <para><xref linkend="ch-config-hostname" role="."/></para> - </listitem> - <listitem> - <para><xref linkend="ch-config-hosts" role="."/></para> - </listitem> - </itemizedlist> - - <para>Second, issues that affect the proper setup of devices are - discussed.</para> - - <itemizedlist> - <listitem> - <para><xref linkend="ch-config-udev" role="."/></para> - </listitem> - <listitem> - <para><xref linkend="ch-config-symlinks" role="."/></para> - </listitem> - </itemizedlist> - - <para>Third, configuring the system clock and keyboard layout.</para> - - <itemizedlist> - <listitem> - <para><xref linkend="ch-config-clock" role="."/></para> - </listitem> - <listitem> - <para><xref linkend="ch-config-console" role="."/></para> - </listitem> - </itemizedlist> - - - <para>Fourth, a brief introduction to the scripts and configuration - files used when the user logs into the system.</para> - - <itemizedlist> - <listitem> - <para><xref linkend="ch-config-locale" role="."/></para> - </listitem> - <listitem> - <para><xref linkend="ch-config-inputrc" role="."/></para> - </listitem> - </itemizedlist> - - <para>And finally, configuring the systemd behavior.</para> - - <itemizedlist> - <listitem> - <para><xref linkend="ch-config-systemd-custom" role="."/></para> - </listitem> - </itemizedlist> - -</sect1> diff --git a/chapter07/kernfs.xml b/chapter07/kernfs.xml new file mode 100644 index 000000000..6173e63a1 --- /dev/null +++ b/chapter07/kernfs.xml @@ -0,0 +1,116 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-kernfs"> + <?dbhtml filename="kernfs.html"?> + + <title>Preparing Virtual Kernel File Systems</title> + + <indexterm zone="ch-tools-kernfs"> + <primary sortas="e-/dev/">/dev/*</primary> + </indexterm> + + <para>Various file systems exported by the kernel are used to communicate to + and from the kernel itself. These file systems are virtual in that no disk + space is used for them. The content of the file systems resides in + memory.</para> + + <para>Begin by creating directories onto which the file systems will be + mounted:</para> + +<screen><userinput>mkdir -pv $LFS/{dev,proc,sys,run}</userinput></screen> + + <sect2> + <title>Creating Initial Device Nodes</title> + + <para>When the kernel boots the system, it requires the presence of a few + device nodes, in particular the <filename + class="devicefile">console</filename> and <filename + class="devicefile">null</filename> devices. The device nodes must be + created on the hard disk so that they are available before the kernel + populates <systemitem class="filesystem">/dev</systemitem>), and + additionally when Linux is started with + <parameter>init=/bin/bash</parameter>. Create the devices by running the + following commands:</para> + +<screen><userinput>mknod -m 600 $LFS/dev/console c 5 1 +mknod -m 666 $LFS/dev/null c 1 3</userinput></screen> + + </sect2> + + <sect2 id="ch-system-bindmount"> + <title>Mounting and Populating /dev</title> + + <para>The recommended method of populating the <filename + class="directory">/dev</filename> directory with devices is to mount a + virtual filesystem (such as <systemitem + class="filesystem">tmpfs</systemitem>) on the <filename + class="directory">/dev</filename> directory, and allow the devices to be + created dynamically on that virtual filesystem as they are detected or + accessed. Device creation is generally done during the boot process + by Udev. Since this new system does not yet have Udev and has not yet + been booted, it is necessary to mount and populate <filename + class="directory">/dev</filename> manually. This is accomplished by bind + mounting the host system's <filename class="directory">/dev</filename> + directory. A bind mount is a special type of mount that allows you to + create a mirror of a directory or mount point to some other location. Use + the following command to achieve this:</para> + +<screen><userinput>mount -v --bind /dev $LFS/dev</userinput></screen> + + </sect2> + + <sect2 id="ch-system-kernfsmount"> + <title>Mounting Virtual Kernel File Systems</title> + + <para>Now mount the remaining virtual kernel filesystems:</para> + +<screen><userinput>mount -v --bind /dev/pts $LFS/dev/pts +mount -vt proc proc $LFS/proc +mount -vt sysfs sysfs $LFS/sys +mount -vt tmpfs tmpfs $LFS/run</userinput></screen> +<!-- + <variablelist> + <title>The meaning of the mount options for devpts:</title> + + <varlistentry> + <term><parameter>gid=5</parameter></term> + <listitem> + <para>This ensures that all devpts-created device nodes are owned by + group ID 5. This is the ID we will use later on for the <systemitem + class="groupname">tty</systemitem> group. We use the group ID instead + of a name, since the host system might use a different ID for its + <systemitem class="groupname">tty</systemitem> group.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>mode=0620</parameter></term> + <listitem> + <para>This ensures that all devpts-created device nodes have mode 0620 + (user readable and writable, group writable). Together with the + option above, this ensures that devpts will create device nodes that + meet the requirements of grantpt(), meaning the Glibc + <command>pt_chown</command> helper binary (which is not installed by + default) is not necessary.</para> + </listitem> + </varlistentry> + + </variablelist> +--> + <para>In some host systems, <filename>/dev/shm</filename> is a + symbolic link to <filename class="directory">/run/shm</filename>. + The /run tmpfs was mounted above so in this case only a + directory needs to be created.</para> + +<screen><userinput>if [ -h $LFS/dev/shm ]; then + mkdir -pv $LFS/$(readlink $LFS/dev/shm) +fi</userinput></screen> + + </sect2> + +</sect1> diff --git a/chapter07/libstdc++-pass2.xml b/chapter07/libstdc++-pass2.xml new file mode 100644 index 000000000..015d8d8ea --- /dev/null +++ b/chapter07/libstdc++-pass2.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-libstdcpp-pass2" role="wrap"> + <?dbhtml filename="gcc-libstdc++-pass2.html"?> + + <sect1info condition="script"> + <productname>gcc-libstdc++</productname> + <productnumber>&gcc-version;</productnumber> + <address>&gcc-url;</address> + </sect1info> + + <title>Libstdc++ from GCC-&gcc-version;, Pass 2</title> + + <indexterm zone="ch-tools-libstdcpp-pass2"> + <primary sortas="a-GCC">GCC</primary> + <secondary>tools, libstdc++ pass 2</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>When building <xref linkend="ch-tools-gcc-pass2"/> we had to defer + the installation of the C++ standard library because no suitable compiler + was available to compile it. We could not use the compiler built in that + section because it is a native compiler and should not be used outside of + chroot and risks polluting the libraries with some host components.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&libstdcpp-tmpp2-sbu;</seg> + <seg>&libstdcpp-tmpp2-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Target Libstdc++</title> + + <note> + <para><application>Libstdc++</application> is part of the GCC sources. + You should first unpack the GCC tarball and change to the + <filename>gcc-&gcc-version;</filename> directory.</para> + </note> + + <para>Create a link which exists when building libstdc++ in the gcc tree:</para> + +<screen><userinput remap="pre">ln -s gthr-posix.h libgcc/gthr-default.h</userinput></screen> + + <para>Create a separate build directory for libstdc++ and enter it:</para> + +<screen><userinput remap="pre">mkdir -v build +cd build</userinput></screen> + + <para>Prepare libstdc++ for compilation:</para> + +<screen><userinput remap="configure">../libstdc++-v3/configure \ + CXXFLAGS="-g -O2 -D_GNU_SOURCE" \ + --prefix=/usr \ + --disable-multilib \ + --disable-nls \ + --disable-libstdcxx-pch</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>CXXFLAGS="-g -O2 -D_GNU_SOURCE"</parameter></term> + <listitem> + <para>These flags are passed by the top level Makefile when doing + a full build of GCC.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-libstdcxx-pch</parameter></term> + <listitem> + <para>This switch prevents the installation of precompiled + include files, which are not needed at this stage.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile libstdc++ by running:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the library:</para> + +<screen><userinput remap="install">make install</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter07/locale.xml b/chapter07/locale.xml deleted file mode 100644 index 5f473ac72..000000000 --- a/chapter07/locale.xml +++ /dev/null @@ -1,152 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-locale" revision="systemd"> - <?dbhtml filename="locale.html"?> - - <title>Configuring the System Locale</title> - - <indexterm zone="ch-config-locale"> - <primary sortas="e-etc-locale-conf">/etc/locale.conf</primary> - </indexterm> - - <para>The <filename>/etc/locale.conf</filename> below sets some - environment variables necessary for native language support. Setting - them properly results in:</para> - - <itemizedlist> - <listitem> - <para>The output of programs translated into the native language</para> - </listitem> - <listitem> - <para>Correct classification of characters into letters, digits and other - classes. This is necessary for <command>bash</command> to properly accept - non-ASCII characters in command lines in non-English locales</para> - </listitem> - <listitem> - <para>The correct alphabetical sorting order for the country</para> - </listitem> - <listitem> - <para>Appropriate default paper size</para> - </listitem> - <listitem> - <para>Correct formatting of monetary, time, and date values</para> - </listitem> - </itemizedlist> - - <para>Replace <replaceable><ll></replaceable> below with the two-letter code - for the desired language (e.g., <quote>en</quote>) and - <replaceable><CC></replaceable> with the two-letter code for the appropriate - country (e.g., <quote>GB</quote>). <replaceable><charmap></replaceable> should - be replaced with the canonical charmap for your chosen locale. Optional - modifiers such as <quote>@euro</quote> may also be present.</para> - - <para>The list of all locales supported by Glibc can be obtained by running - the following command:</para> - -<screen role="nodump"><userinput>locale -a</userinput></screen> - - <para>Charmaps can have a number of aliases, e.g., <quote>ISO-8859-1</quote> - is also referred to as <quote>iso8859-1</quote> and <quote>iso88591</quote>. - Some applications cannot handle the various synonyms correctly (e.g., require - that <quote>UTF-8</quote> is written as <quote>UTF-8</quote>, not - <quote>utf8</quote>), 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 <replaceable><locale - name></replaceable> is the output given by <command>locale -a</command> for - your preferred locale (<quote>en_GB.iso88591</quote> in our example).</para> - -<screen role="nodump"><userinput>LC_ALL=<replaceable><locale name></replaceable> locale charmap</userinput></screen> - - <para>For the <quote>en_GB.iso88591</quote> locale, the above command - will print:</para> - -<screen><computeroutput>ISO-8859-1</computeroutput></screen> - - <para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>. - It is important that the locale found using the heuristic above is tested prior - to it being added to the Bash startup files:</para> - -<screen role="nodump"><userinput>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</userinput></screen> - - <para>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.</para> - -<screen><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></screen> - - <para>If this happens, you should either install the desired locale using the - <command>localedef</command> command, or consider choosing a different locale. - Further instructions assume that there are no such error messages from - Glibc.</para> - - <!-- FIXME: the xlib example will became obsolete real soon --> - <para>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:</para> - -<screen><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></screen> - - <para>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 <command>locale charmap</command> 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.</para> - - <para>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.</para> - - <para>Once the proper locale settings have been determined, create the - <filename>/etc/locale.conf</filename> file:</para> - -<screen><userinput>cat > /etc/locale.conf << "EOF" -<literal>LANG=<replaceable><ll>_<CC>.<charmap><@modifiers></replaceable></literal> -EOF</userinput></screen> - - <para>Note that you can modify <filename>/etc/locale.conf</filename> with the - systemd <command>localectl</command> utility. To use - <command>localectl</command> for the example above, run:</para> - -<screen role="nodump"><userinput>localectl set-locale LANG="<replaceable><ll>_<CC>.<charmap><@modifiers></replaceable>"</userinput></screen> - - <para>You can also specify other language specific environment variables such - as <envar>LANG</envar>, <envar>LC_CTYPE</envar>, <envar>LC_NUMERIC</envar> or - any other environment variable from <command>locale</command> output. Just - separate them with a space. An example where <envar>LANG</envar> is set as - en_US.UTF-8 but <envar>LC_CTYPE</envar> is set as just en_US is:</para> - -<screen role="nodump"><userinput>localectl set-locale LANG="en_US.UTF-8" LC_CTYPE="en_US"</userinput></screen> - - <note><para>Please note that the <command>localectl</command> command can - be used only on a system booted with systemd.</para></note> - - <para>The <quote>C</quote> (default) and <quote>en_US</quote> (the recommended - one for United States English users) locales are different. <quote>C</quote> - 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 <command>ls</command> 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 <quote>unknown - 8-bit</quote>). So you can use the <quote>C</quote> locale only if you are sure that - you will never need 8-bit characters.</para> - - <para>UTF-8 based locales are not supported well by many programs. - Work is in progress to document and, if possible, fix such problems, see - <ulink url="&blfs-book;introduction/locale-issues.html"/>.</para> - -</sect1> diff --git a/chapter07/network.xml b/chapter07/network.xml deleted file mode 100644 index b527258ee..000000000 --- a/chapter07/network.xml +++ /dev/null @@ -1,247 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-network" revision="sysv"> - <?dbhtml filename="network.html"?> - - <title>General Network Configuration</title> - - <indexterm zone="ch-config-network"> - <primary sortas="d-network">network</primary> - <secondary>configuring</secondary></indexterm> -<!-- - <para>This section only applies if a network card is to be - configured.</para> - - <para>If a network card will not be used, there is likely no need to create - any configuration files relating to network cards. If that is the case, you - will need to remove the <filename class="symlink">network</filename> symlinks - from all run-level directories (<filename - class="directory">/etc/rc.d/rc*.d</filename>) after the bootscripts are - installed in <xref linkend="ch-config-bootscripts"/>.</para> ---> - <sect2> - <title>Creating Network Interface Configuration Files</title> - - <para>Which interfaces are brought up and down by the network script - usually depends on the files in <filename - class="directory">/etc/sysconfig/</filename>. This directory should - contain a file for each interface to be configured, such as - <filename>ifconfig.xyz</filename>, where <quote>xyz</quote> 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 <emphasis>ifconfig</emphasis>.</para> - - <note><para>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 <command>ip link</command> or <command>ls - /sys/class/net</command> after you have booted your system. - </para></note> - - <para>The following command creates a sample file for the - <emphasis>eth0</emphasis> device with a static IP address:</para> -<!-- jhalfs relies on the values for IFACE, IP, etc. If you want to change - them, please inform the jhalfs maintainer(s). --> -<screen><userinput>cd /etc/sysconfig/ -cat > ifconfig.<replaceable>eth0</replaceable> << "EOF" -<literal>ONBOOT=<replaceable>yes</replaceable> -IFACE=<replaceable>eth0</replaceable> -SERVICE=<replaceable>ipv4-static</replaceable> -IP=<replaceable>192.168.1.2</replaceable> -GATEWAY=<replaceable>192.168.1.1</replaceable> -PREFIX=<replaceable>24</replaceable> -BROADCAST=<replaceable>192.168.1.255</replaceable></literal> -EOF</userinput></screen> - - <para>The values in italics must be changed in every file to match - the proper setup.</para> - - <para>If the <envar>ONBOOT</envar> variable is set to <quote>yes</quote> the - System V network script will bring up the Network Interface Card (NIC) during - booting of the system. If set to anything but <quote>yes</quote> 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 - <command>ifup</command> and <command>ifdown</command> commands.</para> - - <para>The <envar>IFACE</envar> variable defines the interface name, - for example, eth0. It is required for all network device configuration - files. The filename extension must match this value.</para> - - <para>The <envar>SERVICE</envar> 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 <filename - class="directory">/lib/services/</filename> directory allows other IP - assignment methods. This is commonly used for Dynamic Host Configuration - Protocol (DHCP), which is addressed in the BLFS book.</para> - - <para>The <envar>GATEWAY</envar> variable should contain the default - gateway IP address, if one is present. If not, then comment out the - variable entirely.</para> - - <para>The <envar>PREFIX</envar> 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 - <envar>PREFIX</envar> variable according to your specific subnet. - If omitted, the PREFIX defaults to 24.</para> - - <para>For more information see the <command>ifup</command> man page.</para> - - </sect2> - <sect2 id="resolv.conf"> - <title>Creating the /etc/resolv.conf File</title> - - <indexterm zone="resolv.conf"> - <primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary> - </indexterm> - - <para>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 - <filename>/etc/resolv.conf</filename>. Create the file by running the - following:</para> - -<screen><userinput>cat > /etc/resolv.conf << "EOF" -<literal># Begin /etc/resolv.conf - -domain <replaceable><Your Domain Name></replaceable> -nameserver <replaceable><IP address of your primary nameserver></replaceable> -nameserver <replaceable><IP address of your secondary nameserver></replaceable> - -# End /etc/resolv.conf</literal> -EOF</userinput></screen> - - <para>The <varname>domain</varname> statement can be omitted - or replaced with a <varname>search</varname> statement. See the man page for - resolv.conf for more details.</para> - - <para>Replace <replaceable><IP address of the nameserver></replaceable> - 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 <emphasis>nameserver</emphasis> line from the file. The IP address - may also be a router on the local network.</para> - - <note> - <para>The Google Public IPv4 DNS addresses are 8.8.8.8 and 8.8.4.4.</para> - </note> - - </sect2> - - <sect2 id="ch-config-hostname"> - <title>Configuring the system hostname</title> - - <indexterm zone="ch-config-hostname"> - <primary sortas="d-hostname">hostname</primary> - <secondary>configuring</secondary> - </indexterm> - - <para>During the boot process, the file <filename>/etc/hostname</filename> - is used for establishing the system's hostname.</para> - - <para>Create the <filename>/etc/hostname</filename> file and enter a - hostname by running:</para> - -<screen><userinput>echo "<replaceable><lfs></replaceable>" > /etc/hostname</userinput></screen> - - <para><replaceable><lfs></replaceable> 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 - <filename>/etc/hosts</filename> file.</para> - - </sect2> - - <sect2 id="ch-config-hosts"> - <title>Customizing the /etc/hosts File</title> - - <indexterm zone="ch-config-hosts"> - <primary sortas="e-/etc/hosts">/etc/hosts</primary> - </indexterm> - - <indexterm zone="ch-config-hosts"> - <primary sortas="d-localnet">localnet</primary> - <secondary>/etc/hosts</secondary> - </indexterm> - - <indexterm zone="ch-config-hosts"> - <primary sortas="d-network">network</primary> - <secondary>/etc/hosts</secondary> - </indexterm> - - <para>Decide on the IP address, fully-qualified domain name (FQDN), and - possible aliases for use in the <filename>/etc/hosts</filename> file. The - syntax is:</para> - -<screen><literal>IP_address myhost.example.org aliases</literal></screen> - - <para>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:</para> - -<screen><literal>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</literal></screen> - - <para>x can be any number in the range 16-31. y can be any number in the - range 0-255.</para> - - <para>A valid private IP address could be 192.168.1.1. A valid FQDN for - this IP could be lfs.example.org.</para> - - <para>Even if not using a network card, a valid FQDN is still required. - This is necessary for certain programs to operate correctly.</para> - - <para>Create the <filename>/etc/hosts</filename> file by running:</para> - -<screen><userinput>cat > /etc/hosts << "EOF" -<literal># Begin /etc/hosts - -127.0.0.1 localhost.localdomain localhost -127.0.1.1 <replaceable><FQDN></replaceable> <replaceable><HOSTNAME></replaceable> -<replaceable><192.168.1.1></replaceable> <replaceable><FQDN></replaceable> <replaceable><HOSTNAME></replaceable> <replaceable>[alias1] [alias2 ...]</replaceable> -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters - -# End /etc/hosts</literal> -EOF</userinput></screen> - - <para>The <replaceable><192.168.1.1></replaceable>, - <replaceable><FQDN></replaceable>, and - <replaceable><HOSTNAME></replaceable> 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.</para> - -<!-- This is not very useful - - <para>If a network card is not going to be configured, create the - <filename>/etc/hosts</filename> file by running:</para> - -<screen role="nodump"><userinput>cat > /etc/hosts << "EOF" -<literal># Begin /etc/hosts (no network card version) - -127.0.0.1 localhost -127.0.1.1 <replaceable><FQDN></replaceable> <replaceable><HOSTNAME></replaceable> -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters - -# End /etc/hosts (no network card version)</literal> -EOF</userinput></screen> --> - - </sect2> - -</sect1> diff --git a/chapter07/networkd.xml b/chapter07/networkd.xml deleted file mode 100644 index 688c315aa..000000000 --- a/chapter07/networkd.xml +++ /dev/null @@ -1,335 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-network" revision="systemd"> - <?dbhtml filename="network.html"?> - - <title>General Network Configuration</title> - - <indexterm zone="ch-config-network"> - <primary sortas="d-network">network</primary> - <secondary>configuring</secondary></indexterm> - - <para>This section only applies if a network card is to be - configured.</para> - - <sect2> - <title>Network Interface Configuration Files</title> - - <para>Starting with version 209, systemd ships a network configuration - daemon called <command>systemd-networkd</command> which can be used for - basic network configuration. Additionally, since version 213, DNS name - resolution can be handled by <command>systemd-resolved</command> in place - of a static <filename>/etc/resolv.conf</filename> file. Both services are - enabled by default.</para> - - <para>Configuration files for <command>systemd-networkd</command> (and - <command>systemd-resolved</command>) can be placed in - <filename class="directory">/usr/lib/systemd/network</filename> - or <filename class="directory">/etc/systemd/network</filename>. Files in - <filename class="directory">/etc/systemd/network</filename> have a - higher priority than the ones in - <filename class="directory">/usr/lib/systemd/network</filename>. - There are three types of configuration files: - <filename class="extension">.link</filename>, - <filename class="extension">.netdev</filename> and - <filename class="extension">.network</filename> files. For detailed - descriptions and example contents of these configuration files, consult - the <filename>systemd-link(5)</filename>, - <filename>systemd-netdev(5)</filename> and - <filename>systemd-network(5)</filename> manual pages.</para> - - <sect3 id="systemd-network-devices"> - <title>Network Device Naming</title> - - <para> - 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 - <command>ip link</command> after you have booted your system. - </para> - - <para> - 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. - </para> - - <para> - If you prefer to use the classic or customized network interface names, - there are three alternative ways to do that:</para> - - <itemizedlist> - <listitem> - <para> - Mask udev's .link file for the default policy: -<screen role="nodump"><userinput>ln -s /dev/null /etc/systemd/network/99-default.link</userinput></screen> - </para> - </listitem> - - <listitem> - <para> - 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: - </para> - -<screen role="nodump"><userinput>cat > /etc/systemd/network/10-ether0.link << "EOF" -<literal>[Match] -# Change the MAC address as appropriate for your network device -MACAddress=12:34:45:78:90:AB - -[Link] -Name=ether0</literal> -EOF</userinput></screen> - - <para> - See the man page systemd.link(5) for more information. - </para> - </listitem> - - <listitem> - <para> - In /boot/grub/grub.cfg, pass the option net.ifnames=0 on the - kernel command line. - </para> - </listitem> - </itemizedlist> - </sect3> - - <sect3 id="systemd-networkd-static"> - <title>Static IP Configuration</title> - - <para>The command below creates a basic configuration file for a - Static IP setup (using both systemd-networkd and - systemd-resolved):</para> -<!-- jhalfs relies on the values for Name, Address, etc. If you want to change - them, please inform the jhalfs maintainer(s). --> -<screen><userinput>cat > /etc/systemd/network/10-eth-static.network << "EOF" -<literal>[Match] -Name=<replaceable><network-device-name></replaceable> - -[Network] -Address=192.168.0.2/24 -Gateway=192.168.0.1 -DNS=192.168.0.1 -Domains=<replaceable><Your Domain Name></replaceable></literal> -EOF</userinput></screen> - - <para>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 <filename>/etc/resolv.conf</filename> file.</para> - - </sect3> - - <sect3 id="systemd-networkd-dhcp"> - <title>DHCP Configuration</title> - - <para>The command below creates a basic configuration file for an IPv4 - DHCP setup:</para> - -<screen role="nodump"><userinput>cat > /etc/systemd/network/10-eth-dhcp.network << "EOF" -<literal>[Match] -Name=<network-device-name> - -[Network] -DHCP=ipv4 - -[DHCP] -UseDomains=true</literal> -EOF</userinput></screen> - - </sect3> - - </sect2> - - <sect2 id="resolv.conf"> - <title>Creating the /etc/resolv.conf File</title> - - <indexterm zone="resolv.conf"> - <primary sortas="e-/etc/resolv.conf">/etc/resolv.conf</primary> - </indexterm> - - <para>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 - <filename>/etc/resolv.conf</filename>.</para> - - <sect3 id="resolv-conf-systemd-resolved"> - <title>systemd-resolved Configuration</title> - - <note><para>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 <filename>/etc/resolv.conf</filename> (ex: resolvconf), the - <command>systemd-resolved</command> service should not be - used.</para></note> - - <para>When using <command>systemd-resolved</command> for DNS - configuration, it creates the file - <filename>/run/systemd/resolve/resolv.conf</filename>. Create a - symlink in <filename>/etc</filename> to use the generated file:</para> - -<screen><userinput>ln -sfv /run/systemd/resolve/resolv.conf /etc/resolv.conf</userinput></screen> - - </sect3> - - <sect3 id="resolv-conf-static"> - <title>Static resolv.conf Configuration</title> - - <para>If a static <filename>/etc/resolv.conf</filename> is desired, - create it by running the following command:</para> - -<screen role="nodump"><userinput>cat > /etc/resolv.conf << "EOF" -<literal># Begin /etc/resolv.conf - -domain <replaceable><Your Domain Name></replaceable> -nameserver <replaceable><IP address of your primary nameserver></replaceable> -nameserver <replaceable><IP address of your secondary nameserver></replaceable> - -# End /etc/resolv.conf</literal> -EOF</userinput></screen> - - <para>The <varname>domain</varname> statement can be omitted - or replaced with a <varname>search</varname> statement. See the man page - for resolv.conf for more details.</para> - - <para>Replace - <replaceable><IP address of the nameserver></replaceable> - 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 <emphasis>nameserver</emphasis> line from the file. The IP address - may also be a router on the local network.</para> - - <note><para>The Google Public IPv4 DNS addresses are - <parameter>8.8.8.8</parameter> and <parameter>8.8.4.4</parameter> - for IPv4, and <parameter>2001:4860:4860::8888</parameter> and - <parameter>2001:4860:4860::8844</parameter> for IPv6.</para></note> - - </sect3> - - </sect2> - - <sect2 id="ch-config-hostname"> - <title>Configuring the system hostname</title> - - <indexterm zone="ch-config-hostname"> - <primary sortas="d-hostname">hostname</primary> - <secondary>configuring</secondary> - </indexterm> - - <para>During the boot process, the file <filename>/etc/hostname</filename> - is used for establishing the system's hostname.</para> - - <para>Create the <filename>/etc/hostname</filename> file and enter a - hostname by running:</para> - -<screen><userinput>echo "<replaceable><lfs></replaceable>" > /etc/hostname</userinput></screen> - - <para><replaceable><lfs></replaceable> 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 - <filename>/etc/hosts</filename> file.</para> - - </sect2> - - <sect2 id="ch-config-hosts"> - <title>Customizing the /etc/hosts File</title> - - <indexterm zone="ch-config-hosts"> - <primary sortas="e-/etc/hosts">/etc/hosts</primary> - </indexterm> - - <indexterm zone="ch-config-hosts"> - <primary sortas="d-localnet">localnet</primary> - <secondary>/etc/hosts</secondary> - </indexterm> - - <indexterm zone="ch-config-hosts"> - <primary sortas="d-network">network</primary> - <secondary>/etc/hosts</secondary> - </indexterm> - - <para>Decide on a fully-qualified domain name (FQDN), and possible aliases - for use in the <filename>/etc/hosts</filename> file. If using static - addresses, you'll also need to decide on an IP address. The syntax - for a hosts file entry is:</para> - -<screen><literal>IP_address myhost.example.org aliases</literal></screen> - - <para>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:</para> - -<screen><literal>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</literal></screen> - - <para>x can be any number in the range 16-31. y can be any number in the - range 0-255.</para> - - <para>A valid private IP address could be 192.168.1.1. A valid FQDN for - this IP could be lfs.example.org.</para> - - <para>Even if not using a network card, a valid FQDN is still required. - This is necessary for certain programs to operate correctly.</para> - - <para>If using DHCP, DHCPv6, IPv6 Autoconfiguration, or if a network card - is not going to be configured, create the <filename>/etc/hosts</filename> - file by running the following command:</para> - -<screen role="nodump"><userinput>cat > /etc/hosts << "EOF" -<literal># Begin /etc/hosts - -127.0.0.1 localhost.localdomain localhost -127.0.1.1 <replaceable><FQDN></replaceable> <replaceable><HOSTNAME></replaceable> -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters - -# End /etc/hosts</literal> -EOF</userinput></screen> - - <para>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.</para> - - <para>If using a static address, create the <filename>/etc/hosts</filename> - file by running this command instead:</para> - -<screen><userinput>cat > /etc/hosts << "EOF" -<literal># Begin /etc/hosts - -127.0.0.1 localhost -127.0.1.1 <replaceable><FQDN></replaceable> <replaceable><HOSTNAME></replaceable> -<replaceable><192.168.0.2></replaceable> <replaceable><FQDN></replaceable> <replaceable><HOSTNAME></replaceable> <replaceable>[alias1] [alias2] ...</replaceable> -::1 localhost ip6-localhost ip6-loopback -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters - -# End /etc/hosts</literal> -EOF</userinput></screen> - - <para>The <replaceable><192.168.0.2></replaceable>, - <replaceable><FQDN></replaceable>, and - <replaceable><HOSTNAME></replaceable> 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.</para> - - </sect2> - -</sect1> diff --git a/chapter07/perl.xml b/chapter07/perl.xml new file mode 100644 index 000000000..d282fb4ba --- /dev/null +++ b/chapter07/perl.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-perl" role="wrap"> + <?dbhtml filename="perl.html"?> + + <sect1info condition="script"> + <productname>perl</productname> + <productnumber>&perl-version;</productnumber> + <address>&perl-url;</address> + </sect1info> + + <title>Perl-&perl-version;</title> + + <indexterm zone="ch-tools-perl"> + <primary sortas="a-Perl">Perl</primary> + <secondary>tools</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/perl.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&perl-tmp-sbu;</seg> + <seg>&perl-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Perl</title> + + <para>Prepare Perl for compilation:</para> + +<screen><userinput remap="configure">sh Configure -des -Dprefix=/usr</userinput></screen> + + <variablelist> + <title>The meaning of the new Configure options:</title> + <varlistentry> + <term><parameter>-des</parameter></term> + <listitem> + <para>This is a combination of three options: -d uses defaults for + all items; -e ensures completion of all tasks; -s silences + non-essential output.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Build and install the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + +<screen><userinput remap="install">make install</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in <xref linkend="contents-perl" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter07/profile.xml b/chapter07/profile.xml deleted file mode 100644 index 226dd9fac..000000000 --- a/chapter07/profile.xml +++ /dev/null @@ -1,162 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-profile" revision="sysv"> - <?dbhtml filename="profile.html"?> - - <title>The Bash Shell Startup Files</title> - - <indexterm zone="ch-config-profile"> - <primary sortas="e-/etc/profile">/etc/profile</primary> - </indexterm> - - <para>The shell program <command>/bin/bash</command> (hereafter referred to - as <quote>the shell</quote>) 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 <filename - class="directory">/etc</filename> directory provide global settings. If an - equivalent file exists in the home directory, it may override the global - settings.</para> - - <para>An interactive login shell is started after a successful login, using - <command>/bin/login</command>, by reading the <filename>/etc/passwd</filename> - file. An interactive non-login shell is started at the command-line (e.g., - <prompt>[prompt]$</prompt><command>/bin/bash</command>). 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.</para> - - <para>For more information, see <command>info bash</command> under the - <emphasis>Bash Startup Files and Interactive Shells</emphasis> section.</para> - - <para>The files <filename>/etc/profile</filename> and - <filename>~/.bash_profile</filename> are read when the shell is - invoked as an interactive login shell.</para> - - <para>The base <filename>/etc/profile</filename> below sets some - environment variables necessary for native language support. Setting - them properly results in:</para> - - <itemizedlist> - <listitem> - <para>The output of programs translated into the native language</para> - </listitem> - <listitem> - <para>Correct classification of characters into letters, digits and other - classes. This is necessary for <command>bash</command> to properly accept - non-ASCII characters in command lines in non-English locales</para> - </listitem> - <listitem> - <para>The correct alphabetical sorting order for the country</para> - </listitem> - <listitem> - <para>Appropriate default paper size</para> - </listitem> - <listitem> - <para>Correct formatting of monetary, time, and date values</para> - </listitem> - </itemizedlist> - - <para>Replace <replaceable><ll></replaceable> below with the two-letter code - for the desired language (e.g., <quote>en</quote>) and - <replaceable><CC></replaceable> with the two-letter code for the appropriate - country (e.g., <quote>GB</quote>). <replaceable><charmap></replaceable> should - be replaced with the canonical charmap for your chosen locale. Optional - modifiers such as <quote>@euro</quote> may also be present.</para> - - <para>The list of all locales supported by Glibc can be obtained by running - the following command:</para> - -<screen role="nodump"><userinput>locale -a</userinput></screen> - - <para>Charmaps can have a number of aliases, e.g., <quote>ISO-8859-1</quote> - is also referred to as <quote>iso8859-1</quote> and <quote>iso88591</quote>. - Some applications cannot handle the various synonyms correctly (e.g., require - that <quote>UTF-8</quote> is written as <quote>UTF-8</quote>, not - <quote>utf8</quote>), 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 <replaceable><locale - name></replaceable> is the output given by <command>locale -a</command> for - your preferred locale (<quote>en_GB.iso88591</quote> in our example).</para> - -<screen role="nodump"><userinput>LC_ALL=<replaceable><locale name></replaceable> locale charmap</userinput></screen> - - <para>For the <quote>en_GB.iso88591</quote> locale, the above command - will print:</para> - -<screen><computeroutput>ISO-8859-1</computeroutput></screen> - - <para>This results in a final locale setting of <quote>en_GB.ISO-8859-1</quote>. - It is important that the locale found using the heuristic above is tested prior - to it being added to the Bash startup files:</para> - -<screen role="nodump"><userinput>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</userinput></screen> - - <para>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.</para> - -<screen><computeroutput>locale: Cannot set LC_* to default locale: No such file or directory</computeroutput></screen> - - <para>If this happens, you should either install the desired locale using the - <command>localedef</command> command, or consider choosing a different locale. - Further instructions assume that there are no such error messages from - Glibc.</para> - - <!-- FIXME: the xlib example will became obsolete real soon --> - <para>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:</para> - -<screen><computeroutput>Warning: locale not supported by Xlib, locale set to C</computeroutput></screen> - - <para>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 <command>locale charmap</command> 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.</para> - - <para>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.</para> - - <para>Once the proper locale settings have been determined, create the - <filename>/etc/profile</filename> file:</para> - -<screen><userinput>cat > /etc/profile << "EOF" -<literal># Begin /etc/profile - -export LANG=<replaceable><ll>_<CC>.<charmap><@modifiers></replaceable> - -# End /etc/profile</literal> -EOF</userinput></screen> - - <para>The <quote>C</quote> (default) and <quote>en_US</quote> (the recommended - one for United States English users) locales are different. <quote>C</quote> - 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 <command>ls</command> 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 <quote>unknown - 8-bit</quote>). So you can use the <quote>C</quote> locale only if you are sure that - you will never need 8-bit characters.</para> - - <para>UTF-8 based locales are not supported well by some programs. - Work is in progress to document and, if possible, fix such problems, see - <ulink url="&blfs-book;introduction/locale-issues.html"/>.</para> - -</sect1> diff --git a/chapter07/python.xml b/chapter07/python.xml new file mode 100644 index 000000000..9354bb99e --- /dev/null +++ b/chapter07/python.xml @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-Python-temp" role="wrap"> + <?dbhtml filename="Python-temp.html"?> + + <sect1info condition="script"> + <productname>Python</productname> + <productnumber>&python-version;</productnumber> + <address>&python-url;</address> + </sect1info> + + <title>Python-&python-version;</title> + + <indexterm zone="ch-system-Python-temp"> + <primary sortas="a-Python">Python</primary> + <secondary>temporary</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/python.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&python-tmp-sbu;</seg> + <seg>&python-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Python</title> + + <note> + <para>There are two package files whose name starts with + <quote>python</quote>. The one to extract from is + <filename>Python-&python-version;.tar.xz</filename> (notice the + uppercase first letter).</para> + </note> + + <para>Prepare Python for compilation:</para> + +<screen><userinput remap="configure">./configure --prefix=/usr --without-ensurepip</userinput></screen> + + <variablelist> + <title>The meaning of the configure option:</title> + + <varlistentry> + <term><parameter>--without-ensurepip</parameter></term> + <listitem> + <para>This switch disables the Python package installer, which is not + needed at this stage.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput remap="install">make install</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in <xref linkend="contents-python" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter07/stripping.xml b/chapter07/stripping.xml new file mode 100644 index 000000000..a31faadc3 --- /dev/null +++ b/chapter07/stripping.xml @@ -0,0 +1,188 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-stripping"> + <?dbhtml filename="stripping.html"?> + + <title>Finishing Temporary Tools</title> + + <para> + The steps in this section are optional. Skip this section entirely + if you are not really short on disk space and do not want to create + a backup of the temporary tools. + </para> + + <para> + The following steps are performed from outside the chroot + environment. That means, you have to leave the chroot environment + first before continuing. The reason for that is to: + <itemizedlist> + <listitem> + <para> + make sure that objects are not in use while they are + manipulated. + </para> + </listitem> + <listitem> + <para> + get access to file system locations outside of the chroot + environment to store/read the backup archive which should + not be placed within the + <filename class="directory">$LFS</filename> hierarchy for + safety reasons. + </para> + </listitem> + </itemizedlist> + </para> + + <para> + Leave the chroot environment and unmount the kernel virtual file + systems: + </para> + + <note> + <para>All of the following instructions are executed by + <systemitem class="username">root</systemitem>. Take extra + care about the commands you're going to run as mistakes + here can modify your host system. Be aware that the + environment variable <envar>LFS</envar> is set for user + <systemitem class="username">lfs</systemitem> by default + but it might <emphasis>not</emphasis> be set for + <systemitem class="username">root</systemitem>. Whenever + commands are to be executed by <systemitem class="username">root</systemitem>, + make sure you have set <envar>LFS</envar> accordingly. + This has been discussed in <xref linkend='ch-partitioning-aboutlfs'/>. + </para> + </note> + +<screen role="nodump"><userinput>exit +umount $LFS/dev{/pts,} +umount $LFS/{sys,proc,run}</userinput></screen> + + <sect2> + <title>Stripping</title> + + <para>If the LFS partition is rather small, it is good to + know that unnecessary items can be removed. The executables and + libraries built so far contain a little over 90 MB of unneeded debugging + symbols.</para> + + <para>Strip off debugging symbols from binaries:</para> +<screen role="nodump"><userinput>strip --strip-debug $LFS/usr/lib/* +strip --strip-unneeded $LFS/usr/{,s}bin/* +strip --strip-unneeded $LFS/tools/bin/*</userinput></screen> + + <para>These commands will skip a number of files reporting that it does not + recognize their file format. Most of these are scripts instead of binaries. + <!--Note that we use the <command>strip</command> program built in + <quote>Binutils pass 2</quote>, since it is the one that knows how to strip + our cross-compiled programs.--></para> + + <para>Take care <emphasis>NOT</emphasis> to use + <parameter>--strip-unneeded</parameter> on the libraries. The static + ones would be destroyed and the toolchain packages would need to be + built all over again.</para> + + <para>To save more space (slightly more than 35 MB), remove the documentation:</para> + +<screen role="nodump"><userinput>rm -rf $LFS/usr/share/{info,man,doc}</userinput></screen> + + <para>The libtool .la files are only useful when linking with static + libraries. They are unneeded, and potentially harmful, when using dynamic + shared libraries, specially when using non-autotools build systems. + Remove those files now:</para> + +<screen role="nodump"><userinput>find $LFS/usr/{lib,libexec} -name \*.la -delete</userinput></screen> + + <para>At this point, you should have at least 5 GB of free space on the + chroot partition that can be used to build and install Glibc and GCC in + the next phase. If you can build and install Glibc, you can build and install + the rest too. You can check the free disk space with the command + <command>df -h $LFS</command>.</para> + + </sect2> + + <sect2> + <title>Backup</title> + + <para> + Now that the essential tools have been created, its time to think about + a backup. When every check has passed successfully in the previously + built packages, your temporary tools are in a good state and might be + backed up for later reuse. In case of fatal failures in the subsequent + chapters, it often turns out that removing everything and starting over + (more carefully) is the best option to recover. Unfortunatly, all the + temporary tools will be removed, too. To avoid spending extra time to + redo something which has been built successfully, prepare a backup. + </para> + + <para> + Make sure you have at least 600 MB free disk space (the source tarballs + will be included in the backup archive) in the home directory of user + <systemitem class="username">root</systemitem>. + </para> + + <para> + Create the backup archive by running the following command: + </para> + +<screen role="nodump" revision="sysv"><userinput>cd $LFS && +tar -cJpf $HOME/lfs-temp-tools-&version;.tar.xz .</userinput></screen> + +<screen role="nodump" revision="systemd"><userinput>cd $LFS && +tar -cJpf $HOME/lfs-temp-tools-&versiond;.tar.xz .</userinput></screen> + + <para> + Replace <envar>$HOME</envar> by a directory of your choice if you + do not want to have the backup stored in <systemitem + class="username">root</systemitem>'s home directory. + </para> + </sect2> + + <sect2> + <title>Restore</title> + + <para> + 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 recovery time. + Since the sources are located under + <filename class="directory">$LFS</filename>, they are included in the + backup archive as well, so they do not need to be downloaded again. After + checking that <filename class="directory">$LFS</filename> is set properly, + restore the backup by executing the following commands: + </para> + +<!-- Make the following look different so users don't blindly run the + restore when they don't need to. --> + +<screen role="nodump" revision="sysv"><computeroutput>cd $LFS && +rm -rf ./* && +tar -xpf $HOME/lfs-temp-tools-&version;.tar.xz</computeroutput></screen> + +<screen role="nodump" revision="systemd"><computeroutput>cd $LFS && +rm -rf ./* && +tar -xpf $HOME/lfs-temp-tools-&versiond;.tar.xz</computeroutput></screen> + + <para> + Again, double check that the environment has been setup properly + and continue building the rest of the system. + </para> + + <important> + <para> + If you left the chroot environment either to strip off debug + symbols, create a backup or restart building using a restore, + remember to mount the kernel virtual filesystems now again as + described in <xref linkend='ch-tools-kernfs'/> and re-enter + the chroot environment (see <xref linkend='ch-tools-chroot'/>) + again before continuing. + </para> + </important> + + </sect2> + +</sect1> diff --git a/chapter07/symlinks.xml b/chapter07/symlinks.xml deleted file mode 100644 index 951e6976d..000000000 --- a/chapter07/symlinks.xml +++ /dev/null @@ -1,256 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-symlinks"> - <?dbhtml filename="symlinks.html"?> - - <title>Managing Devices</title> - - <sect2 revision="sysv"> - - <title>Network Devices</title> - - <para>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.</para> - - <para>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.</para> - - <sect3> - <title>Disabling Persistent Naming on the Kernel Command Line</title> - - <para>The traditional naming scheme using eth0, eth1, etc can be - restored by adding <userinput>net.ifnames=0</userinput> 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 <xref linkend="grub-cfg"/>.</para> - </sect3> - - <sect3> - <title>Creating Custom Udev Rules</title> - - <para>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:</para> - -<screen role="install"><userinput>bash /lib/udev/init-net-rules.sh</userinput></screen> - - <para> Now, inspect the - <filename>/etc/udev/rules.d/70-persistent-net.rules</filename> file, to - find out which name was assigned to which network device:</para> - -<screen role="nodump"><userinput>cat /etc/udev/rules.d/70-persistent-net.rules</userinput></screen> - - <note><para>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.</para></note> - - <para>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.</para> - - <para>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:</para> - - <itemizedlist> - <listitem> - <para><literal>SUBSYSTEM=="net"</literal> - This tells Udev to ignore - devices that are not network cards.</para> - </listitem> - <listitem> - <para><literal>ACTION=="add"</literal> - 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).</para> - </listitem> - <listitem> - <para><literal>DRIVERS=="?*"</literal> - 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.</para> - </listitem> - <listitem> - <para><literal>ATTR{address}</literal> - The value of this key is the - NIC's MAC address.</para> - </listitem> - <listitem> - <para><literal>ATTR{type}=="1"</literal> - 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.</para> - </listitem> - <listitem> - <para><literal>NAME</literal> - The value of this key is the name that - Udev will assign to this interface.</para> - </listitem> - </itemizedlist> - - <para>The value of <literal>NAME</literal> 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 <literal>NAME</literal> value when - creating your configuration files below.</para> - - </sect3> - - </sect2> - - <sect2 revision="sysv"> - - <title>CD-ROM symlinks</title> - - <para>Some software that you may want to install later (e.g., various - media players) expect the <filename class="symlink">/dev/cdrom</filename> - and <filename class="symlink">/dev/dvd</filename> 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 <filename>/etc/fstab</filename>. 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.</para> - - <para>First, the script can operate in <quote>by-path</quote> 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 - <quote>by-id</quote> 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 <command>path_id</command> - script, and the identification strings are read from the hardware by its - <command>ata_id</command> or <command>scsi_id</command> programs, depending - on which type of device you have.</para> - - <para>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 - <quote>by-id</quote> 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 - <quote>by-path</quote> mode.</para> - - <para>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.</para> - -<!-- If you use by-id mode, the symlinks will survive even the transition - to libata for IDE drives, but that is not for the book. --> - - <important><para>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.</para></important> - - <para>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 - <filename class="directory">/sys</filename> (e.g., this can be - <filename class="directory">/sys/block/hdd</filename>) and - run a command similar to the following:</para> - -<screen role="nodump"><userinput>udevadm test /sys/block/hdd</userinput></screen> - - <para>Look at the lines containing the output of various *_id programs. - The <quote>by-id</quote> 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 <quote>by-path</quote> mode will use the ID_PATH value.</para> - - <para>If the default mode is not suitable for your situation, then the - following modification can be made to the - <filename>/etc/udev/rules.d/83-cdrom-symlinks.rules</filename> file, - as follows (where <replaceable>mode</replaceable> is one of - <quote>by-id</quote> or <quote>by-path</quote>):</para> - -<screen role="nodump"><userinput>sed -i -e 's/"write_cd_rules"/"write_cd_rules <replaceable>mode</replaceable>"/' \ - /etc/udev/rules.d/83-cdrom-symlinks.rules</userinput></screen> - - <para>Note that it is not necessary to create the rules files or symlinks - at this time, because you have bind-mounted the host's - <filename class="directory">/dev</filename> 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.</para> - - <para>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 <filename>/etc/udev/rules.d/70-persistent-cd.rules</filename> - file after booting, to make sure the assigned symlinks match what you need.</para> - - </sect2> - - <sect2> - - <title>Dealing with duplicate devices</title> - - <para>As explained in <xref linkend="ch-config-udev"/>, the order in - which devices with the same function appear in - <filename class="directory">/dev</filename> is essentially random. - E.g., if you have a USB web camera and a TV tuner, sometimes - <filename>/dev/video0</filename> refers to the camera and - <filename>/dev/video1</filename> 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 - <xref linkend="ch-config-network"/>, and sound card configuration can - be found in <ulink url="&blfs-book;postlfs/devices.html">BLFS</ulink>.</para> - - <para>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 - <filename class="directory">/sys/class</filename> or - <filename class="directory">/sys/block</filename>. - For video devices, this may be - <filename - class="directory">/sys/class/video4linux/video<replaceable>X</replaceable></filename>. - Figure out the attributes that identify the device uniquely (usually, - vendor and product IDs and/or serial numbers work):</para> - -<screen role="nodump"><userinput>udevadm info -a -p /sys/class/video4linux/video0</userinput></screen> - - <para>Then write rules that create the symlinks, e.g.:</para> - -<screen role="nodump"><userinput>cat > /etc/udev/rules.d/83-duplicate_devs.rules << "EOF" -<literal> -# 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" -</literal> -EOF</userinput></screen> - - <para>The result is that <filename>/dev/video0</filename> and - <filename>/dev/video1</filename> devices still refer randomly to the tuner - and the web camera (and thus should never be used directly), but there are - symlinks <filename>/dev/tvtuner</filename> and - <filename>/dev/webcam</filename> that always point to the correct - device.</para> - - </sect2> - -</sect1> diff --git a/chapter07/systemd-custom.xml b/chapter07/systemd-custom.xml deleted file mode 100644 index 787fd4572..000000000 --- a/chapter07/systemd-custom.xml +++ /dev/null @@ -1,313 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-systemd-custom" revision="systemd"> - <?dbhtml filename="systemd-custom.html"?> - - <title>Systemd Usage and Configuration</title> - - <indexterm zone="ch-config-systemd-custom"> - <primary sortas="e-Systemd">Systemd Customization</primary> - </indexterm> - - <sect2> - <title>Basic Configuration</title> - - <para>The <filename>/etc/systemd/system.conf</filename> 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 <filename>systemd-system.conf(5)</filename> manual page for details - on each configuration option.</para> - - </sect2> - - <sect2> - <title>Disabling Screen Clearing at Boot Time</title> - - <para>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:</para> - -<screen role="nodump"><userinput>mkdir -pv /etc/systemd/system/getty@tty1.service.d - -cat > /etc/systemd/system/getty@tty1.service.d/noclear.conf << EOF -<literal>[Service] -TTYVTDisallocate=no</literal> -EOF</userinput></screen> - - <para>The boot messages can always be reviewed by using the - <userinput>journalctl -b</userinput> command as the root user.</para> - - </sect2> - - <sect2> - <title>Disabling tmpfs for /tmp</title> - - <para>By default, <filename class="directory">/tmp</filename> is created as - a tmpfs. If this is not desired, it can be overridden by the following:</para> - -<screen role="nodump"><userinput>ln -sfv /dev/null /etc/systemd/system/tmp.mount</userinput></screen> - - <para>Alternatively, if a a separate partition for - <filename class="directory">/tmp</filename> is desired, specify that - partition in an <filename>/etc/fstab</filename> entry.</para> - - <warning> - <para> - Do not create the symbolic link above if a separate partition is used - for <filename class="directory">/tmp</filename>. This will prevent the - root file system (/) from being remounted r/w and make the system - unusable when booted. - </para> - </warning> - - </sect2> - - <sect2> - <title>Configuring Automatic File Creation and Deletion</title> - - <para>There are several services that create or delete files or - directories:</para> - - <itemizedlist> - <listitem><para>systemd-tmpfiles-clean.service</para></listitem> - <listitem><para>systemd-tmpfiles-setup-dev.service</para></listitem> - <listitem><para>systemd-tmpfiles-setup.service</para></listitem> - </itemizedlist> - - <para>The system location for the configuration files is - <filename>/usr/lib/tmpfiles.d/*.conf</filename>. The local - configuration files are in - <filename class="directory">/etc/tmpfiles.d</filename>. Files in - <filename class="directory">/etc/tmpfiles.d</filename> override - files with the same name in - <filename class="directory">/usr/lib/tmpfiles.d</filename>. See - <filename>tmpfiles.d(5)</filename> manual page for file format - details.</para> - - <para> - Note that the syntax for the - <filename>/usr/lib/tmpfiles.d/*.conf</filename> files can be - confusing. For example, the default deletion of files in the /tmp directory - is located in <filename>/usr/lib/tmpfiles.d/tmp.conf</filename> with - the line: - -<screen role="nodump">q /tmp 1777 root root 10d</screen> - - 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. - </para> - - <para> - If the default parameters are not desired, then the file should - be copied to <filename class="directory">/etc/tmpfiles.d</filename> - and edited as desired. For example: - -<screen role="nodump"><userinput>mkdir -p /etc/tmpfiles.d -cp /usr/lib/tmpfiles.d/tmp.conf /etc/tmpfiles.d</userinput></screen> - </para> - - </sect2> - - <sect2> - <title>Overriding Default Services Behavior</title> - - <para>The parameter of a unit can be overriden by creating a directory - and a configuration file in <filename - class="directory">/etc/systemd/system</filename>. For example:</para> - -<screen role="nodump"><userinput>mkdir -pv /etc/systemd/system/foobar.service.d - -cat > /etc/systemd/system/foobar.service.d/foobar.conf << EOF -<literal>[Service] -Restart=always -RestartSec=30</literal> -EOF</userinput></screen> - - <para>See <filename>systemd.unit(5)</filename> manual page for more - information. After creating the configuration file, run - <userinput>systemctl daemon-reload</userinput> and <userinput>systemctl - restart foobar</userinput> to activate the changes to a service.</para> - - </sect2> - - <sect2> - <title>Debugging the Boot Sequence</title> - - <para>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 <command>systemctl</command> is used to - enable, disable, control state, and obtain status of unit files. Here - are some examples of frequently used commands:</para> - - <itemizedlist> - <listitem> - <para><command>systemctl list-units -t <replaceable><service></replaceable> [--all]</command>: - lists loaded unit files of type service.</para> - </listitem> - <listitem> - <para><command>systemctl list-units -t <replaceable><target></replaceable> [--all]</command>: - lists loaded unit files of type target.</para> - </listitem> - <listitem> - <para><command>systemctl show -p Wants <replaceable><multi-user.target></replaceable></command>: - shows all units that depend on the multi-user target. Targets are - special unit files that are anogalous to runlevels under - SysVinit.</para> - </listitem> - <listitem> - <para><command>systemctl status <replaceable><servicename.service></replaceable></command>: - 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).</para> - </listitem> - </itemizedlist> - - </sect2> - - <sect2> - <title>Working with the Systemd Journal</title> - - <para>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 <command>journalctl</command> is provided. - Here are some examples of frequently used commands:</para> - - <itemizedlist> - <listitem> - <para><command>journalctl -r</command>: shows all contents of the - journal in reverse chronological order.</para> - </listitem> - <listitem> - <para><command>journalctl -u <replaceable>UNIT</replaceable></command>: - shows the journal entries associated with the specified UNIT - file.</para> - </listitem> - <listitem> - <para><command>journalctl -b[=ID] -r</command>: shows the journal - entries since last successful boot (or for boot ID) in reverse - chronological order.</para> - </listitem> - <listitem> - <para><command>journalctl -f</command>: povides functionality similar - to tail -f (follow).</para> - </listitem> - </itemizedlist> - - </sect2> - - <sect2> - <title>Working with Core Dumps</title> - - <para>Core dumps are useful to debug crashed programs, especially - when a daemon process crashes. On systemd booted systems the core - dumping is handled by <command>systemd-coredump</command>. It will - log the core dump into the journal and store the core dump itself in - <filename class="directory">/var/lib/systemd/coredump</filename>. - To retrieve and process core dumps, <command>coredumpctl</command> - tool is provided. Here are some examples of frequently used commands: - </para> - - <itemizedlist> - <listitem> - <para><command>coredumpctl -r</command>: lists all core dumps in - reversed chronological order.</para> - </listitem> - <listitem> - <para><command>coredumpctl -1 info</command>: show the information - of the last core dump.</para> - </listitem> - <listitem> - <para><command>coredumpctl -1 debug</command>: load the last core - dump into <ulink url="&blfs-book;general/gdb.html">GDB</ulink>. - </para> - </listitem> - </itemizedlist> - - <para>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 - <filename class="directory">/etc/systemd/coredump.conf.d</filename>. - For example:</para> - -<screen role="nodump"><userinput>mkdir -pv /etc/systemd/coredump.conf.d - -cat > /etc/systemd/coredump.conf.d/maxuse.conf << EOF -<literal>[Coredump] -MaxUse=5G</literal> -EOF</userinput></screen> - - <para>See <filename>systemd-coredump(8)</filename>, - <filename>coredumpctl(1)</filename>, and - <filename>coredump.conf.d(5)</filename> manual pages for more - information.</para> - </sect2> - - <sect2> - <title>Long Running Processes</title> - - <para>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 - <function>daemon()</function> or <function>setsid()</function> 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., <command>screen</command> or - <command>tmux</command>) to remain active after ending your user session. - There are three ways to enable lingering processes to remain after a user - session is ended.</para> - - <itemizedlist> - <listitem> - <para> - <emphasis>Enable process lingering for only selected users</emphasis>: - Normal users have permission to enable process lingering - with the command <command>loginctl enable-linger</command> for their - own user. System administrators can use the same command with a - <parameter>user</parameter> argument to enable for a user. That user - can then use the <command>systemd-run</command> command to start - long running processes. For example: <command>systemd-run --scope - --user /usr/bin/screen</command>. 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 <command>nohup</command> and utilities that use - <function>deamon()</function>. - </para> - </listitem> - <listitem> - <para> - <emphasis>Enable system-wide process lingering</emphasis>: - You can set <parameter>KillUserProcesses=no</parameter> in - <filename>/etc/systemd/logind.conf</filename> 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. - </para> - </listitem> - <listitem> - <para> - <emphasis>Disable at build-time</emphasis>: You can enable - lingering by default while building systemd by adding the switch - <parameter>-Ddefault-kill-user-processes=false</parameter> to the - <command>meson</command> command for systemd. This completely - disables the ability of systemd to kill user processes at session - end. - </para> - </listitem> - </itemizedlist> - - </sect2> - -</sect1> diff --git a/chapter07/tcl.xml b/chapter07/tcl.xml new file mode 100644 index 000000000..39219b06b --- /dev/null +++ b/chapter07/tcl.xml @@ -0,0 +1,196 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; + <!ENTITY tdbc-ver "1.1.1"> + <!ENTITY itcl-ver "4.2.0"> +]> + +<sect1 id="ch-tools-tcl" role="wrap"> + <?dbhtml filename="tcl.html"?> + + <sect1info condition="script"> + <productname>tcl</productname> + <productnumber>&tcl-version;</productnumber> + <address>&tcl-url;</address> + </sect1info> + + <title>Tcl-&tcl-version;</title> + + <indexterm zone="ch-tools-tcl"> + <primary sortas="a-Tcl">Tcl</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The <application>Tcl</application> package contains the Tool Command Language, + a robust general-purpose scripting language. The <application>Expect</application> package + is written in the <application>Tcl</application> language.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&tcl-tmp-sbu;</seg> + <seg>&tcl-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Tcl</title> + + <para>This package and the next two (Expect and DejaGNU) are + installed to support running the test suites for GCC and binutils and other + packages. Installing three packages for testing purposes may seem + excessive, but it is very reassuring, if not essential, to know that the + most important tools are working properly. These packages are required + to run the test suites in <xref linkend="chapter-building-system"/>.</para> + + <para>Note that the Tcl package used here is a minimal version needed + to run the LFS tests. For the full package, see the + <ulink url='&blfs-book;general/tcl.html'>BLFS Tcl procedures</ulink>.</para> + + <para>Prepare Tcl for compilation:</para> + +<screen><userinput remap="configure">SRCDIR=$(pwd) +cd unix +./configure --prefix=/usr \ + --mandir=/usr/share/man \ + $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>$([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)</parameter></term> + <listitem> + <para>The construct <parameter>$(<shell command>)</parameter> + is replaced by the output of the shell command. Here this output is + empty if running on a 32 bit machine, and is + <parameter>--enable-64bit</parameter> if running on a 64 bit machine. + </para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Build the package:</para> + +<screen><userinput remap="make">make + +sed -e "s|$SRCDIR/unix|/usr/lib|" \ + -e "s|$SRCDIR|/usr/include|" \ + -i tclConfig.sh + +sed -e "s|$SRCDIR/unix/pkgs/tdbc&tdbc-ver;|/usr/lib/tdbc&tdbc-ver;|" \ + -e "s|$SRCDIR/pkgs/tdbc&tdbc-ver;/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/tdbc&tdbc-ver;/library|/usr/lib/tcl8.6|" \ + -e "s|$SRCDIR/pkgs/tdbc&tdbc-ver;|/usr/include|" \ + -i pkgs/tdbc&tdbc-ver;/tdbcConfig.sh + +sed -e "s|$SRCDIR/unix/pkgs/itcl&itcl-ver;|/usr/lib/itcl&itcl-ver;|" \ + -e "s|$SRCDIR/pkgs/itcl&itcl-ver;/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/itcl&itcl-ver;|/usr/include|" \ + -i pkgs/itcl&itcl-ver;/itclConfig.sh + +unset SRCDIR</userinput></screen> + + <para>The various <quote>sed</quote> instructions after the + <quote>make</quote> command removes references to the build directory from + the configuration files and replaces them with the install directory. + This is not mandatory for the remainder of LFS, but may be needed in case a + package built later uses Tcl.</para> + + <para>Install the package:</para> + +<screen><userinput remap="install">make install</userinput></screen> + + <para>Make the installed library writable so debugging symbols can + be removed later:</para> + +<screen><userinput remap="install">chmod -v u+w /usr/lib/libtcl&tcl-major-version;.so</userinput></screen> + + <para>Install Tcl's headers. The next package, Expect, requires them.</para> + +<screen><userinput remap="install">make install-private-headers</userinput></screen> + + <para>Now make a necessary symbolic link:</para> + +<screen><userinput remap="install">ln -sfv tclsh&tcl-major-version; /usr/bin/tclsh</userinput></screen> + + </sect2> + + <sect2 id="contents-tcl" role="content"> + <title>Contents of Tcl</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed library</segtitle> + + <seglistitem> + <seg> + tclsh (link to tclsh&tcl-major-version;) and + tclsh&tcl-major-version; + </seg> + <seg> + libtcl&tcl-major-version;.so and + libtclstub&tcl-major-version;.a + </seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="tclsh&tcl-major-version;"> + <term><command>tclsh&tcl-major-version;</command></term> + <listitem> + <para>The Tcl command shell</para> + <indexterm zone="ch-tools-tcl tclsh&tcl-major-version;"> + <primary sortas="b-tclsh&tcl-major-version;">tclsh&tcl-major-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tclsh"> + <term><command>tclsh</command></term> + <listitem> + <para>A link to tclsh&tcl-major-version;</para> + <indexterm zone="ch-tools-tcl tclsh"> + <primary sortas="b-tclsh">tclsh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libtcl&tcl-major-version;.so"> + <term><filename class="libraryfile">libtcl&tcl-major-version;.so</filename></term> + <listitem> + <para>The Tcl library</para> + <indexterm zone="ch-tools-tcl libtcl&tcl-major-version;.so"> + <primary sortas="c-libtcl&tcl-major-version;.so">libtcl&tcl-major-version;.so</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libtclstub&tcl-major-version;.a"> + <term><filename class="libraryfile">libtclstub&tcl-major-version;.a</filename></term> + <listitem> + <para>The Tcl Stub library</para> + <indexterm zone="ch-tools-tcl libtclstub&tcl-major-version;.a"> + <primary sortas="c-libtclstub&tcl-major-version;.a">libtclstub&tcl-major-version;.a</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter07/texinfo.xml b/chapter07/texinfo.xml new file mode 100644 index 000000000..3ce3d08b9 --- /dev/null +++ b/chapter07/texinfo.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-texinfo-temp" role="wrap"> + <?dbhtml filename="texinfo-temp.html"?> + + <sect1info condition="script"> + <productname>texinfo</productname> + <productnumber>&texinfo-version;</productnumber> + <address>&texinfo-url;</address> + </sect1info> + + <title>Texinfo-&texinfo-version;</title> + + <indexterm zone="ch-system-texinfo-temp"> + <primary sortas="a-Texinfo">Texinfo</primary> + <secondary>temporary</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/texinfo.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&texinfo-tmp-sbu;</seg> + <seg>&texinfo-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Texinfo</title> + + <para>Prepare Texinfo for compilation:</para> + +<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> + + <note> + <para>As part of the configure process, a test is made that indicates an + error for TestXS_la-TestXS.lo. This is not relevant for LFS and should be + ignored.</para> + </note> + + <para>Compile the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput remap="install">make install</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in <xref linkend="contents-texinfo" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter07/udev.xml b/chapter07/udev.xml deleted file mode 100644 index 6060849be..000000000 --- a/chapter07/udev.xml +++ /dev/null @@ -1,342 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-config-udev"> - <?dbhtml filename="udev.html"?> - - <title>Overview of Device and Module Handling</title> - - <indexterm zone="ch-config-udev"> - <primary sortas="a-Udev">Udev</primary> - <secondary>usage</secondary> - </indexterm> - - <para>In <xref linkend="chapter-building-system"/>, we installed the Udev - package when <phrase revision="sysv">eudev</phrase> - <phrase revision="systemd">systemd</phrase> was built. Before we go into the - details regarding how this works, a brief history of previous methods of - handling devices is in order.</para> - - <para>Linux systems in general traditionally used a static device creation - method, whereby a great many device nodes were created under <filename - class="directory">/dev</filename> (sometimes literally thousands of nodes), - regardless of whether the corresponding hardware devices actually existed. This - was typically done via a <command>MAKEDEV</command> script, which contains a - number of calls to the <command>mknod</command> program with the relevant - major and minor device numbers for every possible device that might exist in - the world.</para> - - <para>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 <systemitem - class="filesystem">devtmpfs</systemitem> 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.</para> - - <sect2> - <title>History</title> - - <para>In February 2000, a new filesystem called <systemitem - class="filesystem">devfs</systemitem> 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.</para> - - <para>The main problem with the approach adopted by <systemitem - class="filesystem">devfs</systemitem> 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 <systemitem - class="filesystem">devfs</systemitem> 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.</para> - - <para>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 - <systemitem class="filesystem">sysfs</systemitem> came to be. The job of - <systemitem class="filesystem">sysfs</systemitem> 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 <systemitem class="filesystem">devfs</systemitem> became - much more realistic.</para> - - </sect2> - - <sect2> - <title>Udev Implementation</title> - - <sect3> - <title>Sysfs</title> - - <para>The <systemitem class="filesystem">sysfs</systemitem> filesystem - was mentioned briefly above. One may wonder how <systemitem - class="filesystem">sysfs</systemitem> 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 - <systemitem class="filesystem">sysfs</systemitem> (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 <systemitem - class="filesystem">sysfs</systemitem> filesystem is mounted (on /sys), - data which the drivers register with <systemitem - class="filesystem">sysfs</systemitem> are available to userspace - processes and to udevd for processing (including modifications to device - nodes).</para> - - </sect3> - - <sect3> - <title>Device Node Creation</title> - - <para>Device files are created by the kernel by the <systemitem - class="filesystem">devtmpfs</systemitem> filesystem. Any driver that - wishes to register a device node will go through the <systemitem - class="filesystem">devtmpfs</systemitem> (via the driver core) to do it. - When a <systemitem class="filesystem">devtmpfs</systemitem> instance is - mounted on <filename class="directory">/dev</filename>, the device node - will initially be created with a fixed name, permissions, and - owner.</para> - - <para>A short time later, the kernel will send a uevent to <command> - udevd</command>. Based on the rules specified in the files within the - <filename class="directory">/etc/udev/rules.d</filename>, <filename - class="directory">/lib/udev/rules.d</filename>, and <filename - class="directory">/run/udev/rules.d</filename> directories, <command> - udevd</command> will create additional symlinks to the device node, or - change its permissions, owner, or group, or modify the internal - <command>udevd</command> database entry (name) for that object.</para> - - <para>The rules in these three directories are numbered and all three - directories are merged together. If <command>udevd</command> can't find a - rule for the device it is creating, it will leave the permissions and - ownership at whatever <systemitem - class="filesystem">devtmpfs</systemitem> used initially.</para> </sect3> - - <sect3 id="module-loading"> - <title>Module Loading</title> - - <para>Device drivers compiled as modules may have aliases built into them. - Aliases are visible in the output of the <command>modinfo</command> - program and are usually related to the bus-specific identifiers of devices - supported by a module. For example, the <emphasis>snd-fm801</emphasis> - driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801, - and has an alias of <quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>. - For most devices, the bus driver exports the alias of the driver that - would handle the device via <systemitem - class="filesystem">sysfs</systemitem>. E.g., the - <filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> file - might contain the string - <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>. - The default rules provided with Udev will cause <command>udevd</command> - to call out to <command>/sbin/modprobe</command> with the contents of the - <envar>MODALIAS</envar> uevent environment variable (which should be the - same as the contents of the <filename>modalias</filename> file in sysfs), - thus loading all modules whose aliases match this string after wildcard - expansion.</para> - - <para>In this example, this means that, in addition to - <emphasis>snd-fm801</emphasis>, the obsolete (and unwanted) - <emphasis>forte</emphasis> driver will be loaded if it is - available. See below for ways in which the loading of unwanted drivers can - be prevented.</para> - - <para>The kernel itself is also able to load modules for network - protocols, filesystems and NLS support on demand.</para> - - </sect3> - - <sect3> - <title>Handling Hotpluggable/Dynamic Devices</title> - - <para>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 - <command>udevd</command> as described above.</para> - - </sect3> - - </sect2> - - <sect2> - <title>Problems with Loading Modules and Creating Devices</title> - - <para>There are a few possible problems when it comes to automatically - creating device nodes.</para> - - <sect3> - <title>A kernel module is not loaded automatically</title> - - <para>Udev will only load a module if it has a bus-specific alias and the - bus driver properly exports the necessary aliases to <systemitem - class="filesystem">sysfs</systemitem>. 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.</para> - - <para>To determine if the device driver you require has the necessary - support for Udev, run <command>modinfo</command> with the module name as - the argument. Now try locating the device directory under - <filename class="directory">/sys/bus</filename> and check whether there is - a <filename>modalias</filename> file there.</para> - - <para>If the <filename>modalias</filename> file exists in <systemitem - class="filesystem">sysfs</systemitem>, 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.</para> - - <para>If there is no <filename>modalias</filename> file in the relevant - directory under <filename class="directory">/sys/bus</filename>, 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.</para> - - <para>Udev is not intended to load <quote>wrapper</quote> drivers such as - <emphasis>snd-pcm-oss</emphasis> and non-hardware drivers such as - <emphasis>loop</emphasis> at all.</para> - - </sect3> - - <sect3> - <title>A kernel module is not loaded automatically, and Udev is not - intended to load it</title> - - <para>If the <quote>wrapper</quote> module only enhances the - functionality provided by some other module (e.g., - <emphasis>snd-pcm-oss</emphasis> enhances the functionality of - <emphasis>snd-pcm</emphasis> by making the sound cards available to OSS - applications), configure <command>modprobe</command> to load the wrapper - after Udev loads the wrapped module. To do this, add a - <quote>softdep</quote> line to the corresponding - <filename>/etc/modprobe.d/<replaceable><filename></replaceable>.conf</filename> - file. For example:</para> - -<screen role="nodump"><literal>softdep snd-pcm post: snd-pcm-oss</literal></screen> - - <para>Note that the <quote>softdep</quote> command also allows - <literal>pre:</literal> dependencies, or a mixture of both - <literal>pre:</literal> and <literal>post:</literal>. See the - <filename>modprobe.d(5)</filename> manual page for more information - on <quote>softdep</quote> syntax and capabilities.</para> - - <para>If the module in question is not a wrapper and is useful by itself, - configure the <command>modules</command> bootscript to load this - module on system boot. To do this, add the module name to the - <filename>/etc/sysconfig/modules</filename> file on a separate line. - This works for wrapper modules too, but is suboptimal in that case.</para> - - </sect3> - - <sect3> - <title>Udev loads some unwanted module</title> - - <para>Either don't build the module, or blacklist it in a - <filename>/etc/modprobe.d/blacklist.conf</filename> file as done with the - <emphasis>forte</emphasis> module in the example below:</para> - -<screen role="nodump"><literal>blacklist forte</literal></screen> - - <para>Blacklisted modules can still be loaded manually with the - explicit <command>modprobe</command> command.</para> - - </sect3> - - <sect3> - <title>Udev creates a device incorrectly, or makes a wrong symlink</title> - - <para>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 - <command>udevadm info</command> command.</para> - - </sect3> - - <sect3> - <title>Udev rule works unreliably</title> - - <para>This may be another manifestation of the previous problem. If not, - and your rule uses <systemitem class="filesystem">sysfs</systemitem> - 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 - <systemitem class="filesystem">sysfs</systemitem> attribute and appending - it to the <filename>/etc/udev/rules.d/10-wait_for_sysfs.rules</filename> - file (create this file if it does not exist). Please notify the LFS - Development list if you do so and it helps.</para> - - </sect3> - - <sect3> - <title>Udev does not create a device</title> - - <para>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.</para> - - <para>Udev has no information needed to create a device node if a kernel - driver does not export its data to - <systemitem class="filesystem">sysfs</systemitem>. This is most common - with third party drivers from outside the kernel tree. Create a static - device node in <filename>/lib/udev/devices</filename> with the - appropriate major/minor numbers (see the file - <filename>devices.txt</filename> inside the kernel documentation or the - documentation provided by the third party driver vendor). The static - device node will be copied to <filename class="directory">/dev</filename> - by <command>udev</command>.</para> - - </sect3> - - <sect3> - <title>Device naming order changes randomly after rebooting</title> - - <para>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 <quote>fixed</quote>. 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 <xref linkend="ch-config-symlinks"/> and - <xref linkend="ch-config-network"/> for examples.</para> - - </sect3> - - </sect2> - - <sect2> - <title>Useful Reading</title> - - <para>Additional helpful documentation is available at the following - sites:</para> - - <itemizedlist> - - <listitem> - <para>A Userspace Implementation of <systemitem class="filesystem">devfs</systemitem> - <ulink url="http://www.kroah.com/linux/talks/ols_2003_udev_paper/Reprint-Kroah-Hartman-OLS2003.pdf"/></para> - </listitem> - - <listitem> - <para>The <systemitem class="filesystem">sysfs</systemitem> Filesystem - <ulink url="http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf"/></para> - </listitem> - -<!-- No longer available - <listitem> - <para>Pointers to further reading - <ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html"/> - </para> - </listitem> ---> - </itemizedlist> - - </sect2> - -</sect1> diff --git a/chapter07/usage.xml b/chapter07/usage.xml deleted file mode 100644 index 4a4cf6c36..000000000 --- a/chapter07/usage.xml +++ /dev/null @@ -1,710 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - <!ENTITY site SYSTEM "../appendices/rc.site.script"> - %general-entities; -]> - -<sect1 id="ch-config-usage" revision="sysv"> - <?dbhtml filename="usage.html"?> - - <title>System V Bootscript Usage and Configuration</title> - - <indexterm zone="ch-config-usage"> - <primary sortas="a-Bootscripts">Bootscripts</primary> - <secondary>usage</secondary> - </indexterm> - - <sect2> - <title>How Do the System V Bootscripts Work?</title> - - <para>Linux uses a special booting facility named SysVinit that is based on a - concept of <emphasis>run-levels</emphasis>. 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.</para> - - <para>SysVinit (which will be referred to as <quote>init</quote> 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 <filename>init(8)</filename> 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:</para> - -<literallayout>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 <command>xdm</command> or KDE's <command>kdm</command>) -6: reboot the computer</literallayout> - - </sect2> - - <sect2 id="conf-sysvinit" role="configuration"> - <title>Configuring Sysvinit</title> - - <indexterm zone="conf-sysvinit"> - <primary sortas="a-Sysvinit">Sysvinit</primary> - <secondary>configuring</secondary> - </indexterm> - - <indexterm zone="conf-sysvinit"> - <primary sortas="e-/etc/inittab">/etc/inittab</primary> - </indexterm> - - <para>During the kernel initialization, the first program that is run - is either specified on the command line or, by default - <command>init</command>. This program reads the initialization file - <filename>/etc/inittab</filename>. Create this file with:</para> - -<screen><userinput>cat > /etc/inittab << "EOF" -<literal># 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</literal> -EOF</userinput></screen> - - <para>An explanation of this initialization file is in the man page for - <emphasis>inittab</emphasis>. For LFS, the key command that is run is - <command>rc</command>. The initialization file above will instruct - <command>rc</command> to run all the scripts starting with an S in the - <filename class="directory">/etc/rc.d/rcS.d</filename> directory - followed by all the scripts starting with an S in the <filename - class="directory">/etc/rc.d/rc?.d</filename> directory where the question - mark is specified by the initdefault value.</para> - - <para>As a convenience, the <command>rc</command> script reads a library of - functions in <filename class="directory">/lib/lsb/init-functions</filename>. - This library also reads an optional configuration file, - <filename>/etc/sysconfig/rc.site</filename>. 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.</para> - - <para>As a debugging convenience, the functions script also logs all output - to <filename>/run/var/bootlog</filename>. Since the <filename - class="directory">/run</filename> directory is a tmpfs, this file is not - persistent across boots, however it is appended to the more permanent file - <filename>/var/log/boot.log</filename> at the end of the boot process.</para> - - <sect3 id="init-levels" > - <title>Changing Run Levels</title> - - <para>Changing run-levels is done with <command>init - <replaceable><runlevel></replaceable></command>, where - <replaceable><runlevel></replaceable> is the target run-level. For example, to - reboot the computer, a user could issue the <command>init 6</command> command, - which is an alias for the <command>reboot</command> command. Likewise, - <command>init 0</command> is an alias for the <command>halt</command> - command.</para> - - <para>There are a number of directories under <filename - class="directory">/etc/rc.d</filename> that look like <filename - class="directory">rc?.d</filename> (where ? is the number of the run-level) and - <filename class="directory">rcsysinit.d</filename>, all containing a number of - symbolic links. Some begin with a <emphasis>K</emphasis>, the others begin with - an <emphasis>S</emphasis>, 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 - <command>init</command> switches to another run-level, the appropriate services - are either started or stopped, depending on the runlevel chosen.</para> - - <para>The real scripts are in <filename - class="directory">/etc/rc.d/init.d</filename>. They do the actual work, and - the symlinks all point to them. K links and S links point to - the same script in <filename class="directory">/etc/rc.d/init.d</filename>. - This is because the scripts can be called with different parameters like - <parameter>start</parameter>, <parameter>stop</parameter>, - <parameter>restart</parameter>, <parameter>reload</parameter>, and - <parameter>status</parameter>. When a K link is encountered, the appropriate - script is run with the <parameter>stop</parameter> argument. When an S link - is encountered, the appropriate script is run with the - <parameter>start</parameter> argument.</para> - - <para>There is one exception to this explanation. Links that start - with an <emphasis>S</emphasis> in the <filename - class="directory">rc0.d</filename> and <filename - class="directory">rc6.d</filename> directories will not cause anything - to be started. They will be called with the parameter - <parameter>stop</parameter> 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.</para> - - <para>These are descriptions of what the arguments make the scripts - do:</para> - - <variablelist> - - <varlistentry> - <term><parameter>start</parameter></term> - <listitem> - <para>The service is started.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter>stop</parameter></term> - <listitem> - <para>The service is stopped.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter>restart</parameter></term> - <listitem> - <para>The service is stopped and then started again.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter>reload</parameter></term> - <listitem> - <para>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.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term><parameter>status</parameter></term> - <listitem> - <para>Tells if the service is running and with which PIDs.</para> - </listitem> - </varlistentry> - - </variablelist> - - <para>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.</para> - - </sect3> - </sect2> - - <sect2> - <title>Udev Bootscripts</title> - - <para>The <filename>/etc/rc.d/init.d/udev</filename> initscript starts - <command>udevd</command>, 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 - <filename>/sbin/hotplug </filename>. This is done because the kernel no - longer needs to call out to an external binary. Instead - <command>udevd</command> will listen on a netlink socket for uevents that - the kernel raises.</para> - - <para>The <command>/etc/rc.d/init.d/udev_retry</command> initscript takes - care of re-triggering events for subsystems whose rules may rely on - filesystems that are not mounted until the <command>mountfs</command> - script is run (in particular, <filename class="directory">/usr</filename> - and <filename class="directory">/var</filename> may cause this). This - script runs after the <command>mountfs</command> script, so those rules - (if re-triggered) should succeed the second time around. It is - configured from the <filename>/etc/sysconfig/udev_retry</filename> 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 - <command>udevadm info --attribute-walk <device></command> where - <device> is an absolute path in /dev or /sys such as /dev/sr0 or - /sys/class/rtc.</para> - - <para>For information on kernel module loading and udev, see - <xref linkend="module-loading"/>.</para> -<!-- - <sect3> - <title>Module Loading</title> - - <para>Device drivers compiled as modules may have aliases built into them. - Aliases are visible in the output of the <command>modinfo</command> - program and are usually related to the bus-specific identifiers of devices - supported by a module. For example, the <emphasis>snd-fm801</emphasis> - driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801, - and has an alias of <quote>pci:v00001319d00000801sv*sd*bc04sc01i*</quote>. - For most devices, the bus driver exports the alias of the driver that - would handle the device via <systemitem - class="filesystem">sysfs</systemitem>. E.g., the - <filename>/sys/bus/pci/devices/0000:00:0d.0/modalias</filename> file - might contain the string - <quote>pci:v00001319d00000801sv00001319sd00001319bc04sc01i00</quote>. - The default rules provided with Udev will cause <command>udevd</command> - to call out to <command>/sbin/modprobe</command> with the contents of the - <envar>MODALIAS</envar> uevent environment variable (which should be the - same as the contents of the <filename>modalias</filename> file in sysfs), - thus loading all modules whose aliases match this string after wildcard - expansion.</para> - - <para>In this example, this means that, in addition to - <emphasis>snd-fm801</emphasis>, the obsolete (and unwanted) - <emphasis>forte</emphasis> driver will be loaded if it is - available. See below for ways in which the loading of unwanted drivers can - be prevented.</para> - - <para>The kernel itself is also able to load modules for network - protocols, filesystems and NLS support on demand.</para> - - </sect3> - - <sect3> - <title>Handling Hotpluggable/Dynamic Devices</title> - - <para>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 - <command>udevd</command> as described above.</para> - - </sect3> ---> - </sect2> - - <sect2 id="ch-config-clock"> - <title>Configuring the System Clock</title> - - <indexterm zone="ch-config-clock"> - <primary sortas="d-setclock">setclock</primary> - <secondary>configuring</secondary></indexterm> - - <para>The <command>setclock</command> 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 - <filename>/etc/localtime</filename> file (which tells the - <command>hwclock</command> 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.</para> - - <para>The <command>setclock</command> is run via - <application>udev</application> 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.</para> - - <para>If you cannot remember whether or not the hardware clock is set to UTC, - find out by running the <userinput>hwclock --localtime --show</userinput> - 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 <command>hwclock</command> 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 - <command>hwclock</command>. For example, if you are currently in the MST - timezone, which is also known as GMT -0700, add seven hours to the local - time.</para> - - <para>Change the value of the <envar>UTC</envar> variable below - to a value of <parameter>0</parameter> (zero) if the hardware clock - is <emphasis>not</emphasis> set to UTC time.</para> - - <para>Create a new file <filename>/etc/sysconfig/clock</filename> by running - the following:</para> - -<screen><userinput>cat > /etc/sysconfig/clock << "EOF" -<literal># 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</literal> -EOF</userinput></screen> - - <para>A good hint explaining how to deal with time on LFS is available - at <ulink url="&hints-root;time.txt"/>. It explains issues such as - time zones, UTC, and the <envar>TZ</envar> environment variable.</para> - - <note><para>The CLOCKPARAMS and UTC paramaters may be alternatively set - in the <filename>/etc/sysconfig/rc.site</filename> file.</para></note> - - </sect2> - - <sect2 id="ch-config-console"> - <?dbhtml filename="console.html"?> - - <title>Configuring the Linux Console</title> - - <indexterm zone="ch-config-console"> - <primary sortas="d-console">console</primary> - <secondary>configuring</secondary> - </indexterm> - - <para>This section discusses how to configure the <command>console</command> - 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 <filename>rc.site</filename>), the - <command>console</command> bootscript will do nothing.</para> - - <para>The <command>console</command> script reads the - <filename>/etc/sysconfig/console</filename> file for configuration - information. Decide which keymap and screen font will be used. Various - language-specific HOWTOs can also help with this, see <ulink - url="http://www.tldp.org/HOWTO/HOWTO-INDEX/other-lang.html"/>. If still in - doubt, look in the <filename class="directory">/usr/share/keymaps</filename> - and <filename class="directory">/usr/share/consolefonts</filename> directories - for valid keymaps and screen fonts. Read <filename>loadkeys(1)</filename> and - <filename>setfont(8)</filename> manual pages to determine the correct - arguments for these programs.</para> - - <para>The <filename>/etc/sysconfig/console</filename> file should contain lines - of the form: VARIABLE="value". The following variables are recognized:</para> - <variablelist> - - <varlistentry> - <term>LOGLEVEL</term> - <listitem> - <para>This variable specifies the log level for kernel messages sent - to the console as set by <command>dmesg -n</command>. Valid levels are - from "1" (no messages) to "8". The default level is "7".</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>KEYMAP</term> - <listitem> - <para>This variable specifies the arguments for the - <command>loadkeys</command> program, typically, the name of keymap - to load, e.g., <quote>it</quote>. If this variable is not set, the - bootscript will not run the <command>loadkeys</command> 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. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>KEYMAP_CORRECTIONS</term> - <listitem> - <para>This (rarely used) variable - specifies the arguments for the second call to the - <command>loadkeys</command> 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 <quote>euro2</quote>.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>FONT</term> - <listitem> - <para>This variable specifies the arguments for the - <command>setfont</command> program. Typically, this includes the font - name, <quote>-m</quote>, and the name of the application character - map to load. E.g., in order to load the <quote>lat1-16</quote> font - together with the <quote>8859-1</quote> application character map - (as it is appropriate in the USA), - <!-- because of the copyright sign --> - set this variable to <quote>lat1-16 -m 8859-1</quote>. - 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.</para> - - </listitem> - </varlistentry> - - <varlistentry> - <term>UNICODE</term> - <listitem> - <para>Set this variable to <quote>1</quote>, <quote>yes</quote> or - <quote>true</quote> in order to put the - console into UTF-8 mode. This is useful in UTF-8 based locales and - harmful otherwise.</para> - </listitem> - </varlistentry> - - <varlistentry> - <term>LEGACY_CHARSET</term> - <listitem> - <para>For many keyboard layouts, there is no stock Unicode keymap in - the Kbd package. The <command>console</command> 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.</para> - </listitem> - </varlistentry> - - </variablelist> - - <para>Some examples:</para> - - <itemizedlist> - - <listitem> - <para>For a non-Unicode setup, only the KEYMAP and FONT variables are - generally needed. E.g., for a Polish setup, one would use:</para> -<screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" -<literal># Begin /etc/sysconfig/console - -KEYMAP="pl2" -FONT="lat2a-16 -m 8859-2" - -# End /etc/sysconfig/console</literal> -EOF</userinput></screen> - </listitem> - - <listitem> - <para>As mentioned above, it is sometimes necessary to adjust a - stock keymap slightly. The following example adds the Euro symbol to the - German keymap:</para> - -<screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" -<literal># Begin /etc/sysconfig/console - -KEYMAP="de-latin1" -KEYMAP_CORRECTIONS="euro2" -FONT="lat0-16 -m 8859-15" -UNICODE="1" - -# End /etc/sysconfig/console</literal> -EOF</userinput></screen> - </listitem> - - <listitem> - <para>The following is a Unicode-enabled example for Bulgarian, where a - stock UTF-8 keymap exists:</para> -<!-- This is what is used by jhalfs for creating the console file: whenever - you change the following, please inform the jhalfs maintainer(s). --> -<screen><userinput>cat > /etc/sysconfig/console << "EOF" -<literal># Begin /etc/sysconfig/console - -UNICODE="1" -KEYMAP="bg_bds-utf8" -FONT="LatArCyrHeb-16" - -# End /etc/sysconfig/console</literal> -EOF</userinput></screen> - </listitem> - - <listitem> - <para>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:</para> - -<screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" -<literal># Begin /etc/sysconfig/console - -UNICODE="1" -KEYMAP="bg_bds-utf8" -FONT="cyr-sun16" - -# End /etc/sysconfig/console</literal> -EOF</userinput></screen> - </listitem> - - <listitem> - <para>The following example illustrates keymap autoconversion from - ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode:</para> - -<screen role="nodump"><userinput>cat > /etc/sysconfig/console << "EOF" -<literal># 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</literal> -EOF</userinput></screen> - </listitem> - - <listitem> - <para>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: <quote>press - Ctrl+. A E to get Æ</quote> 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 <quote>alpha</quote>. - 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.</para> - </listitem> - - <listitem> - <para>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).</para> - </listitem> - - </itemizedlist> - - <!-- Added because folks keep posting their console file with X questions - to blfs-support list --> - <note> - <para>The <filename>/etc/sysconfig/console</filename> 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.</para> - </note> - - </sect2> - - <sect2 id="ch-config-createfiles"> - <title>Creating Files at Boot</title> - - <indexterm zone="ch-config-createfiles"> - <primary sortas="d-createfiles">File creation at boot</primary> - <secondary>configuring</secondary> - </indexterm> - - <para>At times, it is desired to create files at boot time. For instance, - the <filename class="directory">/tmp/.ICE-unix</filename> directory - may be desired. This can be done by creating an entry in the - <filename>/etc/sysconfig/createfiles</filename> configuration script. - The format of this file is embedded in the comments of the default - configuration file.</para> - </sect2> - - <sect2 id="ch-config-sysklogd"> - <title>Configuring the sysklogd Script</title> - - <indexterm zone="ch-config-sysklogd"> - <primary sortas="d-sysklogd">sysklogd</primary> - <secondary>configuring</secondary> - </indexterm> - - <para>The <filename>sysklogd</filename> script invokes the - <command>syslogd</command> program as a part of System V initialization. The - <parameter>-m 0</parameter> option turns off the periodic timestamp mark that - <command>syslogd</command> writes to the log files every 20 minutes by - default. If you want to turn on this periodic timestamp mark, edit - <filename>/etc/sysconfig/rc.site</filename> and define the variable - SYSKLOGD_PARMS to the desired value. For instance, to remove all parameters, - set the variable to a null value:</para> - -<screen role="nodump">SYSKLOGD_PARMS=</screen> - - <para>See <userinput>man syslogd</userinput> for more options.</para> - - </sect2> - - <sect2 id="ch-config-site"> - <title>The rc.site File</title> - - <indexterm zone="ch-config-site"> - <primary sortas="a-rc.site">rc.site</primary> - </indexterm> - - <para>The optional <filename>/etc/sysconfig/rc.site</filename> file contains - settings that are automatically set for each SystemV boot script. It can - alternatively set the values specified in the <filename>hostname</filename>, - <filename>console</filename>, and <filename>clock</filename> files in the - <filename class='directory'>/etc/sysconfig/</filename> directory. If the - associated variables are present in both these separate files and - <filename>rc.site</filename>, the values in the script specific files have - precedence. </para> - - <para><filename>rc.site</filename> 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:</para> - - <!-- Use role to fix a pdf generation problem --> - <screen role="auto">&site;</screen> - - <sect3> - <title>Customizing the Boot and Shutdown Scripts</title> - - <para>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 <filename>/etc/sysconfig/rc.site</filename> file above.</para> - - <itemizedlist> - - <listitem><para>During the boot script <filename>udev</filename>, there is - a call to <command>udev settle</command> 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.</para></listitem> - - <listitem><para>The boot script <filename>udev_retry</filename> also runs - <command>udev settle</command> by default. This command is only needed by - default if the <filename class='directory'>/var</filename> directory is - separately mounted. This is because the clock needs the file - <filename>/var/lib/hwclock/adjtime</filename>. 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. - </para></listitem> - - <listitem><para>By default, the file system checks are silent. This can - appear to be a delay during the bootup process. To turn on the - <command>fsck</command> output, set the variable VERBOSE_FSCK=y. - </para></listitem> - - <listitem><para>When rebooting, you may want to skip the filesystem check, - <command>fsck</command>, completely. To do this, either create the file - <filename>/fastboot</filename> or reboot the system with the command - <command>/sbin/shutdown -f -r now</command>. On the other hand, you can - force all file systems to be checked by creating - <filename>/forcefsck</filename> or running <command>shutdown</command> with - the <parameter>-F</parameter> parameter instead of <parameter>-f</parameter>. - </para> - - <para>Setting the variable FASTBOOT=y will disable <command>fsck</command> - during the boot process until it is removed. This is not recommended - on a permanent basis.</para></listitem> - - <listitem><para>Normally, all files in the <filename - class='directory'>/tmp</filename> 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.</para></listitem> - - <listitem><para>During shutdown, the <command>init</command> 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 <command>sendsignals</command> - script for any processes that are not shut down by their own scripts. The - delay for <command>init</command> can be set by passing a parameter. For - example to remove the delay in <command>init</command>, pass the -t0 - parameter when shutting down or rebooting (e.g. <command>/sbin/shutdown - -t0 -r now</command>). The delay for the <command>sendsignals</command> - script can be skipped by setting the parameter - KILLDELAY=0.</para></listitem> - - </itemizedlist> - - </sect3> - </sect2> -</sect1> diff --git a/chapter07/util-linux.xml b/chapter07/util-linux.xml new file mode 100644 index 000000000..a598cb4bc --- /dev/null +++ b/chapter07/util-linux.xml @@ -0,0 +1,112 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-util-linux" role="wrap"> + <?dbhtml filename="util-linux.html"?> + + <sect1info condition="script"> + <productname>util-linux</productname> + <productnumber>&util-linux-version;</productnumber> + <address>&util-linux-url;</address> + </sect1info> + + <title>Util-linux-&util-linux-version;</title> + + <indexterm zone="ch-tools-util-linux"> + <primary sortas="a-Util-linux">Util-linux</primary> + <secondary>tools</secondary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Util-linux package contains miscellaneous utility programs.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&util-linux-tmp-sbu;</seg> + <seg>&util-linux-tmp-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Util-linux</title> + + <para>First create a directory + to enable storage for the <command>hwclock</command> program:</para> + +<screen><userinput remap="pre">mkdir -pv /var/lib/hwclock</userinput></screen> + + <para>Prepare Util-linux for compilation:</para> + +<screen><userinput remap="configure">./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ + --docdir=/usr/share/doc/util-linux-&util-linux-version; \ + --disable-chfn-chsh \ + --disable-login \ + --disable-nologin \ + --disable-su \ + --disable-setpriv \ + --disable-runuser \ + --disable-pylibmount \ + --disable-static \ + --without-python</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>ADJTIME_PATH=/var/lib/hwclock/adjtime</parameter></term> + <listitem> + <para>This sets the location of the file recording information about + the hardware clock in accordance to the FHS. This is not stricly + needed for this temporary tool, but it prevents creating a file + at another location, which would not be overwritten or removed + when building the final util-linux package.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-*</parameter></term> + <listitem> + <para>These switches prevent warnings about building components + that require packages not in LFS or not installed yet.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--without-python</parameter></term> + <listitem> + <para>This switch disables using <application>Python</application>. + It avoids trying to build unneeded bindings.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput remap="make">make</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput remap="install">make install</userinput></screen> + + </sect2> + + <sect2 role="content"> + <title/> + + <para>Details on this package are located in <xref linkend="contents-utillinux" role="."/></para> + + </sect2> + +</sect1> |