diff options
author | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2006-07-16 01:56:42 +0000 |
---|---|---|
committer | Bruce Dubbs <bdubbs@linuxfromscratch.org> | 2006-07-16 01:56:42 +0000 |
commit | 519ee452362f9166fdbaa75d3041ff44b56db30e (patch) | |
tree | 969eb88801c64f4016e3b4bc7328e4e70869ed37 /chapter06 |
Changing branch name
git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/6.2/BOOK@7678 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
Diffstat (limited to 'chapter06')
61 files changed, 14195 insertions, 0 deletions
diff --git a/chapter06/aboutdebug.xml b/chapter06/aboutdebug.xml new file mode 100644 index 000000000..5cecada9c --- /dev/null +++ b/chapter06/aboutdebug.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-aboutdebug"> + <?dbhtml filename="aboutdebug.html"?> + + <title>About Debugging Symbols</title> + + <para>Most programs and libraries are, by default, compiled with + debugging symbols included (with <command>gcc</command>'s + <parameter>-g</parameter> option). This means that when debugging a + program or library that was compiled with debugging information + included, the debugger can provide not only memory addresses, but also + the names of the routines and variables.</para> + + <para>However, the inclusion of these debugging symbols enlarges a + program or library significantly. The following is an example of the + amount of space these symbols occupy:</para> + + <itemizedlist> + <listitem> + <para>A <command>bash</command> binary with debugging symbols: + 1200 KB</para> + </listitem> + <listitem> + <para>A <command>bash</command> binary without debugging symbols: + 480 KB</para> + </listitem> + <listitem> + <para>Glibc and GCC files (<filename class="directory">/lib</filename> + and <filename class="directory">/usr/lib</filename>) with debugging + symbols: 87 MB</para> + </listitem> + <listitem> + <para>Glibc and GCC files without debugging symbols: 16 MB</para> + </listitem> + </itemizedlist> + + <para>Sizes may vary depending on which compiler and C library were used, + but when comparing programs with and without debugging symbols, the + difference will usually be a factor between two and five.</para> + + <para>Because most users will never use a debugger on their system software, + a lot of disk space can be regained by removing these symbols. The next + section shows how to strip all debugging symbols from the programs and + libraries. Additional information on system optimization can be found at + <ulink url="&hints-root;optimization.txt"/>.</para> + +</sect1> diff --git a/chapter06/autoconf.xml b/chapter06/autoconf.xml new file mode 100644 index 000000000..4ffb8e9ee --- /dev/null +++ b/chapter06/autoconf.xml @@ -0,0 +1,171 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-autoconf" role="wrap"> + <?dbhtml filename="autoconf.html"?> + + <title>Autoconf-&autoconf-version;</title> + + <indexterm zone="ch-system-autoconf"> + <primary sortas="a-Autoconf">Autoconf</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Autoconf package contains programs for producing shell scripts that + can automatically configure source code.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&autoconf-ch6-sbu;</seg> + <seg>&autoconf-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Autoconf</title> + + <para>Prepare Autoconf for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>. + This takes a long time, about 3 SBUs. In addition, 2 test are skipped + that use Automake. For full test coverage, Autoconf can be re-tested + after Automake has been installed.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-autoconf" role="content"> + <title>Contents of Autoconf</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>autoconf, autoheader, autom4te, autoreconf, autoscan, autoupdate, + and ifnames</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="autoconf"> + <term><command>autoconf</command></term> + <listitem> + <para>Produces shell scripts that automatically configure software + source code packages to adapt to many kinds of Unix-like systems. + The configuration scripts it produces are independent—running + them does not require the <command>autoconf</command> program.</para> + <indexterm zone="ch-system-autoconf autoconf"> + <primary sortas="b-autoconf">autoconf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="autoheader"> + <term><command>autoheader</command> </term> + <listitem> + <para>A tool for creating template files of C + <emphasis>#define</emphasis> statements for configure to use</para> + <indexterm zone="ch-system-autoconf autoheader"> + <primary sortas="b-autoheader">autoheader</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="autom4te"> + <term><command>autom4te</command></term> + <listitem> + <para>A wrapper for the M4 macro processor</para> + <indexterm zone="ch-system-autoconf autom4te"> + <primary sortas="b-autom4te">autom4te</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="autoreconf"> + <term><command>autoreconf</command></term> + <listitem> + <para>Automatically runs <command>autoconf</command>, + <command>autoheader</command>, <command>aclocal</command>, + <command>automake</command>, <command>gettextize</command>, and + <command>libtoolize</command> in the correct order to save time + when changes are made to <command>autoconf</command> and + <command>automake</command> template files</para> + <indexterm zone="ch-system-autoconf autoreconf"> + <primary sortas="b-autoreconf">autoreconf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="autoscan"> + <term><command>autoscan</command> </term> + <listitem> + <para>Helps to create a <filename>configure.in</filename> file for a + software package; it examines the source files in a directory tree, + searching them for common portability issues, and creates a + <filename>configure.scan</filename> file that serves as as a + preliminary <filename>configure.in</filename> file for the + package</para> + <indexterm zone="ch-system-autoconf autoscan"> + <primary sortas="b-autoscan">autoscan</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="autoupdate"> + <term><command>autoupdate</command></term> + <listitem> + <para>Modifies a <filename>configure.in</filename> file that still + calls <command>autoconf</command> macros by their old names to use the + current macro names</para> + <indexterm zone="ch-system-autoconf autoupdate"> + <primary sortas="b-autoupdate">autoupdate</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ifnames"> + <term><command>ifnames</command> </term> + <listitem> + <para>Helps when writing <filename>configure.in</filename> files + for a software package; it prints the identifiers that the package + uses in C preprocessor conditionals. If a package has already been set + up to have some portability, this program can help determine what + <command>configure</command> needs to check for. It can also fill in + gaps in a <filename>configure.in</filename> file generated by + <command>autoscan</command></para> + <indexterm zone="ch-system-autoconf ifnames"> + <primary sortas="b-ifnames">ifnames</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/automake.xml b/chapter06/automake.xml new file mode 100644 index 000000000..65da0b897 --- /dev/null +++ b/chapter06/automake.xml @@ -0,0 +1,263 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-automake" role="wrap"> + <?dbhtml filename="automake.html"?> + + <title>Automake-&automake-version;</title> + + <indexterm zone="ch-system-automake"> + <primary sortas="a-Automake">Automake</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Automake package contains programs for generating Makefiles for use + with Autoconf.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&automake-ch6-sbu;</seg> + <seg>&automake-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Automake</title> + + <para>Prepare Automake for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>. + This takes a long time, about 10 SBUs.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-automake" role="content"> + <title>Contents of Automake</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>acinstall, aclocal, aclocal-&automake-version;, automake, + automake-&automake-version;, compile, config.guess, config.sub, + depcomp, elisp-comp, install-sh, mdate-sh, missing, mkinstalldirs, + py-compile, symlink-tree, and ylwrap</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="acinstall"> + <term><command>acinstall</command></term> + <listitem> + <para>A script that installs aclocal-style M4 files</para> + <indexterm zone="ch-system-automake acinstall"> + <primary sortas="b-acinstall">acinstall</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="aclocal"> + <term><command>aclocal</command></term> + <listitem> + <para>Generates <filename>aclocal.m4</filename> files based on the + contents of <filename>configure.in</filename> files</para> + <indexterm zone="ch-system-automake aclocal"> + <primary sortas="b-aclocal">aclocal</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="aclocal-version"> + <term><command>aclocal-&automake-version;</command></term> + <listitem> + <para>A hard link to <command>aclocal</command></para> + <indexterm zone="ch-system-automake aclocal-version"> + <primary sortas="b-aclocal-&automake-version;">aclocal-&automake-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="automake"> + <term><command>automake</command></term> + <listitem> + <para>A tool for automatically generating + <filename>Makefile.in</filename> files from + <filename>Makefile.am</filename> files. To create all the + <filename>Makefile.in</filename> files for a package, run this program + in the top-level directory. By scanning the + <filename>configure.in</filename> file, it automatically finds each + appropriate <filename>Makefile.am</filename> file and generates the + corresponding <filename>Makefile.in</filename> file</para> + <indexterm zone="ch-system-automake automake"> + <primary sortas="b-automake">automake</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="automake-version"> + <term><command>automake-&automake-version;</command></term> + <listitem> + <para>A hard link to <command>automake</command></para> + <indexterm zone="ch-system-automake automake-version"> + <primary sortas="b-automake-&automake-version;">automake-&automake-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="compile"> + <term><command>compile</command></term> + <listitem> + <para>A wrapper for compilers</para> + <indexterm zone="ch-system-automake compile"> + <primary sortas="b-compile">compile</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="config.guess"> + <term><command>config.guess</command></term> + <listitem> + <para>A script that attempts to guess the canonical triplet for + the given build, host, or target architecture</para> + <indexterm zone="ch-system-automake config.guess"> + <primary sortas="b-config.guess">config.guess</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="config.sub"> + <term><command>config.sub</command></term> + <listitem> + <para>A configuration validation subroutine script</para> + <indexterm zone="ch-system-automake config.sub"> + <primary sortas="b-config.sub">config.sub</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="depcomp"> + <term><command>depcomp</command></term> + <listitem> + <para>A script for compiling a program so that dependency information + is generated in addition to the desired output</para> + <indexterm zone="ch-system-automake depcomp"> + <primary sortas="b-depcomp">depcomp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="elisp-comp"> + <term><command>elisp-comp</command></term> + <listitem> + <para>Byte-compiles Emacs Lisp code</para> + <indexterm zone="ch-system-automake elisp-comp"> + <primary sortas="b-elisp-comp">elisp-comp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="install-sh"> + <term><command>install-sh</command></term> + <listitem> + <para>A script that installs a program, script, or data file</para> + <indexterm zone="ch-system-automake install-sh"> + <primary sortas="b-install-sh">install-sh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mdate-sh"> + <term><command>mdate-sh</command></term> + <listitem> + <para>A script that prints the modification time of a file or + directory</para> + <indexterm zone="ch-system-automake mdate-sh"> + <primary sortas="b-mdate-sh">mdate-sh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="missing"> + <term><command>missing</command></term> + <listitem> + <para>A script acting as a common stub for missing GNU programs during + an installation</para> + <indexterm zone="ch-system-automake missing"> + <primary sortas="b-missing">missing</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkinstalldirs"> + <term><command>mkinstalldirs</command></term> + <listitem> + <para>A script that creates a directory tree</para> + <indexterm zone="ch-system-automake mkinstalldirs"> + <primary sortas="b-mkinstalldirs">mkinstalldirs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="py-compile"> + <term><command>py-compile</command></term> + <listitem> + <para>Compiles a Python program</para> + <indexterm zone="ch-system-automake py-compile"> + <primary sortas="b-py-compile">py-compile</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="symlink-tree"> + <term><command>symlink-tree</command></term> + <listitem> + <para>A script to create a symlink tree of a directory tree</para> + <indexterm zone="ch-system-automake symlink-tree"> + <primary sortas="b-symlink-tree">symlink-tree</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ylwrap"> + <term><command>ylwrap</command></term> + <listitem> + <para>A wrapper for <command>lex</command> and + <command>yacc</command></para> + <indexterm zone="ch-system-automake ylwrap"> + <primary sortas="b-ylwrap">ylwrap</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/bash.xml b/chapter06/bash.xml new file mode 100644 index 000000000..53ea0a66b --- /dev/null +++ b/chapter06/bash.xml @@ -0,0 +1,150 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-bash" role="wrap"> + <?dbhtml filename="bash.html"?> + + <title>Bash-&bash-version;</title> + + <indexterm zone="ch-system-bash"> + <primary sortas="a-Bash">Bash</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Bash package contains the Bourne-Again SHell.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bash-ch6-sbu;</seg> + <seg>&bash-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bash</title> + + <para>If you downloaded the Bash documentation tarball and wish to install + HTML documentation, issue the following commands:</para> + +<screen><userinput>tar -xvf ../bash-doc-&bash-doc-version;.tar.gz && +sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/bash-&bash-version;|" \ + Makefile.in</userinput></screen> + + <para>Upstream developers have fixed several issues since the initial + release of Bash-&bash-version;. Apply those fixes:</para> + +<screen><userinput>patch -Np1 -i ../&bash-fixes-patch;</userinput></screen> + + <para>Prepare Bash for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --bindir=/bin \ + --without-bash-malloc --with-installed-readline</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--with-installed-readline</parameter></term> + <listitem> + <para>This option tells Bash to use the <filename + class="libraryfile">readline</filename> library that is already + installed on the system rather than using its own readline + version.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make tests</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Run the newly compiled <command>bash</command> program (replacing the one that is + currently being executed):</para> + +<screen role="nodump"><userinput>exec /bin/bash --login +h</userinput></screen> + + <note> + <para>The parameters used make the <command>bash</command> + process an interactive login shell and continue to disable hashing so + that new programs are found as they become available.</para> + </note> + + </sect2> + + <sect2 id="contents-bash" role="content"> + <title>Contents of Bash</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>bash, bashbug, and sh (link to bash)</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="bash"> + <term><command>bash</command></term> + <listitem> + <para>A widely-used command interpreter; it performs many types of + expansions and substitutions on a given command line before executing + it, thus making this interpreter a powerful tool</para> + <indexterm zone="ch-system-bash bash"> + <primary sortas="b-bash">bash</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bashbug"> + <term><command>bashbug</command></term> + <listitem> + <para>A shell script to help the user compose and mail standard + formatted bug reports concerning <command>bash</command></para> + <indexterm zone="ch-system-bash bashbug"> + <primary sortas="b-bashbug">bashbug</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sh"> + <term><command>sh</command></term> + <listitem> + <para>A symlink to the <command>bash</command> program; when invoked + as <command>sh</command>, <command>bash</command> tries to mimic the + startup behavior of historical versions of <command>sh</command> as + closely as possible, while conforming to the POSIX standard as + well</para> + <indexterm zone="ch-system-bash sh"> + <primary sortas="b-sh">sh</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/binutils.xml b/chapter06/binutils.xml new file mode 100644 index 000000000..5c9514bf2 --- /dev/null +++ b/chapter06/binutils.xml @@ -0,0 +1,327 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-binutils" role="wrap"> + <?dbhtml filename="binutils.html"?> + + <title>Binutils-&binutils-version;</title> + + <indexterm zone="ch-system-binutils"> + <primary sortas="a-Binutils">Binutils</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Binutils package contains a linker, an assembler, and other + tools for handling object files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&binutils-ch6-sbu;</seg> + <seg>&binutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Binutils</title> + + <para>Verify that the PTYs are working properly inside the chroot + environment. Check that everything is set up correctly by performing a + simple test:</para> + +<screen><userinput>expect -c "spawn ls"</userinput></screen> + + <para>If the following message shows up, the chroot environment is not + set up for proper PTY operation:</para> + +<screen><computeroutput>The system has no more ptys. +Ask your system administrator to create more.</computeroutput></screen> + + <para>This issue needs to be resolved before running the test suites + for Binutils and GCC.</para> + + <para>The Binutils documentation recommends building Binutils outside of the + source directory in a dedicated build directory:</para> + +<screen><userinput>mkdir -v ../binutils-build +cd ../binutils-build</userinput></screen> + + <para>Prepare Binutils for compilation:</para> + +<screen><userinput>../binutils-&binutils-version;/configure --prefix=/usr \ + --enable-shared</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make tooldir=/usr</userinput></screen> + + <variablelist> + <title>The meaning of the make parameter:</title> + + <varlistentry> + <term><parameter>tooldir=/usr</parameter></term> + <listitem> + <para>Normally, the tooldir (the directory where the executables will + ultimately be located) is set to <filename + class="directory">$(exec_prefix)/$(target_alias)</filename>. For + example, i686 machines would expand that to <filename + class="directory">/usr/i686-pc-linux-gnu</filename>. Because this is + a custom system, this target-specific directory in <filename + class="directory">/usr</filename> is not required. <filename + class="directory">$(exec_prefix)/$(target_alias)</filename> would be + used if the system was used to cross-compile (for example, compiling a + package on an Intel machine that generates code that can be executed + on PowerPC machines).</para> + </listitem> + </varlistentry> + + </variablelist> + + <important> + <para>The test suite for Binutils in this section is considered critical. + Do not skip it under any circumstances.</para> + </important> + + <para>Test the results:</para> + +<screen><userinput>make check</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput>make tooldir=/usr install</userinput></screen> + + <para>Install the <filename class="headerfile">libiberty</filename> header + file that is needed by some packages:</para> + +<screen><userinput>cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> + + </sect2> + + + <sect2 id="contents-binutils" role="content"> + <title>Contents of Binutils</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump, + ranlib, readelf, size, strings, and strip</seg> + <seg>libiberty.a, libbfd.{a,so}, and libopcodes.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="addr2line"> + <term><command>addr2line</command></term> + <listitem> + <para>Translates program addresses to file names and line numbers; + given an address and the name of an executable, it uses the debugging + information in the executable to determine which source file and line + number are associated with the address</para> + <indexterm zone="ch-system-binutils addr2line"> + <primary sortas="b-addr2line">addr2line</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ar"> + <term><command>ar</command></term> + <listitem> + <para>Creates, modifies, and extracts from archives</para> + <indexterm zone="ch-system-binutils ar"> + <primary sortas="b-ar">ar</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="as"> + <term><command>as</command></term> + <listitem> + <para>An assembler that assembles the output of <command>gcc</command> + into object files</para> + <indexterm zone="ch-system-binutils as"> + <primary sortas="b-as">as</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="c-filt"> + <term><command>c++filt</command></term> + <listitem> + <para>Used by the linker to de-mangle C++ and Java symbols and to keep + overloaded functions from clashing</para> + <indexterm zone="ch-system-binutils c-filt"> + <primary sortas="b-c++filt">c++filt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gprof"> + <term><command>gprof</command></term> + <listitem> + <para>Displays call graph profile data</para> + <indexterm zone="ch-system-binutils gprof"> + <primary sortas="b-gprof">gprof</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ld"> + <term><command>ld</command></term> + <listitem> + <para>A linker that combines a number of object and archive files + into a single file, relocating their data and tying up symbol + references</para> + <indexterm zone="ch-system-binutils ld"> + <primary sortas="b-ld">ld</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nm"> + <term><command>nm</command></term> + <listitem> + <para>Lists the symbols occurring in a given object file</para> + <indexterm zone="ch-system-binutils nm"> + <primary sortas="b-nm">nm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="objcopy"> + <term><command>objcopy</command></term> + <listitem> + <para>Translates one type of object file into another</para> + <indexterm zone="ch-system-binutils objcopy"> + <primary sortas="b-objcopy">objcopy</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="objdump"> + <term><command>objdump</command></term> + <listitem> + <para>Displays information about the given object file, with options + controlling the particular information to display; the information + shown is useful to programmers who are working on the compilation + tools</para> + <indexterm zone="ch-system-binutils objdump"> + <primary sortas="b-objdump">objdump</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ranlib"> + <term><command>ranlib</command></term> + <listitem> + <para>Generates an index of the contents of an archive and stores it + in the archive; the index lists all of the symbols defined by archive + members that are relocatable object files</para> + <indexterm zone="ch-system-binutils ranlib"> + <primary sortas="b-ranlib">ranlib</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="readelf"> + <term><command>readelf</command></term> + <listitem> + <para>Displays information about ELF type binaries</para> + <indexterm zone="ch-system-binutils readelf"> + <primary sortas="b-readelf">readelf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="size"> + <term><command>size</command></term> + <listitem> + <para>Lists the section sizes and the total size for the given + object files</para> + <indexterm zone="ch-system-binutils size"> + <primary sortas="b-size">size</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="strings"> + <term><command>strings</command></term> + <listitem> + <para>Outputs, for each given file, the sequences of printable + characters that are of at least the specified length (defaulting to + four); for object files, it prints, by default, only the strings from + the initializing and loading sections while for other types of files, it + scans the entire file</para> + <indexterm zone="ch-system-binutils strings"> + <primary sortas="b-strings">strings</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="strip"> + <term><command>strip</command></term> + <listitem> + <para>Discards symbols from object files</para> + <indexterm zone="ch-system-binutils strip"> + <primary sortas="b-strip">strip</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libiberty"> + <term><filename class="libraryfile">libiberty</filename></term> + <listitem> + <para>Contains routines used by various GNU programs, including + <command>getopt</command>, <command>obstack</command>, + <command>strerror</command>, <command>strtol</command>, and + <command>strtoul</command></para> + <indexterm zone="ch-system-binutils libiberty"> + <primary sortas="c-libiberty">libiberty</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libbfd"> + <term><filename class="libraryfile">libbfd</filename></term> + <listitem> + <para>The Binary File Descriptor library</para> + <indexterm zone="ch-system-binutils libbfd"> + <primary sortas="c-libbfd">libbfd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libopcodes"> + <term><filename class="libraryfile">libopcodes</filename></term> + <listitem> + <para>A library for dealing with opcodes—the <quote>readable + text</quote> versions of instructions for the processor; + it is used for building utilities like + <command>objdump</command>.</para> + <indexterm zone="ch-system-binutils libopcodes"> + <primary sortas="c-libopcodes">libopcodes</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/bison.xml b/chapter06/bison.xml new file mode 100644 index 000000000..9079bf723 --- /dev/null +++ b/chapter06/bison.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-bison" role="wrap"> + <?dbhtml filename="bison.html"?> + + <title>Bison-&bison-version;</title> + + <indexterm zone="ch-system-bison"> + <primary sortas="a-Bison">Bison</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Bison package contains a parser generator.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bison-ch6-sbu;</seg> + <seg>&bison-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bison</title> + + <para>Prepare Bison for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>The configure system causes bison to be built without support for + internationalization of error messages if a <command>bison</command> + program is not already in $PATH. The following addition will correct + this.</para> + +<screen><userinput>echo '#define YYENABLE_NLS 1' >> config.h</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-bison" role="content"> + <title>Contents of Bison</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed library</segtitle> + + <seglistitem> + <seg>bison and yacc</seg> + <seg>liby.a</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="bison"> + <term><command>bison</command></term> + <listitem> + <para>Generates, from a series of rules, a program for analyzing the + structure of text files; Bison is a replacement for Yacc (Yet Another + Compiler Compiler)</para> + <indexterm zone="ch-system-bison bison"> + <primary sortas="b-bison">bison</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="yacc"> + <term><command>yacc</command></term> + <listitem> + <para>A wrapper for <command>bison</command>, meant for programs that + still call <command>yacc</command> instead of <command>bison</command>; + it calls <command>bison</command> with the <parameter>-y</parameter> + option</para> + <indexterm zone="ch-system-bison yacc"> + <primary sortas="b-yacc">yacc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="liby.a"> + <term><filename class="libraryfile">liby.a</filename></term> + <listitem> + <para>The Yacc library containing implementations of Yacc-compatible + <function>yyerror</function> and <function>main</function> functions; + this library is normally not very useful, but POSIX requires it</para> + <indexterm zone="ch-system-bison liby.a"> + <primary sortas="c-liby.a">liby.a</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml new file mode 100644 index 000000000..69d4d9b12 --- /dev/null +++ b/chapter06/bzip2.xml @@ -0,0 +1,250 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-bzip2" role="wrap"> + <?dbhtml filename="bzip2.html"?> + + <title>Bzip2-&bzip2-version;</title> + + <indexterm zone="ch-system-bzip2"> + <primary sortas="a-Bzip2">Bzip2</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Bzip2 package contains programs for compressing and decompressing + files. Compressing text files with <command>bzip2</command> yields a much + better compression percentage than with the traditional + <command>gzip</command>.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bzip2-ch6-sbu;</seg> + <seg>&bzip2-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bzip2</title> + + <para>Apply a patch to install the documentation for this package:</para> + +<screen><userinput>patch -Np1 -i ../&bzip2-docs-patch;</userinput></screen> + + <para>The <command>bzgrep</command> command does not escape '|' and '&' + in filenames passed to it. This allows arbitrary commands to be executed + with the privileges of the user running <command>bzgrep</command>. Apply + the following to address this:</para> + +<screen><userinput>patch -Np1 -i ../&bzip2-bzgrep-patch;</userinput></screen> + + <para>The <command>bzdiff</command> script still uses the deprecated + <command>tempfile</command> program. Update it to use + <command>mktemp</command> instead:</para> + +<screen><userinput>sed -i 's@tempfile -d /tmp -p bz@mktemp -p /tmp@' bzdiff</userinput></screen> + + <para>Prepare Bzip2 for compilation with:</para> + +<screen><userinput>make -f Makefile-libbz2_so +make clean</userinput></screen> + + <variablelist> + <title>The meaning of the make parameter:</title> + + <varlistentry> + <term><parameter>-f Makefile-libbz2_so</parameter></term> + <listitem> + <para>This will cause Bzip2 to be built using a different + <filename>Makefile</filename> file, in this case the + <filename>Makefile-libbz2_so</filename> file, which creates a dynamic + <filename class="libraryfile">libbz2.so</filename> library and links + the Bzip2 utilities against it.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile and test the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>If reinstalling Bzip2, perform + <userinput>rm -vf /usr/bin/bz*</userinput> first, otherwise the following + <command>make install</command> will fail.</para> + + <para>Install the programs:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Install the shared <command>bzip2</command> binary into the + <filename class="directory">/bin</filename> directory, make + some necessary symbolic links, and clean up:</para> + +<screen><userinput>cp -v bzip2-shared /bin/bzip2 +cp -av libbz2.so* /lib +ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so +rm -v /usr/bin/{bunzip2,bzcat,bzip2} +ln -sv bzip2 /bin/bunzip2 +ln -sv bzip2 /bin/bzcat</userinput></screen> + + </sect2> + + <sect2 id="contents-bzip2" role="content"> + <title>Contents of Bzip2</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, + bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg> + <seg>libbz2.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="bunzip2"> + <term><command>bunzip2</command></term> + <listitem> + <para>Decompresses bzipped files</para> + <indexterm zone="ch-system-bzip2 bunzip2"> + <primary sortas="b-bunzip2">bunzip2</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzcat"> + <term><command>bzcat</command></term> + <listitem> + <para>Decompresses to standard output</para> + <indexterm zone="ch-system-bzip2 bzcat"> + <primary sortas="b-bzcat">bzcat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzcmp"> + <term><command>bzcmp</command></term> + <listitem> + <para>Runs <command>cmp</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzcmp"> + <primary sortas="b-bzcmp">bzcmp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzdiff"> + <term><command>bzdiff</command></term> + <listitem> + <para>Runs <command>diff</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzdiff"> + <primary sortas="b-bzdiff">bzdiff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzgrep"> + <term><command>bzgrep</command></term> + <listitem> + <para>Runs <command>grep</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzgrep"> + <primary sortas="b-bzgrep">bzgrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzegrep"> + <term><command>bzegrep</command></term> + <listitem> + <para>Runs <command>egrep</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzegrep"> + <primary sortas="b-bzegrep">bzegrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzfgrep"> + <term><command>bzfgrep</command></term> + <listitem> + <para>Runs <command>fgrep</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzfgrep"> + <primary sortas="b-bzfgrep">bzfgrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzip2"> + <term><command>bzip2</command></term> + <listitem> + <para>Compresses files using the Burrows-Wheeler block sorting text + compression algorithm with Huffman coding; the compression rate is + better than that achieved by more conventional compressors using + <quote>Lempel-Ziv</quote> algorithms, like <command>gzip</command></para> + <indexterm zone="ch-system-bzip2 bzip2"> + <primary sortas="b-bzip2">bzip2</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzip2recover"> + <term><command>bzip2recover</command></term> + <listitem> + <para>Tries to recover data from damaged bzipped files</para> + <indexterm zone="ch-system-bzip2 bzip2recover"> + <primary sortas="b-bzip2recover">bzip2recover</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzless"> + <term><command>bzless</command></term> + <listitem> + <para>Runs <command>less</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzless"> + <primary sortas="b-bzless">bzless</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="bzmore"> + <term><command>bzmore</command></term> + <listitem> + <para>Runs <command>more</command> on bzipped files</para> + <indexterm zone="ch-system-bzip2 bzmore"> + <primary sortas="b-bzmore">bzmore</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libbz2"> + <term><filename class="libraryfile">libbz2*</filename></term> + <listitem> + <para>The library implementing lossless, block-sorting data + compression, using the Burrows-Wheeler algorithm</para> + <indexterm zone="ch-system-bzip2 libbz2"> + <primary sortas="c-libbz2*">libbz2*</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml new file mode 100644 index 000000000..5715d6be9 --- /dev/null +++ b/chapter06/chapter06.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<chapter id="chapter-building-system" xreflabel="Chapter 6"> + <?dbhtml dir="chapter06"?> + <?dbhtml filename="chapter06.html"?> + + <title>Installing Basic System Software</title> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kernfs.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pkgmgt.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chroot.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingdirs.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="createfiles.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="db.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iana-etc.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procps.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readline.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="autoconf.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="automake.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inetutils.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iproute2.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="less.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-db.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="psmisc.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="shadow.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysvinit.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="vim.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="strippingagain.xml"/> + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/> + +</chapter> diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml new file mode 100644 index 000000000..ea213033e --- /dev/null +++ b/chapter06/chroot.xml @@ -0,0 +1,61 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-chroot"> + <?dbhtml filename="chroot.html"?> + + <title>Entering the Chroot Environment</title> + + <para>It is time to enter the chroot environment to begin building and + installing the final LFS system. As user <systemitem + class="username">root</systemitem>, run the following command to enter the + realm that is, at the moment, populated with only the temporary tools:</para> + +<screen><userinput>chroot "$LFS" /tools/bin/env -i \ + HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ + /tools/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 needed, 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> comes last + 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/chapter06/coreutils.xml b/chapter06/coreutils.xml new file mode 100644 index 000000000..bc614c205 --- /dev/null +++ b/chapter06/coreutils.xml @@ -0,0 +1,1062 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-coreutils" role="wrap"> + <?dbhtml filename="coreutils.html"?> + + <title>Coreutils-&coreutils-version;</title> + + <indexterm zone="ch-system-coreutils"> + <primary sortas="a-Coreutils">Coreutils</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Coreutils package contains utilities for showing and setting the + basic system characteristics.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&coreutils-ch6-sbu;</seg> + <seg>&coreutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Coreutils</title> + + <para>A known issue with the <command>uname</command> program from + this package is that the <parameter>-p</parameter> switch always + returns <computeroutput>unknown</computeroutput>. The following patch + fixes this behavior for Intel architectures:</para> + +<screen><userinput>patch -Np1 -i ../&coreutils-uname-patch;</userinput></screen> + + <para>Prevent Coreutils from installing binaries that will be installed by + other packages later:</para> + +<screen><userinput>patch -Np1 -i ../&coreutils-suppress-patch;</userinput></screen> + + <para>POSIX requires that programs from Coreutils recognize character + boundaries correctly even in multibyte locales. The following patch + fixes this non-compliance and other internationalization-related bugs:</para> + +<screen><userinput>patch -Np1 -i ../&coreutils-i18n-patch;</userinput></screen> + + <para>In order for the tests added by this patch to pass, the permissions for + the test file have to be changed:</para> + +<screen><userinput>chmod +x tests/sort/sort-mb-tests</userinput></screen> + + <note> + <para>In the past, many bugs were found in this patch. When reporting new + bugs to Coreutils maintainers, please check first if they are reproducible + without this patch.</para> + </note> + + <para>It has been found that translated messages sometimes overflow a buffer + in the <command>who -Hu</command> command. Increase the buffer size:</para> + +<screen><userinput>sed -i 's/_LEN 6/_LEN 20/' src/who.c</userinput></screen> + + <para>Now prepare Coreutils for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>The test suite of Coreutils makes several assumptions about the + presence of system users and groups that are not valid within the minimal + environment that exists at the moment. Therefore, additional items need + to be set up before running the tests. Skip down to <quote>Install the + package</quote> if not running the test suite.</para> + + <para>Create two dummy groups and a dummy user:</para> + +<screen><userinput>echo "dummy1:x:1000:" >> /etc/group +echo "dummy2:x:1001:dummy" >> /etc/group +echo "dummy:x:1000:1000::/root:/bin/bash" >> /etc/passwd</userinput></screen> + + <para>Now the test suite is ready to be run. First, run the tests that are + meant to be run as user <systemitem class="username">root</systemitem>:</para> + +<screen><userinput>make NON_ROOT_USERNAME=dummy check-root</userinput></screen> + + <para>Then run the remainder of the tests as the + <systemitem class="username">dummy</systemitem> user:</para> + +<screen><userinput>src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check"</userinput></screen> + + <para>When testing is complete, remove the dummy user and groups:</para> + +<screen><userinput>sed -i '/dummy/d' /etc/passwd /etc/group</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Move programs to the locations specified by the FHS:</para> + +<screen><userinput>mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin +mv -v /usr/bin/{false,hostname,ln,ls,mkdir,mknod,mv,pwd,rm} /bin +mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin +mv -v /usr/bin/chroot /usr/sbin</userinput></screen> + + <para>Some of the scripts in the LFS-Bootscripts package depend on + <command>head</command>, <command>sleep</command>, and + <command>nice</command>. As <filename class="directory">/usr</filename> + may not be available during the early stages of booting, those binaries + need to be on the root partition:</para> + +<screen><userinput>mv -v /usr/bin/{head,sleep,nice} /bin</userinput></screen> + + </sect2> + + + <sect2 id="contents-coreutils" role="content"> + <title>Contents of Coreutils</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, + csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, + expand, expr, factor, false, fmt, fold, groups, head, hostid, + hostname, id, install, join, link, ln, logname, ls, md5sum, mkdir, + mkfifo, mknod, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, + printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, shred, + sleep, sort, split, stat, stty, sum, sync, tac, tail, tee, test, + touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, users, + vdir, wc, who, whoami, and yes</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="basename"> + <term><command>basename</command></term> + <listitem> + <para>Strips any path and a given suffix from a file name</para> + <indexterm zone="ch-system-coreutils basename"> + <primary sortas="b-basename">basename</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cat"> + <term><command>cat</command></term> + <listitem> + <para>Concatenates files to standard output</para> + <indexterm zone="ch-system-coreutils cat"> + <primary sortas="b-cat">cat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chgrp"> + <term><command>chgrp</command></term> + <listitem> + <para>Changes the group ownership of files and directories</para> + <indexterm zone="ch-system-coreutils chgrp"> + <primary sortas="b-chgrp">chgrp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chmod"> + <term><command>chmod</command></term> + <listitem> + <para>Changes the permissions of each file to the given mode; the mode + can be either a symbolic representation of the changes to make or an + octal number representing the new permissions</para> + <indexterm zone="ch-system-coreutils chmod"> + <primary sortas="b-chmod">chmod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chown"> + <term><command>chown</command></term> + <listitem> + <para>Changes the user and/or group ownership of files and + directories</para> + <indexterm zone="ch-system-coreutils chown"> + <primary sortas="b-chown">chown</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chroot"> + <term><command>chroot</command></term> + <listitem> + <para>Runs a command with the specified directory as the + <filename class="directory">/</filename> directory</para> + <indexterm zone="ch-system-coreutils chroot"> + <primary sortas="b-chroot">chroot</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cksum"> + <term><command>cksum</command></term> + <listitem> + <para>Prints the Cyclic Redundancy Check (CRC) checksum and the byte + counts of each specified file</para> + <indexterm zone="ch-system-coreutils cksum"> + <primary sortas="b-cksum">cksum</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="comm"> + <term><command>comm</command></term> + <listitem> + <para>Compares two sorted files, outputting in three columns the lines + that are unique and the lines that are common</para> + <indexterm zone="ch-system-coreutils comm"> + <primary sortas="b-comm">comm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cp"> + <term><command>cp</command></term> + <listitem> + <para>Copies files</para> + <indexterm zone="ch-system-coreutils cp"> + <primary sortas="b-cp">cp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="csplit"> + <term><command>csplit</command></term> + <listitem> + <para>Splits a given file into several new files, separating them + according to given patterns or line numbers and outputting the byte + count of each new file</para> + <indexterm zone="ch-system-coreutils csplit"> + <primary sortas="b-csplit">csplit</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cut"> + <term><command>cut</command></term> + <listitem> + <para>Prints sections of lines, selecting the parts according to given + fields or positions</para> + <indexterm zone="ch-system-coreutils cut"> + <primary sortas="b-cut">cut</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="date"> + <term><command>date</command></term> + <listitem> + <para>Displays the current time in the given format, or sets the + system date</para> + <indexterm zone="ch-system-coreutils date"> + <primary sortas="b-date">date</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dd"> + <term><command>dd</command> </term> + <listitem> + <para>Copies a file using the given block size and count, while + optionally performing conversions on it</para> + <indexterm zone="ch-system-coreutils dd"> + <primary sortas="b-dd">dd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="df"> + <term><command>df</command></term> + <listitem> + <para>Reports the amount of disk space available (and used) on all + mounted file systems, or only on the file systems holding the selected + files</para> + <indexterm zone="ch-system-coreutils df"> + <primary sortas="b-df">df</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dir"> + <term><command>dir</command></term> + <listitem> + <para>Lists the contents of each given directory (the same as + the <command>ls</command> command)</para> + <indexterm zone="ch-system-coreutils dir"> + <primary sortas="b-dir">dir</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dircolors"> + <term><command>dircolors</command></term> + <listitem> + <para>Outputs commands to set the <envar>LS_COLOR</envar> + environment variable to change the color scheme used by + <command>ls</command></para> + <indexterm zone="ch-system-coreutils dircolors"> + <primary sortas="b-dircolors">dircolors</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dirname"> + <term><command>dirname</command></term> + <listitem> + <para>Strips the non-directory suffix from a file name</para> + <indexterm zone="ch-system-coreutils dirname"> + <primary sortas="b-dirname">dirname</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="du"> + <term><command>du</command></term> + <listitem> + <para>Reports the amount of disk space used by the current directory, + by each of the given directories (including all subdirectories) or by + each of the given files</para> + <indexterm zone="ch-system-coreutils du"> + <primary sortas="b-du">du</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="echo"> + <term><command>echo</command></term> + <listitem> + <para>Displays the given strings</para> + <indexterm zone="ch-system-coreutils echo"> + <primary sortas="b-echo">echo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="env"> + <term><command>env</command></term> + <listitem> + <para>Runs a command in a modified environment</para> + <indexterm zone="ch-system-coreutils env"> + <primary sortas="b-env">env</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="expand"> + <term><command>expand</command></term> + <listitem> + <para>Converts tabs to spaces</para> + <indexterm zone="ch-system-coreutils expand"> + <primary sortas="b-expand">expand</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="expr"> + <term><command>expr</command></term> + <listitem> + <para>Evaluates expressions</para> + <indexterm zone="ch-system-coreutils expr"> + <primary sortas="b-expr">expr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="factor"> + <term><command>factor</command></term> + <listitem> + <para>Prints the prime factors of all specified integer numbers</para> + <indexterm zone="ch-system-coreutils factor"> + <primary sortas="b-factor">factor</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="false"> + <term><command>false</command></term> + <listitem> + <para>Does nothing, unsuccessfully; it always exits with a status code + indicating failure</para> + <indexterm zone="ch-system-coreutils false"> + <primary sortas="b-false">false</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fmt"> + <term><command>fmt</command></term> + <listitem> + <para>Reformats the paragraphs in the given files</para> + <indexterm zone="ch-system-coreutils fmt"> + <primary sortas="b-fmt">fmt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fold"> + <term><command>fold</command></term> + <listitem> + <para>Wraps the lines in the given files</para> + <indexterm zone="ch-system-coreutils fold"> + <primary sortas="b-fold">fold</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="groups"> + <term><command>groups</command></term> + <listitem> + <para>Reports a user's group memberships</para> + <indexterm zone="ch-system-coreutils groups"> + <primary sortas="b-groups">groups</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="head"> + <term><command>head</command></term> + <listitem> + <para>Prints the first ten lines (or the given number of lines) + of each given file</para> + <indexterm zone="ch-system-coreutils head"> + <primary sortas="b-head">head</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="hostid"> + <term><command>hostid</command></term> + <listitem> + <para>Reports the numeric identifier (in hexadecimal) of the host</para> + <indexterm zone="ch-system-coreutils hostid"> + <primary sortas="b-hostid">hostid</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="hostname"> + <term><command>hostname</command></term> + <listitem> + <para>Reports or sets the name of the host</para> + <indexterm zone="ch-system-coreutils hostname"> + <primary sortas="b-hostname">hostname</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="id"> + <term><command>id</command></term> + <listitem> + <para>Reports the effective user ID, group ID, and group memberships + of the current user or specified user</para> + <indexterm zone="ch-system-coreutils id"> + <primary sortas="b-id">id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="install"> + <term><command>install</command> </term> + <listitem> + <para>Copies files while setting their permission modes and, if + possible, their owner and group</para> + <indexterm zone="ch-system-coreutils install"> + <primary sortas="b-install">install</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="join"> + <term><command>join</command></term> + <listitem> + <para>Joins the lines that have identical join fields from two + separate files</para> + <indexterm zone="ch-system-coreutils join"> + <primary sortas="b-join">join</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="link"> + <term><command>link</command></term> + <listitem> + <para>Creates a hard link with the given name to a file</para> + <indexterm zone="ch-system-coreutils link"> + <primary sortas="b-link">link</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ln"> + <term><command>ln</command></term> + <listitem> + <para>Makes hard links or soft (symbolic) links between files</para> + <indexterm zone="ch-system-coreutils ln"> + <primary sortas="b-ln">ln</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="logname"> + <term><command>logname</command></term> + <listitem> + <para>Reports the current user's login name</para> + <indexterm zone="ch-system-coreutils logname"> + <primary sortas="b-logname">logname</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ls"> + <term><command>ls</command></term> + <listitem> + <para>Lists the contents of each given directory</para> + <indexterm zone="ch-system-coreutils ls"> + <primary sortas="b-ls">ls</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="md5sum"> + <term><command>md5sum</command></term> + <listitem> + <para>Reports or checks Message Digest 5 (MD5) checksums</para> + <indexterm zone="ch-system-coreutils md5sum"> + <primary sortas="b-md5sum">md5sum</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkdir"> + <term><command>mkdir</command></term> + <listitem> + <para>Creates directories with the given names</para> + <indexterm zone="ch-system-coreutils mkdir"> + <primary sortas="b-mkdir">mkdir</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfifo"> + <term><command>mkfifo</command></term> + <listitem> + <para>Creates First-In, First-Outs (FIFOs), a <quote>named + pipe</quote> in UNIX parlance, with the given names</para> + <indexterm zone="ch-system-coreutils mkfifo"> + <primary sortas="b-mkfifo">mkfifo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mknod"> + <term><command>mknod</command></term> + <listitem> + <para>Creates device nodes with the given names; a device node is a + character special file, a block special file, or a FIFO</para> + <indexterm zone="ch-system-coreutils mknod"> + <primary sortas="b-mknod">mknod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mv"> + <term><command>mv</command></term> + <listitem> + <para>Moves or renames files or directories</para> + <indexterm zone="ch-system-coreutils mv"> + <primary sortas="b-mv">mv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nice"> + <term><command>nice</command></term> + <listitem> + <para>Runs a program with modified scheduling priority</para> + <indexterm zone="ch-system-coreutils nice"> + <primary sortas="b-nice">nice</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nl"> + <term><command>nl</command></term> + <listitem> + <para>Numbers the lines from the given files</para> + <indexterm zone="ch-system-coreutils nl"> + <primary sortas="b-nl">nl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nohup"> + <term><command>nohup</command></term> + <listitem> + <para>Runs a command immune to hangups, with its output redirected to + a log file</para> + <indexterm zone="ch-system-coreutils nohup"> + <primary sortas="b-nohup">nohup</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="od"> + <term><command>od</command></term> + <listitem> + <para>Dumps files in octal and other formats</para> + <indexterm zone="ch-system-coreutils od"> + <primary sortas="b-od">od</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="paste"> + <term><command>paste</command></term> + <listitem> + <para>Merges the given files, joining sequentially corresponding lines + side by side, separated by tab characters</para> + <indexterm zone="ch-system-coreutils paste"> + <primary sortas="b-paste">paste</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pathchk"> + <term><command>pathchk</command></term> + <listitem> + <para>Checks if file names are valid or portable</para> + <indexterm zone="ch-system-coreutils pathchk"> + <primary sortas="b-pathchk">pathchk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pinky"> + <term><command>pinky</command></term> + <listitem> + <para>Is a lightweight finger client; it reports some information + about the given users</para> + <indexterm zone="ch-system-coreutils pinky"> + <primary sortas="b-pinky">pinky</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pr"> + <term><command>pr</command></term> + <listitem> + <para>Paginates and columnates files for printing</para> + <indexterm zone="ch-system-coreutils pr"> + <primary sortas="b-pr">pr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="printenv"> + <term><command>printenv</command></term> + <listitem> + <para>Prints the environment</para> + <indexterm zone="ch-system-coreutils printenv"> + <primary sortas="b-printenv">printenv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="printf"> + <term><command>printf</command></term> + <listitem> + <para>Prints the given arguments according to the given format, much + like the C printf function</para> + <indexterm zone="ch-system-coreutils printf"> + <primary sortas="b-printf">printf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ptx"> + <term><command>ptx</command></term> + <listitem> + <para>Produces a permuted index from the contents of the given files, + with each keyword in its context</para> + <indexterm zone="ch-system-coreutils ptx"> + <primary sortas="b-ptx">ptx</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pwd"> + <term><command>pwd</command></term> + <listitem> + <para>Reports the name of the current working directory</para> + <indexterm zone="ch-system-coreutils pwd"> + <primary sortas="b-pwd">pwd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="readlink"> + <term><command>readlink</command></term> + <listitem> + <para>Reports the value of the given symbolic link</para> + <indexterm zone="ch-system-coreutils readlink"> + <primary sortas="b-readlink">readlink</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rm"> + <term><command>rm</command></term> + <listitem> + <para>Removes files or directories</para> + <indexterm zone="ch-system-coreutils rm"> + <primary sortas="b-rm">rm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rmdir"> + <term><command>rmdir</command></term> + <listitem> + <para>Removes directories if they are empty</para> + <indexterm zone="ch-system-coreutils rmdir"> + <primary sortas="b-rmdir">rmdir</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="seq"> + <term><command>seq</command></term> + <listitem> + <para>Prints a sequence of numbers within a given range and with a + given increment</para> + <indexterm zone="ch-system-coreutils seq"> + <primary sortas="b-seq">seq</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sha1sum"> + <term><command>sha1sum</command></term> + <listitem> + <para>Prints or checks 160-bit Secure Hash Algorithm 1 (SHA1) + checksums</para> + <indexterm zone="ch-system-coreutils sha1sum"> + <primary sortas="b-sha1sum">sha1sum</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="shred"> + <term><command>shred</command></term> + <listitem> + <para>Overwrites the given files repeatedly with complex patterns, + making it difficult to recover the data</para> + <indexterm zone="ch-system-coreutils shred"> + <primary sortas="b-shred">shred</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sleep"> + <term><command>sleep</command></term> + <listitem> + <para>Pauses for the given amount of time</para> + <indexterm zone="ch-system-coreutils sleep"> + <primary sortas="b-sleep">sleep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sort"> + <term><command>sort</command></term> + <listitem> + <para>Sorts the lines from the given files</para> + <indexterm zone="ch-system-coreutils sort"> + <primary sortas="b-sort">sort</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="split"> + <term><command>split</command></term> + <listitem> + <para>Splits the given file into pieces, by size or by number of + lines</para> + <indexterm zone="ch-system-coreutils split"> + <primary sortas="b-split">split</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="stat"> + <term><command>stat</command></term> + <listitem> + <para>Displays file or filesystem status</para> + <indexterm zone="ch-system-coreutils stat"> + <primary sortas="b-stat">stat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="stty"> + <term><command>stty</command></term> + <listitem> + <para>Sets or reports terminal line settings</para> + <indexterm zone="ch-system-coreutils stty"> + <primary sortas="b-stty">stty</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sum"> + <term><command>sum</command></term> + <listitem> + <para>Prints checksum and block counts for each given file</para> + <indexterm zone="ch-system-coreutils sum"> + <primary sortas="b-sum">sum</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sync"> + <term><command>sync</command></term> + <listitem> + <para>Flushes file system buffers; it forces changed blocks to disk + and updates the super block</para> + <indexterm zone="ch-system-coreutils sync"> + <primary sortas="b-sync">sync</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tac"> + <term><command>tac</command></term> + <listitem> + <para>Concatenates the given files in reverse</para> + <indexterm zone="ch-system-coreutils tac"> + <primary sortas="b-tac">tac</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tail"> + <term><command>tail</command></term> + <listitem> + <para>Prints the last ten lines (or the given number of lines) of each + given file</para> + <indexterm zone="ch-system-coreutils tail"> + <primary sortas="b-tail">tail</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tee"> + <term><command>tee</command></term> + <listitem> + <para>Reads from standard input while writing both to standard output + and to the given files</para> + <indexterm zone="ch-system-coreutils tee"> + <primary sortas="b-tee">tee</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="test"> + <term><command>test</command></term> + <listitem> + <para>Compares values and checks file types</para> + <indexterm zone="ch-system-coreutils test"> + <primary sortas="b-test">test</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="touch"> + <term><command>touch</command></term> + <listitem> + <para>Changes file timestamps, setting the access and modification + times of the given files to the current time; files that do not exist + are created with zero length</para> + <indexterm zone="ch-system-coreutils touch"> + <primary sortas="b-touch">touch</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tr"> + <term><command>tr</command></term> + <listitem> + <para>Translates, squeezes, and deletes the given characters from + standard input</para> + <indexterm zone="ch-system-coreutils tr"> + <primary sortas="b-tr">tr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="true"> + <term><command>true</command></term> + <listitem> + <para>Does nothing, successfully; it always exits with a status code + indicating success</para> + <indexterm zone="ch-system-coreutils true"> + <primary sortas="b-true">true</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tsort"> + <term><command>tsort</command></term> + <listitem> + <para>Performs a topological sort; it writes a completely ordered list + according to the partial ordering in a given file</para> + <indexterm zone="ch-system-coreutils tsort"> + <primary sortas="b-tsort">tsort</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tty"> + <term><command>tty</command></term> + <listitem> + <para>Reports the file name of the terminal connected to standard + input</para> + <indexterm zone="ch-system-coreutils tty"> + <primary sortas="b-tty">tty</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="uname"> + <term><command>uname</command></term> + <listitem> + <para>Reports system information</para> + <indexterm zone="ch-system-coreutils uname"> + <primary sortas="b-uname">uname</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="unexpand"> + <term><command>unexpand</command></term> + <listitem> + <para>Converts spaces to tabs</para> + <indexterm zone="ch-system-coreutils unexpand"> + <primary sortas="b-unexpand">unexpand</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="uniq"> + <term><command>uniq</command></term> + <listitem> + <para>Discards all but one of successive identical lines</para> + <indexterm zone="ch-system-coreutils uniq"> + <primary sortas="b-uniq">uniq</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="unlink"> + <term><command>unlink</command></term> + <listitem> + <para>Removes the given file</para> + <indexterm zone="ch-system-coreutils unlink"> + <primary sortas="b-unlink">unlink</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="users"> + <term><command>users</command></term> + <listitem> + <para>Reports the names of the users currently logged on</para> + <indexterm zone="ch-system-coreutils users"> + <primary sortas="b-users">users</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vdir"> + <term><command>vdir</command></term> + <listitem> + <para>Is the same as <command>ls -l</command></para> + <indexterm zone="ch-system-coreutils vdir"> + <primary sortas="b-vdir">vdir</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="wc"> + <term><command>wc</command></term> + <listitem> + <para>Reports the number of lines, words, and bytes for each given + file, as well as a total line when more than one file is given</para> + <indexterm zone="ch-system-coreutils wc"> + <primary sortas="b-wc">wc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="who"> + <term><command>who</command></term> + <listitem> + <para>Reports who is logged on</para> + <indexterm zone="ch-system-coreutils who"> + <primary sortas="b-who">who</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="whoami"> + <term><command>whoami</command></term> + <listitem> + <para>Reports the user name associated with the current effective + user ID</para> + <indexterm zone="ch-system-coreutils whoami"> + <primary sortas="b-whoami">whoami</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="yes"> + <term><command>yes</command></term> + <listitem> + <para>Repeatedly outputs <quote>y</quote> or a given string until + killed</para> + <indexterm zone="ch-system-coreutils yes"> + <primary sortas="b-yes">yes</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml new file mode 100644 index 000000000..0cfc7596f --- /dev/null +++ b/chapter06/createfiles.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-createfiles"> + <?dbhtml filename="createfiles.html"?> + + <title>Creating Essential Files and Symlinks</title> + + <indexterm zone="ch-system-createfiles"> + <primary sortas="e-/etc/passwd">/etc/passwd</primary> + </indexterm> + + <indexterm zone="ch-system-createfiles"> + <primary sortas="e-/etc/group">/etc/group</primary> + </indexterm> + + <indexterm zone="ch-system-createfiles"> + <primary sortas="e-/var/run/utmp">/var/run/utmp</primary> + </indexterm> + + <indexterm zone="ch-system-createfiles"> + <primary sortas="e-/var/log/btmp">/var/log/btmp</primary> + </indexterm> + + <indexterm zone="ch-system-createfiles"> + <primary sortas="e-/var/log/lastlog">/var/log/lastlog</primary> + </indexterm> + + <indexterm zone="ch-system-createfiles"> + <primary sortas="e-/var/log/wtmp">/var/log/wtmp</primary> + </indexterm> + + <para>Some programs use hard-wired paths to programs which do not exist yet. In + order to satisfy these programs, create a number of symbolic links which will be + replaced by real files throughout the course of this chapter after the software + has been installed.</para> + +<screen><userinput>ln -sv /tools/bin/{bash,cat,grep,pwd,stty} /bin +ln -sv /tools/bin/perl /usr/bin +ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib +ln -sv bash /bin/sh</userinput></screen> + + <para>A proper Linux system maintains a list of the mounted file systems in + the file <filename>/etc/mtab</filename>. Normally, this file would be + created when we mount a new file system. Since we will not be mounting any + file systems inside our chroot environment, create an empty file for + utilities that expect the presence of <filename>/etc/mtab</filename>:</para> + +<screen><userinput>touch /etc/mtab</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><userinput>cat > /etc/passwd << "EOF" +<literal>root:x:0:0:root:/root:/bin/bash</literal> +EOF</userinput></screen> + + <para>The actual password for <systemitem class="username">root</systemitem> + (the <quote>x</quote> used here is just a placeholder) will be set later.</para> + + <para>Create the <filename>/etc/group</filename> file by running the following + command:</para> + +<screen><userinput>cat > /etc/group << "EOF" +<literal>root:x:0: +bin:x:1: +sys:x:2: +kmem:x:3: +tty:x:4: +tape: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:</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 this + chapter, and in part by common convention employed by a number of existing + Linux distributions. The Linux Standard Base (LSB, available at <ulink + url="http://www.linuxbase.org"/>) recommends only 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>To remove the <quote>I have no name!</quote> prompt, start a new + shell. Since a full Glibc was installed in <xref + linkend="chapter-temporary-tools"/> and 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 /tools/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 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/run/utmp /var/log/{btmp,lastlog,wtmp} +chgrp -v utmp /var/run/utmp /var/log/lastlog +chmod -v 664 /var/run/utmp /var/log/lastlog</userinput></screen> + + <para>The <filename>/var/run/utmp</filename> file records the users + that are currently logged in. 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/btmp</filename> file + records the bad login attempts.</para> + +</sect1> diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml new file mode 100644 index 000000000..20e0e6f1d --- /dev/null +++ b/chapter06/creatingdirs.xml @@ -0,0 +1,69 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-creatingdirs"> + <?dbhtml filename="creatingdirs.html"?> + + <title>Creating Directories</title> + + <para>It is time to create some 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,home,lib,mnt,opt} +mkdir -pv /{media/{floppy,cdrom},sbin,srv,var} +install -dv -m 0750 /root +install -dv -m 1777 /tmp /var/tmp +mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} +mkdir -pv /usr/{,local/}share/{doc,info,locale,man} +mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo} +mkdir -pv /usr/{,local/}share/man/man{1..8} +for dir in /usr /usr/local; do + ln -sv share/{man,doc,info} $dir +done +mkdir -v /var/{lock,log,mail,run,spool} +mkdir -pv /var/{opt,cache,lib/{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="http://www.pathname.com/fhs/"/>). In addition to + the FHS, we create compatibility symlinks for the <filename + class="directory">man</filename>, <filename + class="directory">doc</filename>, and <filename + class="directory">info</filename> directories since many packages still try + to install their documentation into <filename + class="directory">/usr/<directory></filename> or <filename + class="directory">/usr/local/<directory></filename> as opposed to + <filename class="directory">/usr/share/<directory></filename> or + <filename class="directory">/usr/local/share/<directory></filename>. + The FHS also stipulates the existence of <filename + class="directory">/usr/local/games</filename> and <filename + class="directory">/usr/share/games</filename>. The FHS is not precise as to + the structure of the <filename class="directory">/usr/local/share</filename> + subdirectory, so we create only the directories that are needed. However, + feel free to create these directories if you prefer to conform more strictly + to the FHS.</para> + + </sect2> + +</sect1> diff --git a/chapter06/db.xml b/chapter06/db.xml new file mode 100644 index 000000000..367f85e65 --- /dev/null +++ b/chapter06/db.xml @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-db" role="wrap"> + <?dbhtml filename="db.html"?> + + <title>Berkeley DB-&db-version;</title> + + <indexterm zone="ch-system-db"> + <primary sortas="a-Berkeley-DB">Berkeley DB</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Berkeley DB package contains programs and utilities used by many + other applications for database related functions.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&db-ch6-sbu;</seg> + <seg>&db-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + <tip> + <title>Other Installation Possibilities</title> + + <para>There are instructions to build this package in the BLFS book if you + need to build the RPC server or additional language bindings. The + additional language bindings will require additional packages to be + installed. See <ulink url="&blfs-root;view/svn/server/databases.html#db"/> + for suggested installation instructions.</para> + + <para>Also, GDBM <emphasis>could</emphasis> be used in place of Berkeley + DB to satisfy Man-DB. However, since Berkeley DB is considered a core part + of the LFS build, it will not be listed as a dependency for any package in + the BLFS book. Likewise, many hours go into testing LFS with Berkeley DB + installed, not with GDBM. If you fully understand the risks versus + benefits of using GDBM and wish to use it anyway, see the BLFS + instructions located at <ulink + url="&blfs-root;view/svn/general/gdbm.html"/></para> + + </tip> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Berkeley DB</title> + + <para>Prepare Berkeley DB for compilation:</para> + +<screen><userinput>cd build_unix && +../dist/configure --prefix=/usr --enable-compat185 --enable-cxx</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--enable-compat185</parameter></term> + <listitem> + <para>This option enables building Berkeley DB 1.85 compatibility + API.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--enable-cxx</parameter></term> + <listitem> + <para>This option enables building C++ API libraries.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>It is not possible to test the package meaningfully, because + that would involve building TCL bindings. TCL bindings cannot be + built properly now because TCL is linked against Glibc in + <filename class="directory">/tools</filename>, not against Glibc in + <filename class="directory">/usr</filename>.</para> + + <para>Install the package:</para> + +<screen><userinput>make docdir=/usr/share/doc/db-&db-version; install</userinput></screen> + + <variablelist> + <title>The meaning of the make parameter:</title> + + <varlistentry> + <term><parameter>docdir=...</parameter></term> + <listitem> + <para>This variable specifies the correct place for the + documentation.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Fix the ownerships of the installed files:</para> + +<screen><userinput>chown -v root:root /usr/bin/db_* \ + /usr/lib/libdb* /usr/include/db* && +chown -Rv root:root /usr/share/doc/db-&db-version;</userinput></screen> + + </sect2> + + <sect2 id="contents-db" role="content"> + <title>Contents of Berkeley DB</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>db_archive, db_checkpoint, db_deadlock, db_dump, db_hotbackup, + db_load, db_printlog, db_recover, db_stat, db_upgrade, and db_verify</seg> + <seg>libdb.{so,ar}and libdb_cxx.r{o,ar}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="db_archive"> + <term><command>db_archive</command></term> + <listitem> + <para>Prints the pathnames of log files that are no longer in use</para> + <indexterm zone="ch-system-db db_archive"> + <primary sortas="b-db_archive">db_archive</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_checkpoint"> + <term><command>db_checkpoint</command></term> + <listitem> + <para>A daemon used to monitor and checkpoint database logs</para> + <indexterm zone="ch-system-db db_checkpoint"> + <primary sortas="b-db_checkpoint">db_checkpoint</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_deadlock"> + <term><command>db_deadlock</command></term> + <listitem> + <para>A daemon used to abort lock requests when deadlocks are + detected</para> + <indexterm zone="ch-system-db db_deadlock"> + <primary sortas="b-db_deadlock">db_deadlock</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_dump"> + <term><command>db_dump</command></term> + <listitem> + <para>Converts database files to a plain-text file format readable + by <command>db_load</command></para> + <indexterm zone="ch-system-db db_dump"> + <primary sortas="b-db_dump">db_dump</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_hotbackup"> + <term><command>db_hotbackup</command></term> + <listitem> + <para>Creates <quote>hot backup</quote> or <quote>hot failover</quote> + snapshots of Berkeley DB databases</para> + <indexterm zone="ch-system-db db_hotbackup"> + <primary sortas="b-db_hotbackup">db_hotbackup</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_load"> + <term><command>db_load</command></term> + <listitem> + <para>Is used to create database files from plain-text files</para> + <indexterm zone="ch-system-db db_load"> + <primary sortas="b-db_load">db_load</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_printlog"> + <term><command>db_printlog</command></term> + <listitem> + <para>Converts database log files to human readable text</para> + <indexterm zone="ch-system-db db_printlog"> + <primary sortas="b-db_printlog">db_printlog</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_recover"> + <term><command>db_recover</command></term> + <listitem> + <para>Is used to restore a database to a consistent state after a + failure</para> + <indexterm zone="ch-system-db db_recover"> + <primary sortas="b-db_recover">db_recover</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_stat"> + <term><command>db_stat</command></term> + <listitem> + <para>Displays statistics for Berkeley databases</para> + <indexterm zone="ch-system-db db_stat"> + <primary sortas="b-db_stat">db_stat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_upgrade"> + <term><command>db_upgrade</command></term> + <listitem> + <para>Is used to upgrade database files to a newer version of + Berkeley DB</para> + <indexterm zone="ch-system-db db_upgrade"> + <primary sortas="b-db_upgrade">db_upgrade</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="db_verify"> + <term><command>db_verify</command></term> + <listitem> + <para>Is used to run consistency checks on database files</para> + <indexterm zone="ch-system-db db_verify"> + <primary sortas="b-db_verify">db_verify</primary> + </indexterm> + </listitem> + </varlistentry> + + + <varlistentry id="libdb"> + <term><filename class="libraryfile">libdb.{so,a}</filename></term> + <listitem> + <para>Contains functions to manipulate database files from C + programs</para> + <indexterm zone="ch-system-db libdb"> + <primary sortas="c-libdb">libdb</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libdb_cxx"> + <term><filename class="libraryfile">libdb_cxx.{so,a}</filename></term> + <listitem> + <para>Contains functions to manipulate database files from C++ + programs</para> + <indexterm zone="ch-system-db libdb_cxx"> + <primary sortas="c-libdb_cxx">libdb_cxx</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/diffutils.xml b/chapter06/diffutils.xml new file mode 100644 index 000000000..855c7d418 --- /dev/null +++ b/chapter06/diffutils.xml @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-diffutils" role="wrap"> + <?dbhtml filename="diffutils.html"?> + + <title>Diffutils-&diffutils-version;</title> + + <indexterm zone="ch-system-diffutils"> + <primary sortas="a-Diffutils">Diffutils</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Diffutils package contains programs that show the differences + between files or directories.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&diffutils-ch6-sbu;</seg> + <seg>&diffutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Diffutils</title> + + <para>POSIX requires the <command>diff</command> command to treat whitespace + characters according to the current locale. The following patch fixes the + non-compliance issue:</para> + +<screen><userinput>patch -Np1 -i ../&diffutils-i18n-patch;</userinput></screen> + + <para>The above patch will cause the Diffutils build system to attempt to + rebuild the <filename>diff.1</filename> man page using the unavailable + program <command>help2man</command>. The result is an unreadable man page for + <command>diff</command>. We can avoid this by updating the timestamp on + the file <filename>man/diff.1</filename>:</para> + +<screen><userinput>touch man/diff.1</userinput></screen> + + <para>Prepare Diffutils for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-diffutils" role="content"> + <title>Contents of Diffutils</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>cmp, diff, diff3, and sdiff</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="cmp"> + <term><command>cmp</command></term> + <listitem> + <para>Compares two files and reports whether or in which bytes they + differ</para> + <indexterm zone="ch-system-diffutils cmp"> + <primary sortas="b-cmp">cmp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="diff"> + <term><command>diff</command></term> + <listitem> + <para>Compares two files or directories and reports which lines in + the files differ</para> + <indexterm zone="ch-system-diffutils diff"> + <primary sortas="b-diff">diff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="diff3"> + <term><command>diff3</command></term> + <listitem> + <para>Compares three files line by line</para> + <indexterm zone="ch-system-diffutils diff3"> + <primary sortas="b-diff3">diff3</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sdiff"> + <term><command>sdiff</command></term> + <listitem> + <para>Merges two files and interactively outputs the results</para> + <indexterm zone="ch-system-diffutils sdiff"> + <primary sortas="b-sdiff">sdiff</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml new file mode 100644 index 000000000..7d27eefb5 --- /dev/null +++ b/chapter06/e2fsprogs.xml @@ -0,0 +1,470 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-e2fsprogs" role="wrap"> + <?dbhtml filename="e2fsprogs.html"?> + + <title>E2fsprogs-&e2fsprogs-version;</title> + + <indexterm zone="ch-system-e2fsprogs"> + <primary sortas="a-E2fsprogs">E2fsprogs</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The E2fsprogs package contains the utilities for handling the + <systemitem class="filesystem">ext2</systemitem> file system. It also + supports the <systemitem class="filesystem">ext3</systemitem> journaling + file system.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&e2fsprogs-ch6-sbu;</seg> + <seg>&e2fsprogs-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of E2fsprogs</title> + + <para>It is recommended that E2fsprogs be built in a subdirectory of + the source tree: </para> + +<screen><userinput>mkdir -v build +cd build</userinput></screen> + + <para>Prepare E2fsprogs for compilation:</para> + +<screen><userinput>../configure --prefix=/usr --with-root-prefix="" \ + --enable-elf-shlibs --disable-evms</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--with-root-prefix=""</parameter></term> + <listitem> + <para>Certain programs (such as the <command>e2fsck</command> + program) are considered essential programs. When, for example, + <filename class="directory">/usr</filename> is not mounted, these + programs still need to be available. They belong in directories + like <filename class="directory">/lib</filename> and <filename + class="directory">/sbin</filename>. If this option is not passed + to E2fsprogs' configure, the programs are installed into the + <filename class="directory">/usr</filename> directory.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--enable-elf-shlibs</parameter></term> + <listitem> + <para>This creates the shared libraries which some programs + in this package use.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-evms</parameter></term> + <listitem> + <para>This disables the building of the Enterprise Volume + Management System (EVMS) plugin. This plugin is not up-to-date with + the latest EVMS internal interfaces and EVMS is not installed as part + of a base LFS system, so the plugin is not required. See the EVMS + website at <ulink url="http://evms.sourceforge.net/"/> for more + information regarding EVMS.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the binaries and documentation:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Install the shared libraries:</para> + +<screen><userinput>make install-libs</userinput></screen> + + </sect2> + + <sect2 id="contents-e2fsprogs" role="content"> + <title>Contents of E2fsprogs</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>badblocks, blkid, chattr, compile_et, debugfs, dumpe2fs, e2fsck, + e2image, e2label, filefrag, findfs, fsck, fsck.ext2, fsck.ext3, logsave, lsattr, + mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, mklost+found, resize2fs, + tune2fs, and uuidgen.</seg> + <seg>libblkid.{a,so}, libcom_err.{a,so}, libe2p.{a,so}, + libext2fs.{a,so}, libss.{a,so}, and libuuid.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="badblocks"> + <term><command>badblocks</command></term> + <listitem> + <para>Searches a device (usually a disk partition) for bad + blocks</para> + <indexterm zone="ch-system-e2fsprogs badblocks"> + <primary sortas="b-badblocks">badblocks</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="blkid"> + <term><command>blkid</command></term> + <listitem> + <para>A command line utility to locate and print block device + attributes</para> + <indexterm zone="ch-system-e2fsprogs blkid"> + <primary sortas="b-blkid">blkid</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chattr"> + <term><command>chattr</command></term> + <listitem> + <para>Changes the attributes of files on an <systemitem + class="filesystem">ext2</systemitem> file system; it also + changes <systemitem class="filesystem">ext3</systemitem> + file systems, the journaling version of <systemitem + class="filesystem">ext2</systemitem> file systems</para> + <indexterm zone="ch-system-e2fsprogs chattr"> + <primary sortas="b-chattr">chattr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="compile_et"> + <term><command>compile_et</command></term> + <listitem> + <para>An error table compiler; it converts a table of error-code + names and messages into a C source file suitable for use with the + <filename class="libraryfile">com_err</filename> library</para> + <indexterm zone="ch-system-e2fsprogs compile_et"> + <primary sortas="b-compile_et">compile_et</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="debugfs"> + <term><command>debugfs</command></term> + <listitem> + <para>A file system debugger; it can be used to examine and change + the state of an <systemitem class="filesystem">ext2</systemitem> + file system</para> + <indexterm zone="ch-system-e2fsprogs debugfs"> + <primary sortas="b-debugfs">debugfs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dumpe2fs"> + <term><command>dumpe2fs</command></term> + <listitem> + <para>Prints the super block and blocks group information for the + file system present on a given device</para> + <indexterm zone="ch-system-e2fsprogs dumpe2fs"> + <primary sortas="b-dumpe2fs">dumpe2fs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="e2fsck"> + <term><command>e2fsck</command></term> + <listitem> + <para>Is used to check, and optionally repair <systemitem + class="filesystem">ext2</systemitem> file systems and <systemitem + class="filesystem">ext3</systemitem> file systems</para> + <indexterm zone="ch-system-e2fsprogs e2fsck"> + <primary sortas="b-e2fsck">e2fsck</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="e2image"> + <term><command>e2image</command></term> + <listitem> + <para>Is used to save critical <systemitem + class="filesystem">ext2</systemitem> file system data to a file</para> + <indexterm zone="ch-system-e2fsprogs e2image"> + <primary sortas="b-e2image">e2image</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="e2label"> + <term><command>e2label</command></term> + <listitem> + <para>Displays or changes the file system label on the <systemitem + class="filesystem">ext2</systemitem> file system present on a given + device</para> + <indexterm zone="ch-system-e2fsprogs e2label"> + <primary sortas="b-e2label">e2label</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="filefrag"> + <term><command>filefrag</command></term> + <listitem> + <para>Reports on how badly fragmented a particular file might be</para> + <indexterm zone="ch-system-e2fsprogs filefrag"> + <primary sortas="b-filefrag">filefrag</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="findfs"> + <term><command>findfs</command></term> + <listitem> + <para>Finds a file system by label or Universally Unique Identifier + (UUID)</para> + <indexterm zone="ch-system-e2fsprogs findfs"> + <primary sortas="b-findfs">findfs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fsck"> + <term><command>fsck</command></term> + <listitem> + <para>Is used to check, and optionally repair, file systems</para> + <indexterm zone="ch-system-e2fsprogs fsck"> + <primary sortas="b-fsck">fsck</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fsck.ext2"> + <term><command>fsck.ext2</command></term> + <listitem> + <para>By default checks <systemitem class="filesystem">ext2</systemitem> + file systems</para> + <indexterm zone="ch-system-e2fsprogs fsck.ext2"> + <primary sortas="b-fsck.ext2">fsck.ext2</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fsck.ext3"> + <term><command>fsck.ext3</command></term> + <listitem> + <para>By default checks <systemitem class="filesystem">ext3</systemitem> + file systems</para> + <indexterm zone="ch-system-e2fsprogs fsck.ext3"> + <primary sortas="b-fsck.ext3">fsck.ext3</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="logsave"> + <term><command>logsave</command></term> + <listitem> + <para>Saves the output of a command in a log file</para> + <indexterm zone="ch-system-e2fsprogs logsave"> + <primary sortas="b-logsave">logsave</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lsattr"> + <term><command>lsattr</command></term> + <listitem> + <para>Lists the attributes of files on a second extended file + system</para> + <indexterm zone="ch-system-e2fsprogs lsattr"> + <primary sortas="b-lsattr">lsattr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mk_cmds"> + <term><command>mk_cmds</command></term> + <listitem> + <para>Converts a table of command names and help messages into a C + source file suitable for use with the <filename + class="libraryfile">libss</filename> subsystem library</para> + <indexterm zone="ch-system-e2fsprogs mk_cmds"> + <primary sortas="b-mk_cmds">mk_cmds</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mke2fs"> + <term><command>mke2fs</command></term> + <listitem> + <para>Creates an <systemitem class="filesystem">ext2</systemitem> + or <systemitem class="filesystem">ext3</systemitem> file system on + the given device</para> + <indexterm zone="ch-system-e2fsprogs mke2fs"> + <primary sortas="b-mke2fs">mke2fs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfs.ext2"> + <term><command>mkfs.ext2</command></term> + <listitem> + <para>By default creates <systemitem class="filesystem">ext2</systemitem> + file systems</para> + <indexterm zone="ch-system-e2fsprogs mkfs.ext2"> + <primary sortas="b-mkfs.ext2">mkfs.ext2</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfs.ext3"> + <term><command>mkfs.ext3</command></term> + <listitem> + <para>By default creates <systemitem class="filesystem">ext3</systemitem> + file systems</para> + <indexterm zone="ch-system-e2fsprogs mkfs.ext3"> + <primary sortas="b-mkfs.ext3">mkfs.ext3</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mklost-found"> + <term><command>mklost+found</command></term> + <listitem> + <para>Used to create a <filename class="directory">lost+found</filename> + directory on an <systemitem class="filesystem">ext2</systemitem> file + system; it pre-allocates disk blocks to this directory to lighten the + task of <command>e2fsck</command></para> + <indexterm zone="ch-system-e2fsprogs mklost-found"> + <primary sortas="b-mklost+found">mklost+found</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="resize2fs"> + <term><command>resize2fs</command></term> + <listitem> + <para>Can be used to enlarge or shrink an <systemitem + class="filesystem">ext2</systemitem> file system</para> + <indexterm zone="ch-system-e2fsprogs resize2fs"> + <primary sortas="b-resize2fs">resize2fs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tune2fs"> + <term><command>tune2fs</command></term> + <listitem> + <para>Adjusts tunable file system parameters on an <systemitem + class="filesystem">ext2</systemitem> file system</para> + <indexterm zone="ch-system-e2fsprogs tune2fs"> + <primary sortas="b-tune2fs">tune2fs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="uuidgen"> + <term><command>uuidgen</command></term> + <listitem> + <para>Creates new UUIDs. Each new UUID can reasonably be considered + unique among all UUIDs created, on the local system and on other + systems, in the past and in the future</para> + <indexterm zone="ch-system-e2fsprogs uuidgen"> + <primary sortas="b-uuidgen">uuidgen</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libblkid"> + <term><filename class="libraryfile">libblkid</filename></term> + <listitem> + <para>Contains routines for device identification and token + extraction</para> + <indexterm zone="ch-system-e2fsprogs libblkid"> + <primary sortas="c-libblkid">libblkid</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libcom_err"> + <term><filename class="libraryfile">libcom_err</filename></term> + <listitem> + <para>The common error display routine</para> + <indexterm zone="ch-system-e2fsprogs libcom_err"> + <primary sortas="c-libcom_err">libcom_err</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libe2p"> + <term><filename class="libraryfile">libe2p</filename></term> + <listitem> + <para>Used by <command>dumpe2fs</command>, <command>chattr</command>, + and <command>lsattr</command></para> + <indexterm zone="ch-system-e2fsprogs libe2p"> + <primary sortas="c-libe2p">libe2p</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libext2fs"> + <term><filename class="libraryfile">libext2fs</filename></term> + <listitem> + <para>Contains routines to enable user-level programs to manipulate an + <systemitem class="filesystem">ext2</systemitem> file system</para> + <indexterm zone="ch-system-e2fsprogs libext2fs"> + <primary sortas="c-libext2fs">libext2fs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libss"> + <term><filename class="libraryfile">libss</filename></term> + <listitem> + <para>Used by <command>debugfs</command></para> + <indexterm zone="ch-system-e2fsprogs libss"> + <primary sortas="c-libss">libss</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libuuid"> + <term><filename class="libraryfile">libuuid</filename></term> + <listitem> + <para>Contains routines for generating unique identifiers for objects + that may be accessible beyond the local system</para> + <indexterm zone="ch-system-e2fsprogs libuuid"> + <primary sortas="c-libuuid">libuuid</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/file.xml b/chapter06/file.xml new file mode 100644 index 000000000..2d7abff5c --- /dev/null +++ b/chapter06/file.xml @@ -0,0 +1,100 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-file" role="wrap"> + <?dbhtml filename="file.html"?> + + <title>File-&file-version;</title> + + <indexterm zone="ch-system-file"> + <primary sortas="a-File">File</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The File package contains a utility for determining the type of a given + file or files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&file-ch6-sbu;</seg> + <seg>&file-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of File</title> + + <para>Prepare File for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-file" role="content"> + <title>Contents of File</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed library</segtitle> + + <seglistitem> + <seg>file</seg> + <seg>libmagic.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="file"> + <term><command>file</command></term> + <listitem> + <para>Tries to classify each given file; it does this by performing + several tests—file system tests, magic number tests, and language + tests</para> + <indexterm zone="ch-system-file file"> + <primary sortas="b-file">file</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libmagic"> + <term><filename class="libraryfile">libmagic</filename></term> + <listitem> + <para>Contains routines for magic number recognition, used by the + <command>file</command> program</para> + <indexterm zone="ch-system-file libmagic"> + <primary sortas="c-libmagic">libmagic</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/findutils.xml b/chapter06/findutils.xml new file mode 100644 index 000000000..d2a89174d --- /dev/null +++ b/chapter06/findutils.xml @@ -0,0 +1,180 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-findutils" role="wrap"> + <?dbhtml filename="findutils.html"?> + + <title>Findutils-&findutils-version;</title> + + <indexterm zone="ch-system-findutils"> + <primary sortas="a-Findutils">Findutils</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Findutils package contains programs to find files. These programs + are provided to recursively search through a directory tree and to + create, maintain, and search a database (often faster than the recursive + find, but unreliable if the database has not been recently updated).</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&findutils-ch6-sbu;</seg> + <seg>&findutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Findutils</title> + + <para>Prepare Findutils for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --libexecdir=/usr/lib/findutils \ + --localstatedir=/var/lib/locate</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--localstatedir</parameter></term> + <listitem> + <para>This option changes the location of the <command>locate</command> + database to be in <filename class="directory">/var/lib/locate</filename>, + which is FHS-compliant.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Some of the scripts in the LFS-Bootscripts package depend on + <command>find</command>. As <filename class="directory">/usr</filename> + may not be available during the early stages of booting, this program + needs to be on the root partition. The <command>updatedb</command> + script also needs to correct an explicit path.</para> + +<screen><userinput>mv -v /usr/bin/find /bin</userinput> +sed -i -e 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb</screen> + + </sect2> + + <sect2 id="contents-findutils" role="content"> + <title>Contents of Findutils</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>bigram, code, find, frcode, locate, updatedb, and xargs</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="bigram"> + <term><command>bigram</command></term> + <listitem> + <para>Was formerly used to produce <command>locate</command> + databases</para> + <indexterm zone="ch-system-findutils bigram"> + <primary sortas="b-bigram">bigram</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="code"> + <term><command>code</command></term> + <listitem> + <para>Was formerly used to produce <command>locate</command> + databases; it is the ancestor of <command>frcode</command>.</para> + <indexterm zone="ch-system-findutils code"> + <primary sortas="b-code">code</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="find"> + <term><command>find</command></term> + <listitem> + <para>Searches given directory trees for files matching the specified + criteria</para> + <indexterm zone="ch-system-findutils find"> + <primary sortas="b-find">find</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="frcode"> + <term><command>frcode</command></term> + <listitem> + <para>Is called by <command>updatedb</command> to compress the list + of file names; it uses front-compression, reducing the database size + by a factor of four to five.</para> + <indexterm zone="ch-system-findutils frcode"> + <primary sortas="b-frcode">frcode</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="locate"> + <term><command>locate</command></term> + <listitem> + <para>Searches through a database of file names and reports the names + that contain a given string or match a given pattern</para> + <indexterm zone="ch-system-findutils locate"> + <primary sortas="b-locate">locate</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="updatedb"> + <term><command>updatedb</command></term> + <listitem> + <para>Updates the <command>locate</command> database; it scans the + entire file system (including other file systems that are currently + mounted, unless told not to) and puts every file name it finds into + the database</para> + <indexterm zone="ch-system-findutils updatedb"> + <primary sortas="b-updatedb">updatedb</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="xargs"> + <term><command>xargs</command></term> + <listitem> + <para>Can be used to apply a given command to a list of files</para> + <indexterm zone="ch-system-findutils xargs"> + <primary sortas="b-xargs">xargs</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/flex.xml b/chapter06/flex.xml new file mode 100644 index 000000000..96b414897 --- /dev/null +++ b/chapter06/flex.xml @@ -0,0 +1,133 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-flex" role="wrap"> + <?dbhtml filename="flex.html"?> + + <title>Flex-&flex-version;</title> + + <indexterm zone="ch-system-flex"> + <primary sortas="a-Flex">Flex</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Flex package contains a utility for generating programs that + recognize patterns in text.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&flex-ch6-sbu;</seg> + <seg>&flex-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Flex</title> + + <para>Prepare Flex for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>There are some packages that expect to find the + <filename class="libraryfile">lex</filename> library in <filename + class="directory">/usr/lib</filename>. Create a symlink to account for + this:</para> + +<screen><userinput>ln -sv libfl.a /usr/lib/libl.a</userinput></screen> + + <para>A few programs do not know about <command>flex</command> yet and + try to run its predecessor, <command>lex</command>. To support those + programs, create a wrapper script named <filename>lex</filename> that + calls <filename>flex</filename> in <command>lex</command> emulation + mode:</para> + +<screen><userinput>cat > /usr/bin/lex << "EOF" +<literal>#!/bin/sh +# Begin /usr/bin/lex + +exec /usr/bin/flex -l "$@" + +# End /usr/bin/lex</literal> +EOF +chmod -v 755 /usr/bin/lex</userinput></screen> + + </sect2> + + <sect2 id="contents-flex" role="content"> + <title>Contents of Flex</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed library</segtitle> + + <seglistitem> + <seg>flex and lex</seg> + <seg>libfl.a</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="flex"> + <term><command>flex</command></term> + <listitem> + <para>A tool for generating programs that recognize patterns in text; + it allows for the versatility to specify the rules for pattern-finding, + eradicating the need to develop a specialized program</para> + <indexterm zone="ch-system-flex flex"> + <primary sortas="b-flex">flex</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lex"> + <term><command>lex</command></term> + <listitem> + <para>A script that runs <command>flex</command> in + <command>lex</command> emulation mode</para> + <indexterm zone="ch-system-flex lex"> + <primary sortas="b-lex">lex</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libfl.a"> + <term><filename class="libraryfile">libfl.a</filename></term> + <listitem> + <para>The <filename class="libraryfile">flex</filename> library</para> + <indexterm zone="ch-system-flex libfl.a"> + <primary sortas="c-libfl.a">libfl.a</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/gawk.xml b/chapter06/gawk.xml new file mode 100644 index 000000000..5c157bc03 --- /dev/null +++ b/chapter06/gawk.xml @@ -0,0 +1,172 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-gawk" role="wrap"> + <?dbhtml filename="gawk.html"?> + + <title>Gawk-&gawk-version;</title> + + <indexterm zone="ch-system-gawk"> + <primary sortas="a-Gawk">Gawk</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Gawk package contains programs for manipulating text files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gawk-ch6-sbu;</seg> + <seg>&gawk-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gawk</title> + + <para>Under some circumstances, Gawk-&gawk-version; attempts to free a + chunk of memory that was not allocated. This bug is fixed by the following + patch:</para> + +<screen><userinput>patch -Np1 -i ../&gawk-segfault-patch;</userinput></screen> + + <para>Prepare Gawk for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --libexecdir=/usr/lib</userinput></screen> + + <para>Due to a bug in the <command>configure</command> script, Gawk fails + to detect certain aspects of locale support in Glibc. This bug leads to, + e.g., Gettext testsuite failures. Work around this issue by appending the + missing macro definitions to <filename>config.h</filename>:</para> + +<screen><userinput>cat >>config.h <<"EOF" +<literal>#define HAVE_LANGINFO_CODESET 1 +#define HAVE_LC_MESSAGES 1</literal> +EOF</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-gawk" role="content"> + <title>Contents of Gawk</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>awk (link to gawk), gawk, gawk-&gawk-version;, grcat, igawk, pgawk, + pgawk-&gawk-version;, and pwcat</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="awk"> + <term><command>awk</command></term> + <listitem> + <para>A link to <command>gawk</command></para> + <indexterm zone="ch-system-gawk awk"> + <primary sortas="b-awk">awk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gawk"> + <term><command>gawk</command></term> + <listitem> + <para>A program for manipulating text files; it is the GNU + implementation of <command>awk</command></para> + <indexterm zone="ch-system-gawk gawk"> + <primary sortas="b-gawk">gawk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gawk-version"> + <term><command>gawk-&gawk-version;</command></term> + <listitem> + <para>A hard link to <command>gawk</command></para> + <indexterm zone="ch-system-gawk gawk-version"> + <primary sortas="b-gawk-&gawk-version;">gawk-&gawk-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grcat"> + <term><command>grcat</command></term> + <listitem> + <para>Dumps the group database <filename>/etc/group</filename></para> + <indexterm zone="ch-system-gawk grcat"> + <primary sortas="b-grcat">grcat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="igawk"> + <term><command>igawk</command></term> + <listitem> + <para>Gives <command>gawk</command> the ability to include files</para> + <indexterm zone="ch-system-gawk igawk"> + <primary sortas="b-igawk">igawk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pgawk"> + <term><command>pgawk</command></term> + <listitem> + <para>The profiling version of <command>gawk</command></para> + <indexterm zone="ch-system-gawk pgawk"> + <primary sortas="b-pgawk">pgawk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pgawk-version"> + <term><command>pgawk-&gawk-version;</command></term> + <listitem> + <para>Hard link to <command>pgawk</command></para> + <indexterm zone="ch-system-gawk pgawk-version"> + <primary sortas="b-pgawk-&gawk-version;">pgawk-&gawk-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pwcat"> + <term><command>pwcat</command></term> + <listitem> + <para>Dumps the password database <filename>/etc/passwd</filename></para> + <indexterm zone="ch-system-gawk pwcat"> + <primary sortas="b-pwcat">pwcat</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml new file mode 100644 index 000000000..41754d817 --- /dev/null +++ b/chapter06/gcc.xml @@ -0,0 +1,349 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-gcc" role="wrap"> + <?dbhtml filename="gcc.html"?> + + <title>GCC-&gcc-version;</title> + + <indexterm zone="ch-system-gcc"> + <primary sortas="a-GCC">GCC</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The GCC package contains the GNU compiler collection, which includes + the C and C++ compilers.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gcc-ch6-sbu;</seg> + <seg>&gcc-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of GCC</title> + + <para>Apply a <command>sed</command> substitution that will suppress the + installation of <filename class="libraryfile">libiberty.a</filename>. The + version of <filename class="libraryfile">libiberty.a</filename> provided by + Binutils will be used instead:</para> + +<screen><userinput>sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in</userinput></screen> + + <para>The bootstrap build performed in <xref linkend="ch-tools-gcc-pass1"/> + built GCC with the <option>-fomit-frame-pointer</option> compiler flag. + Non-bootstrap builds omit this flag by default, so apply the following + <command>sed</command> to use it in order to ensure consistent compiler + builds.</para> + +<screen><userinput>sed -i 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in</userinput></screen> + + <para>The <command>fixincludes</command> script is known to occasionally + erroneously attempt to "fix" the system headers installed so far. As + the headers installed by GCC-&gcc-version; and Glibc-&glibc-version; are known + to not require fixing, issue the following command to prevent the + <command>fixincludes</command> script from running:</para> + +<screen><userinput>sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in</userinput></screen> + + <para>GCC provides a <command>gccbug</command> script which detects at + compile time whether mktemp is present, and hardcodes the result in a test. + This will cause the script to fall back to using less random names for + temporary files. We will be installing mktemp later, so the following sed + will simulate its presence.</para> + +<screen><userinput>sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in</userinput></screen> + + <para>The GCC documentation recommends building GCC outside of the source + directory in a dedicated build directory:</para> + +<screen><userinput>mkdir -v ../gcc-build +cd ../gcc-build</userinput></screen> + + <para>Prepare GCC for compilation:</para> + +<screen><userinput>../gcc-&gcc-version;/configure --prefix=/usr \ + --libexecdir=/usr/lib --enable-shared \ + --enable-threads=posix --enable-__cxa_atexit \ + --enable-clocale=gnu --enable-languages=c,c++</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <important> + <para>In this section, the test suite for GCC is considered + critical. Do not skip it under any circumstance.</para> + </important> + + <para>Test the results, but do not stop at errors:</para> + +<screen><userinput>make -k check</userinput></screen> + + <para>To receive a summary of the test suite results, run:</para> + +<screen><userinput>../gcc-&gcc-version;/contrib/test_summary</userinput></screen> + + <para>For only the summaries, pipe the output through + <userinput>grep -A7 Summ</userinput>.</para> + + <para>Results can be compared with those located at <ulink + url="&test-results;"/>.</para> + + <para>A few unexpected failures cannot always be avoided. The GCC developers + are usually aware of these issues, but have not resolved them yet. In + particular, the <filename class="libraryfile">libmudflap</filename> tests + are known be particularly problematic as a result of a bug in GCC + (<ulink url="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20003"/>). + Unless the test results are vastly different from those at the above URL, + it is safe to continue.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Some packages expect the C preprocessor to be installed in the + <filename class="directory">/lib</filename> directory. + To support those packages, create this symlink:</para> + +<screen><userinput>ln -sv ../usr/bin/cpp /lib</userinput></screen> + + <para>Many packages use the name <command>cc</command> to call the C + compiler. To satisfy those packages, create a symlink:</para> + +<screen><userinput>ln -sv gcc /usr/bin/cc</userinput></screen> + + <para>Now that our final toolchain is in place, it is important to again ensure + that compiling and linking will work as expected. We do this by performing + the same sanity checks as we did earlier in the chapter:</para> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='a'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='b'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='c'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='d'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='e'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='f'])"/> + +<screen><computeroutput>/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crt1.o succeeded +/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crti.o succeeded +/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crtn.o succeeded</computeroutput></screen> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='g'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='h'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='i'])"/> + +<screen><computeroutput>SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/local/lib") +SEARCH_DIR("/lib") +SEARCH_DIR("/usr/lib");</computeroutput></screen> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='j'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='k'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='l'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='m'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='n'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='o'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='p'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='q'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='r'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='s'])"/> + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="readjusting.xml" + xpointer="xpointer(//*[@os='t'])"/> + + </sect2> + + <sect2 id="contents-gcc" role="content"> + <title>Contents of GCC</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov</seg> + <seg>libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.{a,so}, and + libsupc++.a</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="cc"> + <term><command>cc</command></term> + <listitem> + <para>The C compiler</para> + <indexterm zone="ch-system-gcc cc"> + <primary sortas="b-cc">cc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cpp"> + <term><command>cpp</command></term> + <listitem> + <para>The C preprocessor; it is used by the compiler to expand the + #include, #define, and similar statements in the source files</para> + <indexterm zone="ch-system-gcc cpp"> + <primary sortas="b-cpp">cpp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="c"> + <term><command>c++</command></term> + <listitem> + <para>The C++ compiler</para> + <indexterm zone="ch-system-gcc c"> + <primary sortas="b-c++">c++</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="g"> + <term><command>g++</command></term> + <listitem> + <para>The C++ compiler</para> + <indexterm zone="ch-system-gcc g"> + <primary sortas="b-g++">g++</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gcc"> + <term><command>gcc</command></term> + <listitem> + <para>The C compiler</para> + <indexterm zone="ch-system-gcc gcc"> + <primary sortas="b-gcc">gcc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gccbug"> + <term><command>gccbug</command></term> + <listitem> + <para>A shell script used to help create useful bug reports</para> + <indexterm zone="ch-system-gcc gccbug"> + <primary sortas="b-gccbug">gccbug</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gcov"> + <term><command>gcov</command></term> + <listitem> + <para>A coverage testing tool; it is used to analyze programs to + determine where optimizations will have the most effect</para> + <indexterm zone="ch-system-gcc gcov"> + <primary sortas="b-gcov">gcov</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libgcc"> + <term><filename class="libraryfile">libgcc</filename></term> + <listitem> + <para>Contains run-time support for <command>gcc</command></para> + <indexterm zone="ch-system-gcc libgcc"> + <primary sortas="c-libgcc*">libgcc*</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libstdc"> + <term><filename class="libraryfile">libstdc++</filename></term> + <listitem> + <para>The standard C++ library</para> + <indexterm zone="ch-system-gcc libstdc"> + <primary sortas="c-libstdc++">libstdc++</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libsupc"> + <term><filename class="libraryfile">libsupc++</filename></term> + <listitem> + <para>Provides supporting routines for the C++ programming + language</para> + <indexterm zone="ch-system-gcc libsupc"> + <primary sortas="c-libsupc++">libsupc++</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/gettext.xml b/chapter06/gettext.xml new file mode 100644 index 000000000..f1e53723e --- /dev/null +++ b/chapter06/gettext.xml @@ -0,0 +1,394 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-gettext" role="wrap"> + <?dbhtml filename="gettext.html"?> + + <title>Gettext-&gettext-version;</title> + + <indexterm zone="ch-system-gettext"> + <primary sortas="a-Gettext">Gettext</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Gettext package contains utilities for internationalization and + localization. These allow programs to be compiled with NLS (Native Language + Support), enabling them to output messages in the user's native + language.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gettext-ch6-sbu;</seg> + <seg>&gettext-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gettext</title> + + <para>Prepare Gettext for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>. + This takes a very long time, around 5 SBUs.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-gettext" role="content"> + <title>Contents of Gettext</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>autopoint, config.charset, config.rpath, envsubst, gettext, gettext.sh, + gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, + msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, + ngettext, and xgettext</seg> + <seg>libasprintf.{a,so}, libgettextlib.so, libgettextpo.{a,so}, and + libgettextsrc.so</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="autopoint"> + <term><command>autopoint</command></term> + <listitem> + <para>Copies standard Gettext infrastructure files into a source + package</para> + <indexterm zone="ch-system-gettext autopoint"> + <primary sortas="b-autopoint">autopoint</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="config.charset"> + <term><command>config.charset</command></term> + <listitem> + <para>Outputs a system-dependent table of character encoding + aliases</para> + <indexterm zone="ch-system-gettext config.charset"> + <primary sortas="b-config.charset">config.charset</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="config.rpath"> + <term><command>config.rpath</command></term> + <listitem> + <para>Outputs a system-dependent set of variables, describing how + to set the runtime search path of shared libraries in an + executable</para> + <indexterm zone="ch-system-gettext config.rpath"> + <primary sortas="b-config.rpath">config.rpath</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="envsubst"> + <term><command>envsubst</command></term> + <listitem> + <para>Substitutes environment variables in shell format strings</para> + <indexterm zone="ch-system-gettext envsubst"> + <primary sortas="b-envsubst">envsubst</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gettext"> + <term><command>gettext</command></term> + <listitem> + <para>Translates a natural language message into the user's language + by looking up the translation in a message catalog</para> + <indexterm zone="ch-system-gettext gettext"> + <primary sortas="b-gettext">gettext</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gettext.sh"> + <term><command>gettext.sh</command></term> + <listitem> + <para>Primarily serves as a shell function library for gettext</para> + <indexterm zone="ch-system-gettext gettext.sh"> + <primary sortas="b-gettext.sh">gettext.sh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gettextize"> + <term><command>gettextize</command></term> + <listitem> + <para>Copies all standard Gettext files into the given top-level + directory of a package to begin internationalizing it</para> + <indexterm zone="ch-system-gettext gettextize"> + <primary sortas="b-gettextize">gettextize</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="hostname-gettext"> + <term><command>hostname</command></term> + <listitem> + <para>Displays a network hostname in various forms</para> + <indexterm zone="ch-system-gettext hostname-gettext"> + <primary sortas="b-hostname-gettext">hostname</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgattrib"> + <term><command>msgattrib</command></term> + <listitem> + <para>Filters the messages of a translation catalog according to their + attributes and manipulates the attributes</para> + <indexterm zone="ch-system-gettext msgattrib"> + <primary sortas="b-msgattrib">msgattrib</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgcat"> + <term><command>msgcat</command></term> + <listitem> + <para>Concatenates and merges the given + <filename class="extension">.po</filename> files</para> + <indexterm zone="ch-system-gettext msgcat"> + <primary sortas="b-msgcat">msgcat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgcmp"> + <term><command>msgcmp</command></term> + <listitem> + <para>Compares two <filename class="extension">.po</filename> + files to check that both contain the same set of msgid strings</para> + <indexterm zone="ch-system-gettext msgcmp"> + <primary sortas="b-msgcmp">msgcmp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgcomm"> + <term><command>msgcomm</command></term> + <listitem> + <para>Finds the messages that are common to to the given + <filename class="extension">.po</filename> files</para> + <indexterm zone="ch-system-gettext msgcomm"> + <primary sortas="b-msgcomm">msgcomm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgconv"> + <term><command>msgconv</command></term> + <listitem> + <para>Converts a translation catalog to a different character + encoding</para> + <indexterm zone="ch-system-gettext msgconv"> + <primary sortas="b-msgconv">msgconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgen"> + <term><command>msgen</command></term> + <listitem> + <para>Creates an English translation catalog</para> + <indexterm zone="ch-system-gettext msgen"> + <primary sortas="b-msgen">msgen</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgexec"> + <term><command>msgexec</command></term> + <listitem> + <para>Applies a command to all translations of a translation + catalog</para> + <indexterm zone="ch-system-gettext msgexec"> + <primary sortas="b-msgexec">msgexec</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgfilter"> + <term><command>msgfilter</command></term> + <listitem> + <para>Applies a filter to all translations of a translation + catalog</para> + <indexterm zone="ch-system-gettext msgfilter"> + <primary sortas="b-msgfilter">msgfilter</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgfmt"> + <term><command>msgfmt</command></term> + <listitem> + <para>Generates a binary message catalog from a translation + catalog</para> + <indexterm zone="ch-system-gettext msgfmt"> + <primary sortas="b-msgfmt">msgfmt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msggrep"> + <term><command>msggrep</command></term> + <listitem> + <para>Extracts all messages of a translation catalog that match a + given pattern or belong to some given source files</para> + <indexterm zone="ch-system-gettext msggrep"> + <primary sortas="b-msggrep">msggrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msginit"> + <term><command>msginit</command></term> + <listitem> + <para>Creates a new <filename class="extension">.po</filename> file, + initializing the meta information with values from the user's + environment</para> + <indexterm zone="ch-system-gettext msginit"> + <primary sortas="b-msginit">msginit</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgmerge"> + <term><command>msgmerge</command></term> + <listitem> + <para>Combines two raw translations into a single file</para> + <indexterm zone="ch-system-gettext msgmerge"> + <primary sortas="b-msgmerge">msgmerge</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msgunfmt"> + <term><command>msgunfmt</command></term> + <listitem> + <para>Decompiles a binary message catalog into raw translation + text</para> + <indexterm zone="ch-system-gettext msgunfmt"> + <primary sortas="b-msgunfmt">msgunfmt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="msguniq"> + <term><command>msguniq</command></term> + <listitem> + <para>Unifies duplicate translations in a translation catalog</para> + <indexterm zone="ch-system-gettext msguniq"> + <primary sortas="b-msguniq">msguniq</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ngettext"> + <term><command>ngettext</command></term> + <listitem> + <para>Displays native language translations of a textual message whose + grammatical form depends on a number</para> + <indexterm zone="ch-system-gettext ngettext"> + <primary sortas="b-ngettext">ngettext</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="xgettext"> + <term><command>xgettext</command></term> + <listitem> + <para>Extracts the translatable message lines from the given source + files to make the first translation template</para> + <indexterm zone="ch-system-gettext xgettext"> + <primary sortas="b-xgettext">xgettext</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libasprintf"> + <term><filename class="libraryfile">libasprintf</filename></term> + <listitem> + <para>defines the <emphasis>autosprintf</emphasis> class, which makes + C formatted output routines usable in C++ programs, for use with the + <emphasis><string></emphasis> strings and the + <emphasis><iostream></emphasis> streams</para> + <indexterm zone="ch-system-gettext libasprintf"> + <primary sortas="c-libasprintf">libasprintf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libgettextlib"> + <term><filename class="libraryfile">libgettextlib</filename></term> + <listitem> + <para>a private library containing common routines used by the + various Gettext programs; these are not intended for general use</para> + <indexterm zone="ch-system-gettext libgettextlib"> + <primary sortas="c-libgettextlib">libgettextlib</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libgettextpo"> + <term><filename class="libraryfile">libgettextpo</filename></term> + <listitem> + <para>Used to write specialized programs that process + <filename class="extension">.po</filename> files; this library is + used when the standard applications shipped with Gettext (such as + <command>msgcomm</command>, <command>msgcmp</command>, + <command>msgattrib</command>, and <command>msgen</command>) will + not suffice</para> + <indexterm zone="ch-system-gettext libgettextpo"> + <primary sortas="c-libgettextpo">libgettextpo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libgettextsrc"> + <term><filename class="libraryfile">libgettextsrc</filename></term> + <listitem> + <para>A private library containing common routines used by the + various Gettext programs; these are not intended for general use</para> + <indexterm zone="ch-system-gettext libgettextsrc"> + <primary sortas="c-libgettextsrc">libgettextsrc</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml new file mode 100644 index 000000000..eb39a12e9 --- /dev/null +++ b/chapter06/glibc.xml @@ -0,0 +1,854 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-glibc" role="wrap"> + <?dbhtml filename="glibc.html"?> + + <title>Glibc-&glibc-version;</title> + + <indexterm zone="ch-system-glibc"> + <primary sortas="a-Glibc">Glibc</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Glibc package contains the main C library. This library provides + the basic routines for allocating memory, searching directories, opening and + closing files, reading and writing files, string handling, pattern matching, + arithmetic, and so on.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&glibc-ch6-sbu;</seg> + <seg>&glibc-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Glibc</title> + + <note> + <para>Some packages outside of LFS suggest installing GNU libiconv in + order to translate data from one encoding to another. The project's + home page (<ulink url="http://www.gnu.org/software/libiconv/"/>) says + <quote>This library provides an <function>iconv()</function> + implementation, for use on systems which don't have one, or whose + implementation cannot convert from/to Unicode.</quote> Glibc provides + an <function>iconv()</function> implementation and can convert from/to + Unicode, therefore libiconv is not required on an LFS system.</para> + </note> + + <para>The Glibc build system is self-contained and will install + perfectly, even though the compiler specs file and linker are still + pointing at <filename class="directory">/tools</filename>. The specs + and linker cannot be adjusted before the Glibc install because the + Glibc autoconf tests would give false results and defeat the goal + of achieving a clean build.</para> + + <para>The glibc-libidn tarball adds support for internationalized domain + names (IDN) to Glibc. Many programs that support IDN require the full + <filename class="libraryfile">libidn</filename> library (see + <ulink url="&blfs-root;view/svn/general/libidn.html"/>), not this add-on. + Unpack the tarball from within the Glibc source directory:</para> + +<screen><userinput>tar -xf ../glibc-libidn-&glibc-version;.tar.bz2</userinput></screen> + + <para>Apply the following patch to fix build errors in packages that include + <filename class="headerfile">linux/types.h</filename> after <filename + class="headerfile">sys/kd.h</filename>:</para> + +<screen><userinput>patch -Np1 -i ../&glibc-linux_types-patch;</userinput></screen> + + <para>In the vi_VN.TCVN locale, <command>bash</command> enters an infinite loop + at startup. It is unknown whether this is a <command>bash</command> bug or a + Glibc problem. Disable installation of this locale in order to avoid the + problem:</para> + +<screen><userinput>sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED</userinput></screen> + + <para>When running <command>make install</command>, a script called + <filename>test-installation.pl</filename> performs a small sanity test on + our newly installed Glibc. However, because our toolchain still points to + the <filename class="directory">/tools</filename> directory, the sanity + test would be carried out against the wrong Glibc. We can force the script + to check the Glibc we have just installed with the following:</para> + +<screen><userinput>sed -i \ +'s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \ + scripts/test-installation.pl</userinput></screen> + + <para>The Glibc documentation recommends building Glibc outside of the source + directory in a dedicated build directory:</para> + +<screen><userinput>mkdir -v ../glibc-build +cd ../glibc-build</userinput></screen> + + <para>Prepare Glibc for compilation:</para> + +<screen><userinput>../glibc-&glibc-version;/configure --prefix=/usr \ + --disable-profile --enable-add-ons \ + --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc</userinput></screen> + + <variablelist> + <title>The meaning of the new configure options:</title> + + <varlistentry> + <term><parameter>--libexecdir=/usr/lib/glibc</parameter></term> + <listitem> + <para>This changes the location of the <command>pt_chown</command> + program from its default of <filename + class="directory">/usr/libexec</filename> to <filename + class="directory">/usr/lib/glibc</filename>.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <important> + <para>In this section, the test suite for Glibc is considered critical. + Do not skip it under any circumstance.</para> + </important> + + <para>Test the results:</para> + +<screen><userinput>make -k check 2>&1 | tee glibc-check-log +grep Error glibc-check-log</userinput></screen> + + <para>You will probably see an expected (ignored) failure in the + <emphasis>posix/annexc</emphasis> test. In addition the Glibc test suite + is somewhat dependent on the host system. This is a list of the most + common issues:</para> + + <itemizedlist> + <listitem> + <para>The <emphasis>nptl/tst-clock2</emphasis> and + <emphasis>tst-attr3</emphasis> tests sometimes + fail. The reason is not completely understood, but indications + are that a heavy system load can trigger these failures.</para> + </listitem> + <listitem> + <para>The math tests sometimes fail when running on + systems where the CPU is not a relatively new genuine Intel or + authentic AMD processor.</para> + </listitem> + <listitem> + <para>If you have mounted the LFS partition with the + <parameter>noatime</parameter> option, the <emphasis>atime</emphasis> + test will fail. As mentioned in <xref linkend="space-mounting"/>, do not + use the <parameter>noatime</parameter> option while building LFS.</para> + </listitem> + <listitem> + <para>When running on older and slower hardware or on systems under + load, some tests can fail because of test timeouts being exceeded.</para> + </listitem> + </itemizedlist> + + <para>Though it is a harmless message, the install stage of Glibc will + complain about the absence of <filename>/etc/ld.so.conf</filename>. + Prevent this warning with:</para> + +<screen><userinput>touch /etc/ld.so.conf</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>The locales that can make the system respond in a different language + were not installed by the above command. None of the locales are required, + but, if some of them are misssing, testuites of the future packages would + skip important testcases.</para> + + <para>Individual locales can be installed using the + <command>localedef</command> program. E.g., the first + <command>localedef</command> command below combines the + <filename>/usr/share/i18n/locales/de_DE</filename> + charset-independent locale definition with the + <filename>/usr/share/i18n/charmaps/ISO-8859-1.gz</filename> + charmap definition and appends the result to the + <filename>/usr/lib/locale/locale-archive</filename> file. + The following instructions will install the minimum set of + locales necessary for the optimal coverage of tests:</para> + +<screen role="nodump"><userinput>mkdir -pv /usr/lib/locale +localedef -i de_DE -f ISO-8859-1 de_DE +localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro +localedef -i en_HK -f ISO-8859-1 en_HK +localedef -i en_PH -f ISO-8859-1 en_PH +localedef -i en_US -f ISO-8859-1 en_US +localedef -i en_US -f UTF-8 en_US.UTF-8 +localedef -i es_MX -f ISO-8859-1 es_MX +localedef -i fa_IR -f UTF-8 fa_IR +localedef -i fr_FR -f ISO-8859-1 fr_FR +localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro +localedef -i fr_FR -f UTF-8 fr_FR.UTF-8 +localedef -i it_IT -f ISO-8859-1 it_IT +localedef -i ja_JP -f EUC-JP ja_JP</userinput></screen> + + <para>In addition, install the locale for your own country, language and + character set.</para> + + <para>Alternatively, install all locales listed in the + <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file + (it includes every locale listed above and many more) at once with the + following time-consuming command:</para> + +<screen><userinput>make localedata/install-locales</userinput></screen> + + <para>Then use the <command>localedef</command> command to create and + install locales not listed in the + <filename>glibc-&glibc-version;/localedata/SUPPORTED</filename> file + in the unlikely case if you need them.</para> + <!-- The Live CD patches the localedata/SUPPORTED file instead of + running localedef, the results are equivalent --> + + </sect2> + + <sect2 id="conf-glibc" role="configuration"> + <title>Configuring Glibc</title> + + <indexterm zone="conf-glibc"> + <primary sortas="e-/etc/nsswitch.conf">/etc/nsswitch.conf</primary> + </indexterm> + + <indexterm zone="conf-glibc"> + <primary sortas="e-/etc/localtime">/etc/localtime</primary> + </indexterm> + + <para>The <filename>/etc/nsswitch.conf</filename> file needs to be created + because, although Glibc provides defaults when this file is missing or corrupt, + the Glibc defaults do not work well in a networked environment. The time zone + also needs to be configured.</para> + + <para>Create a new file <filename>/etc/nsswitch.conf</filename> by running the + following:</para> + +<screen><userinput>cat > /etc/nsswitch.conf << "EOF" +<literal># Begin /etc/nsswitch.conf + +passwd: files +group: files +shadow: files + +hosts: files dns +networks: files + +protocols: files +services: files +ethers: files +rpc: files + +# End /etc/nsswitch.conf</literal> +EOF</userinput></screen> + + <para>To determine the local time zone, run the following script:</para> + +<screen role="nodump"><userinput>tzselect</userinput></screen> + + <para>After answering a few questions about the location, the script will + output the name of the time zone (e.g., <emphasis>EST5EDT</emphasis> or + <emphasis>Canada/Eastern</emphasis>). Then create the + <filename>/etc/localtime</filename> file by running:</para> + +<screen><userinput>cp -v --remove-destination /usr/share/zoneinfo/<replaceable><xxx></replaceable> \ + /etc/localtime</userinput></screen> + + <para>Replace <replaceable><xxx></replaceable> with the name of the time zone + that <command>tzselect</command> provided (e.g., Canada/Eastern).</para> + + <variablelist> + <title>The meaning of the cp option:</title> + + <varlistentry> + <term><parameter>--remove-destination</parameter></term> + <listitem> + <para>This is needed to force removal of the already existing symbolic + link. The reason for copying the file instead of using a symlink is to + cover the situation where <filename class="directory">/usr</filename> + is on a separate partition. This could be important when booted into + single user mode.</para> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + + <sect2 id="conf-ld" role="configuration"> + <title>Configuring the Dynamic Loader</title> + + <indexterm zone="conf-ld"> + <primary sortas="e-/etc/ld.so.conf">/etc/ld.so.conf</primary> + </indexterm> + + <para>By default, the dynamic loader (<filename + class="libraryfile">/lib/ld-linux.so.2</filename>) searches through + <filename class="directory">/lib</filename> and <filename + class="directory">/usr/lib</filename> for dynamic libraries that are + needed by programs as they are run. However, if there are libraries in + directories other than <filename class="directory">/lib</filename> and + <filename class="directory">/usr/lib</filename>, these need to be added + to the <filename>/etc/ld.so.conf</filename> file in order for the + dynamic loader to find them. Two directories that are commonly known + to contain additional libraries are <filename + class="directory">/usr/local/lib</filename> and <filename + class="directory">/opt/lib</filename>, so add those directories to the + dynamic loader's search path.</para> + + <para>Create a new file <filename>/etc/ld.so.conf</filename> by running the + following:</para> + +<screen><userinput>cat > /etc/ld.so.conf << "EOF" +<literal># Begin /etc/ld.so.conf + +/usr/local/lib +/opt/lib + +# End /etc/ld.so.conf</literal> +EOF</userinput></screen> + + </sect2> + + <sect2 id="contents-glibc" role="content"> + <title>Contents of Glibc</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>catchsegv, gencat, getconf, getent, iconv, iconvconfig, ldconfig, + ldd, lddlibc4, locale, localedef, mtrace, nscd, nscd_nischeck, + pcprofiledump, pt_chown, rpcgen, rpcinfo, sln, sprof, tzselect, xtrace, + zdump, and zic</seg> + <seg>ld.so, libBrokenLocale.{a,so}, libSegFault.so, libanl.{a,so}, + libbsd-compat.a, libc.{a,so}, libcidn.so, libcrypt.{a,so}, libdl.{a,so}, + libg.a, libieee.a, libm.{a,so}, libmcheck.a, libmemusage.so, libnsl.a, + libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, + libnss_nis.so, libnss_nisplus.so, libpcprofile.so, libpthread.{a,so}, + libresolv.{a,so}, librpcsvc.a, librt.{a,so}, libthread_db.so, and + libutil.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="catchsegv"> + <term><command>catchsegv</command></term> + <listitem> + <para>Can be used to create a stack trace when a program + terminates with a segmentation fault</para> + <indexterm zone="ch-system-glibc catchsegv"> + <primary sortas="b-catchsegv">catchsegv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gencat"> + <term><command>gencat</command></term> + <listitem> + <para>Generates message catalogues</para> + <indexterm zone="ch-system-glibc gencat"> + <primary sortas="b-gencat">gencat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="getconf"> + <term><command>getconf</command></term> + <listitem> + <para>Displays the system configuration values for file system + specific variables</para> + <indexterm zone="ch-system-glibc getconf"> + <primary sortas="b-getconf">getconf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="getent"> + <term><command>getent</command></term> + <listitem> + <para>Gets entries from an administrative database</para> + <indexterm zone="ch-system-glibc getent"> + <primary sortas="b-getent">getent</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="iconv"> + <term><command>iconv</command></term> + <listitem> + <para>Performs character set conversion</para> + <indexterm zone="ch-system-glibc iconv"> + <primary sortas="b-iconv">iconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="iconvconfig"> + <term><command>iconvconfig</command></term> + <listitem> + <para>Creates fastloading <command>iconv</command> module configuration + files</para> + <indexterm zone="ch-system-glibc iconvconfig"> + <primary sortas="b-iconvconfig">iconvconfig</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ldconfig"> + <term><command>ldconfig</command></term> + <listitem> + <para>Configures the dynamic linker runtime bindings</para> + <indexterm zone="ch-system-glibc ldconfig"> + <primary sortas="b-ldconfig">ldconfig</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ldd"> + <term><command>ldd</command></term> + <listitem> + <para>Reports which shared libraries are required + by each given program or shared library</para> + <indexterm zone="ch-system-glibc ldd"> + <primary sortas="b-ldd">ldd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lddlibc4"> + <term><command>lddlibc4</command></term> + <listitem> + <para>Assists <command>ldd</command> with object files</para> + <indexterm zone="ch-system-glibc lddlibc4"> + <primary sortas="b-lddlibc4">lddlibc4</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="locale"> + <term><command>locale</command></term> + <listitem> + <para>Prints various information about the current locale</para> + <indexterm zone="ch-system-glibc locale"> + <primary sortas="b-locale">locale</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="localedef"> + <term><command>localedef</command></term> + <listitem> + <para>Compiles locale specifications</para> + <indexterm zone="ch-system-glibc localedef"> + <primary sortas="b-localedef">localedef</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mtrace"> + <term><command>mtrace</command></term> + <listitem> + <para>Reads and interprets a memory trace file and displays a summary + in human-readable format</para> + <indexterm zone="ch-system-glibc mtrace"> + <primary sortas="b-mtrace">mtrace</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nscd"> + <term><command>nscd</command></term> + <listitem> + <para>A daemon that provides a cache for the most common name + service requests</para> + <indexterm zone="ch-system-glibc nscd"> + <primary sortas="b-nscd">nscd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nscd_nischeck"> + <term><command>nscd_nischeck</command></term> + <listitem> + <para>Checks whether or not secure mode is necessary for NIS+ + lookup</para> + <indexterm zone="ch-system-glibc nscd_nischeck"> + <primary sortas="b-nscd_nischeck">nscd_nischeck</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pcprofiledump"> + <term><command>pcprofiledump</command></term> + <listitem> + <para>Dumps information generated by PC profiling</para> + <indexterm zone="ch-system-glibc pcprofiledump"> + <primary sortas="b-pcprofiledump">pcprofiledump</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pt_chown"> + <term><command>pt_chown</command></term> + <listitem> + <para>A helper program for <command>grantpt</command> to set the owner, + group and access permissions of a slave pseudo terminal</para> + <indexterm zone="ch-system-glibc pt_chown"> + <primary sortas="b-pt_chown">pt_chown</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rpcgen"> + <term><command>rpcgen</command></term> + <listitem> + <para>Generates C code to implement the Remote Procecure Call (RPC) + protocol</para> + <indexterm zone="ch-system-glibc rpcgen"> + <primary sortas="b-rpcgen">rpcgen</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rpcinfo"> + <term><command>rpcinfo</command></term> + <listitem> + <para>Makes an RPC call to an RPC server</para> + <indexterm zone="ch-system-glibc rpcinfo"> + <primary sortas="b-rpcinfo">rpcinfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sln"> + <term><command>sln</command></term> + <listitem> + <para>A statically linked <command>ln</command> program</para> + <indexterm zone="ch-system-glibc sln"> + <primary sortas="b-sln">sln</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sprof"> + <term><command>sprof</command></term> + <listitem> + <para>Reads and displays shared object profiling data</para> + <indexterm zone="ch-system-glibc sprof"> + <primary sortas="b-sprof">sprof</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tzselect"> + <term><command>tzselect</command></term> + <listitem> + <para>Asks the user about the location of the system and reports + the corresponding time zone description</para> + <indexterm zone="ch-system-glibc tzselect"> + <primary sortas="b-tzselect">tzselect</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="xtrace"> + <term><command>xtrace</command></term> + <listitem> + <para>Traces the execution of a program by printing the currently + executed function</para> + <indexterm zone="ch-system-glibc xtrace"> + <primary sortas="b-xtrace">xtrace</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zdump"> + <term><command>zdump</command></term> + <listitem> + <para>The time zone dumper</para> + <indexterm zone="ch-system-glibc zdump"> + <primary sortas="b-zdump">zdump</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zic"> + <term><command>zic</command></term> + <listitem> + <para>The time zone compiler</para> + <indexterm zone="ch-system-glibc zic"> + <primary sortas="b-zic">zic</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ld.so"> + <term><filename class="libraryfile">ld.so</filename></term> + <listitem> + <para>The helper program for shared library executables</para> + <indexterm zone="ch-system-glibc ld.so"> + <primary sortas="c-ld.so">ld.so</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libBrokenLocale"> + <term><filename class="libraryfile">libBrokenLocale</filename></term> + <listitem> + <para>Used internally by Glibc as a gross hack to get broken programs + (e.g., some Motif applications) running. See comments in + <filename>glibc-&glibc-version;/locale/broken_cur_max.c</filename> + for more information</para> + <indexterm zone="ch-system-glibc libBrokenLocale"> + <primary sortas="c-libBrokenLocale">libBrokenLocale</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libSegFault"> + <term><filename class="libraryfile">libSegFault</filename></term> + <listitem> + <para>The segmentation fault signal handler, used by + <command>catchsegv</command></para> + <indexterm zone="ch-system-glibc libSegFault"> + <primary sortas="c-libSegFault">libSegFault</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libanl"> + <term><filename class="libraryfile">libanl</filename></term> + <listitem> + <para>An asynchronous name lookup library</para> + <indexterm zone="ch-system-glibc libanl"> + <primary sortas="c-libanl">libanl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libbsd-compat"> + <term><filename class="libraryfile">libbsd-compat</filename></term> + <listitem> + <para>Provides the portability needed in order to run certain Berkey + Software Distribution (BSD) programs under Linux</para> + <indexterm zone="ch-system-glibc libbsd-compat"> + <primary sortas="c-libbsd-compat">libbsd-compat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libc"> + <term><filename class="libraryfile">libc</filename></term> + <listitem> + <para>The main C library</para> + <indexterm zone="ch-system-glibc libc"> + <primary sortas="c-libc">libc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libcidn"> + <term><filename class="libraryfile">libcidn</filename></term> + <listitem> + <para>Used internally by Glibc for handling internationalized domain + names in the <function>getaddrinfo()</function> function</para> + <indexterm zone="ch-system-glibc libcrypt"> + <primary sortas="c-libcrypt">libcrypt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libcrypt"> + <term><filename class="libraryfile">libcrypt</filename></term> + <listitem> + <para>The cryptography library</para> + <indexterm zone="ch-system-glibc libcrypt"> + <primary sortas="c-libcrypt">libcrypt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libdl"> + <term><filename class="libraryfile">libdl</filename></term> + <listitem> + <para>The dynamic linking interface library</para> + <indexterm zone="ch-system-glibc libdl"> + <primary sortas="c-libdl">libdl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libg"> + <term><filename class="libraryfile">libg</filename></term> + <listitem> + <para>Dummy library containing no functions. Previously was a runtime + library for <command>g++</command></para> + <indexterm zone="ch-system-glibc libg"> + <primary sortas="c-libg">libg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libieee"> + <term><filename class="libraryfile">libieee</filename></term> + <listitem> + <para>Linking in this module forces error handling rules for math + functions as defined by the Institute of Electrical and Electronic + Engineers (IEEE). The default is POSIX.1 error handling</para> + <indexterm zone="ch-system-glibc libieee"> + <primary sortas="c-libieee">libieee</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libm"> + <term><filename class="libraryfile">libm</filename></term> + <listitem> + <para>The mathematical library</para> + <indexterm zone="ch-system-glibc libm"> + <primary sortas="c-libm">libm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libmcheck"> + <term><filename class="libraryfile">libmcheck</filename></term> + <listitem> + <para>Turns on memory allocation checking when linked to</para> + <indexterm zone="ch-system-glibc libmcheck"> + <primary sortas="c-libmcheck">libmcheck</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libmemusage"> + <term><filename class="libraryfile">libmemusage</filename></term> + <listitem> + <para>Used by <command>memusage</command> to help collect + information about the memory usage of a program</para> + <indexterm zone="ch-system-glibc libmemusage"> + <primary sortas="c-libmemusage">libmemusage</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libnsl"> + <term><filename class="libraryfile">libnsl</filename></term> + <listitem> + <para>The network services library</para> + <indexterm zone="ch-system-glibc libnsl"> + <primary sortas="c-libnsl">libnsl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libnss"> + <term><filename class="libraryfile">libnss</filename></term> + <listitem> + <para>The Name Service Switch libraries, containing functions for + resolving host names, user names, group names, aliases, services, + protocols, etc.</para> + <indexterm zone="ch-system-glibc libnss"> + <primary sortas="c-libnss">libnss</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libpcprofile"> + <term><filename class="libraryfile">libpcprofile</filename></term> + <listitem> + <para>Contains profiling functions used to track the amount of CPU + time spent in specific source code lines</para> + <indexterm zone="ch-system-glibc libpcprofile"> + <primary sortas="c-libpcprofile">libpcprofile</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libpthread"> + <term><filename class="libraryfile">libpthread</filename></term> + <listitem> + <para>The POSIX threads library</para> + <indexterm zone="ch-system-glibc libpthread"> + <primary sortas="c-libpthread">libpthread</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libresolv"> + <term><filename class="libraryfile">libresolv</filename></term> + <listitem> + <para>Contains functions for creating, sending, and interpreting + packets to the Internet domain name servers</para> + <indexterm zone="ch-system-glibc libresolv"> + <primary sortas="c-libresolv">libresolv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="librpcsvc"> + <term><filename class="libraryfile">librpcsvc</filename></term> + <listitem> + <para>Contains functions providing miscellaneous RPC services</para> + <indexterm zone="ch-system-glibc librpcsvc"> + <primary sortas="c-librpcsvc">librpcsvc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="librt"> + <term><filename class="libraryfile">librt</filename></term> + <listitem> + <para>Contains functions providing most of the interfaces specified + by the POSIX.1b Realtime Extension</para> + <indexterm zone="ch-system-glibc librt"> + <primary sortas="c-librt">librt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libthread_db"> + <term><filename class="libraryfile">libthread_db</filename></term> + <listitem> + <para>Contains functions useful for building debuggers for + multi-threaded programs</para> + <indexterm zone="ch-system-glibc libthread_db"> + <primary sortas="c-libthread_db">libthread_db</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libutil"> + <term><filename class="libraryfile">libutil</filename></term> + <listitem> + <para>Contains code for <quote>standard</quote> functions used in + many different Unix utilities</para> + <indexterm zone="ch-system-glibc libutil"> + <primary sortas="c-libutil">libutil</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/grep.xml b/chapter06/grep.xml new file mode 100644 index 000000000..b92bfcf94 --- /dev/null +++ b/chapter06/grep.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-grep" role="wrap"> + <?dbhtml filename="grep.html"?> + + <title>Grep-&grep-version;</title> + + <indexterm zone="ch-system-grep"> + <primary sortas="a-Grep">Grep</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Grep package contains programs for searching through files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&grep-ch6-sbu;</seg> + <seg>&grep-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Grep</title> + + <para>The current Grep package has many bugs, especially in the support of + multibyte locales. RedHat fixed some of them with the following patch:</para> + +<screen><userinput>patch -Np1 -i ../&grep-fixes-patch;</userinput></screen> + + <para>In order for the tests added by this patch to pass, the permissions for + the test file have to be changed:</para> + +<screen><userinput>chmod +x tests/fmbtest.sh</userinput></screen> + + <para>Prepare Grep for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --bindir=/bin</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-grep" role="content"> + <title>Contents of Grep</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>egrep (link to grep), fgrep (link to grep), and grep</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="egrep"> + <term><command>egrep</command></term> + <listitem> + <para>Prints lines matching an extended regular expression</para> + <indexterm zone="ch-system-grep egrep"> + <primary sortas="b-egrep">egrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fgrep"> + <term><command>fgrep</command></term> + <listitem> + <para>Prints lines matching a list of fixed strings</para> + <indexterm zone="ch-system-grep fgrep"> + <primary sortas="b-fgrep">fgrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grep"> + <term><command>grep</command></term> + <listitem> + <para>Prints lines matching a basic regular expression</para> + <indexterm zone="ch-system-grep grep"> + <primary sortas="b-grep">grep</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/groff.xml b/chapter06/groff.xml new file mode 100644 index 000000000..3887ca4c0 --- /dev/null +++ b/chapter06/groff.xml @@ -0,0 +1,474 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-groff" role="wrap"> + <?dbhtml filename="groff.html"?> + + <title>Groff-&groff-version;</title> + + <indexterm zone="ch-system-groff"> + <primary sortas="a-Groff">Groff</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Groff package contains programs for processing and formatting + text.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&groff-ch6-sbu;</seg> + <seg>&groff-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Groff</title> + + <para>Apply the patch that adds the <quote>ascii8</quote> and + <quote>nippon</quote> devices to Groff:</para> + +<screen><userinput>patch -Np1 -i ../&groff-debian-patch;</userinput></screen> + + <note> + <para>These devices are used by Man-DB when formatting non-English manual + pages that are not in the ISO-8859-1 encoding. Currently, there is no + working patch for Groff-1.19.x that adds this functionality.</para> + <!-- Details: http://bugs.debian.org/196762 --> + </note> + + <para>Many screen fonts don't have Unicode single quotes and dashes in them. + Tell Groff to use the ASCII equivalents instead:</para> + +<screen><userinput>sed -i -e 's/2010/002D/' -e 's/2212/002D/' \ + -e 's/2018/0060/' -e 's/2019/0027/' font/devutf8/R.proto</userinput></screen> + + <para>Groff expects the environment variable <envar>PAGE</envar> to + contain the default paper size. For users in the United States, + <parameter>PAGE=letter</parameter> is appropriate. Elsewhere, + <parameter>PAGE=A4</parameter> may be more suitable. While the default + paper size is configured during compilation, it can be overridden later + by echoing either <quote>A4</quote> or <quote>letter</quote> to the + <filename>/etc/papersize</filename> file.</para> + + <para>Prepare Groff for compilation:</para> + +<screen><userinput>PAGE=<replaceable><paper_size></replaceable> ./configure --prefix=/usr --enable-multibyte</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Some documentation programs, such as <command>xman</command>, + will not work properly without the following symlinks:</para> + +<screen><userinput>ln -sv eqn /usr/bin/geqn +ln -sv tbl /usr/bin/gtbl</userinput></screen> + + </sect2> + + <sect2 id="contents-groff" role="content"> + <title>Contents of Groff</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>addftinfo, afmtodit, eqn, eqn2graph, geqn (link to eqn), grn, + grodvi, groff, groffer, grog, grolbp, grolj4, grops, grotty, gtbl + (link to tbl), hpftodit, indxbib, lkbib, lookbib, mmroff, neqn, + nroff, pfbtops, pic, pic2graph, post-grohtml, pre-grohtml, refer, + soelim, tbl, tfmtodit, and troff</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="addftinfo"> + <term><command>addftinfo</command></term> + <listitem> + <para>Reads a troff font file and adds some additional font-metric + information that is used by the <command>groff</command> system</para> + <indexterm zone="ch-system-groff addftinfo"> + <primary sortas="b-addftinfo">addftinfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="afmtodit"> + <term><command>afmtodit</command></term> + <listitem> + <para>Creates a font file for use with <command>groff</command> and + <command>grops</command></para> + <indexterm zone="ch-system-groff afmtodit"> + <primary sortas="b-afmtodit">afmtodit</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="eqn"> + <term><command>eqn</command></term> + <listitem> + <para>Compiles descriptions of equations embedded within troff + input files into commands that are understood by + <command>troff</command></para> + <indexterm zone="ch-system-groff eqn"> + <primary sortas="b-eqn">eqn</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="eqn2graph"> + <term><command>eqn2graph</command></term> + <listitem> + <para>Converts a troff EQN (equation) into a cropped image</para> + <indexterm zone="ch-system-groff eqn2graph"> + <primary sortas="b-eqn2graph">eqn2graph</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="geqn"> + <term><command>geqn</command></term> + <listitem> + <para>A link to <command>eqn</command></para> + <indexterm zone="ch-system-groff geqn"> + <primary sortas="b-geqn">geqn</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grn"> + <term><command>grn</command></term> + <listitem> + <para>A <command>groff</command> preprocessor for gremlin files</para> + <indexterm zone="ch-system-groff grn"> + <primary sortas="b-grn">grn</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grodvi"> + <term><command>grodvi</command></term> + <listitem> + <para>A driver for <command>groff</command> that produces TeX dvi + format</para> + <indexterm zone="ch-system-groff grodvi"> + <primary sortas="b-grodvi">grodvi</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="groff"> + <term><command>groff</command></term> + <listitem> + <para>A front-end to the groff document formatting system; normally, it + runs the <command>troff</command> program and a post-processor + appropriate for the selected device</para> + <indexterm zone="ch-system-groff groff"> + <primary sortas="b-groff">groff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="groffer"> + <term><command>groffer</command></term> + <listitem> + <para>Displays groff files and man pages on X and tty terminals</para> + <indexterm zone="ch-system-groff groffer"> + <primary sortas="b-groffer">groffer</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grog"> + <term><command>grog</command></term> + <listitem> + <para>Reads files and guesses which of the <command>groff</command> + options <option>-e</option>, <option>-man</option>, <option>-me</option>, + <option>-mm</option>, <option>-ms</option>, <option>-p</option>, + <option>-s</option>, and <option>-t</option> are required for printing + files, and reports the <command>groff</command> command including those + options</para> + <indexterm zone="ch-system-groff grog"> + <primary sortas="b-grog">grog</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grolbp"> + <term><command>grolbp</command></term> + <listitem> + <para>Is a <command>groff</command> driver for Canon CAPSL printers + (LBP-4 and LBP-8 series laser printers)</para> + <indexterm zone="ch-system-groff grolbp"> + <primary sortas="b-grolbp">grolbp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grolj4"> + <term><command>grolj4</command></term> + <listitem> + <para>Is a driver for <command>groff</command> that produces output + in PCL5 format suitable for an HP LaserJet 4 printer</para> + <indexterm zone="ch-system-groff grolj4"> + <primary sortas="b-grolj4">grolj4</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grops"> + <term><command>grops</command></term> + <listitem> + <para>Translates the output of GNU <command>troff</command> to + PostScript</para> + <indexterm zone="ch-system-groff grops"> + <primary sortas="b-grops">grops</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grotty"> + <term><command>grotty</command></term> + <listitem> + <para>Translates the output of GNU <command>troff</command> into + a form suitable for typewriter-like devices</para> + <indexterm zone="ch-system-groff grotty"> + <primary sortas="b-grotty">grotty</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gtbl"> + <term><command>gtbl</command></term> + <listitem> + <para>A link to <command>tbl</command></para> + <indexterm zone="ch-system-groff gtbl"> + <primary sortas="b-gtbl">gtbl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="hpftodit"> + <term><command>hpftodit</command></term> + <listitem> + <para>Creates a font file for use with <command>groff -Tlj4</command> + from an HP-tagged font metric file</para> + <indexterm zone="ch-system-groff hpftodit"> + <primary sortas="b-hpftodit">hpftodit</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="indxbib"> + <term><command>indxbib</command></term> + <listitem> + <para>Creates an inverted index for the bibliographic databases with a + specified file for use with <command>refer</command>, + <command>lookbib</command>, and <command>lkbib</command></para> + <indexterm zone="ch-system-groff indxbib"> + <primary sortas="b-indxbib">indxbib</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lkbib"> + <term><command>lkbib</command></term> + <listitem> + <para>Searches bibliographic databases for references that contain + specified keys and reports any references found</para> + <indexterm zone="ch-system-groff lkbib"> + <primary sortas="b-lkbib">lkbib</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lookbib"> + <term><command>lookbib</command></term> + <listitem> + <para>Prints a prompt on the standard error (unless the standard input + is not a terminal), reads a line containing a set of keywords from the + standard input, searches the bibliographic databases in a specified file + for references containing those keywords, prints any references found + on the standard output, and repeats this process until the end of + input</para> + <indexterm zone="ch-system-groff lookbib"> + <primary sortas="b-lookbib">lookbib</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mmroff"> + <term><command>mmroff</command></term> + <listitem> + <para>A simple preprocessor for <command>groff</command></para> + <indexterm zone="ch-system-groff mmroff"> + <primary sortas="b-mmroff">mmroff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="neqn"> + <term><command>neqn</command></term> + <listitem> + <para>Formats equations for American Standard Code for Information + Interchange (ASCII) output</para> + <indexterm zone="ch-system-groff neqn"> + <primary sortas="b-neqn">neqn</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nroff"> + <term><command>nroff</command></term> + <listitem> + <para>A script that emulates the <command>nroff</command> command + using <command>groff</command></para> + <indexterm zone="ch-system-groff nroff"> + <primary sortas="b-nroff">nroff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pfbtops"> + <term><command>pfbtops</command></term> + <listitem> + <para>Translates a PostScript font in <filename + class="extension">.pfb</filename> format to ASCII</para> + <indexterm zone="ch-system-groff pfbtops"> + <primary sortas="b-pfbtops">pfbtops</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pic"> + <term><command>pic</command></term> + <listitem> + <para>Compiles descriptions of pictures embedded within troff or + TeX input files into commands understood by TeX or + <command>troff</command></para> + <indexterm zone="ch-system-groff pic"> + <primary sortas="b-pic">pic</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pic2graph"> + <term><command>pic2graph</command></term> + <listitem> + <para>Converts a PIC diagram into a cropped image</para> + <indexterm zone="ch-system-groff pic2graph"> + <primary sortas="b-pic2graph">pic2graph</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="post-grohtml"> + <term><command>post-grohtml</command></term> + <listitem> + <para>Translates the output of GNU <command>troff</command> to + HTML</para> + <indexterm zone="ch-system-groff post-grohtml"> + <primary sortas="b-post-grohtml">post-grohtml</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pre-grohtml"> + <term><command>pre-grohtml </command></term> + <listitem> + <para>Translates the output of GNU <command>troff</command> to + HTML</para> + <indexterm zone="ch-system-groff pre-grohtml"> + <primary sortas="b-pre-grohtml">pre-grohtml</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="refer"> + <term><command>refer</command></term> + <listitem> + <para>Copies the contents of a file to the standard output, except + that lines between <emphasis>.[</emphasis> and <emphasis>.]</emphasis> + are interpreted as citations, and lines between <emphasis>.R1</emphasis> + and <emphasis>.R2</emphasis> are interpreted as commands for how + citations are to be processed</para> + <indexterm zone="ch-system-groff refer"> + <primary sortas="b-refer">refer</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="soelim"> + <term><command>soelim</command></term> + <listitem> + <para>Reads files and replaces lines of the form <emphasis>.so + file</emphasis> by the contents of the mentioned + <emphasis>file</emphasis></para> + <indexterm zone="ch-system-groff soelim"> + <primary sortas="b-soelim">soelim</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tbl"> + <term><command>tbl</command></term> + <listitem> + <para>Compiles descriptions of tables embedded within troff input + files into commands that are understood by + <command>troff</command></para> + <indexterm zone="ch-system-groff tbl"> + <primary sortas="b-tbl">tbl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tfmtodit"> + <term><command>tfmtodit</command></term> + <listitem> + <para>Creates a font file for use with <command>groff + -Tdvi</command></para> + <indexterm zone="ch-system-groff tfmtodit"> + <primary sortas="b-tfmtodit">tfmtodit</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="troff"> + <term><command>troff</command></term> + <listitem> + <para>Is highly compatible with Unix <command>troff</command>; it + should usually be invoked using the <command>groff</command> command, + which will also run preprocessors and post-processors in the + appropriate order and with the appropriate options</para> + <indexterm zone="ch-system-groff troff"> + <primary sortas="b-troff">troff</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/grub.xml b/chapter06/grub.xml new file mode 100644 index 000000000..8651c95c8 --- /dev/null +++ b/chapter06/grub.xml @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-grub" role="wrap"> + <?dbhtml filename="grub.html"?> + + <title>GRUB-&grub-version;</title> + + <indexterm zone="ch-system-grub"> + <primary sortas="a-Grub">GRUB</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The GRUB package contains the GRand Unified Bootloader.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&grub-ch6-sbu;</seg> + <seg>&grub-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of GRUB</title> + + <para>This package is known to have issues when its default + optimization flags (including the <parameter>-march</parameter> and + <parameter>-mcpu</parameter> options) are changed. If any environment + variables that override default optimizations have been defined, such + as <envar>CFLAGS</envar> and <envar>CXXFLAGS</envar>, + unset them when building GRUB.</para> + + <para>Prepare GRUB for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install +mkdir -v /boot/grub +cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub</userinput></screen> + + <para>Replace <filename class="directory">i386-pc</filename> with whatever + directory is appropriate for the hardware in use.</para> + + <para>The <filename class="directory">i386-pc</filename> directory + contains a number of <filename>*stage1_5</filename> files, different + ones for different file systems. Review the files available and copy + the appropriate ones to the <filename + class="directory">/boot/grub</filename> directory. Most users will + copy the <filename>e2fs_stage1_5</filename> and/or + <filename>reiserfs_stage1_5</filename> files.</para> + + </sect2> + + <sect2 id="contents-gRUB" role="content"> + <title>Contents of GRUB</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>grub, grub-install, grub-md5-crypt, grub-set-default, + grub-terminfo, and mbchk</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="grub"> + <term><command>grub</command></term> + <listitem> + <para>The Grand Unified Bootloader's command shell</para> + <indexterm zone="ch-system-grub grub"> + <primary sortas="b-grub">grub</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grub-install"> + <term><command>grub-install</command></term> + <listitem> + <para>Installs GRUB on the given device</para> + <indexterm zone="ch-system-grub grub-install"> + <primary sortas="b-grub-install">grub-install</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grub-md5-crypt"> + <term><command>grub-md5-crypt</command></term> + <listitem> + <para>Encrypts a password in MD5 format</para> + <indexterm zone="ch-system-grub grub-md5-crypt"> + <primary sortas="b-grub-md5-crypt">grub-md5-crypt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grub-set-default"> + <term><command>grub-set-default</command></term> + <listitem> + <para>Sets the default boot entry for GRUB</para> + <indexterm zone="ch-system-grub grub-set-default"> + <primary sortas="b-grub-set-default">grub-set-default</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grub-terminfo"> + <term><command>grub-terminfo</command></term> + <listitem> + <para>Generates a terminfo command from a terminfo name; it can be + employed if an unknown terminal is being used</para> + <indexterm zone="ch-system-grub grub-terminfo"> + <primary sortas="b-grub-terminfo">grub-terminfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mbchk"> + <term><command>mbchk</command></term> + <listitem> + <para>Checks the format of a multi-boot kernel</para> + <indexterm zone="ch-system-grub mbchk"> + <primary sortas="b-mbchk">mbchk</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/gzip.xml b/chapter06/gzip.xml new file mode 100644 index 000000000..9cb4b8437 --- /dev/null +++ b/chapter06/gzip.xml @@ -0,0 +1,255 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-gzip" role="wrap"> + <?dbhtml filename="gzip.html"?> + + <title>Gzip-&gzip-version;</title> + + <indexterm zone="ch-system-gzip"> + <primary sortas="a-Gzip">Gzip</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Gzip package contains programs for compressing and decompressing + files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gzip-ch6-sbu;</seg> + <seg>&gzip-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gzip</title> + + <para>Gzip has 2 known security vulnerabilities. The following patch + addresses both of them:</para> + +<screen><userinput>patch -Np1 -i ../&gzip-security_fix-patch;</userinput></screen> + + <para>Prepare Gzip for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>The <command>gzexe</command> script has the location of the + <command>gzip</command> binary hard-wired into it. Because the + location of the binary is changed later, the following command ensures + that the new location gets placed into the script:</para> + +<screen><userinput>sed -i 's@"BINDIR"@/bin@g' gzexe.in</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Move the <command>gzip</command> program to the <filename + class="directory">/bin</filename> directory and create some commonly used + symlinks to it:</para> + +<screen><userinput>mv -v /usr/bin/gzip /bin +rm -v /usr/bin/{gunzip,zcat} +ln -sv gzip /bin/gunzip +ln -sv gzip /bin/zcat +ln -sv gzip /bin/compress +ln -sv gunzip /bin/uncompress</userinput></screen> + + </sect2> + + <sect2 id="contents-gzip" role="content"> + <title>Contents of Gzip</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>compress (link to gzip), gunzip (link to gzip), gzexe, gzip, + uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, + zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="compress"> + <term><command>compress</command></term> + <listitem> + <para>Compresses and decompresses files</para> + <indexterm zone="ch-system-gzip compress"> + <primary sortas="b-compress">compress</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gunzip"> + <term><command>gunzip</command></term> + <listitem> + <para>Decompresses gzipped files</para> + <indexterm zone="ch-system-gzip gunzip"> + <primary sortas="b-gunzip">gunzip</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gzexe"> + <term><command>gzexe</command></term> + <listitem> + <para>Creates self-decompressing executable files</para> + <indexterm zone="ch-system-gzip gzexe"> + <primary sortas="b-gzexe">gzexe</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gzip"> + <term><command>gzip</command></term> + <listitem> + <para>Compresses the given files using Lempel-Ziv (LZ77) coding</para> + <indexterm zone="ch-system-gzip gzip"> + <primary sortas="b-gzip">gzip</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="uncompress"> + <term><command>uncompress</command></term> + <listitem> + <para>Decompresses compressed files</para> + <indexterm zone="ch-system-gzip uncompress"> + <primary sortas="b-uncompress">uncompress</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zcat"> + <term><command>zcat</command></term> + <listitem> + <para>Decompresses the given gzipped files to standard output</para> + <indexterm zone="ch-system-gzip zcat"> + <primary sortas="b-zcat">zcat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zcmp"> + <term><command>zcmp</command></term> + <listitem> + <para>Runs <command>cmp</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zcmp"> + <primary sortas="b-zcmp">zcmp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zdiff"> + <term><command>zdiff</command></term> + <listitem> + <para>Runs <command>diff</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zdiff"> + <primary sortas="b-zdiff">zdiff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zegrep"> + <term><command>zegrep</command></term> + <listitem> + <para>Runs <command>egrep</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zegrep"> + <primary sortas="b-zegrep">zegrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zfgrep"> + <term><command>zfgrep</command></term> + <listitem> + <para>Runs <command>fgrep</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zfgrep"> + <primary sortas="b-zfgrep">zfgrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zforce"> + <term><command>zforce</command></term> + <listitem> + <para>Forces a <filename class="extension">.gz</filename> extension on + all given files that are gzipped files, so that <command>gzip</command> + will not compress them again; this can be useful when file names were + truncated during a file transfer</para> + <indexterm zone="ch-system-gzip zforce"> + <primary sortas="b-zforce">zforce</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zgrep"> + <term><command>zgrep</command></term> + <listitem> + <para>Runs <command>grep</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zgrep"> + <primary sortas="b-zgrep">zgrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zless"> + <term><command>zless</command></term> + <listitem> + <para>Runs <command>less</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zless"> + <primary sortas="b-zless">zless</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zmore"> + <term><command>zmore</command></term> + <listitem> + <para>Runs <command>more</command> on gzipped files</para> + <indexterm zone="ch-system-gzip zmore"> + <primary sortas="b-zmore">zmore</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="znew"> + <term><command>znew</command></term> + <listitem> + <para>Re-compresses files from <command>compress</command> format to + <command>gzip</command> format—<filename + class="extension">.Z</filename> to <filename + class="extension">.gz</filename></para> + <indexterm zone="ch-system-gzip znew"> + <primary sortas="b-znew">znew</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/iana-etc.xml b/chapter06/iana-etc.xml new file mode 100644 index 000000000..2e786ce74 --- /dev/null +++ b/chapter06/iana-etc.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-iana-etc" role="wrap"> + <?dbhtml filename="iana-etc.html"?> + + <title>Iana-Etc-&iana-etc-version;</title> + + <indexterm zone="ch-system-iana-etc"> + <primary sortas="a-Iana-Etc">Iana-Etc</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Iana-Etc package provides data for network services and + protocols.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&iana-etc-ch6-sbu;</seg> + <seg>&iana-etc-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Iana-Etc</title> + + <para>The following command converts the raw data provided by IANA into the + correct formats for the <filename>/etc/protocols</filename> and + <filename>/etc/services</filename> data files:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-iana-etc" role="content"> + <title>Contents of Iana-Etc</title> + + <segmentedlist> + <segtitle>Installed files</segtitle> + + <seglistitem> + <seg>/etc/protocols and /etc/services</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="protocols"> + <term><filename>/etc/protocols</filename></term> + <listitem> + <para>Describes the various DARPA Internet protocols that are + available from the TCP/IP subsystem</para> + <indexterm zone="ch-system-iana-etc"> + <primary sortas="e-/etc/protocols">/etc/protocols</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="services"> + <term><filename>/etc/services</filename></term> + <listitem> + <para>Provides a mapping between friendly textual names for internet + services, and their underlying assigned port numbers and protocol + types</para> + <indexterm zone="ch-system-iana-etc"> + <primary sortas="e-/etc/services">/etc/services</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/inetutils.xml b/chapter06/inetutils.xml new file mode 100644 index 000000000..87bd5e35c --- /dev/null +++ b/chapter06/inetutils.xml @@ -0,0 +1,218 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-inetutils" role="wrap"> + <?dbhtml filename="inetutils.html"?> + + <title>Inetutils-&inetutils-version;</title> + + <indexterm zone="ch-system-inetutils"> + <primary sortas="a-Inetutils">Inetutils</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Inetutils package contains programs for basic networking.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&inetutils-ch6-sbu;</seg> + <seg>&inetutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Inetutils</title> + + <para>Apply a patch to Inetutils to enable it to compile with + GCC-&gcc-version;:</para> + +<screen><userinput>patch -Np1 -i ../&inetutils-gcc4_fixes-patch;</userinput></screen> + + <para>All programs that come with Inetutils will not be installed. + However, the Inetutils build system will insist on installing all the + man pages anyway. The following patch will correct this + situation:</para> + +<screen><userinput>patch -Np1 -i ../&inetutils-man_pages-patch;</userinput></screen> + +<para>Prepare Inetutils for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --libexecdir=/usr/sbin \ + --sysconfdir=/etc --localstatedir=/var \ + --disable-logger --disable-syslogd \ + --disable-whois --disable-servers</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--disable-logger</parameter></term> + <listitem> + <para>This option prevents Inetutils from installing the + <command>logger</command> program, which is used by scripts to + pass messages to the System Log Daemon. Do not install it because + Util-linux installs a better version later.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-syslogd</parameter></term> + <listitem> + <para>This option prevents Inetutils from installing the System Log + Daemon, which is installed with the Sysklogd package.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-whois</parameter></term> + <listitem> + <para>This option disables the building of the Inetutils + <command>whois</command> client, which is out of date. Instructions for + a better <command>whois</command> client are in the BLFS book.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-servers</parameter></term> + <listitem> + <para>This disables the installation of the various network servers + included as part of the Inetutils package. These servers are deemed not + appropriate in a basic LFS system. Some are insecure by nature and are + only considered safe on trusted networks. More information can be found + at <ulink url="&blfs-root;view/svn/basicnet/inetutils.html"/>. Note that + better replacements are available for many of these servers.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Move the <command>ping</command> program to its FHS-compliant + place:</para> + +<screen><userinput>mv -v /usr/bin/ping /bin</userinput></screen> + + </sect2> + + <sect2 id="contents-inetutils" role="content"> + <title>Contents of Inetutils</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>ftp, ping, rcp, rlogin, rsh, talk, telnet, and tftp</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="ftp"> + <term><command>ftp</command></term> + <listitem> + <para>Is the file transfer protocol program</para> + <indexterm zone="ch-system-inetutils ftp"> + <primary sortas="b-ftp">ftp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ping"> + <term><command>ping</command></term> + <listitem> + <para>Sends echo-request packets and reports how long the replies + take</para> + <indexterm zone="ch-system-inetutils ping"> + <primary sortas="b-ping">ping</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rcp"> + <term><command>rcp</command></term> + <listitem> + <para>Performs remote file copy</para> + <indexterm zone="ch-system-inetutils rcp"> + <primary sortas="b-rcp">rcp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rlogin"> + <term><command>rlogin</command></term> + <listitem> + <para>Performs remote login</para> + <indexterm zone="ch-system-inetutils rlogin"> + <primary sortas="b-rlogin">rlogin</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rsh"> + <term><command>rsh</command></term> + <listitem> + <para>Runs a remote shell</para> + <indexterm zone="ch-system-inetutils rsh"> + <primary sortas="b-rsh">rsh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="talk"> + <term><command>talk</command></term> + <listitem> + <para>Is used to chat with another user</para> + <indexterm zone="ch-system-inetutils talk"> + <primary sortas="b-talk">talk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="telnet"> + <term><command>telnet</command></term> + <listitem> + <para>An interface to the TELNET protocol</para> + <indexterm zone="ch-system-inetutils telnet"> + <primary sortas="b-telnet">telnet</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tftp"> + <term><command>tftp</command></term> + <listitem> + <para>A trivial file transfer program</para> + <indexterm zone="ch-system-inetutils tftp"> + <primary sortas="b-tftp">tftp</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/introduction.xml b/chapter06/introduction.xml new file mode 100644 index 000000000..1a5e0aae4 --- /dev/null +++ b/chapter06/introduction.xml @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-introduction"> + <?dbhtml filename="introduction.html"?> + + <title>Introduction</title> + + <para>In this chapter, we enter the building site and start constructing the + LFS system in earnest. That is, we chroot into the temporary mini Linux system, + make a few final preparations, and then begin installing the packages.</para> + + <para>The installation of this software is straightforward. Although in many + cases the installation instructions could be made shorter and more generic, + we have opted to provide the full instructions for every package to minimize + the possibilities for mistakes. The key to learning what makes a Linux system + work is to know what each package is used for and why the user (or the system) + needs it. For every installed package, a summary of its contents is given, + followed by concise descriptions of each program and library the package + installed.</para> + + <para>If using compiler optimizations, please + review the optimization hint at <ulink url="&hints-root;optimization.txt"/>. + Compiler optimizations can make a program run slightly faster, but they may + also cause compilation difficulties and problems when running the program. + If a package refuses to compile when using optimization, try to compile it + without optimization and see if that fixes the problem. Even if the package + does compile when using optimization, there is the risk it may have been + compiled incorrectly because of the complex interactions between the code + and build tools. Also note that the <option>-march</option> and + <option>-mtune</option> options may cause problems with the toolchain packages + (Binutils, GCC and Glibc). The small potential gains achieved in using + compiler optimizations are often outweighed by the risks. First-time builders + of LFS are encouraged to build without custom optimizations. The subsequent + system will still run very fast and be stable at the same time.</para> + + <para>The order that packages are installed in this chapter needs to be + strictly followed to ensure that no program accidentally acquires a path + referring to <filename class="directory">/tools</filename> hard-wired into + it. For the same reason, do not compile packages in parallel. Compiling in + parallel may save time (especially on dual-CPU machines), but it could result + in a program containing a hard-wired path to <filename + class="directory">/tools</filename>, which will cause the program to stop + working when that directory is removed.</para> + + <para>Before the installation instructions, each installation page provides + information about the package, including a concise description of what it + contains, approximately how long it will take to build, and how much disk + space is required during this building process. Following the installation + instructions, there is a list of programs and libraries (along with brief + descriptions of these) that the package installs.</para> + +</sect1> diff --git a/chapter06/iproute2.xml b/chapter06/iproute2.xml new file mode 100644 index 000000000..eb0438e25 --- /dev/null +++ b/chapter06/iproute2.xml @@ -0,0 +1,299 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-iproute2" role="wrap"> + <?dbhtml filename="iproute2.html"?> + + <title>IPRoute2-&iproute2-version;</title> + + <indexterm zone="ch-system-iproute2"> + <primary sortas="a-IPRoute2">IPRoute2</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The IPRoute2 package contains programs for basic and advanced IPV4-based + networking.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&iproute2-ch6-sbu;</seg> + <seg>&iproute2-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of IPRoute2</title> + + <para>Compile the package:</para> + +<screen><userinput>make SBINDIR=/sbin</userinput></screen> + + <variablelist> + <title>The meaning of the make option:</title> + + <varlistentry> + <term><parameter>SBINDIR=/sbin</parameter></term> + <listitem> + <para>This ensures that the IPRoute2 binaries will install into + <filename class="directory">/sbin</filename>. This is the correct + location according to the FHS, because some of the IPRoute2 binaries + are used by the LFS-Bootscripts package.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make SBINDIR=/sbin install</userinput></screen> + + <para>The <command>arpd</command> binary links against the Berkeley DB + libraries that reside in <filename class="directory">/usr</filename> and + uses a database in <filename>/var/lib/arpd/arpd.db</filename>. Thus, + according to the FHS, it must be in <filename + class="directory">/usr/sbin</filename>. Move it there:</para> + + <screen><userinput>mv -v /sbin/arpd /usr/sbin</userinput></screen> + + </sect2> + + <sect2 id="contents-iproute2" role="content"> + <title>Contents of IPRoute2</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>arpd, ctstat (link to lnstat), ifcfg, ifstat, ip, lnstat, nstat, + routef, routel, rtacct, rtmon, rtpr, rtstat (link to lnstat), ss, + and tc.</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="arpd"> + <term><command>arpd</command></term> + <listitem> + <para>Userspace ARP daemon, useful in really large networks, where the + kernelspace ARP implementation is insufficient, or when setting up a + honeypot</para> + <indexterm zone="ch-system-iproute2 arpd"> + <primary sortas="b-arpd">arpd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ctstat"> + <term><command>ctstat</command></term> + <listitem> + <para>Connection status utility</para> + <indexterm zone="ch-system-iproute2 ctstat"> + <primary sortas="b-ctstat">ctstat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ifcfg"> + <term><command>ifcfg</command></term> + <listitem> + <para>A shell script wrapper for the <command>ip</command> command</para> + <indexterm zone="ch-system-iproute2 ifcfg"> + <primary sortas="b-ifcfg">ifcfg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ifstat"> + <term><command>ifstat</command></term> + <listitem> + <para>Shows the interface statistics, including the amount of + transmitted and received packets by interface</para> + <indexterm zone="ch-system-iproute2 ifstat"> + <primary sortas="b-ifstat">ifstat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ip"> + <term><command>ip</command></term> + <listitem> + <para>The main executable. It has several different functions:</para> + + <para><command>ip link <replaceable><device></replaceable></command> + allows users to look at the state of devices and to make changes</para> + + <para><command>ip addr</command> allows users to look at addresses and + their properties, add new addresses, and delete old ones</para> + + <para><command>ip neighbor</command> allows users to look at neighbor + bindings and their properties, add new neighbor entries, and delete + old ones</para> + + <para><command>ip rule</command> allows users to look at the routing + policies and change them</para> + + <para><command>ip route</command> allows users to look at the routing + table and change routing table rules</para> + + <para><command>ip tunnel</command> allows users to look at the IP + tunnels and their properties, and change them</para> + + <para><command>ip maddr</command> allows users to look at the multicast + addresses and their properties, and change them</para> + + <para><command>ip mroute</command> allows users to set, change, or + delete the multicast routing</para> + + <para><command>ip monitor</command> allows users to continously monitor + the state of devices, addresses and routes</para> + <indexterm zone="ch-system-iproute2 ip"> + <primary sortas="b-ip">ip</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lnstat"> + <term><command>lnstat</command></term> + <listitem> + <para>Provides Linux network statistics. It is a generalized and more + feature-complete replacement for the old <command>rtstat</command> + program</para> + <indexterm zone="ch-system-iproute2 lnstat"> + <primary sortas="b-lnstat">lnstat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nstat"> + <term><command>nstat</command></term> + <listitem> + <para>Shows network statistics</para> + <indexterm zone="ch-system-iproute2 nstat"> + <primary sortas="b-nstat">nstat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="routef"> + <term><command>routef</command></term> + <listitem> + <para>A component of <command>ip route</command>. This is for flushing + the routing tables</para> + <indexterm zone="ch-system-iproute2 routef"> + <primary sortas="b-routef">routef</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="routel"> + <term><command>routel</command></term> + <listitem> + <para>A component of <command>ip route</command>. This is for listing + the routing tables</para> + <indexterm zone="ch-system-iproute2 routel"> + <primary sortas="b-routel">routel</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rtacct"> + <term><command>rtacct</command></term> + <listitem> + <para>Displays the contents of + <filename>/proc/net/rt_acct</filename></para> + <indexterm zone="ch-system-iproute2 rtacct"> + <primary sortas="b-rtacct">rtacct</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rtmon"> + <term><command>rtmon</command></term> + <listitem> + <para>Route monitoring utility</para> + <indexterm zone="ch-system-iproute2 rtmon"> + <primary sortas="b-rtmon">rtmon</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rtpr"> + <term><command>rtpr</command></term> + <listitem> + <para>Converts the output of <command>ip -o</command> back into a + readable form</para> + <indexterm zone="ch-system-iproute2 rtpr"> + <primary sortas="b-rtpr">rtpr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rtstat"> + <term><command>rtstat</command></term> + <listitem> + <para>Route status utility</para> + <indexterm zone="ch-system-iproute2 rtstat"> + <primary sortas="b-rtstat">rtstat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ss"> + <term><command>ss</command></term> + <listitem> + <para>Similar to the <command>netstat</command> command; shows active + connections</para> + <indexterm zone="ch-system-iproute2 ss"> + <primary sortas="b-ss">ss</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tc"> + <term><command>tc</command></term> + <listitem> + <para>Traffic Controlling Executable; this is for Quality Of Service + (QOS) and Class Of Service (COS) implementations</para> + + <para><command>tc qdisc</command> allows users to setup the queueing + discipline</para> + + <para><command>tc class</command> allows users to setup classes based + on the queuing discipline scheduling</para> + + <para><command>tc estimator</command> allows users to estimate the + network flow into a network</para> + + <para><command>tc filter</command> allows users to setup the QOS/COS + packet filtering</para> + + <para><command>tc policy</command> allows users to setup the QOS/COS + policies</para> + <indexterm zone="ch-system-iproute2 ss"> + <primary sortas="b-tc">tc</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/kbd.xml b/chapter06/kbd.xml new file mode 100644 index 000000000..1ada7b17c --- /dev/null +++ b/chapter06/kbd.xml @@ -0,0 +1,371 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-kbd" role="wrap"> + <?dbhtml filename="kbd.html"?> + + <title>Kbd-&kbd-version;</title> + + <indexterm zone="ch-system-kbd"> + <primary sortas="a-Kbd">Kbd</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Kbd package contains key-table files and keyboard utilities.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&kbd-ch6-sbu;</seg> + <seg>&kbd-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Kbd</title> + + <para>The behaviour of the Backspace and Delete keys is not consistent + across the keymaps in the Kbd package. The following patch fixes this + issue for i386 keymaps:</para> + +<screen><userinput>patch -Np1 -i ../&kbd-backspace-patch;</userinput></screen> + + <para>After patching, the Backspace key generates the character with code 127, + and the Delete key generates a well-known escape sequence.</para> + + <para>Patch Kbd to fix a bug in <command>setfont</command> that is triggered + when compiling with GCC-&gcc-version;:</para> + +<screen><userinput>patch -Np1 -i ../&kbd-gcc4_fixes-patch;</userinput></screen> + + <para>Prepare Kbd for compilation:</para> + +<screen><userinput>./configure --datadir=/lib/kbd</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--datadir=/lib/kbd</parameter></term> + <listitem> + <para>This option puts keyboard layout data in a directory that will + always be on the root partition instead of the default <filename + class="directory">/usr/share/kbd</filename>.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <note> + <para>For some languages (e.g., Belarusian) the Kbd package doesn't + provide a useful keymap where the stock <quote>by</quote> keymap assumes + the ISO-8859-5 encoding, and the CP1251 keymap is normally used. Users of + such languages have to download working keymaps separately.</para> + </note> + + <para>Some of the scripts in the LFS-Bootscripts package depend on + <command>kbd_mode</command>, <command>openvt</command>, and + <command>setfont</command>. As <filename class="directory">/usr</filename> + may not be available during the early stages of booting, those binaries + need to be on the root partition:</para> + +<screen><userinput>mv -v /usr/bin/{kbd_mode,openvt,setfont} /bin</userinput></screen> + + + + + </sect2> + + <sect2 id="contents-kbd" role="content"> + <title>Contents of Kbd</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, kbd_mode, + kbdrate, loadkeys, loadunimap, + mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to + psfxtable), psfstriptable (link to psfxtable), psfxtable, resizecons, + setfont, setkeycodes, setleds, setmetamode, + showconsolefont, showkey, unicode_start, and unicode_stop</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="chvt"> + <term><command>chvt</command></term> + <listitem> + <para>Changes the foreground virtual terminal</para> + <indexterm zone="ch-system-kbd chvt"> + <primary sortas="b-chvt">chvt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="deallocvt"> + <term><command>deallocvt</command></term> + <listitem> + <para>Deallocates unused virtual terminals</para> + <indexterm zone="ch-system-kbd deallocvt"> + <primary sortas="b-deallocvt">deallocvt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dumpkeys"> + <term><command>dumpkeys</command></term> + <listitem> + <para>Dumps the keyboard translation tables</para> + <indexterm zone="ch-system-kbd dumpkeys"> + <primary sortas="b-dumpkeys">dumpkeys</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fgconsole"> + <term><command>fgconsole</command></term> + <listitem> + <para>Prints the number of the active virtual terminal</para> + <indexterm zone="ch-system-kbd fgconsole"> + <primary sortas="b-fgconsole">fgconsole</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="getkeycodes"> + <term><command>getkeycodes</command></term> + <listitem> + <para>Prints the kernel scancode-to-keycode mapping table</para> + <indexterm zone="ch-system-kbd getkeycodes"> + <primary sortas="b-getkeycodes">getkeycodes</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="kbd_mode"> + <term><command>kbd_mode</command></term> + <listitem> + <para>Reports or sets the keyboard mode</para> + <indexterm zone="ch-system-kbd kbd_mode"> + <primary sortas="b-kbd_mode">kbd_mode</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="kbdrate"> + <term><command>kbdrate</command></term> + <listitem> + <para>Sets the keyboard repeat and delay rates</para> + <indexterm zone="ch-system-kbd kbdrate"> + <primary sortas="b-kbdrate">kbdrate</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="loadkeys"> + <term><command>loadkeys</command></term> + <listitem> + <para>Loads the keyboard translation tables</para> + <indexterm zone="ch-system-kbd loadkeys"> + <primary sortas="b-loadkeys">loadkeys</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="loadunimap"> + <term><command>loadunimap</command></term> + <listitem> + <para>Loads the kernel unicode-to-font mapping table</para> + <indexterm zone="ch-system-kbd loadunimap"> + <primary sortas="b-loadunimap">loadunimap</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mapscrn"> + <term><command>mapscrn</command></term> + <listitem> + <para>An obsolete program that used to load a user-defined output + character mapping table into the console driver; this is now done + by <command>setfont</command></para> + <indexterm zone="ch-system-kbd mapscrn"> + <primary sortas="b-mapscrn">mapscrn</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="openvt"> + <term><command>openvt</command></term> + <listitem> + <para>Starts a program on a new virtual terminal (VT)</para> + <indexterm zone="ch-system-kbd openvt"> + <primary sortas="b-openvt">openvt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="psfaddtable"> + <term><command>psfaddtable</command></term> + <listitem> + <para>A link to <command>psfxtable</command></para> + <indexterm zone="ch-system-kbd psfaddtable"> + <primary sortas="b-psfaddtable">psfaddtable</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="psfgettable"> + <term><command>psfgettable</command></term> + <listitem> + <para>A link to <command>psfxtable</command></para> + <indexterm zone="ch-system-kbd psfgettable"> + <primary sortas="b-psfgettable">psfgettable</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="psfstriptable"> + <term><command>psfstriptable</command></term> + <listitem> + <para>A link to <command>psfxtable</command></para> + <indexterm zone="ch-system-kbd psfstriptable"> + <primary sortas="b-psfstriptable">psfstriptable</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="psfxtable"> + <term><command>psfxtable</command></term> + <listitem> + <para>Handle Unicode character tables for console fonts</para> + <indexterm zone="ch-system-kbd psfxtable"> + <primary sortas="b-psfxtable">psfxtable</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="resizecons"> + <term><command>resizecons</command></term> + <listitem> + <para>Changes the kernel idea of the console size</para> + <indexterm zone="ch-system-kbd resizecons"> + <primary sortas="b-resizecons">resizecons</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setfont"> + <term><command>setfont</command></term> + <listitem> + <para>Changes the Enhanced Graphic Adapter (EGA) and Video Graphics + Array (VGA) fonts on the console</para> + <indexterm zone="ch-system-kbd setfont"> + <primary sortas="b-setfont">setfont</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setkeycodes"> + <term><command>setkeycodes</command></term> + <listitem> + <para>Loads kernel scancode-to-keycode mapping table entries; this is + useful if there are unusual keys on the keyboard</para> + <indexterm zone="ch-system-kbd setkeycodes"> + <primary sortas="b-setkeycodes">setkeycodes</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setleds"> + <term><command>setleds</command></term> + <listitem> + <para>Sets the keyboard flags and Light Emitting Diodes (LEDs)</para> + <indexterm zone="ch-system-kbd setleds"> + <primary sortas="b-setleds">setleds</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setmetamode"> + <term><command>setmetamode</command></term> + <listitem> + <para>Defines the keyboard meta-key handling</para> + <indexterm zone="ch-system-kbd setmetamode"> + <primary sortas="b-setmetamode">setmetamode</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="showconsolefont"> + <term><command>showconsolefont</command></term> + <listitem> + <para>Shows the current EGA/VGA console screen font</para> + <indexterm zone="ch-system-kbd showconsolefont"> + <primary sortas="b-showconsolefont">showconsolefont</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="showkey"> + <term><command>showkey</command></term> + <listitem> + <para>Reports the scancodes, keycodes, and ASCII codes of the keys + pressed on the keyboard</para> + <indexterm zone="ch-system-kbd showkey"> + <primary sortas="b-showkey">showkey</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="unicode_start"> + <term><command>unicode_start</command></term> + <listitem> + <para>Puts the keyboard and console in UNICODE mode. Don't use this + program unless your keymap file is in the ISO-8859-1 encoding. For + other encodings, this utility produces incorrect results.</para> + <indexterm zone="ch-system-kbd unicode_start"> + <primary sortas="b-unicode_start">unicode_start</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="unicode_stop"> + <term><command>unicode_stop</command></term> + <listitem> + <para>Reverts keyboard and console from UNICODE mode</para> + <indexterm zone="ch-system-kbd unicode_stop"> + <primary sortas="b-unicode_stop">unicode_stop</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml new file mode 100644 index 000000000..034d60422 --- /dev/null +++ b/chapter06/kernfs.xml @@ -0,0 +1,78 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-kernfs"> + <?dbhtml filename="kernfs.html"?> + + <title>Preparing Virtual Kernel File Systems</title> + + <indexterm zone="ch-system-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}</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 will be created + on the hard disk so that they are available before <command>udevd</command> + has been started, 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. This 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 --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 -vt devpts devpts $LFS/dev/pts +mount -vt tmpfs shm $LFS/dev/shm +mount -vt proc proc $LFS/proc +mount -vt sysfs sysfs $LFS/sys</userinput></screen> + + </sect2> + +</sect1> diff --git a/chapter06/less.xml b/chapter06/less.xml new file mode 100644 index 000000000..4dfacdbcc --- /dev/null +++ b/chapter06/less.xml @@ -0,0 +1,119 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-less" role="wrap"> + <?dbhtml filename="less.html"?> + + <title>Less-&less-version;</title> + + <indexterm zone="ch-system-less"> + <primary sortas="a-Less">Less</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Less package contains a text file viewer.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&less-ch6-sbu;</seg> + <seg>&less-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Less</title> + + <para>Prepare Less for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --sysconfdir=/etc</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--sysconfdir=/etc</parameter></term> + <listitem> + <para>This option tells the programs created by the package to look + in <filename class="directory">/etc</filename> for the configuration + files.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-less" role="content"> + <title>Contents of Less</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>less, lessecho, and lesskey</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="less"> + <term><command>less</command></term> + <listitem> + <para>A file viewer or pager; it displays the contents of the given + file, letting the user scroll, find strings, and jump to marks</para> + <indexterm zone="ch-system-less less"> + <primary sortas="b-less">less</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lessecho"> + <term><command>lessecho</command></term> + <listitem> + <para>Needed to expand meta-characters, such as <emphasis>*</emphasis> + and <emphasis>?</emphasis>, in filenames on Unix systems</para> + <indexterm zone="ch-system-less lessecho"> + <primary sortas="b-lessecho">lessecho</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lesskey"> + <term><command>lesskey</command></term> + <listitem> + <para>Used to specify the key bindings for <command>less</command></para> + <indexterm zone="ch-system-less lesskey"> + <primary sortas="b-lesskey">lesskey</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/libtool.xml b/chapter06/libtool.xml new file mode 100644 index 000000000..8283627ee --- /dev/null +++ b/chapter06/libtool.xml @@ -0,0 +1,110 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-libtool" role="wrap"> + <?dbhtml filename="libtool.html"?> + + <title>Libtool-&libtool-version;</title> + + <indexterm zone="ch-system-libtool"> + <primary sortas="a-Libtool">Libtool</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Libtool package contains the GNU generic library support script. + It wraps the complexity of using shared libraries in a consistent, portable + interface.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&libtool-ch6-sbu;</seg> + <seg>&libtool-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Libtool</title> + + <para>Prepare Libtool for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-libtool" role="content"> + <title>Contents of Libtool</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>libtool and libtoolize</seg> + <seg>libltdl.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="libtool"> + <term><command>libtool</command></term> + <listitem> + <para>Provides generalized library-building support services</para> + <indexterm zone="ch-system-libtool libtool"> + <primary sortas="b-libtool">libtool</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libtoolize"> + <term><command>libtoolize</command></term> + <listitem> + <para>Provides a standard way to add <command>libtool</command> + support to a package</para> + <indexterm zone="ch-system-libtool libtoolize"> + <primary sortas="b-libtoolize">libtoolize</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libltdl"> + <term><filename class="libraryfile">libltdl</filename></term> + <listitem> + <para>Hides the various difficulties of dlopening libraries</para> + <indexterm zone="ch-system-libtool libltdl"> + <primary sortas="c-libltdl">libltdl</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/linux-libc-headers.xml b/chapter06/linux-libc-headers.xml new file mode 100644 index 000000000..9496c0b99 --- /dev/null +++ b/chapter06/linux-libc-headers.xml @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-linux-libc-headers" role="wrap"> + <?dbhtml filename="linux-libc-headers.html"?> + + <title>Linux-Libc-Headers-&linux-libc-headers-version;</title> + + <indexterm zone="ch-system-linux-libc-headers"> + <primary sortas="a-Linux-Libc-Headers">Linux-Libc-Headers</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Linux-Libc-Headers package contains the + <quote>sanitized</quote> kernel headers.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&linux-libc-headers-ch6-sbu;</seg> + <seg>&linux-libc-headers-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Linux-Libc-Headers</title> + + <para>For years it has been common practice to use <quote>raw</quote> + kernel headers (straight from a kernel tarball) in <filename + class="directory">/usr/include</filename>, but over the last few + years, the kernel developers have taken a strong stance that this + should not be done. This gave birth to the Linux-Libc-Headers Project, + which was designed to maintain an API stable version of the Linux + headers.</para> + + <para>Install the header files:</para> + +<screen><userinput>install -dv /usr/include/asm +cp -Rv include/asm-i386/* /usr/include/asm +cp -Rv include/linux /usr/include</userinput></screen> + + <para>Ensure that all the headers are owned by root:</para> + +<screen><userinput>chown -Rv root:root /usr/include/{asm,linux}</userinput></screen> + + <para>Make sure the users can read the headers:</para> + +<screen><userinput>find /usr/include/{asm,linux} -type d -exec chmod -v 755 {} \; +find /usr/include/{asm,linux} -type f -exec chmod -v 644 {} \;</userinput></screen> + + </sect2> + + <sect2 id="contents-linux-libc-headers" role="content"> + <title>Contents of Linux-Libc-Headers</title> + + <segmentedlist> + <segtitle>Installed headers</segtitle> + + <seglistitem> + <seg>/usr/include/{asm,linux}/*.h</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="linux-libc-headers"> + <term><filename class="headerfile">/usr/include/{asm,linux}/*.h</filename></term> + <listitem> + <para>The Linux API headers</para> + <indexterm zone="ch-system-linux-libc-headers linux-libc-headers"> + <primary sortas="e-/usr/include/{asm,linux}/*.h">/usr/include/{asm,linux}/*.h</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/m4.xml b/chapter06/m4.xml new file mode 100644 index 000000000..fe5c5a6a6 --- /dev/null +++ b/chapter06/m4.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-m4" role="wrap"> + <?dbhtml filename="m4.html"?> + + <title>M4-&m4-version;</title> + + <indexterm zone="ch-system-m4"> + <primary sortas="a-M4">M4</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The M4 package contains a macro processor.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&m4-ch6-sbu;</seg> + <seg>&m4-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of M4</title> + + <para>Prepare M4 for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-m4" role="content"> + <title>Contents of M4</title> + + <segmentedlist> + <segtitle>Installed program</segtitle> + + <seglistitem> + <seg>m4</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="m4"> + <term><command>m4</command></term> + <listitem> + <para>copies the given files while expanding the macros that they + contain. These macros are either built-in or user-defined and can + take any number of arguments. Besides performing macro expansion, + <command>m4</command> has built-in functions for including named + files, running Unix commands, performing integer arithmetic, + manipulating text, recursion, etc. The <command>m4</command> program + can be used either as a front-end to a compiler or as a macro processor + in its own right.</para> + <indexterm zone="ch-system-m4 m4"> + <primary sortas="b-m4">m4</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/make.xml b/chapter06/make.xml new file mode 100644 index 000000000..4e131f521 --- /dev/null +++ b/chapter06/make.xml @@ -0,0 +1,86 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-make" role="wrap"> + <?dbhtml filename="make.html"?> + + <title>Make-&make-version;</title> + + <indexterm zone="ch-system-make"> + <primary sortas="a-Make">Make</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Make package contains a program for compiling packages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&make-ch6-sbu;</seg> + <seg>&make-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Make</title> + + <para>Prepare Make for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-make" role="content"> + <title>Contents of Make</title> + + <segmentedlist> + <segtitle>Installed program</segtitle> + + <seglistitem> + <seg>make</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="make"> + <term><command>make</command></term> + <listitem> + <para>Automatically determines which pieces of a package need to + be (re)compiled and then issues the relevant commands</para> + <indexterm zone="ch-system-make make"> + <primary sortas="b-make">make</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/man-db.xml b/chapter06/man-db.xml new file mode 100644 index 000000000..482ae7a17 --- /dev/null +++ b/chapter06/man-db.xml @@ -0,0 +1,453 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-man-db" role="wrap"> + <?dbhtml filename="man-db.html"?> + + <title>Man-DB-&man-db-version;</title> + + <indexterm zone="ch-system-man-db"> + <primary sortas="a-Man-DB">Man-DB</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Man-DB package contains programs for finding and viewing man + pages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&man-db-ch6-sbu;</seg> + <seg>&man-db-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Man-DB</title> + + <para>Three adjustments need to be made to the sources of Man-DB.</para> + + <para>The first one changes the location of translated manual pages that come + with Man-DB, in order for them to be accessible in both traditional and + UTF-8 locales:</para> + +<screen><userinput>mv man/de{_DE.88591,} && +mv man/es{_ES.88591,} && +mv man/it{_IT.88591,} && +mv man/ja{_JP.eucJP,} && +sed -i 's,\*_\*,??,' man/Makefile.in</userinput></screen> + + <para>The second change is a <command>sed</command> substitution to delete + the <quote>/usr/man</quote> lines in the <filename>man_db.conf</filename> + file to prevent redundant results when using programs such as + <command>whatis</command>:</para> + +<screen><userinput>sed -i '/\t\/usr\/man/d' src/man_db.conf.in</userinput></screen> + + <para>The third change accounts for programs that Man-DB should be able + to find at runtime, but that haven't been installed yet:</para> + +<screen><userinput>cat >>include/manconfig.h.in <<"EOF" +<literal>#define WEB_BROWSER "exec /usr/bin/lynx" +#define COL "/usr/bin/col" +#define VGRIND "/usr/bin/vgrind" +#define GRAP "/usr/bin/grap"</literal> +EOF</userinput></screen> + + <para>The <command>col</command> program is a part of the Util-linux + package, <command>lynx</command> is a text-based web browser (see BLFS + for installation instructions), <command>vgrind</command> converts + program sources to Groff input, and <command>grap</command> is useful + for typesetting graphs in Groff documents. The <command>vgrind</command> + and <command>grap</command> programs are not normally needed for viewing + manual pages. They are not part of LFS or BLFS, but you should be able + to install them yourself after finishing LFS if you wish to do so.</para> + + <para>Prepare Man-DB for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --enable-mb-groff --disable-setuid</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--enable-mb-groff</parameter></term> + <listitem> + <para>This tells the <command>man</command> program to use the + <quote>ascii8</quote> and <quote>nippon</quote> Groff devices for + formatting non-ISO-8859-1 manual pages.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>--disable-setuid</parameter></term> + <listitem> + <para>This disables making the <command>man</command> program setuid + to user <systemitem class="username">man</systemitem>.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Some packages provide UTF-8 man pages which this version of + <command>man</command> is unable to display. The following script will + allow some of these to be converted into the expected encodings shown in + the table below. Man-DB expects the manual pages to be in the encodings + in the table, and will convert them as necessary to the actual locale + encoding when it displays them, so that they will display in both UTF-8 + and traditional locales. Because this script is intended for limited use + during the system build, for public data, we will not bother with error + checking, nor use a non-predictable temporary file name.</para> + +<screen><userinput>cat >>convert-mans <<"EOF" +<literal>#!/bin/sh -e +FROM="$1" +TO="$2" +shift ; shift +while [ $# -gt 0 ] +do + FILE="$1" + shift + iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv + mv .tmp.iconv "$FILE" +done</literal> +EOF +install -m755 convert-mans /usr/bin</userinput></screen> + + <para>Additional information regarding the compression of + man and info pages can be found in the BLFS book at + <ulink url="&blfs-root;view/cvs/postlfs/compressdoc.html"/>.</para> + + </sect2> + + <sect2> + <title>Non-English Manual Pages in LFS</title> + + <para>Linux distributions have different policies concerning the character + encoding in which manual pages are stored in the filesystem. E.g., RedHat + stores all manual pages in UTF-8, while Debian uses language-specific + (mostly 8-bit) encodings. This leads to incompatibility of packages with + manual pages designed for different distributions.</para> + + <para>LFS uses the same conventions as Debian. This was chosen because + Man-DB does not understand man pages stored in UTF-8. And, for our + purposes, Man-DB is preferable to Man as it works without extra + configuration in any locale. Lastly, as of now, there is no fully-working + implementation of the RedHat convention. RedHat's <command>groff</command> + is known to misformat text.</para> + + <para>The relationship between language codes and the expected encoding + of manual pages is listed below. Man-DB automatically converts them to + the locale encoding while viewing.</para> + + <!-- Origin: man-db-2.4.3/src/encodings.c --> + <table> + <title>Expected character encoding of manual pages</title> + + <tgroup cols="2"> + + <thead> + <row> + <entry>Language (code)</entry> + <entry>Encoding</entry> + </row> + </thead> + + <tbody> + <row> + <entry>Danish (da)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>German (de)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>English (en)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Spanish (es)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Finnish (fi)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>French (fr)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Irish (ga)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Galician (gl)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Indonesian (id)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Icelandic (is)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Italian (it)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Dutch (nl)</entry> + <entry>ISO-8859-1</entry> + </row> + <!-- FIXME: BUG: "no" is deprecated, should use "nb" or "nn" and + symlinks --> + <row> + <entry>Norwegian (no)</entry> + <entry>ISO-8859-1</entry> + </row> + <!-- END BUG --> + <row> + <entry>Portuguese (pt)</entry> + <entry>ISO-8859-1</entry> + </row> + <row> + <entry>Swedish (sv)</entry> + <entry>ISO-8859-1</entry> + </row> + <!-- Languages below require patched groff --> + <row> + <entry>Czech (cs)</entry> + <entry>ISO-8859-2</entry> + </row> + <row> + <entry>Croatian (hr)</entry> + <entry>ISO-8859-2</entry> + </row> + <row> + <entry>Hungarian (hu)</entry> + <entry>ISO-8859-2</entry> + </row> + <row> + <entry>Japanese (ja)</entry> + <entry>EUC-JP</entry> + </row> + <row> + <entry>Korean (ko)</entry> + <entry>EUC-KR</entry> + </row> + <row> + <entry>Polish (pl)</entry> + <entry>ISO-8859-2</entry> + </row> + <row> + <entry>Russian (ru)</entry> + <entry>KOI8-R</entry> + </row> + <row> + <entry>Slovak (sk)</entry> + <entry>ISO-8859-2</entry> + </row> + <row> + <entry>Turkish (tr)</entry> + <entry>ISO-8859-9</entry> + </row> + </tbody> + + </tgroup> + + </table> + + <note> + <para>Manual pages in languages not in the list are not supported. + Norwegian doesn't work now because of the transition from no_NO to + nb_NO locale, and Korean is non-functional because of the incomplete + Groff patch.</para> + </note> + + <para>If upstream distributes the manual pages in the same encoding + as Man-DB expects, the manual pages can be copied to + <filename class="directory">/usr/share/man/<replaceable><language + code></replaceable></filename>. E.g., French manual pages + (<ulink url="http://ccb.club.fr/man/man-fr-1.58.0.tar.bz2"/>) can be + installed with the following command:</para> + +<screen role="nodump"><userinput>mkdir -p /usr/share/man/fr && +cp -rv man? /usr/share/man/fr</userinput></screen> + + <para>If upstream distributes manual pages in UTF-8 (i.e., <quote>for + RedHat</quote>) instead of the encoding listed in the table above, they + have to be converted from UTF-8 to the encoding listed in the table before + installation. This can be achieved with <command>convert-mans</command>, + e.g., Spanish manual pages (<ulink + url="http://ditec.um.es/~piernas/manpages-es/man-pages-es-1.55.tar.bz2"/>) + can be installed with the following commands:</para> + +<screen role="nodump"><userinput>mv man7/iso_8859-7.7{,X} +convert-mans UTF-8 ISO-8859-1 man?/*.? +mv man7/iso_8859-7.7{X,} +make install</userinput></screen> + + <note> + <para>The need to exclude the <filename>man7/iso_8859-7.7</filename> file + from the conversion process because it is already in ISO-8859-1 is a + packaging bug in man-pages-es-1.55. Future versions should not require + this workaround.</para> + </note> + + </sect2> + + <sect2 id="contents-man-db" role="content"> + <title>Contents of Man-DB</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>accessdb, apropos, catman, convert-mans,lexgrog, man, mandb, + manpath, whatis, and zsoelim</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="accessdb"> + <term><command>accessdb</command></term> + <listitem> + <para>Dumps the <command>whatis</command> database contents in + human-readable form</para> + <indexterm zone="ch-system-man-db accessdb"> + <primary sortas="b-accessdb">accessdb</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="apropos"> + <term><command>apropos</command></term> + <listitem> + <para>Searches the <command>whatis</command> database and displays + the short descriptions of system commands that contain a given + string</para> + <indexterm zone="ch-system-man-db apropos"> + <primary sortas="b-apropos">apropos</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="catman"> + <term><command>catman</command></term> + <listitem> + <para>Creates or updates the pre-formatted manual pages</para> + <indexterm zone="ch-system-man-db catman"> + <primary sortas="b-catman">catman</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="convert-mans"> + <term><command>convert-mans</command></term> + <listitem> + <para>Reformat man pages so that Man-DB can display them</para> + <indexterm zone="ch-system-man-db convert-mans"> + <primary sortas="b-convert-mans">convert-mans</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lexgrog"> + <term><command>lexgrog</command></term> + <listitem> + <para>Displays one-line summary information about a given manual + page</para> + <indexterm zone="ch-system-man-db lexgrog"> + <primary sortas="b-lexgrog">lexgrog</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="man"> + <term><command>man</command></term> + <listitem> + <para>Formats and displays the requested manual page</para> + <indexterm zone="ch-system-man-db man"> + <primary sortas="b-man">man</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mandb"> + <term><command>mandb</command></term> + <listitem> + <para>Creates or updates the <command>whatis</command> database</para> + <indexterm zone="ch-system-man-db mandb"> + <primary sortas="b-mandb">mandb</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="manpath"> + <term><command>manpath</command></term> + <listitem> + <para>Displays the contents of $MANPATH or (if $MANPATH is not set) + a suitable search path based on the settings in man.conf and the + user's environment</para> + <indexterm zone="ch-system-man-db manpath"> + <primary sortas="b-manpath">manpath</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="whatis"> + <term><command>whatis</command></term> + <listitem> + <para>Searches the <command>whatis</command> database and displays + the short descriptions of system commands that contain the given + keyword as a separate word</para> + <indexterm zone="ch-system-man-db whatis"> + <primary sortas="b-whatis">whatis</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="zsoelim"> + <term><command>zsoelim</command></term> + <listitem> + <para>Reads files and replaces lines of the form <emphasis>.so + file</emphasis> by the contents of the mentioned + <emphasis>file</emphasis></para> + <indexterm zone="ch-system-man-db zsoelim"> + <primary sortas="b-zsoelim">zsoelim</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/man-pages.xml b/chapter06/man-pages.xml new file mode 100644 index 000000000..6c289385c --- /dev/null +++ b/chapter06/man-pages.xml @@ -0,0 +1,74 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-man-pages" role="wrap"> + <?dbhtml filename="man-pages.html"?> + + <title>Man-pages-&man-pages-version;</title> + + <indexterm zone="ch-system-man-pages"> + <primary sortas="a-Man-pages">Man-pages</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Man-pages package contains over 1,200 man pages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&man-pages-ch6-sbu;</seg> + <seg>&man-pages-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Man-pages</title> + + <para>Install Man-pages by running:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-manpages" role="content"> + <title>Contents of Man-pages</title> + + <segmentedlist> + <segtitle>Installed files</segtitle> + + <seglistitem> + <seg>various man pages</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="man-pages"> + <term><filename>man pages</filename></term> + <listitem> + <para>Describe the C and C++ functions, important + device files, and significant configuration files</para> + <indexterm zone="ch-system-man-pages man-pages"> + <primary sortas="e-man-pages">man pages</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/mktemp.xml b/chapter06/mktemp.xml new file mode 100644 index 000000000..116dbb510 --- /dev/null +++ b/chapter06/mktemp.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-mktemp" role="wrap"> + <?dbhtml filename="mktemp.html"?> + + <title>Mktemp-&mktemp-version;</title> + + <indexterm zone="ch-system-mktemp"> + <primary sortas="a-Mktemp">Mktemp</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Mktemp package contains programs used to create secure temporary + files in shell scripts.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&mktemp-ch6-sbu;</seg> + <seg>&mktemp-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Mktemp</title> + + <para>Many scripts still use the deprecated + <command>tempfile</command> program, which has functionality similar + to <command>mktemp</command>. Patch Mktemp to include a + <command>tempfile</command> wrapper:</para> + +<screen><userinput>patch -Np1 -i ../&mktemp-tempfile-patch;</userinput></screen> + + <para>Prepare Mktemp for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --with-libc</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--with-libc</parameter></term> + <listitem> + <para>This causes the <command>mktemp</command> program to use the + <emphasis>mkstemp</emphasis> and <emphasis>mkdtemp</emphasis> + functions from the system C library instead of its own implementation + of them. </para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install +make install-tempfile</userinput></screen> + + </sect2> + + <sect2 id="contents-mktemp" role="content"> + <title>Contents of Mktemp</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>mktemp and tempfile</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="mktemp"> + <term><command>mktemp</command></term> + <listitem> + <para>Creates temporary files in a secure manner; it is used in + scripts</para> + <indexterm zone="ch-system-mktemp mktemp"> + <primary sortas="b-mktemp">mktemp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tempfile"> + <term><command>tempfile</command></term> + <listitem> + <para>Creates temporary files in a less secure manner than + <command>mktemp</command>; it is installed for + backwards-compatibility</para> + <indexterm zone="ch-system-mktemp tempfile"> + <primary sortas="b-tempfile">tempfile</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/module-init-tools.xml b/chapter06/module-init-tools.xml new file mode 100644 index 000000000..728317c56 --- /dev/null +++ b/chapter06/module-init-tools.xml @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-module-init-tools" role="wrap"> + <?dbhtml filename="module-init-tools.html"?> + + <title>Module-Init-Tools-&module-init-tools-version;</title> + + <indexterm zone="ch-system-module-init-tools"> + <primary sortas="a-Module-Init-Tools">Module-Init-Tools</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Module-Init-Tools package contains programs for handling kernel + modules in Linux kernels greater than or equal to version 2.5.47.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&module-init-tools-ch6-sbu;</seg> + <seg>&module-init-tools-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Module-Init-Tools</title> + + <para>First correct a potential problem when modules are specified + using regular expressions:</para> + +<screen><userinput>patch -Np1 -i ../module-init-tools-&module-init-tools-version;-modeprobe-1.patch</userinput></screen> + + <para>Issue the following commands to perform the tests (note that the + <command>make distclean</command> command is required to clean up the source + tree, as the source gets recompiled as part of the testing process):</para> + +<screen><userinput>./configure && +make check && +make distclean</userinput></screen> + + <para>Prepare Module-Init-Tools for compilation:</para> + +<screen><userinput>./configure --prefix=/ --enable-zlib</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>Install the package:</para> + +<screen><userinput>make INSTALL=install install</userinput></screen> + + <variablelist> + <title>The meaning of the make parameter:</title> + <varlistentry> + <term><parameter>INSTALL=install</parameter></term> + <listitem> + <para>Normally, <command>make install</command> will not install the + binaries if they already exist. This option overrides that behavior by + calling <command>install</command> instead of using the default + wrapper script.</para> + </listitem> + </varlistentry> + </variablelist> + + </sect2> + + <sect2 id="contents-module-init-tools" role="content"> + <title>Contents of Module-Init-Tools</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>depmod, generate-modprobe.conf, insmod, insmod.static, lsmod, + modinfo, modprobe, and rmmod</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="depmod"> + <term><command>depmod</command></term> + <listitem> + <para>Creates a dependency file based on the symbols it finds in the + existing set of modules; this dependency file is used by + <command>modprobe</command> to automatically load the required + modules</para> + <indexterm zone="ch-system-module-init-tools depmod"> + <primary sortas="b-depmod">depmod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="generate-modprobe.conf"> + <term><command>generate-modprobe.conf</command></term> + <listitem> + <para>Creates a modprobe.conf file from an existing 2.2 or 2.4 module + setup</para> + <indexterm zone="ch-system-module-init-tools generate-modprobe.conf"> + <primary sortas="b-generate-modprobe.conf">generate-modprobe.conf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="insmod"> + <term><command>insmod</command></term> + <listitem> + <para>Installs a loadable module in the running kernel</para> + <indexterm zone="ch-system-module-init-tools insmod"> + <primary sortas="b-insmod">insmod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="insmod.static"> + <term><command>insmod.static</command></term> + <listitem> + <para>A statically compiled version of <command>insmod</command></para> + <indexterm zone="ch-system-module-init-tools insmod.static"> + <primary sortas="b-insmod.static">insmod.static</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lsmod"> + <term><command>lsmod</command></term> + <listitem> + <para>Lists currently loaded modules</para> + <indexterm zone="ch-system-module-init-tools lsmod"> + <primary sortas="b-lsmod">lsmod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="modinfo"> + <term><command>modinfo</command></term> + <listitem> + <para>Examines an object file associated with a kernel module and + displays any information that it can glean</para> + <indexterm zone="ch-system-module-init-tools modinfo"> + <primary sortas="b-modinfo">modinfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="modprobe"> + <term><command>modprobe</command></term> + <listitem> + <para>Uses a dependency file, created by + <command>depmod</command>, to automatically load relevant modules</para> + <indexterm zone="ch-system-module-init-tools modprobe"> + <primary sortas="b-modprobe">modprobe</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rmmod"> + <term><command>rmmod</command></term> + <listitem> + <para>Unloads modules from the running kernel</para> + <indexterm zone="ch-system-module-init-tools rmmod"> + <primary sortas="b-rmmod">rmmod</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml new file mode 100644 index 000000000..b53464fb9 --- /dev/null +++ b/chapter06/ncurses.xml @@ -0,0 +1,337 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-ncurses" role="wrap"> + <?dbhtml filename="ncurses.html"?> + + <title>Ncurses-&ncurses-version;</title> + + <indexterm zone="ch-system-ncurses"> + <primary sortas="a-Ncurses">Ncurses</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Ncurses package contains libraries for terminal-independent + handling of character screens.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&ncurses-ch6-sbu;</seg> + <seg>&ncurses-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Ncurses</title> + + <!-- FIXME: Uncomment if using a dated ncurses release instead of a numbered + one. + + <para>Since the release of Ncurses-&ncurses-version;, some bugs have been fixed + and features added. The most important news are ....... + To get these fixes and features, apply the rollup patch:</para> + +<screen><userinput>bzcat ../&ncurses-rollup-patch; | patch -Np1</userinput></screen> + --> + + <para>Since the release of Ncurses-&ncurses-version;, a memory leak and some + display bugs were found and fixed upstream. Apply those fixes:</para> + +<screen><userinput>patch -Np1 -i ../&ncurses-fixes-patch;</userinput></screen> + + <para>Prepare Ncurses for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --with-shared --without-debug --enable-widec</userinput></screen> + + <variablelist> + <title>The meaning of the configure option:</title> + + <varlistentry> + <term><parameter>--enable-widec</parameter></term> + <listitem> + <para>This switch causes wide-character libraries (e.g., <filename + class="libraryfile">libncursesw.so.&ncurses-version;</filename>) + to be built instead of normal ones (e.g., <filename + class="libraryfile">libncurses.so.&ncurses-version;</filename>). + These wide-character libraries are usable in both multibyte and + traditional 8-bit locales, while normal libraries work properly + only in 8-bit locales. Wide-character and normal libraries are + source-compatible, but not binary-compatible.</para> + </listitem> + </varlistentry> + + <!-- + <varlistentry> + <term><parameter>- -without-cxx-binding</parameter></term> + <listitem> + <para>This optional switch causes the + <filename class="libraryfile">libncurses++w.a</filename> library + not to be built. Nothing in LFS and BLFS uses this library.</para> + </listitem> + </varlistentry> + --> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Give the Ncurses libraries execute permissions:</para> + +<screen><userinput>chmod -v 755 /usr/lib/*.&ncurses-version;</userinput></screen> + + <para>Fix a library that should not be executable:</para> + +<screen><userinput>chmod -v 644 /usr/lib/libncurses++w.a</userinput></screen> + + <para>Move the libraries to the <filename class="directory">/lib</filename> directory, + where they are expected to reside:</para> + +<screen><userinput>mv -v /usr/lib/libncursesw.so.5* /lib</userinput></screen> + + <para>Because the libraries have been moved, one symlink points to + a non-existent file. Recreate it:</para> + +<screen><userinput>ln -sfv ../../lib/libncursesw.so.5 /usr/lib/libncursesw.so</userinput></screen> + + <para>Many applications still expect the linker to be able to find + non-wide-character Ncurses libraries. Trick such applications into linking with + wide-character libraries by means of symlinks and linker scripts:</para> + +<screen><userinput>for lib in curses ncurses form panel menu ; do \ + rm -vf /usr/lib/lib${lib}.so ; \ + echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; \ + ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \ +done && +ln -sfv libncurses++w.a /usr/lib/libncurses++.a</userinput></screen> + + <para>Finally, make sure that old applications that look for + <filename class="libraryfile">-lcurses</filename> at build time are still + buildable:</para> + +<screen><userinput>echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so && +ln -sfv libncurses.so /usr/lib/libcurses.so && +ln -sfv libncursesw.a /usr/lib/libcursesw.a && +ln -sfv libncurses.a /usr/lib/libcurses.a</userinput></screen> + + <note> + <para>The instructions above don't create non-wide-character Ncurses + libraries since no package installed by compiling from sources would + link against them at runtime. If you must have such libraries because + of some binary-only application, build them with the following + commands:</para> + +<screen role="nodump"><userinput>make distclean && +./configure --prefix=/usr --with-shared --without-normal \ + --without-debug --without-cxx-binding && +make sources libs && +cp -av lib/lib*.so.5* /usr/lib</userinput></screen> + </note> + + </sect2> + + <sect2 id="contents-ncurses" role="content"> + <title>Contents of Ncurses</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>captoinfo (link to tic), clear, infocmp, infotocap (link to tic), + reset (link to tset), tack, tic, toe, tput, and tset</seg> + <seg>libcursesw.{a,so} (symlink and linker script to libncursesw.{a,so}), + libformw.{a,so}, libmenuw.{a,so}, libncurses++w.a, libncursesw.{a,so}, + libpanelw.{a,so} and their non-wide-character counterparts without "w" + in the library names.</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="captoinfo"> + <term><command>captoinfo</command></term> + <listitem> + <para>Converts a termcap description into a terminfo description</para> + <indexterm zone="ch-system-ncurses captoinfo"> + <primary sortas="b-captoinfo">captoinfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="clear"> + <term><command>clear</command></term> + <listitem> + <para>Clears the screen, if possible</para> + <indexterm zone="ch-system-ncurses clear"> + <primary sortas="b-clear">clear</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="infocmp"> + <term><command>infocmp</command></term> + <listitem> + <para>Compares or prints out terminfo descriptions</para> + <indexterm zone="ch-system-ncurses infocmp"> + <primary sortas="b-infocmp">infocmp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="infotocap"> + <term><command>infotocap</command></term> + <listitem> + <para>Converts a terminfo description into a termcap description</para> + <indexterm zone="ch-system-ncurses infotocap"> + <primary sortas="b-infotocap">infotocap</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="reset"> + <term><command>reset</command></term> + <listitem> + <para>Reinitializes a terminal to its default values</para> + <indexterm zone="ch-system-ncurses reset"> + <primary sortas="b-reset">reset</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tack"> + <term><command>tack</command></term> + <listitem> + <para>The terminfo action checker; it is mainly used to test the + accuracy of an entry in the terminfo database</para> + <indexterm zone="ch-system-ncurses tack"> + <primary sortas="b-tack">tack</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tic"> + <term><command>tic</command></term> + <listitem> + <para>The terminfo entry-description compiler that translates a + terminfo file from source format into the binary format needed for the + ncurses library routines. A terminfo file contains information on the + capabilities of a certain terminal</para> + <indexterm zone="ch-system-ncurses tic"> + <primary sortas="b-tic">tic</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="toe"> + <term><command>toe</command></term> + <listitem> + <para>Lists all available terminal types, giving the primary name and + description for each</para> + <indexterm zone="ch-system-ncurses toe"> + <primary sortas="b-toe">toe</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tput"> + <term><command>tput</command></term> + <listitem> + <para>Makes the values of terminal-dependent capabilities available to + the shell; it can also be used to reset or initialize a terminal or + report its long name</para> + <indexterm zone="ch-system-ncurses tput"> + <primary sortas="b-tput">tput</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tset"> + <term><command>tset</command></term> + <listitem> + <para>Can be used to initialize terminals</para> + <indexterm zone="ch-system-ncurses tset"> + <primary sortas="b-tset">tset</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libcurses"> + <term><filename class="libraryfile">libcurses</filename></term> + <listitem> + <para>A link to <filename>libncurses</filename></para> + <indexterm zone="ch-system-ncurses libcurses"> + <primary sortas="c-libcurses">libcurses</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libncurses"> + <term><filename class="libraryfile">libncurses</filename></term> + <listitem> + <para>Contains functions to display text in many complex ways on a + terminal screen; a good example of the use of these functions is the + menu displayed during the kernel's <command>make + menuconfig</command></para> + <indexterm zone="ch-system-ncurses libncurses"> + <primary sortas="c-libncurses">libncurses</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libform"> + <term><filename class="libraryfile">libform</filename></term> + <listitem> + <para>Contains functions to implement forms</para> + <indexterm zone="ch-system-ncurses libform"> + <primary sortas="c-libform">libform</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libmenu"> + <term><filename class="libraryfile">libmenu</filename></term> + <listitem> + <para>Contains functions to implement menus</para> + <indexterm zone="ch-system-ncurses libmenu"> + <primary sortas="c-libmenu">libmenu</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libpanel"> + <term><filename class="libraryfile">libpanel</filename></term> + <listitem> + <para>Contains functions to implement panels</para> + <indexterm zone="ch-system-ncurses libpanel"> + <primary sortas="c-libpanel">libpanel</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/patch.xml b/chapter06/patch.xml new file mode 100644 index 000000000..3f7c97988 --- /dev/null +++ b/chapter06/patch.xml @@ -0,0 +1,88 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-patch" role="wrap"> + <?dbhtml filename="patch.html"?> + + <title>Patch-&patch-version;</title> + + <indexterm zone="ch-system-patch"> + <primary sortas="a-Patch">Patch</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Patch package contains a program for modifying or creating files + by applying a <quote>patch</quote> file typically created by the + <command>diff</command> program.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&patch-ch6-sbu;</seg> + <seg>&patch-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Patch</title> + + <para>Prepare Patch for compilation.</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-patch" role="content"> + <title>Contents of Patch</title> + + <segmentedlist> + <segtitle>Installed program</segtitle> + + <seglistitem> + <seg>patch</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="patch"> + <term><command>patch</command></term> + <listitem> + <para>Modifies files according to a patch file. A patch file is + normally a difference listing created with the <command>diff</command> + program. By applying these differences to the original files, + <command>patch</command> creates the patched versions.</para> + <indexterm zone="ch-system-patch patch"> + <primary sortas="b-patch">patch</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/perl.xml b/chapter06/perl.xml new file mode 100644 index 000000000..50efc833a --- /dev/null +++ b/chapter06/perl.xml @@ -0,0 +1,423 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-perl" role="wrap"> + <?dbhtml filename="perl.html"?> + + <title>Perl-&perl-version;</title> + + <indexterm zone="ch-system-perl"> + <primary sortas="a-Perl">Perl</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Perl package contains the Practical Extraction and Report + Language.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&perl-ch6-sbu;</seg> + <seg>&perl-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Perl</title> + + <para>First create a basic <filename>/etc/hosts</filename> file which will be + referenced in one of Perl's configuration files as well as being used used by + the testsuite if you run that.</para> + +<screen><userinput>echo "127.0.0.1 localhost $(hostname)" > /etc/hosts</userinput></screen> + + <para>To have full control over the way Perl is set up, run the + interactive <command>Configure</command> script and hand-pick the way + this package is built. If the defaults it auto-detects are suitable, + prepare Perl for compilation with:</para> + +<screen><userinput>./configure.gnu --prefix=/usr \ + -Dman1dir=/usr/share/man/man1 \ + -Dman3dir=/usr/share/man/man3 \ + -Dpager="/usr/bin/less -isR"</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>-Dpager="/usr/bin/less -isR"</parameter></term> + <listitem> + <para>This corrects an error in the way that <command>perldoc</command> + invokes the <command>less</command> program.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>-Dman1dir=/usr/share/man/man1 + -Dman3dir=/usr/share/man/man3</parameter></term> + <listitem> + <para>Since Groff is not installed yet, <command>Configure</command> + thinks that we do not want man pages for Perl. Issuing these + parameters overrides this decision.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make test</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-perl" role="content"> + <title>Contents of Perl</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>a2p, c2ph, dprofpp, enc2xs, find2perl, h2ph, h2xs, instmodsh, libnetcfg, perl, + perl&perl-version; (link to perl), perlbug, perlcc, perldoc, perlivp, + piconv, pl2pm, pod2html, pod2latex, pod2man, pod2text, pod2usage, + podchecker, podselect, psed (link to s2p), pstruct (link to c2ph), s2p, + splain, and xsubpp</seg> + <seg>Several hundred which cannot all be listed here</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="a2p"> + <term><command>a2p</command></term> + <listitem> + <para>Translates awk to Perl</para> + <indexterm zone="ch-system-perl a2p"> + <primary sortas="b-a2p">a2p</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="c2ph"> + <term><command>c2ph</command></term> + <listitem> + <para>Dumps C structures as generated from + <command>cc -g -S</command></para> + <indexterm zone="ch-system-perl c2ph"> + <primary sortas="b-c2ph">c2ph</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dprofpp"> + <term><command>dprofpp</command></term> + <listitem> + <para>Displays Perl profile data</para> + <indexterm zone="ch-system-perl dprofpp"> + <primary sortas="b-dprofpp">dprofpp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="enc2xs"> + <term><command>enc2xs</command></term> + <listitem> + <para>Builds a Perl extension for the Encode module from either + Unicode Character Mappings or Tcl Encoding Files</para> + <indexterm zone="ch-system-perl enc2xs"> + <primary sortas="b-enc2xs">enc2xs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="find2perl"> + <term><command>find2perl</command></term> + <listitem> + <para>Translates <command>find</command> commands to Perl</para> + <indexterm zone="ch-system-perl find2perl"> + <primary sortas="b-find2perl">find2perl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="h2ph"> + <term><command>h2ph</command></term> + <listitem> + <para>Converts <filename class="extension">.h</filename> C header + files to <filename class="extension">.ph</filename> Perl header + files</para> + <indexterm zone="ch-system-perl h2ph"> + <primary sortas="b-h2ph">h2ph</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="h2xs"> + <term><command>h2xs</command></term> + <listitem> + <para>Converts <filename class="extension">.h</filename> C header + files to Perl extensions</para> + <indexterm zone="ch-system-perl h2xs"> + <primary sortas="b-h2xs">h2xs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="instmodsh"> + <term><command>instmodsh</command></term> + <listitem> + <para>Shell script for examining installed Perl modules, + and can even create a tarball from an installed module</para> + <indexterm zone="ch-system-perl instmodsh"> + <primary sortas="b-instmodsh">instmodsh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libnetcfg"> + <term><command>libnetcfg</command></term> + <listitem> + <para>Can be used to configure the + <filename class="libraryfile">libnet</filename></para> + <indexterm zone="ch-system-perl libnetcfg"> + <primary sortas="b-libnetcfg">libnetcfg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="perl"> + <term><command>perl</command></term> + <listitem> + <para>Combines some of the best features of C, <command>sed</command>, + <command>awk</command> and <command>sh</command> into a single + swiss-army language</para> + <indexterm zone="ch-system-perl perl"> + <primary sortas="b-perl">perl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="perl-version"> + <term><command>perl&perl-version;</command></term> + <listitem> + <para>A hard link to <command>perl</command></para> + <indexterm zone="ch-system-perl perl-version"> + <primary sortas="b-perl&perl-version;">perl&perl-version;</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="perlbug"> + <term><command>perlbug</command></term> + <listitem> + <para>Used to generate bug reports about Perl, or the modules that come + with it, and mail them</para> + <indexterm zone="ch-system-perl perlbug"> + <primary sortas="b-perlbug">perlbug</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="perlcc"> + <term><command>perlcc</command></term> + <listitem> + <para>Generates executables from Perl programs</para> + <indexterm zone="ch-system-perl perlcc"> + <primary sortas="b-perlcc">perlcc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="perldoc"> + <term><command>perldoc</command></term> + <listitem> + <para>Displays a piece of documentation in pod format that is embedded + in the Perl installation tree or in a Perl script</para> + <indexterm zone="ch-system-perl perldoc"> + <primary sortas="b-perldoc">perldoc</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="perlivp"> + <term><command>perlivp</command></term> + <listitem> + <para>The Perl Installation Verification Procedure; it can be used to + verify that Perl and its libraries have been installed + correctly</para> + <indexterm zone="ch-system-perl perlivp"> + <primary sortas="b-perlivp">perlivp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="piconv"> + <term><command>piconv</command></term> + <listitem> + <para>A Perl version of the character encoding converter + <command>iconv</command></para> + <indexterm zone="ch-system-perl piconv"> + <primary sortas="b-piconv">piconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pl2pm"> + <term><command>pl2pm</command></term> + <listitem> + <para>A rough tool for converting Perl4 + <filename class="extension">.pl</filename> files to Perl5 + <filename class="extension">.pm</filename> modules</para> + <indexterm zone="ch-system-perl pl2pm"> + <primary sortas="b-pl2pm">pl2pm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pod2html"> + <term><command>pod2html</command></term> + <listitem> + <para>Converts files from pod format to HTML format</para> + <indexterm zone="ch-system-perl pod2html"> + <primary sortas="b-pod2html">pod2html</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pod2latex"> + <term><command>pod2latex</command></term> + <listitem> + <para>Converts files from pod format to LaTeX format</para> + <indexterm zone="ch-system-perl pod2latex"> + <primary sortas="b-pod2latex">pod2latex</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pod2man"> + <term><command>pod2man</command></term> + <listitem> + <para>Converts pod data to formatted *roff input</para> + <indexterm zone="ch-system-perl pod2man"> + <primary sortas="b-pod2man">pod2man</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pod2text"> + <term><command>pod2text</command></term> + <listitem> + <para>Converts pod data to formatted ASCII text</para> + <indexterm zone="ch-system-perl pod2text"> + <primary sortas="b-pod2text">pod2text</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pod2usage"> + <term><command>pod2usage</command></term> + <listitem> + <para>Prints usage messages from embedded pod docs in files</para> + <indexterm zone="ch-system-perl pod2usage"> + <primary sortas="b-pod2usage">pod2usage</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="podchecker"> + <term><command>podchecker</command></term> + <listitem> + <para>Checks the syntax of pod format documentation files</para> + <indexterm zone="ch-system-perl podchecker"> + <primary sortas="b-podchecker">podchecker</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="podselect"> + <term><command>podselect</command></term> + <listitem> + <para>Displays selected sections of pod documentation</para> + <indexterm zone="ch-system-perl podselect"> + <primary sortas="b-podselect">podselect</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="psed"> + <term><command>psed</command></term> + <listitem> + <para>A Perl version of the stream editor <command>sed</command></para> + <indexterm zone="ch-system-perl psed"> + <primary sortas="b-psed">psed</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pstruct"> + <term><command>pstruct</command></term> + <listitem> + <para>Dumps C structures as generated from <command>cc -g -S</command> + stabs</para> + <indexterm zone="ch-system-perl pstruct"> + <primary sortas="b-pstruct">pstruct</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="s2p"> + <term><command>s2p</command></term> + <listitem> + <para>Translates <command>sed</command> scripts to Perl</para> + <indexterm zone="ch-system-perl s2p"> + <primary sortas="b-s2p">s2p</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="splain"> + <term><command>splain</command></term> + <listitem> + <para>Is used to force verbose warning diagnostics in Perl</para> + <indexterm zone="ch-system-perl splain"> + <primary sortas="b-splain">splain</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="xsubpp"> + <term><command>xsubpp</command></term> + <listitem> + <para>Converts Perl XS code into C code</para> + <indexterm zone="ch-system-perl xsubpp"> + <primary sortas="b-xsubpp">xsubpp</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/pkgmgt.xml b/chapter06/pkgmgt.xml new file mode 100644 index 000000000..c5c783b92 --- /dev/null +++ b/chapter06/pkgmgt.xml @@ -0,0 +1,235 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-pkgmgt"> + <?dbhtml filename="pkgmgt.html"?> + + <title>Package Management</title> + + <para>Package Management is an often requested addition to the LFS Book. A + Package Manager allows tracking the installation of files making it easy to + remove and upgrade packages. Before you begin to wonder, NO—this section + will not talk about nor recommend any particular package manager. What it + provides is a roundup of the more popular techniques and how they work. The + perfect package manager for you may be among these techniques or may be a + combination of two or more of these techniques. This section briefly mentions + issues that may arise when upgrading packages.</para> + + <para>Some reasons why no package manager is mentioned in LFS or BLFS + include:</para> + + <itemizedlist> + <listitem> + <para>Dealing with package management takes the focus away from the goals + of these books—teaching how a Linux system is built.</para> + </listitem> + + <listitem> + <para>There are multiple solutions for package management, each having + its strengths and drawbacks. Including one that satisfies all audiences + is difficult.</para> + </listitem> + </itemizedlist> + + <para>There are some hints written on the topic of package management. Visit + the <ulink url="&hints-root;">Hints subproject</ulink> and see if one of them + fits your need.</para> + + <sect2> + <title>Upgrade Issues</title> + + <para>A Package Manager makes it easy to upgrade to newer versions when they + are released. Generally the instructions in the LFS and BLFS Book can be + used to upgrade to the newer versions. Here are some points that you should + be aware of when upgrading packages, especially on a running system.</para> + + <itemizedlist> + <listitem> + <para>If one of the toolchain packages (Glibc, GCC or Binutils) needs + to be upgraded to a newer minor version, it is safer to rebuild LFS. + Though you <emphasis>may</emphasis> be able to get by rebuilding all + the packages in their dependency order, we do not recommend it. For + example, if glibc-2.2.x needs to be updated to glibc-2.3.x, it is safer + to rebuild. For micro version updates, a simple reinstallation usually + works, but is not guaranteed. For example, upgrading from glibc-2.3.4 + to glibc-2.3.5 will not usually cause any problems.</para> + </listitem> + + <listitem> + <para>If a package containing a shared library is updated, and if the + name of the library changes, then all the packages dynamically linked + to the library need to be recompiled to link against the newer library. + (Note that there is no correlation between the package version and the + name of the library.) For example, consider a package foo-1.2.3 that + installs a shared library with name + <filename class='libraryfile'>libfoo.so.1</filename>. Say you upgrade + the package to a newer version foo-1.2.4 that installs a shared library + with name <filename class='libraryfile'>libfoo.so.2</filename>. In this + case, all packages that are dynamically linked to + <filename class='libraryfile'>libfoo.so.1</filename> need to be + recompiled to link against + <filename class='libraryfile'>libfoo.so.2</filename>. Note that you + should not remove the previous libraries until the dependent packages + are recompiled.</para> + </listitem> + </itemizedlist> + + </sect2> + + <sect2> + <title>Package Management Techniques</title> + + <para>The following are some common package management techniques. Before + making a decision on a package manager, do some research on the various + techniques, particularly the drawbacks of the particular scheme.</para> + + <sect3> + <title>It is All in My Head!</title> + + <para>Yes, this is a package management technique. Some folks do not find + the need for a package manager because they know the packages intimately + and know what files are installed by each package. Some users also do not + need any package management because they plan on rebuilding the entire + system when a package is changed.</para> + + </sect3> + + <sect3> + <title>Install in Separate Directories</title> + + <para>This is a simplistic package management that does not need any extra + package to manage the installations. Each package is installed in a + separate directory. For example, package foo-1.1 is installed in + <filename class='directory'>/usr/pkg/foo-1.1</filename> + and a symlink is made from <filename>/usr/pkg/foo</filename> to + <filename class='directory'>/usr/pkg/foo-1.1</filename>. When installing + a new version foo-1.2, it is installed in + <filename class='directory'>/usr/pkg/foo-1.2</filename> and the previous + symlink is replaced by a symlink to the new version.</para> + + <para>Environment variables such as <envar>PATH</envar>, + <envar>LD_LIBRARY_PATH</envar>, <envar>MANPATH</envar>, + <envar>INFOPATH</envar> and <envar>CPPFLAGS</envar> need to be expanded to + include <filename>/usr/pkg/foo</filename>. For more than a few packages, + this scheme becomes unmanageable.</para> + + </sect3> + + <sect3> + <title>Symlink Style Package Management</title> + + <para>This is a variation of the previous package management technique. + Each package is installed similar to the previous scheme. But instead of + making the symlink, each file is symlinked into the + <filename class='directory'>/usr</filename> hierarchy. This removes the + need to expand the environment variables. Though the symlinks can be + created by the user to automate the creation, many package managers have + been written using this approach. A few of the popular ones include Stow, + Epkg, Graft, and Depot.</para> + + <para>The installation needs to be faked, so that the package thinks that + it is installed in <filename class="directory">/usr</filename> though in + reality it is installed in the + <filename class="directory">/usr/pkg</filename> hierarchy. Installing in + this manner is not usually a trivial task. For example, consider that you + are installing a package libfoo-1.1. The following instructions may + not install the package properly:</para> + +<screen role="nodump"><userinput>./configure --prefix=/usr/pkg/libfoo/1.1 +make +make install</userinput></screen> + + <para>The installation will work, but the dependent packages may not link + to libfoo as you would expect. If you compile a package that links against + libfoo, you may notice that it is linked to + <filename class='libraryfile'>/usr/pkg/libfoo/1.1/lib/libfoo.so.1</filename> + instead of <filename class='libraryfile'>/usr/lib/libfoo.so.1</filename> + as you would expect. The correct approach is to use the + <envar>DESTDIR</envar> strategy to fake installation of the package. This + approach works as follows:</para> + +<screen role="nodump"><userinput>./configure --prefix=/usr +make +make DESTDIR=/usr/pkg/libfoo/1.1 install</userinput></screen> + + <para>Most packages support this approach, but there are some which do not. + For the non-compliant packages, you may either need to manually install the + package, or you may find that it is easier to install some problematic + packages into <filename class='directory'>/opt</filename>.</para> + + </sect3> + + <sect3> + <title>Timestamp Based</title> + + <para>In this technique, a file is timestamped before the installation of + the package. After the installation, a simple use of the + <command>find</command> command with the appropriate options can generate + a log of all the files installed after the timestamp file was created. A + package manager written with this approach is install-log.</para> + + <para>Though this scheme has the advantage of being simple, it has two + drawbacks. If, during installation, the files are installed with any + timestamp other than the current time, those files will not be tracked by + the package manager. Also, this scheme can only be used when one package + is installed at a time. The logs are not reliable if two packages are + being installed on two different consoles.</para> + + </sect3> + + <sect3> + <title>LD_PRELOAD Based</title> + + <para>In this approach, a library is preloaded before installation. During + installation, this library tracks the packages that are being installed by + attaching itself to various executables such as <command>cp</command>, + <command>install</command>, <command>mv</command> and tracking the system + calls that modify the filesystem. For this approach to work, all the + executables need to be dynamically linked without the suid or sgid bit. + Preloading the library may cause some unwanted side-effects during + installation. Therefore, it is advised that one performs some tests to + ensure that the package manager does not break anything and logs all the + appropriate files.</para> + + </sect3> + + <sect3> + <title>Creating Package Archives</title> + + <para>In this scheme, the package installation is faked into a separate + tree as described in the Symlink style package management. After the + installation, a package archive is created using the installed files. + This archive is then used to install the package either on the local + machine or can even be used to install the package on other machines.</para> + + <para>This approach is used by most of the package managers found in the + commercial distributions. Examples of package managers that follow this + approach are RPM (which, incidentally, is required by the <ulink + url="http://lsbbook.gforge.freestandards.org/package.html#RPM">Linux + Standard Base Specification</ulink>), pkg-utils, Debian's apt, and + Gentoo's Portage system. A hint describing how to adopt this style of + package management for LFS systems is located at <ulink + url="&hints-root;fakeroot.txt"/>.</para> + + </sect3> + + <sect3> + <title>User Based Management</title> + + <para>This scheme, unique to LFS, was devised by Matthias Benkmann, and is + available from the <ulink url="&hints-root;">Hints Project</ulink>. In + this scheme, each package is installed as a separate user into the + standard locations. Files belonging to a package are easily identified by + checking the user ID. The features and shortcomings of this approach are + too complex to describe in this section. For the details please see the + hint at <ulink url="&hints-root;more_control_and_pkg_man.txt"/>.</para> + + </sect3> + + </sect2> + +</sect1> diff --git a/chapter06/procps.xml b/chapter06/procps.xml new file mode 100644 index 000000000..341ab24e5 --- /dev/null +++ b/chapter06/procps.xml @@ -0,0 +1,252 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-procps" role="wrap"> + <?dbhtml filename="procps.html"?> + + <title>Procps-&procps-version;</title> + + <indexterm zone="ch-system-procps"> + <primary sortas="a-Procps">Procps</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Procps package contains programs for monitoring processes.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&procps-ch6-sbu;</seg> + <seg>&procps-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Procps</title> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-procps" role="content"> + <title>Contents of Procps</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed library</segtitle> + + <seglistitem> + <seg>free, kill, pgrep, pkill, pmap, ps, skill, slabtop, snice, + sysctl, tload, top, uptime, vmstat, w, and watch</seg> + <seg>libproc.so</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="free"> + <term><command>free</command></term> + <listitem> + <para>Reports the amount of free and used memory (both physical and + swap memory) in the system</para> + <indexterm zone="ch-system-procps free"> + <primary sortas="b-free">free</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="kill"> + <term><command>kill</command></term> + <listitem> + <para>Sends signals to processes</para> + <indexterm zone="ch-system-procps kill"> + <primary sortas="b-kill">kill</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pgrep"> + <term><command>pgrep</command></term> + <listitem> + <para>Looks up processes based on their name and other attributes</para> + <indexterm zone="ch-system-procps pgrep"> + <primary sortas="b-pgrep">pgrep</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pkill"> + <term><command>pkill</command></term> + <listitem> + <para>Signals processes based on their name and other attributes</para> + <indexterm zone="ch-system-procps pkill"> + <primary sortas="b-pkill">pkill</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pmap"> + <term><command>pmap</command></term> + <listitem> + <para>Reports the memory map of the given process</para> + <indexterm zone="ch-system-procps pmap"> + <primary sortas="b-pmap">pmap</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ps"> + <term><command>ps</command></term> + <listitem> + <para>Lists the current running processes</para> + <indexterm zone="ch-system-procps ps"> + <primary sortas="b-ps">ps</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="skill"> + <term><command>skill</command></term> + <listitem> + <para>Sends signals to processes matching the given criteria</para> + <indexterm zone="ch-system-procps skill"> + <primary sortas="b-skill">skill</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="slabtop"> + <term><command>slabtop</command></term> + <listitem> + <para>Displays detailed kernel slap cache information in real time</para> + <indexterm zone="ch-system-procps slabtop"> + <primary sortas="b-slabtop">slabtop</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="snice"> + <term><command>snice</command></term> + <listitem> + <para>Changes the scheduling priority of processes matching the given + criteria</para> + <indexterm zone="ch-system-procps snice"> + <primary sortas="b-snice">snice</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sysctl"> + <term><command>sysctl</command></term> + <listitem> + <para>Modifies kernel parameters at run time</para> + <indexterm zone="ch-system-procps sysctl"> + <primary sortas="b-sysctl">sysctl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tload"> + <term><command>tload</command></term> + <listitem> + <para>Prints a graph of the current system load average</para> + <indexterm zone="ch-system-procps tload"> + <primary sortas="b-tload">tload</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="top"> + <term><command>top</command></term> + <listitem> + <para>Displays a list of the most CPU intensive processes; it + provides an ongoing look at processor activity in real time</para> + <indexterm zone="ch-system-procps top"> + <primary sortas="b-top">top</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="uptime"> + <term><command>uptime</command></term> + <listitem> + <para>Reports how long the system has been running, how many users are + logged on, and the system load averages</para> + <indexterm zone="ch-system-procps uptime"> + <primary sortas="b-uptime">uptime</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vmstat"> + <term><command>vmstat</command></term> + <listitem> + <para>Reports virtual memory statistics, giving information about + processes, memory, paging, block Input/Output (IO), traps, and CPU + activity</para> + <indexterm zone="ch-system-procps vmstat"> + <primary sortas="b-vmstat">vmstat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="w"> + <term><command>w</command></term> + <listitem> + <para>Shows which users are currently logged on, where, and since + when</para> + <indexterm zone="ch-system-procps w"> + <primary sortas="b-w">w</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="watch"> + <term><command>watch</command></term> + <listitem> + <para>Runs a given command repeatedly, displaying the first + screen-full of its output; this allows a user to watch the output + change over time</para> + <indexterm zone="ch-system-procps watch"> + <primary sortas="b-watch">watch</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libproc"> + <term><filename class="libraryfile">libproc</filename></term> + <listitem> + <para>Contains the functions used by most programs in this + package</para> + <indexterm zone="ch-system-procps libproc"> + <primary sortas="c-libproc">libproc</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/psmisc.xml b/chapter06/psmisc.xml new file mode 100644 index 000000000..299ef5ff6 --- /dev/null +++ b/chapter06/psmisc.xml @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-psmisc" role="wrap"> + <?dbhtml filename="psmisc.html"?> + + <title>Psmisc-&psmisc-version;</title> + + <indexterm zone="ch-system-psmisc"> + <primary sortas="a-Psmisc">Psmisc</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Psmisc package contains programs for displaying information about + running processes.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&psmisc-ch6-sbu;</seg> + <seg>&psmisc-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Psmisc</title> + + <para>Prepare Psmisc for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --exec-prefix=""</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--exec-prefix=""</parameter></term> + <listitem> + <para>This ensures that the Psmisc binaries will install into + <filename class="directory">/bin</filename> instead of <filename + class="directory">/usr/bin</filename>. This is the correct location + according to the FHS, because some of the Psmisc binaries are used + by the LFS-Bootscripts package.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>There is no reason for the <command>pstree</command> and + <command>pstree.x11</command> programs to reside in <filename + class="directory">/bin</filename>. Therefore, move them to <filename + class="directory">/usr/bin</filename>:</para> + +<screen><userinput>mv -v /bin/pstree* /usr/bin</userinput></screen> + + <para>By default, Psmisc's <command>pidof</command> program is not + installed. This usually is not a problem because it is installed later + in the Sysvinit package, which provides a better + <command>pidof</command> program. If Sysvinit will not be used for a + particular system, complete the installation of Psmisc by creating the + following symlink:</para> + +<screen><userinput>ln -sv killall /bin/pidof</userinput></screen> + + </sect2> + + <sect2 id="contents-psmisc" role="content"> + <title>Contents of Psmisc</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>fuser, killall, pstree, and pstree.x11 (link to pstree)</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="fuser"> + <term><command>fuser</command></term> + <listitem> + <para>Reports the Process IDs (PIDs) of processes that use the given + files or file systems</para> + <indexterm zone="ch-system-psmisc fuser"> + <primary sortas="b-fuser">fuser</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="killall"> + <term><command>killall</command></term> + <listitem> + <para>Kills processes by name; it sends a signal to all processes + running any of the given commands</para> + <indexterm zone="ch-system-psmisc killall"> + <primary sortas="b-killall">killall</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="oldfuser"> + <term><command>oldfuser</command></term> + <listitem> + <para>Reports the Process IDs (PIDs) of processes that use the given + files or file systems</para> + <indexterm zone="ch-system-psmisc oldfuser"> + <primary sortas="b-oldfuser">oldfuser</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pstree"> + <term><command>pstree</command></term> + <listitem> + <para>Displays running processes as a tree</para> + <indexterm zone="ch-system-psmisc pstree"> + <primary sortas="b-pstree">pstree</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pstree.x11"> + <term><command>pstree.x11</command></term> + <listitem> + <para>Same as <command>pstree</command>, except that it waits for + confirmation before exiting</para> + <indexterm zone="ch-system-psmisc pstree.x11"> + <primary sortas="b-pstree.x11">pstree.x11</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/readjusting.xml b/chapter06/readjusting.xml new file mode 100644 index 000000000..3107168fa --- /dev/null +++ b/chapter06/readjusting.xml @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-readjusting"> + <?dbhtml filename="readjusting.html"?> + + <title>Re-adjusting the Toolchain</title> + + <para>Now that the final C libraries have been installed, it is time to adjust + the toolchain again. The toolchain will be adjusted so that it will link any + newly compiled program against these new libraries. This is a similar process + used in the <quote>Adjusting</quote> phase in the beginning of <xref + linkend="chapter-temporary-tools"/>, but with the adjustments reversed. In <xref + linkend="chapter-temporary-tools"/>, the chain was guided from the host's + <filename class="directory">/{,usr/}lib</filename> directories to the new + <filename class="directory">/tools/lib</filename> directory. Now, the chain will + be guided from that same <filename class="directory">/tools/lib</filename> + directory to the LFS <filename class="directory">/{,usr/}lib</filename> + directories.</para> + + <para>First, backup the <filename class="directory">/tools</filename> linker, + and replace it with the adjusted linker we made in chapter 5. We'll also create + a link to its counterpart in <filename class="directory">/tools/$(gcc + -dumpmachine)/bin</filename>.</para> + +<screen><userinput>mv -v /tools/bin/{ld,ld-old} +mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} +mv -v /tools/bin/{ld-new,ld} +ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld</userinput></screen> + + <para>Next, amend the GCC specs file so that it points to the new + dynamic linker, and so that GCC knows where to find its start files. + A <command>perl</command> command accomplishes this:</para> + +<screen><userinput>gcc -dumpspecs | \ +perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ + -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ + `dirname $(gcc --print-libgcc-file-name)`/specs</userinput></screen> + + <para>It is a good idea to visually inspect the specs file to verify the + intended change was actually made.</para> + + <important> + <para>If working on a platform where the name of the dynamic linker is + something other than <filename class="libraryfile">ld-linux.so.2</filename>, + substitute <quote>ld-linux.so.2</quote> with the name of the platform's + dynamic linker in the above commands. Refer back to <xref + linkend="ch-tools-toolchaintechnotes" role=","/> if necessary.</para> + </important> + + <para>It is imperative at this point to ensure that the basic + functions (compiling and linking) of the adjusted toolchain are working + as expected. To do this, perform the following sanity checks:</para> + +<screen role="nodump" os="a"><userinput>echo 'main(){}' > dummy.c +cc dummy.c -Wl,--verbose &> dummy.log +readelf -l a.out | grep ': /lib'</userinput></screen> + + <para os="b">If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name):</para> + +<screen os="c"><computeroutput>[Requesting program interpreter: /lib/ld-linux.so.2]</computeroutput></screen> + + <para>Note that <filename class="directory">/lib</filename> is now + the prefix of our dynamic linker.</para> + + <para os="d">Now make sure that we're setup to use the correct startfiles:</para> + +<screen role="nodump" os="e"><userinput>grep -o '/usr/lib.*/crt[1in].* .*' dummy.log</userinput></screen> + + <para os="f">If everything is working correctly, there should be no errors, + and the output of the last command will be:</para> + +<screen><computeroutput>/usr/lib/crt1.o succeeded +/usr/lib/crti.o succeeded +/usr/lib/crtn.o succeeded</computeroutput></screen> + + <para os="g">Next, verify that the new linker is being used with the correct search paths:</para> + +<screen role="nodump" os="h"><userinput>grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g'</userinput></screen> + + <para os="i">If everything is working correctly, there should be no errors, + and the output of the last command will be:</para> + +<screen><computeroutput>SEARCH_DIR("/tools/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/lib") +SEARCH_DIR("/lib");</computeroutput></screen> + + <para os="j">Next make sure that we're using the correct libc:</para> + +<screen role="nodump" os="k"><userinput>grep "/lib/libc.so.6 " dummy.log</userinput></screen> + + <para os="l">If everything is working correctly, there should be no errors, + and the output of the last command will be:</para> + +<screen os="m"><computeroutput>attempt to open /lib/libc.so.6 succeeded</computeroutput></screen> + + <para os="n">Lastly, make sure GCC is using the correct dynamic linker:</para> + +<screen role="nodump" os="o"><userinput>grep found dummy.log</userinput></screen> + + <para os="p">If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name):</para> + +<screen os="q"><computeroutput>found ld-linux.so.2 at /lib/ld-linux.so.2</computeroutput></screen> + + <para os="r">If the output does not appear as shown above or is not received + at all, then something is seriously wrong. Investigate and retrace the + steps to find out where the problem is and correct it. The most likely + reason is that something went wrong with the specs file adjustment. Any + issues will need to be resolved before continuing on with the process.</para> + + <para os="s">Once everything is working correctly, clean up the test files:</para> + +<screen role="nodump" os="t"><userinput>rm -v dummy.c a.out dummy.log</userinput></screen> + +</sect1> diff --git a/chapter06/readline.xml b/chapter06/readline.xml new file mode 100644 index 000000000..9dc0f48e2 --- /dev/null +++ b/chapter06/readline.xml @@ -0,0 +1,139 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-readline" role="wrap"> + <?dbhtml filename="readline.html"?> + + <title>Readline-&readline-version;</title> + + <indexterm zone="ch-system-readline"> + <primary sortas="a-Readline">Readline</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Readline package is a set of libraries that offers command-line + editing and history capabilities.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&readline-ch6-sbu;</seg> + <seg>&readline-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Readline</title> + + <para>Upstream developers have fixed several issues since the initial + release of Readline-&readline-version;. Apply those fixes:</para> + +<screen><userinput>patch -Np1 -i ../&readline-fixes-patch;</userinput></screen> + + <para>Reinstalling Readline will cause the old libraries to be moved to + <libraryname>.old. While this is normally not a problem, in some cases + it can trigger a linking bug in <command>ldconfig</command>. This can be + avoided by issuing the following two seds:</para> + +<screen><userinput>sed -i '/MV.*old/d' Makefile.in +sed -i '/{OLDSUFF}/c:' support/shlib-install</userinput></screen> + + <para>Prepare Readline for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --libdir=/lib</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make SHLIB_LIBS=-lncurses</userinput></screen> + + <variablelist> + <title>The meaning of the make option:</title> + + <varlistentry> + <term><parameter>SHLIB_LIBS=-lncurses</parameter></term> + <listitem> + <para>This option forces Readline to link against the + <filename class="libraryfile">libncurses</filename> (really, + <filename class="libraryfile">libncursesw</filename>) library.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Give Readline's dynamic libraries more appropriate permissions:</para> + +<screen><userinput>chmod -v 755 /lib/lib{readline,history}.so*</userinput></screen> + + <para>Now move the static libraries to a more appropriate location:</para> + +<screen><userinput>mv -v /lib/lib{readline,history}.a /usr/lib</userinput></screen> + + <para>Next, remove the <filename class="extension">.so</filename> files in + <filename class="directory">/lib</filename> and relink them into <filename + class="directory">/usr/lib</filename>.</para> + +<screen><userinput>rm -v /lib/lib{readline,history}.so +ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so +ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so</userinput></screen> + + </sect2> + + <sect2 id="contents-readline" role="content"> + <title>Contents of Readline</title> + + <segmentedlist> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>libhistory.{a,so}, and libreadline.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="libhistory"> + <term><filename class="libraryfile">libhistory</filename></term> + <listitem> + <para>Provides a consistent user interface for recalling lines + of history</para> + <indexterm zone="ch-system-readline libhistory"> + <primary sortas="c-libhistory">libhistory</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libreadline"> + <term><filename class="libraryfile">libreadline</filename></term> + <listitem> + <para>Aids in the consistency of user interface across discrete + programs that need to provide a command line interface</para> + <indexterm zone="ch-system-readline libreadline"> + <primary sortas="c-libreadline">libreadline</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml new file mode 100644 index 000000000..5954b64be --- /dev/null +++ b/chapter06/revisedchroot.xml @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-revisedchroot"> + <?dbhtml filename="revisedchroot.html"?> + + <title>Cleaning Up</title> + + <para>From now on, when reentering the chroot environment after + exiting, use the following modified chroot command:</para> + +<screen><userinput>chroot "$LFS" /usr/bin/env -i \ + HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /bin/bash --login</userinput></screen> + + <para>The reason for this is that the programs in <filename + class="directory">/tools</filename> are no longer needed. Since they are no + longer needed you can delete the <filename class="directory">/tools</filename> + directory if so desired.</para> + + <note> + <para>Removing <filename class="directory">/tools</filename> will also + remove the temporary copies of Tcl, Expect, and DejaGNU which were used + for running the toolchain tests. If you need these programs later on, + they will need to be recompiled and re-installed. The BLFS book has + instructions for this (see <ulink url="&blfs-root;"/>).</para> + </note> + +</sect1> diff --git a/chapter06/sed.xml b/chapter06/sed.xml new file mode 100644 index 000000000..5b4249ef3 --- /dev/null +++ b/chapter06/sed.xml @@ -0,0 +1,95 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-sed" role="wrap"> + <?dbhtml filename="sed.html"?> + + <title>Sed-&sed-version;</title> + + <indexterm zone="ch-system-sed"> + <primary sortas="a-Sed">Sed</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Sed package contains a stream editor.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&sed-ch6-sbu;</seg> + <seg>&sed-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Sed</title> + + <para>Prepare Sed for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --bindir=/bin --enable-html</userinput></screen> + + <variablelist> + <title>The meaning of the new configure option:</title> + + <varlistentry> + <term><parameter>--enable-html</parameter></term> + <listitem> + <para>This builds the HTML documentation.</para> + </listitem> + </varlistentry> + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="contents-sed" role="content"> + <title>Contents of Sed</title> + + <segmentedlist> + <segtitle>Installed program</segtitle> + + <seglistitem> + <seg>sed</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="sed"> + <term><command>sed</command></term> + <listitem> + <para>Filters and transforms text files in a single pass</para> + <indexterm zone="ch-system-sed sed"> + <primary sortas="b-sed">sed</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml new file mode 100644 index 000000000..83b8cf53c --- /dev/null +++ b/chapter06/shadow.xml @@ -0,0 +1,563 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-shadow" role="wrap"> + <?dbhtml filename="shadow.html"?> + + <title>Shadow-&shadow-version;</title> + + <indexterm zone="ch-system-shadow"> + <primary sortas="a-Shadow">Shadow</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Shadow package contains programs for handling passwords in a secure + way.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&shadow-ch6-sbu;</seg> + <seg>&shadow-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Shadow</title> + + <note> + <para>If you would like to enforce the use of strong passwords, refer to + <ulink url="&blfs-root;view/svn/postlfs/cracklib.html"/> for installing + Cracklib prior to building Shadow. Then add + <parameter>--with-libcrack</parameter> to the <command>configure</command> + command below.</para> + </note> + + <para>Prepare Shadow for compilation:</para> + +<screen><userinput>./configure --libdir=/lib --enable-shared --without-selinux</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--without-selinux</parameter></term> + <listitem> + <para>Support for selinux is enabled by default, but selinux is not + built in a base LFS system. The <command>configure</command> script + will fail if this option is not used.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Disable the installation of the <command>groups</command> program + and its man page, as Coreutils provides a better version:</para> + +<screen><userinput>sed -i 's/groups$(EXEEXT) //' src/Makefile +find man -name Makefile -exec sed -i '/groups/d' {} \;</userinput></screen> + + <para>Disable the installation of Chinese and Korean manual pages, since + Man-DB cannot format them properly:</para> + +<screen><userinput>sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile</userinput></screen> + + <para>Shadow supplies other manual pages in a UTF-8 encoding. Man-DB + can display these in the recommended encodings by using the + <command>convert-mans</command> script which we installed.</para> + +<screen><userinput> for i in de es fi fr id it pt_BR; do + convert-mans UTF-8 ISO-8859-1 man/${i}/*.? +done + +for i in cs hu pl; do + convert-mans UTF-8 ISO-8859-2 man/${i}/*.? +done + +convert-mans UTF-8 EUC-JP man/ja/*.? +convert-mans UTF-8 KOI8-R man/ru/*.? +convert-mans UTF-8 ISO-8859-9 man/tr/*.?</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para id="shadow-limits-login_access">Shadow uses two files to configure + authentication settings for the system. Install these two configuration + files:</para> + + <indexterm zone="shadow-limits-login_access"> + <primary sortas="e-/etc/limits">/etc/limits</primary> + </indexterm> + + <indexterm zone="shadow-limits-login_access"> + <primary sortas="e-/etc/login.access">/etc/login.access</primary> + </indexterm> + +<screen><userinput>cp -v etc/{limits,login.access} /etc</userinput></screen> + + <para id="shadow-login_defs">Instead of using the default + <emphasis>crypt</emphasis> method, use the more secure + <emphasis>MD5</emphasis> method of password encryption, which also allows + passwords longer than 8 characters. It is also necessary to change the + obsolete <filename class="directory">/var/spool/mail</filename> location + for user mailboxes that Shadow uses by default to the <filename + class="directory">/var/mail</filename> location used currently. Both of + these can be accomplished by changing the relevant configuration file + while copying it to its destination:</para> + + <indexterm zone="shadow-login_defs"> + <primary sortas="e-/etc/login.defs">/etc/login.defs</primary> + </indexterm> + +<screen><userinput>sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \ + -e 's@/var/spool/mail@/var/mail@' \ + etc/login.defs > /etc/login.defs</userinput></screen> + + <note> + <para>If you built Shadow with Cracklib support, run the following:</para> + +<screen role="nodump"><userinput>sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' /etc/login.defs</userinput></screen> + </note> + + <para>Move a misplaced program to its proper location:</para> + +<screen><userinput>mv -v /usr/bin/passwd /bin</userinput></screen> + + <para>Move Shadow's libraries to more appropriate locations:</para> + +<screen><userinput>mv -v /lib/libshadow.*a /usr/lib +rm -v /lib/libshadow.so +ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> + + <para>The <parameter>-D</parameter> option of the + <command>useradd</command> program requires the <filename + class="directory">/etc/default</filename> directory for it to work + properly:</para> + +<screen><userinput>mkdir -v /etc/default</userinput></screen> + + </sect2> + + <sect2 id="conf-shadow" role="configuration"> + <title>Configuring Shadow</title> + + <indexterm zone="conf-shadow"> + <primary sortas="a-Shadow">Shadow</primary> + <secondary>configuring</secondary> + </indexterm> + + <para>This package contains utilities to add, modify, and delete users and + groups; set and change their passwords; and perform other administrative + tasks. For a full explanation of what <emphasis>password shadowing</emphasis> + means, see the <filename>doc/HOWTO</filename> file within the unpacked + source tree. If using Shadow support, keep in mind that programs which need + to verify passwords (display managers, FTP programs, pop3 daemons, etc.) + must be Shadow-compliant. That is, they need to be able to work with + shadowed passwords.</para> + + <para>To enable shadowed passwords, run the following command:</para> + +<screen><userinput>pwconv</userinput></screen> + + <para>To enable shadowed group passwords, run:</para> + +<screen><userinput>grpconv</userinput></screen> + + </sect2> + + <sect2 role="configuration"> + <title>Setting the root password</title> + + <para>Choose a password for user <emphasis>root</emphasis> and set it + by running:</para> + +<screen role="nodump"><userinput>passwd root</userinput></screen> + + </sect2> + + <sect2 id="contents-shadow" role="content"> + <title>Contents of Shadow</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd, + groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login, + logoutd, newgrp, newusers, nologin, passwd, pwck, pwconv, pwunconv, sg (link to + newgrp), su, useradd, userdel, usermod, vigr (link to vipw), and + vipw</seg> + <seg>libshadow.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="chage"> + <term><command>chage</command></term> + <listitem> + <para>Used to change the maximum number of days between obligatory + password changes</para> + <indexterm zone="ch-system-shadow chage"> + <primary sortas="b-chage">chage</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chfn"> + <term><command>chfn</command></term> + <listitem> + <para>Used to change a user's full name and other information</para> + <indexterm zone="ch-system-shadow chfn"> + <primary sortas="b-chfn">chfn</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chgpasswd"> + <term><command>chgpasswd</command></term> + <listitem> + <para>Used to update group passwords in batch mode</para> + <indexterm zone="ch-system-shadow chgpasswd"> + <primary sortas="b-chgpasswd">chgpasswd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chpasswd"> + <term><command>chpasswd</command></term> + <listitem> + <para>Used to update user passwords in batch mode</para> + <indexterm zone="ch-system-shadow chpasswd"> + <primary sortas="b-chpasswd">chpasswd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chsh"> + <term><command>chsh</command></term> + <listitem> + <para>Used to change a user's default login shell</para> + <indexterm zone="ch-system-shadow chsh"> + <primary sortas="b-chsh">chsh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="expiry"> + <term><command>expiry</command></term> + <listitem> + <para>Checks and enforces the current password expiration policy</para> + <indexterm zone="ch-system-shadow expiry"> + <primary sortas="b-expiry">expiry</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="faillog"> + <term><command>faillog</command></term> + <listitem> + <para>Is used to examine the log of login failures, to set a maximum + number of failures before an account is blocked, or to reset the + failure count</para> + <indexterm zone="ch-system-shadow faillog"> + <primary sortas="b-faillog">faillog</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="gpasswd"> + <term><command>gpasswd</command></term> + <listitem> + <para>Is used to add and delete members and administrators to + groups</para> + <indexterm zone="ch-system-shadow gpasswd"> + <primary sortas="b-gpasswd">gpasswd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="groupadd"> + <term><command>groupadd</command></term> + <listitem> + <para>Creates a group with the given name</para> + <indexterm zone="ch-system-shadow groupadd"> + <primary sortas="b-groupadd">groupadd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="groupdel"> + <term><command>groupdel</command></term> + <listitem> + <para>Deletes the group with the given name</para> + <indexterm zone="ch-system-shadow groupdel"> + <primary sortas="b-groupdel">groupdel</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="groupmod"> + <term><command>groupmod</command></term> + <listitem> + <para>Is used to modify the given group's name or GID</para> + <indexterm zone="ch-system-shadow groupmod"> + <primary sortas="b-groupmod">groupmod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grpck"> + <term><command>grpck</command></term> + <listitem> + <para>Verifies the integrity of the group files + <filename>/etc/group</filename> and + <filename>/etc/gshadow</filename></para> + <indexterm zone="ch-system-shadow grpck"> + <primary sortas="b-grpck">grpck</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grpconv"> + <term><command>grpconv</command></term> + <listitem> + <para>Creates or updates the shadow group file from the normal + group file</para> + <indexterm zone="ch-system-shadow grpconv"> + <primary sortas="b-grpconv">grpconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="grpunconv"> + <term><command>grpunconv</command></term> + <listitem> + <para>Updates <filename>/etc/group</filename> from + <filename>/etc/gshadow</filename> and then deletes the latter</para> + <indexterm zone="ch-system-shadow grpunconv"> + <primary sortas="b-grpunconv">grpunconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lastlog"> + <term><command>lastlog</command></term> + <listitem> + <para>Reports the most recent login of all users or of a + given user</para> + <indexterm zone="ch-system-shadow lastlog"> + <primary sortas="b-lastlog">lastlog</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="login"> + <term><command>login</command></term> + <listitem> + <para>Is used by the system to let users sign on</para> + <indexterm zone="ch-system-shadow login"> + <primary sortas="b-login">login</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="logoutd"> + <term><command>logoutd</command></term> + <listitem> + <para>Is a daemon used to enforce restrictions on log-on time + and ports</para> + <indexterm zone="ch-system-shadow logoutd"> + <primary sortas="b-logoutd">logoutd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="newgrp"> + <term><command>newgrp</command></term> + <listitem> + <para>Is used to change the current GID during a login session</para> + <indexterm zone="ch-system-shadow newgrp"> + <primary sortas="b-newgrp">newgrp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="newusers"> + <term><command>newusers</command></term> + <listitem> + <para>Is used to create or update an entire series of user + accounts</para> + <indexterm zone="ch-system-shadow newusers"> + <primary sortas="b-newusers">newusers</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="nologin"> + <term><command>nologin</command></term> + <listitem> + <para>Displays a message that an account is not available. Designed + to be used as the default shell for accounts that have been + disabled</para> + <indexterm zone="ch-system-shadow nologin"> + <primary sortas="b-nologin">nologin</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="passwd"> + <term><command>passwd</command></term> + <listitem> + <para>Is used to change the password for a user or group account</para> + <indexterm zone="ch-system-shadow passwd"> + <primary sortas="b-passwd">passwd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pwck"> + <term><command>pwck</command></term> + <listitem> + <para>Verifies the integrity of the password files + <filename>/etc/passwd</filename> and + <filename>/etc/shadow</filename></para> + <indexterm zone="ch-system-shadow pwck"> + <primary sortas="b-pwck">pwck</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pwconv"> + <term><command>pwconv</command></term> + <listitem> + <para>Creates or updates the shadow password file from the normal + password file</para> + <indexterm zone="ch-system-shadow pwconv"> + <primary sortas="b-pwconv">pwconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pwunconv"> + <term><command>pwunconv</command></term> + <listitem> + <para>Updates <filename>/etc/passwd</filename> from + <filename>/etc/shadow</filename> and then deletes the latter</para> + <indexterm zone="ch-system-shadow pwunconv"> + <primary sortas="b-pwunconv">pwunconv</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sg"> + <term><command>sg</command></term> + <listitem> + <para>Executes a given command while the user's GID + is set to that of the given group</para> + <indexterm zone="ch-system-shadow sg"> + <primary sortas="b-sg">sg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="su"> + <term><command>su</command></term> + <listitem> + <para>Runs a shell with substitute user and group IDs</para> + <indexterm zone="ch-system-shadow su"> + <primary sortas="b-su">su</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="useradd"> + <term><command>useradd</command></term> + <listitem> + <para>Creates a new user with the given name, or updates the default + new-user information</para> + <indexterm zone="ch-system-shadow useradd"> + <primary sortas="b-useradd">useradd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="userdel"> + <term><command>userdel</command></term> + <listitem> + <para>Deletes the given user account</para> + <indexterm zone="ch-system-shadow userdel"> + <primary sortas="b-userdel">userdel</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="usermod"> + <term><command>usermod</command></term> + <listitem> + <para>Is used to modify the given user's login name, User + Identification (UID), shell, initial group, home directory, etc.</para> + <indexterm zone="ch-system-shadow usermod"> + <primary sortas="b-usermod">usermod</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vigr"> + <term><command>vigr</command></term> + <listitem> + <para>Edits the <filename>/etc/group</filename> or + <filename>/etc/gshadow</filename> files</para> + <indexterm zone="ch-system-shadow vigr"> + <primary sortas="b-vigr">vigr</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vipw"> + <term><command>vipw</command></term> + <listitem> + <para>Edits the <filename>/etc/passwd</filename> or + <filename>/etc/shadow</filename> files</para> + <indexterm zone="ch-system-shadow vipw"> + <primary sortas="b-vipw">vipw</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="libshadow"> + <term><filename class="libraryfile">libshadow</filename></term> + <listitem> + <para>Contains functions used by most programs in this package</para> + <indexterm zone="ch-system-shadow libshadow"> + <primary sortas="c-libshadow">libshadow</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml new file mode 100644 index 000000000..74e351799 --- /dev/null +++ b/chapter06/strippingagain.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-strippingagain"> + <?dbhtml filename="strippingagain.html"?> + + <title>Stripping Again</title> + + <para>If the intended user is not a programmer and does not plan to do + any debugging on the system software, the system size can be decreased + by about 90 MB by removing the debugging symbols from binaries and + libraries. This causes no inconvenience other than not being able to + debug the software fully anymore.</para> + + <para>Most people who use the command mentioned below do not + experience any difficulties. However, it is easy to make a typo and + render the new system unusable, so before running the + <command>strip</command> command, it is a good idea to make a + backup of the LFS system in its current state.</para> + + <para>Before performing the stripping, take special care to ensure that + none of the binaries that are about to be stripped are running. If + unsure whether the user entered chroot with the command given in + <xref linkend="ch-system-chroot" role=","/> first exit from + chroot:</para> + +<screen role="nodump"><userinput>logout</userinput></screen> + + <para>Then reenter it with:</para> + +<screen role="nodump"><userinput>chroot $LFS /tools/bin/env -i \ + HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /tools/bin/bash --login</userinput></screen> + + <para>Now the binaries and libraries can be safely stripped:</para> + +<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \ + -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen> + + <para>A large number of files will be reported as having their file + format not recognized. These warnings can be safely ignored. These + warnings indicate that those files are scripts instead of + binaries.</para> + + <para>If disk space is very tight, the + <parameter>--strip-all</parameter> option can be used on the binaries + in <filename class="directory">/{,usr/}{bin,sbin}</filename> to gain + several more megabytes. Do not use this option on libraries—they will + be destroyed.</para> + +</sect1> diff --git a/chapter06/sysklogd.xml b/chapter06/sysklogd.xml new file mode 100644 index 000000000..095fd087c --- /dev/null +++ b/chapter06/sysklogd.xml @@ -0,0 +1,135 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-sysklogd" role="wrap"> + <?dbhtml filename="sysklogd.html"?> + + <title>Sysklogd-&sysklogd-version;</title> + + <indexterm zone="ch-system-sysklogd"> + <primary sortas="a-Sysklogd">Sysklogd</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Sysklogd package contains programs for logging system messages, + such as those given by the kernel when unusual things happen.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&sysklogd-ch6-sbu;</seg> + <seg>&sysklogd-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Sysklogd</title> + + <para>The following patch fixes various issues, including a problem building + Sysklogd with Linux 2.6 series kernels</para> + +<screen><userinput>patch -Np1 -i ../&sysklogd-fixes-patch;</userinput></screen> + + <para>The following patch makes sysklogd treat bytes in the 0x80--0x9f range + literally in the messages being logged, instead of replacing them with octal + codes. Unpatched sysklogd would damage messages in the UTF-8 encoding.</para> + +<screen><userinput>patch -Np1 -i ../&sysklogd-8bit-patch;</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + <sect2 id="conf-sysklogd" role="configuration"> + <title>Configuring Sysklogd</title> + + <indexterm zone="conf-sysklogd"> + <primary sortas="a-Sysklogd">Sysklogd</primary> + <secondary>configuring</secondary> + </indexterm> + + <indexterm zone="conf-sysklogd"> + <primary sortas="e-/etc/syslog.conf">/etc/syslog.conf</primary> + </indexterm> + + <para>Create a new <filename>/etc/syslog.conf</filename> file by running the + following:</para> + +<screen><userinput>cat > /etc/syslog.conf << "EOF" +<literal># Begin /etc/syslog.conf + +auth,authpriv.* -/var/log/auth.log +*.*;auth,authpriv.none -/var/log/sys.log +daemon.* -/var/log/daemon.log +kern.* -/var/log/kern.log +mail.* -/var/log/mail.log +user.* -/var/log/user.log +*.emerg * + +# End /etc/syslog.conf</literal> +EOF</userinput></screen> + + </sect2> + + <sect2 id="contents-sysklogd" role="content"> + <title>Contents of Sysklogd</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>klogd and syslogd</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="klogd"> + <term><command>klogd</command></term> + <listitem> + <para>A system daemon for intercepting and logging kernel messages</para> + <indexterm zone="ch-system-sysklogd klogd"> + <primary sortas="b-klogd">klogd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="syslogd"> + <term><command>syslogd</command></term> + <listitem> + <para>Logs the messages that system programs offer for logging. Every + logged message contains at least a date stamp and a hostname, and + normally the program's name too, but that depends on how trusting the + logging daemon is told to be</para> + <indexterm zone="ch-system-sysklogd syslogd"> + <primary sortas="b-syslogd">syslogd</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/sysvinit.xml b/chapter06/sysvinit.xml new file mode 100644 index 000000000..ab9dad5bd --- /dev/null +++ b/chapter06/sysvinit.xml @@ -0,0 +1,322 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-sysvinit" role="wrap"> + <?dbhtml filename="sysvinit.html"?> + + <title>Sysvinit-&sysvinit-version;</title> + + <indexterm zone="ch-system-sysvinit"> + <primary sortas="a-Sysvinit">Sysvinit</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Sysvinit package contains programs for controlling the startup, + running, and shutdown of the system.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&sysvinit-ch6-sbu;</seg> + <seg>&sysvinit-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Sysvinit</title> + + <para>When run-levels are changed (for example, when halting the + system), <command>init</command> sends termination signals to those + processes that <command>init</command> itself started and that should + not be running in the new run-level. While doing this, + <command>init</command> outputs messages like <quote>Sending processes + the TERM signal</quote> which seem to imply that it is sending these + signals to all currently running processes. To avoid this + misinterpretation, modify the source so that these messages read like + <quote>Sending processes started by init the TERM signal</quote> + instead:</para> + +<screen><userinput>sed -i 's@Sending processes@& started by init@g' \ + src/init.c</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make -C src</userinput></screen> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make -C src install</userinput></screen> + + </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>Create a new file <filename>/etc/inittab</filename> by running the + following:</para> + +<screen><userinput>cat > /etc/inittab << "EOF" +<literal># Begin /etc/inittab + +id:3:initdefault: + +si::sysinit:/etc/rc.d/init.d/rc sysinit + +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 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> + + </sect2> + + <sect2 id="contents-sysvinit" role="content"> + <title>Contents of Sysvinit</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>bootlogd, halt, init, killall5, last, lastb (link to last), mesg, + mountpoint, pidof (link to killall5), poweroff (link to halt), + reboot (link to halt), runlevel, shutdown, sulogin, + telinit (link to init), utmpdump, and wall</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="bootlogd"> + <term><command>bootlogd</command></term> + <listitem> + <para>Logs boot messages to a log file</para> + <indexterm zone="ch-system-sysvinit bootlogd"> + <primary sortas="b-bootlogd">bootlogd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="halt"> + <term><command>halt</command></term> + <listitem> + <para>Normally invokes <command>shutdown</command> with the + <parameter>-h</parameter> option, except when already in run-level 0, + then it tells the kernel to halt the system; it notes in the + file <filename>/var/log/wtmp</filename> that the system is being + brought down</para> + <indexterm zone="ch-system-sysvinit halt"> + <primary sortas="b-halt">halt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="init"> + <term><command>init</command></term> + <listitem> + <para>The first process to be started when the kernel has initialized + the hardware which takes over the boot process and starts all the + proceses it is instructed to</para> + <indexterm zone="ch-system-sysvinit init"> + <primary sortas="b-init">init</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="killall5"> + <term><command>killall5</command></term> + <listitem> + <para>Sends a signal to all processes, except the processes in its own + session so it will not kill the shell running the script that called + it</para> + <indexterm zone="ch-system-sysvinit killall5"> + <primary sortas="b-killall5">killall5</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="last"> + <term><command>last</command></term> + <listitem> + <para>Shows which users last logged in (and out), searching back + through the <filename>/var/log/wtmp</filename> file; it also shows + system boots, shutdowns, and run-level changes</para> + <indexterm zone="ch-system-sysvinit last"> + <primary sortas="b-last">last</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="lastb"> + <term><command>lastb</command></term> + <listitem> + <para>Shows the failed login attempts, as logged in + <filename>/var/log/btmp</filename></para> + <indexterm zone="ch-system-sysvinit lastb"> + <primary sortas="b-lastb">lastb</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mesg"> + <term><command>mesg</command></term> + <listitem> + <para>Controls whether other users can send messages to the current + user's terminal</para> + <indexterm zone="ch-system-sysvinit mesg"> + <primary sortas="b-mesg">mesg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mountpoint"> + <term><command>mountpoint</command></term> + <listitem> + <para>Checks if the directory is a mountpoint</para> + <indexterm zone="ch-system-sysvinit mountpoint"> + <primary sortas="b-mountpoint">mountpoint</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pidof"> + <term><command>pidof</command></term> + <listitem> + <para>Reports the PIDs of the given programs</para> + <indexterm zone="ch-system-sysvinit pidof"> + <primary sortas="b-pidof">pidof</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="poweroff"> + <term><command>poweroff</command></term> + <listitem> + <para>Tells the kernel to halt the system and switch off the computer + (see <command>halt</command>)</para> + <indexterm zone="ch-system-sysvinit poweroff"> + <primary sortas="b-poweroff">poweroff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="reboot"> + <term><command>reboot</command></term> + <listitem> + <para>Tells the kernel to reboot the system (see + <command>halt</command>)</para> + <indexterm zone="ch-system-sysvinit reboot"> + <primary sortas="b-reboot">reboot</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="runlevel"> + <term><command>runlevel</command></term> + <listitem> + <para>Reports the previous and the current run-level, as noted in the + last run-level record in <filename>/var/run/utmp</filename></para> + <indexterm zone="ch-system-sysvinit runlevel"> + <primary sortas="b-runlevel">runlevel</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="shutdown"> + <term><command>shutdown</command></term> + <listitem> + <para>Brings the system down in a secure way, signaling all processes + and notifying all logged-in users</para> + <indexterm zone="ch-system-sysvinit shutdown"> + <primary sortas="b-shutdown">shutdown</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sulogin"> + <term><command>sulogin</command></term> + <listitem> + <para>Allows <systemitem class="username">root</systemitem> to log in; + it is normally invoked by <command>init</command> when the system goes + into single user mode</para> + <indexterm zone="ch-system-sysvinit sulogin"> + <primary sortas="b-sulogin">sulogin</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="telinit"> + <term><command>telinit</command></term> + <listitem> + <para>Tells <command>init</command> which run-level to change to</para> + <indexterm zone="ch-system-sysvinit telinit"> + <primary sortas="b-telinit">telinit</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="utmpdump"> + <term><command>utmpdump</command></term> + <listitem> + <para>Displays the content of the given login file in a more + user-friendly format</para> + <indexterm zone="ch-system-sysvinit utmpdump"> + <primary sortas="b-utmpdump">utmpdump</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="wall"> + <term><command>wall</command></term> + <listitem> + <para>Writes a message to all logged-in users</para> + <indexterm zone="ch-system-sysvinit wall"> + <primary sortas="b-wall">wall</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/tar.xml b/chapter06/tar.xml new file mode 100644 index 000000000..9850b2d34 --- /dev/null +++ b/chapter06/tar.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-tar" role="wrap"> + <?dbhtml filename="tar.html"?> + + <title>Tar-&tar-version;</title> + + <indexterm zone="ch-system-tar"> + <primary sortas="a-Tar">Tar</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Tar package contains an archiving program.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&tar-ch6-sbu;</seg> + <seg>&tar-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Tar</title> + + <para>Apply a patch to fix some issues with the test suite when using + GCC-&gcc-version;:</para> + +<screen><userinput>patch -Np1 -i ../&tar-gcc4_fix-patch;</userinput></screen> + + <para>Tar has a bug when the <parameter>-S</parameter> option is used + with files larger than 4 GB. The following patch properly fixes this + issue:</para> + +<screen><userinput>patch -Np1 -i ../&tar-sparse_fix-patch;</userinput></screen> + + <para>Recent versions of Tar are vulnerable to a buffer overflow from + specially crafted archives. The following patch addresses this:</para> + +<screen><userinput>patch -Np1 -i ../&tar-security_fixes-patch;</userinput></screen> + + <para>Prepare Tar for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/sbin</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + </sect2> + + + <sect2 id="contents-tar" role="content"> + <title>Contents of Tar</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>rmt and tar</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="rmt"> + <term><command>rmt</command></term> + <listitem> + <para>Remotely manipulates a magnetic + tape drive through an interprocess communication connection</para> + <indexterm zone="ch-system-tar rmt"> + <primary sortas="b-rmt">rmt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tar"> + <term><command>tar</command></term> + <listitem> + <para>Creates, extracts files from, and lists the contents of archives, + also known as tarballs</para> + <indexterm zone="ch-system-tar tar"> + <primary sortas="b-tar">tar</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/texinfo.xml b/chapter06/texinfo.xml new file mode 100644 index 000000000..761c4c5e7 --- /dev/null +++ b/chapter06/texinfo.xml @@ -0,0 +1,200 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-texinfo" role="wrap"> + <?dbhtml filename="texinfo.html"?> + + <title>Texinfo-&texinfo-version;</title> + + <indexterm zone="ch-system-texinfo"> + <primary sortas="a-Texinfo">Texinfo</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Texinfo package contains programs for reading, writing, and + converting info pages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&texinfo-ch6-sbu;</seg> + <seg>&texinfo-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Texinfo</title> + + <para>The <command>info</command> program makes assumptions such as that + a string occupies the same number of character cells on the screen and + bytes in memory and that one can break the string anywhere, which fail + in UTF-8 based locales. The patch below makes them valid by falling back + to English messages when a multibyte locale is in use:</para> + +<screen><userinput>patch -Np1 -i ../&texinfo-multibyte-patch;</userinput></screen> + + <para>Texinfo allows local users to overwrite arbitrary files via a symlink + attack on temporary files. Apply the following patch to fix this:</para> + +<screen><userinput>patch -Np1 -i ../&texinfo-tempfile_fix-patch;</userinput></screen> + + <para>Prepare Texinfo for compilation:</para> + +<screen><userinput>./configure --prefix=/usr</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Optionally, install the components belonging in a TeX + installation:</para> + <!-- FIXME: doesn't the TeX installation in BLFS overwrite files there? --> + +<screen><userinput>make TEXMF=/usr/share/texmf install-tex</userinput></screen> + + <variablelist> + <title>The meaning of the make parameter:</title> + + <varlistentry> + <term><parameter>TEXMF=/usr/share/texmf</parameter></term> + <listitem> + <para>The <envar>TEXMF</envar> makefile variable holds the location + of the root of the TeX tree if, for example, a TeX package will be + installed later.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>The Info documentation system uses a plain text file to hold its list of + menu entries. The file is located at <filename>/usr/share/info/dir</filename>. + Unfortunately, due to occasional problems in the Makefiles of various packages, + it can sometimes get out of sync with the info pages installed on the system. + If the <filename>/usr/share/info/dir</filename> file ever needs to be + recreated, the following optional commands will accomplish the task:</para> + +<screen role="nodump"><userinput>cd /usr/share/info +rm dir +for f in * +do install-info $f dir 2>/dev/null +done</userinput></screen> + + </sect2> + + <sect2 id="contents-texinfo" role="content"> + <title>Contents of Texinfo</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>info, infokey, install-info, makeinfo, texi2dvi, texi2pdf, and + texindex</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="info"> + <term><command>info</command></term> + <listitem> + <para>Used to read info pages which are similar to man pages, but + often go much deeper than just explaining all the available command + line options. For example, compare <command>man bison</command> and + <command>info bison</command>.</para> + <indexterm zone="ch-system-texinfo info"> + <primary sortas="b-info">info</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="infokey"> + <term><command>infokey</command></term> + <listitem> + <para>Compiles a source file containing Info customizations into a + binary format</para> + <indexterm zone="ch-system-texinfo infokey"> + <primary sortas="b-infokey">infokey</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="install-info"> + <term><command>install-info</command></term> + <listitem> + <para>Used to install info pages; it updates entries in the + <command>info</command> index file</para> + <indexterm zone="ch-system-texinfo install-info"> + <primary sortas="b-install-info">install-info</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="makeinfo"> + <term><command>makeinfo</command></term> + <listitem> + <para>Translates the given Texinfo source documents into + info pages, plain text, or HTML</para> + <indexterm zone="ch-system-texinfo makeinfo"> + <primary sortas="b-makeinfo">makeinfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="texi2dvi"> + <term><command>texi2dvi</command></term> + <listitem> + <para>Used to format the given Texinfo document into a + device-independent file that can be printed</para> + <indexterm zone="ch-system-texinfo texi2dvi"> + <primary sortas="b-texi2dvi">texi2dvi</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="texi2pdf"> + <term><command>texi2pdf</command></term> + <listitem> + <para>Used to format the given Texinfo document into a + Portable Document Format (PDF) file</para> + <indexterm zone="ch-system-texinfo texi2pdf"> + <primary sortas="b-texi2pdf">texi2pdf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="texindex"> + <term><command>texindex</command></term> + <listitem> + <para>Used to sort Texinfo index files</para> + <indexterm zone="ch-system-texinfo texindex"> + <primary sortas="b-texindex">texindex</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/udev.xml b/chapter06/udev.xml new file mode 100644 index 000000000..cdd6302eb --- /dev/null +++ b/chapter06/udev.xml @@ -0,0 +1,323 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-udev" role="wrap"> + <?dbhtml filename="udev.html"?> + + <title>Udev-&udev-version;</title> + + <indexterm zone="ch-system-udev"> + <primary sortas="a-Udev">Udev</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Udev package contains programs for dynamic creation of device + nodes.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&udev-ch6-sbu;</seg> + <seg>&udev-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Udev</title> + + <para>The udev-config tarball contains LFS-specific files used to configure + Udev.</para> + +<screen><userinput>tar xf ../&udev-config;.tar.bz2</userinput></screen> + + <para>Create some devices and directories that Udev cannot handle due to + them being required very early in the boot process:</para> + +<screen><userinput>install -dv /lib/{firmware,udev/devices/{pts,shm}} +mknod -m0666 /lib/udev/devices/null c 1 3 +ln -sv /proc/self/fd /lib/udev/devices/fd +ln -sv /proc/self/fd/0 /lib/udev/devices/stdin +ln -sv /proc/self/fd/1 /lib/udev/devices/stdout +ln -sv /proc/self/fd/2 /lib/udev/devices/stderr +ln -sv /proc/kcore /lib/udev/devices/core</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \ + extras/firmware extras/floppy extras/path_id \ + extras/scsi_id extras/usb_id extras/volume_id"</userinput></screen> + + <variablelist> + <title>The meaning of the make option:</title> + + <varlistentry> + <term><parameter>EXTRAS=...</parameter></term> + <listitem> + <para>This builds several helper binaries that can aid in writing custom + Udev rules.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>To test the results, issue: + <userinput>make test</userinput>.</para> + + <para>Install the package:</para> + +<screen><userinput>make DESTDIR=/ \ + EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \ + extras/firmware extras/floppy extras/path_id \ + extras/scsi_id extras/usb_id extras/volume_id" install</userinput></screen> + + <variablelist> + <title>The meaning of the make parameter:</title> + + <varlistentry> + <term><parameter>DESTDIR=/</parameter></term> + <listitem> + <para>This prevents the Udev build process from killing any + <command>udevd</command> processes that may be running on the + host system.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Udev has to be configured in order to work properly, as it does + not install any configuration files by default. Install the + LFS-specific configuration files:</para> + +<screen><userinput>cp -v &udev-config;/[0-9]* /etc/udev/rules.d/</userinput></screen> + + <para>Install the documentation that explains how to create Udev rules:</para> + +<screen><userinput>install -m644 -D -v docs/writing_udev_rules/index.html \ + /usr/share/doc/udev-&udev-version;/index.html</userinput></screen> + + </sect2> + + <sect2 id="contents-udev" role="content"> + <title>Contents of Udev</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + <segtitle>Installed directory</segtitle> + + <seglistitem> + <seg>ata_id, cdrom_id, create_floppy_devices, edd_id, firmware_helper, + path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle, + udevtest, udevtrigger, usb_id, vol_id, and write_cd_aliases</seg> + <seg>/etc/udev</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="ata_id"> + <term><command>ata_id</command></term> + <listitem> + <para>Provides Udev with a unique string and + additional information (uuid, label) for an ATA drive</para> + <indexterm zone="ch-system-udev ata_id"> + <primary sortas="b-ata_id">ata_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cdrom_id"> + <term><command>cdrom_id</command></term> + <listitem> + <para>Provides Udev with the capabilities of a + CD-ROM or DVD-ROM drive</para> + <indexterm zone="ch-system-udev cdrom_id"> + <primary sortas="b-cdrom_id">cdrom_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="create_floppy_devices"> + <term><command>create_floppy_devices</command></term> + <listitem> + <para>Creates all possible floppy devices based on the CMOS type</para> + <indexterm zone="ch-system-udev create_floppy_devices"> + <primary sortas="b-create_floppy_devices">create_floppy_devices</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="edd_id"> + <term><command>edd_id</command></term> + <listitem> + <para>Provides Udev with the EDD ID for a BIOS disk drive</para> + <indexterm zone="ch-system-udev edd_id"> + <primary sortas="b-edd_id">edd_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="firmware_helper"> + <term><command>firmware_helper</command></term> + <listitem> + <para>Uploads firmware to devices</para> + <indexterm zone="ch-system-udev firmware_helper"> + <primary sortas="b-firmware_helper">firmware_helper</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="path_id"> + <term><command>path_id</command></term> + <listitem> + <para>Provide the shortest possible unique hardware path to a + device</para> + <indexterm zone="ch-system-udev path_id"> + <primary sortas="b-path_id">path_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="scsi_id"> + <term><command>scsi_id</command></term> + <listitem> + <para>Provides Udev with a unique SCSI identifier + based on the data returned from sending a SCSI INQUIRY command to + the specified device</para> + <indexterm zone="ch-system-udev scsi_id"> + <primary sortas="b-scsi_id">scsi_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevcontrol"> + <term><command>udevcontrol</command></term> + <listitem> + <para>Configures a number of options for the running + <command>udevd</command> daemon, such as the log level.</para> + <indexterm zone="ch-system-udev udevcontrol"> + <primary sortas="b-udevcontrol">udevcontrol</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevd"> + <term><command>udevd</command></term> + <listitem> + <para>A daemon that listens for uevents on the netlink socket, + creates devices and runs the configured external programs in + response to these uevents</para> + <indexterm zone="ch-system-udev udevd"> + <primary sortas="b-udevd">udevd</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevinfo"> + <term><command>udevinfo</command></term> + <listitem> + <para>Allows users to query the Udev database for + information on any device currently present on the system; it also + provides a way to query any device in the <systemitem + class="filesystem">sysfs</systemitem> tree to help create udev + rules</para> + <indexterm zone="ch-system-udev udevinfo"> + <primary sortas="b-udevinfo">udevinfo</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevmonitor"> + <term><command>udevmonitor</command></term> + <listitem> + <para>Prints the event received from the kernel and the environment + which Udev sends out after rule processing</para> + <indexterm zone="ch-system-udev udevmonitor"> + <primary sortas="b-udevmonitor">udevmonitor</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevsettle"> + <term><command>udevsettle</command></term> + <listitem> + <para>Watches the Udev event queue and exits if all current uevents + have been handled</para> + <indexterm zone="ch-system-udev udevsettle"> + <primary sortas="b-udevsettle">udevsettle</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevtest"> + <term><command>udevtest</command></term> + <listitem> + <para>Simulates a uevent for the given device, and prints out the + name of the node the real <command>udevd</command> would have created, + or the name of the renamed network interface</para> + <indexterm zone="ch-system-udev udevtest"> + <primary sortas="b-udevtest">udevtest</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="udevtrigger"> + <term><command>udevtrigger</command></term> + <listitem> + <para>Triggers kernel device uevents to be replayed</para> + <indexterm zone="ch-system-udev udevtrigger"> + <primary sortas="b-udevtrigger">udevtrigger</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="usb_id"> + <term><command>usb_id</command></term> + <listitem> + <para>Provides Udev with information about USB + devices</para> + <indexterm zone="ch-system-udev usb_id"> + <primary sortas="b-usb_id">usb_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vol_id"> + <term><command>vol_id</command></term> + <listitem> + <para>Provides Udev with the label and uuid of a + filesystem</para> + <indexterm zone="ch-system-udev vol_id"> + <primary sortas="b-vol_id">vol_id</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="etc-udev"> + <term><filename class="directory">/etc/udev</filename></term> + <listitem> + <para>Contains Udev configuation files, + device permissions, and rules for device naming</para> + <indexterm zone="ch-system-udev etc-udev"> + <primary sortas="e-/etc/udev">/etc/udev</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml new file mode 100644 index 000000000..900c89e40 --- /dev/null +++ b/chapter06/util-linux.xml @@ -0,0 +1,783 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-util-linux" role="wrap"> + <?dbhtml filename="util-linux.html"?> + + <title>Util-linux-&util-linux-version;</title> + + <indexterm zone="ch-system-util-linux"> + <primary sortas="a-Util-linux">Util-linux</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Util-linux package contains miscellaneous utility programs. Among + them are utilities for handling file systems, consoles, partitions, and + messages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&util-linux-ch6-sbu;</seg> + <seg>&util-linux-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>FHS compliance notes</title> + + <para>The FHS recommends using the <filename + class="directory">/var/lib/hwclock</filename> directory instead of the + usual <filename class="directory">/etc</filename> directory as the + location for the <filename>adjtime</filename> file. To make the + <command>hwclock</command> program FHS-compliant, run the + following:</para> + +<screen><userinput>sed -i 's@etc/adjtime@var/lib/hwclock/adjtime@g' \ + hwclock/hwclock.c +mkdir -p /var/lib/hwclock</userinput></screen> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Util-linux</title> + + <para>Util-linux fails to compile against newer versions of Linux-Libc-Headers. + The following patch properly fixes this issue:</para> + +<screen><userinput>patch -Np1 -i ../&util-linux-cramfs-patch;</userinput></screen> + + <para>Prepare Util-linux for compilation:</para> + +<screen><userinput>./configure</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make HAVE_KILL=yes HAVE_SLN=yes</userinput></screen> + + <variablelist> + <title>The meaning of the make parameters:</title> + + <varlistentry> + <term><parameter>HAVE_KILL=yes</parameter></term> + <listitem> + <para>This prevents the <command>kill</command> program (already + installed by Procps) from being built and installed again.</para> + </listitem> + </varlistentry> + + <varlistentry> + <term><parameter>HAVE_SLN=yes</parameter></term> + <listitem> + <para>This prevents the <command>sln</command> program (a + statically linked version of <command>ln</command> already installed + by Glibc) from being built and installed again.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>This package does not come with a test suite.</para> + + <para>Install the package:</para> + +<screen><userinput>make HAVE_KILL=yes HAVE_SLN=yes install</userinput></screen> + + </sect2> + + <sect2 id="contents-utillinux" role="content"> + <title>Contents of Util-linux</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, + colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, + fdisk, flock, fsck.cramfs, fsck.minix, getopt, hexdump, hwclock, ipcrm, + ipcs, isosize, line, logger, look, losetup, mcookie, mkfs, mkfs.bfs, + mkfs.cramfs, mkfs.minix, mkswap, more, mount, namei, pg, pivot_root, + ramsize (link to rdev), raw, rdev, readprofile, rename, renice, rev, + rootflags (link to rdev), script, setfdprm, setsid, setterm, sfdisk, + swapoff (link to swapon), swapon, tailf, tunelp, ul, umount, + vidmode (link to rdev), whereis, and write</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="agetty"> + <term><command>agetty</command></term> + <listitem> + <para>Opens a tty port, prompts for a login name, + and then invokes the <command>login</command> program</para> + <indexterm zone="ch-system-util-linux agetty"> + <primary sortas="b-agetty">agetty</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="arch"> + <term><command>arch</command></term> + <listitem> + <para>Reports the machine's architecture</para> + <indexterm zone="ch-system-util-linux arch"> + <primary sortas="b-arch">arch</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="blockdev"> + <term><command>blockdev</command></term> + <listitem> + <para>Allows users to call block device ioctls from the command + line</para> + <indexterm zone="ch-system-util-linux blockdev"> + <primary sortas="b-blockdev">blockdev</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cal"> + <term><command>cal</command></term> + <listitem> + <para>Displays a simple calendar</para> + <indexterm zone="ch-system-util-linux cal"> + <primary sortas="b-cal">cal</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cfdisk"> + <term><command>cfdisk</command></term> + <listitem> + <para>Manipulates the partition table of the given device</para> + <indexterm zone="ch-system-util-linux cfdisk"> + <primary sortas="b-cfdisk">cfdisk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="chkdupexe"> + <term><command>chkdupexe</command></term> + <listitem> + <para>Finds duplicate executables</para> + <indexterm zone="ch-system-util-linux chkdupexe"> + <primary sortas="b-chkdupexe">chkdupexe</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="col"> + <term><command>col</command></term> + <listitem> + <para>Filters out reverse line feeds</para> + <indexterm zone="ch-system-util-linux col"> + <primary sortas="b-col">col</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="colcrt"> + <term><command>colcrt</command></term> + <listitem> + <para>Filters <command>nroff</command> output for terminals + that lack some capabilities, such as overstriking and half-lines</para> + <indexterm zone="ch-system-util-linux colcrt"> + <primary sortas="b-colcrt">colcrt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="colrm"> + <term><command>colrm</command></term> + <listitem> + <para>Filters out the given columns</para> + <indexterm zone="ch-system-util-linux colrm"> + <primary sortas="b-colrm">colrm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="column"> + <term><command>column</command></term> + <listitem> + <para>Formats a given file into multiple columns</para> + <indexterm zone="ch-system-util-linux column"> + <primary sortas="b-column">column</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ctrlaltdel"> + <term><command>ctrlaltdel</command></term> + <listitem> + <para>Sets the function of the Ctrl+Alt+Del key combination to a + hard or a soft reset</para> + <indexterm zone="ch-system-util-linux ctrlaltdel"> + <primary sortas="b-ctrlaltdel">ctrlaltdel</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="cytune"> + <term><command>cytune</command></term> + <listitem> + <para>Tunes the parameters of the serial line drivers for + Cyclades cards</para> + <indexterm zone="ch-system-util-linux cytune"> + <primary sortas="b-cytune">cytune</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ddate"> + <term><command>ddate</command></term> + <listitem> + <para>Gives the Discordian date or converts the given Gregorian date + to a Discordian one</para> + <indexterm zone="ch-system-util-linux ddate"> + <primary sortas="b-ddate">ddate</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="dmesg"> + <term><command>dmesg</command></term> + <listitem> + <para>Dumps the kernel boot messages</para> + <indexterm zone="ch-system-util-linux dmesg"> + <primary sortas="b-dmesg">dmesg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="elvtune"> + <term><command>elvtune</command></term> + <listitem> + <para>Tunes the performance and interactivity of a block + device</para> + <indexterm zone="ch-system-util-linux elvtune"> + <primary sortas="b-elvtune">elvtune</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fdformat"> + <term><command>fdformat</command></term> + <listitem> + <para>Low-level formats a floppy disk</para> + <indexterm zone="ch-system-util-linux fdformat"> + <primary sortas="b-fdformat">fdformat</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="flock"> + <term><command>flock</command></term> + <listitem> + <para>Acquires a file lock and then executes a command with the lock + held</para> + <indexterm zone="ch-system-util-linux flock"> + <primary sortas="b-fdisk">flock</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fdisk"> + <term><command>fdisk</command></term> + <listitem> + <para>Manipulates the partition table of the given device</para> + <indexterm zone="ch-system-util-linux fdisk"> + <primary sortas="b-fdisk">fdisk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fsck.cramfs"> + <term><command>fsck.cramfs</command></term> + <listitem> + <para>Performs a consistency check on the Cramfs file system on the + given device</para> + <indexterm zone="ch-system-util-linux fsck.cramfs"> + <primary sortas="b-fsck.cramfs">fsck.cramfs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="fsck.minix"> + <term><command>fsck.minix</command></term> + <listitem> + <para>Performs a consistency check on the Minix file system on the + given device</para> + <indexterm zone="ch-system-util-linux fsck.minix"> + <primary sortas="b-fsck.minix">fsck.minix</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="getopt"> + <term><command>getopt</command></term> + <listitem> + <para>Parses options in the given command line</para> + <indexterm zone="ch-system-util-linux getopt"> + <primary sortas="b-getopt">getopt</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="hexdump"> + <term><command>hexdump</command></term> + <listitem> + <para>Dumps the given file in hexadecimal or in another given + format</para> + <indexterm zone="ch-system-util-linux hexdump"> + <primary sortas="b-hexdump">hexdump</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="hwclock"> + <term><command>hwclock</command></term> + <listitem> + <para>Reads or sets the system's hardware clock, also called + the Real-Time Clock (RTC) or Basic Input-Output System (BIOS) + clock</para> + <indexterm zone="ch-system-util-linux hwclock"> + <primary sortas="b-hwclock">hwclock</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ipcrm"> + <term><command>ipcrm</command></term> + <listitem> + <para>Removes the given Inter-Process Communication (IPC) resource</para> + <indexterm zone="ch-system-util-linux ipcrm"> + <primary sortas="b-ipcrm">ipcrm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ipcs"> + <term><command>ipcs</command></term> + <listitem> + <para>Provides IPC status information</para> + <indexterm zone="ch-system-util-linux ipcs"> + <primary sortas="b-ipcs">ipcs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="isosize"> + <term><command>isosize</command></term> + <listitem> + <para>Reports the size of an iso9660 file system</para> + <indexterm zone="ch-system-util-linux isosize"> + <primary sortas="b-isosize">isosize</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="line"> + <term><command>line</command></term> + <listitem> + <para>Copies a single line</para> + <indexterm zone="ch-system-util-linux line"> + <primary sortas="b-line">line</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="logger"> + <term><command>logger</command></term> + <listitem> + <para>Enters the given message into the system log</para> + <indexterm zone="ch-system-util-linux logger"> + <primary sortas="b-logger">logger</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="look"> + <term><command>look</command></term> + <listitem> + <para>Displays lines that begin with the given string</para> + <indexterm zone="ch-system-util-linux look"> + <primary sortas="b-look">look</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="losetup"> + <term><command>losetup</command></term> + <listitem> + <para>Sets up and controls loop devices</para> + <indexterm zone="ch-system-util-linux losetup"> + <primary sortas="b-losetup">losetup</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mcookie"> + <term><command>mcookie</command></term> + <listitem> + <para>Generates magic cookies (128-bit random hexadecimal numbers) for + <command>xauth</command></para> + <indexterm zone="ch-system-util-linux mcookie"> + <primary sortas="b-mcookie">mcookie</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfs"> + <term><command>mkfs</command></term> + <listitem> + <para>Builds a file system on a device (usually a hard disk + partition)</para> + <indexterm zone="ch-system-util-linux mkfs"> + <primary sortas="b-mkfs">mkfs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfs.bfs"> + <term><command>mkfs.bfs</command></term> + <listitem> + <para>Creates a Santa Cruz Operations (SCO) bfs file system</para> + <indexterm zone="ch-system-util-linux mkfs.bfs"> + <primary sortas="b-mkfs.bfs">mkfs.bfs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfs.cramfs"> + <term><command>mkfs.cramfs</command></term> + <listitem> + <para>Creates a cramfs file system</para> + <indexterm zone="ch-system-util-linux mkfs.cramfs"> + <primary sortas="b-mkfs.cramfs">mkfs.cramfs</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkfs.minix"> + <term><command>mkfs.minix</command></term> + <listitem> + <para>Creates a Minix file system</para> + <indexterm zone="ch-system-util-linux mkfs.minix"> + <primary sortas="b-mkfs.minix">mkfs.minix</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mkswap"> + <term><command>mkswap</command></term> + <listitem> + <para>Initializes the given device or file to be used as a swap + area</para> + <indexterm zone="ch-system-util-linux mkswap"> + <primary sortas="b-mkswap">mkswap</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="more"> + <term><command>more</command></term> + <listitem> + <para>A filter for paging through text one screen at a time</para> + <indexterm zone="ch-system-util-linux more"> + <primary sortas="b-more">more</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mount"> + <term><command>mount</command></term> + <listitem> + <para>Attaches the file system on the given device to a specified + directory in the file-system tree</para> + <indexterm zone="ch-system-util-linux mount"> + <primary sortas="b-mount">mount</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="namei"> + <term><command>namei</command></term> + <listitem> + <para>Shows the symbolic links in the given pathnames</para> + <indexterm zone="ch-system-util-linux namei"> + <primary sortas="b-namei">namei</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pg"> + <term><command>pg</command></term> + <listitem> + <para>Displays a text file one screen full at a time</para> + <indexterm zone="ch-system-util-linux pg"> + <primary sortas="b-pg">pg</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pivot_root"> + <term><command>pivot_root</command></term> + <listitem> + <para>Makes the given file system the new root file system of the + current process</para> + <indexterm zone="ch-system-util-linux pivot_root"> + <primary sortas="b-pivot_root">pivot_root</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ramsize"> + <term><command>ramsize</command></term> + <listitem> + <para>Sets the size of the RAM disk in a bootable image</para> + <indexterm zone="ch-system-util-linux ramsize"> + <primary sortas="b-ramsize">ramsize</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="raw"> + <term><command>raw</command></term> + <listitem> + <para>Used to bind a Linux raw character device to a block + device</para> + <indexterm zone="ch-system-util-linux raw"> + <primary sortas="b-raw">raw</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rdev"> + <term><command>rdev</command></term> + <listitem> + <para>Queries and sets the root device, among other things, in a + bootable image</para> + <indexterm zone="ch-system-util-linux rdev"> + <primary sortas="b-rdev">rdev</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="readprofile"> + <term><command>readprofile</command></term> + <listitem> + <para>Reads kernel profiling information</para> + <indexterm zone="ch-system-util-linux readprofile"> + <primary sortas="b-readprofile">readprofile</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rename"> + <term><command>rename</command></term> + <listitem> + <para>Renames the given files, replacing a given string with + another</para> + <indexterm zone="ch-system-util-linux rename"> + <primary sortas="b-rename">rename</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="renice"> + <term><command>renice</command></term> + <listitem> + <para>Alters the priority of running processes</para> + <indexterm zone="ch-system-util-linux renice"> + <primary sortas="b-renice">renice</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rev"> + <term><command>rev</command></term> + <listitem> + <para>Reverses the lines of a given file</para> + <indexterm zone="ch-system-util-linux rev"> + <primary sortas="b-rev">rev</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rootflags"> + <term><command>rootflags</command></term> + <listitem> + <para>Sets the rootflags in a bootable image</para> + <indexterm zone="ch-system-util-linux rootflags"> + <primary sortas="b-rootflags">rootflags</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="script"> + <term><command>script</command></term> + <listitem> + <para>Makes a typescript of a terminal session</para> + <indexterm zone="ch-system-util-linux script"> + <primary sortas="b-script">script</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setfdprm"> + <term><command>setfdprm</command></term> + <listitem> + <para>Sets user-provided floppy disk parameters</para> + <indexterm zone="ch-system-util-linux setfdprm"> + <primary sortas="b-setfdprm">setfdprm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setsid"> + <term><command>setsid</command></term> + <listitem> + <para>Runs the given program in a new session</para> + <indexterm zone="ch-system-util-linux setsid"> + <primary sortas="b-setsid">setsid</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="setterm"> + <term><command>setterm</command></term> + <listitem> + <para>Sets terminal attributes</para> + <indexterm zone="ch-system-util-linux setterm"> + <primary sortas="b-setterm">setterm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="sfdisk"> + <term><command>sfdisk</command></term> + <listitem> + <para>A disk partition table manipulator</para> + <indexterm zone="ch-system-util-linux sfdisk"> + <primary sortas="b-sfdisk">sfdisk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="swapoff"> + <term><command>swapoff</command></term> + <listitem> + <para>Disables devices and files for paging and swapping</para> + <indexterm zone="ch-system-util-linux swapoff"> + <primary sortas="b-swapoff">swapoff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="swapon"> + <term><command>swapon</command></term> + <listitem> + <para>Enables devices and files for paging and swapping and + lists the devices and files currently in use</para> + <indexterm zone="ch-system-util-linux swapon"> + <primary sortas="b-swapon">swapon</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tailf"> + <term><command>tailf</command></term> + <listitem> + <para>Tracks the growth of a log file. Displays the last 10 lines + of a log file, then continues displaying any new entries in the + log file as they are created</para> + <indexterm zone="ch-system-util-linux tailf"> + <primary sortas="b-tailf">tailf</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tunelp"> + <term><command>tunelp</command></term> + <listitem> + <para>Tunes the parameters of the line printer</para> + <indexterm zone="ch-system-util-linux tunelp"> + <primary sortas="b-tunelp">tunelp</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ul"> + <term><command>ul</command></term> + <listitem> + <para>A filter for translating underscores into escape sequences + indicating underlining for the terminal in use</para> + <indexterm zone="ch-system-util-linux ul"> + <primary sortas="b-ul">ul</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="umount"> + <term><command>umount</command></term> + <listitem> + <para>Disconnects a file system from the system's file tree</para> + <indexterm zone="ch-system-util-linux umount"> + <primary sortas="b-umount">umount</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vidmode"> + <term><command>vidmode</command></term> + <listitem> + <para>Sets the video mode in a bootable image</para> + <indexterm zone="ch-system-util-linux vidmode"> + <primary sortas="b-vidmode">vidmode</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="whereis"> + <term><command>whereis</command></term> + <listitem> + <para>Reports the location of the binary, source, and man page + for the given command</para> + <indexterm zone="ch-system-util-linux whereis"> + <primary sortas="b-whereis">whereis</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="write"> + <term><command>write</command></term> + <listitem> + <para>Sends a message to the given user <emphasis>if</emphasis> that + user has not disabled receipt of such messages</para> + <indexterm zone="ch-system-util-linux write"> + <primary sortas="b-write">write</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/vim.xml b/chapter06/vim.xml new file mode 100644 index 000000000..4d67ad037 --- /dev/null +++ b/chapter06/vim.xml @@ -0,0 +1,445 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-vim" role="wrap"> + <?dbhtml filename="vim.html"?> + + <title>Vim-&vim-version;</title> + + <indexterm zone="ch-system-vim"> + <primary sortas="a-Vim">Vim</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Vim package contains a powerful text editor.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&vim-ch6-sbu;</seg> + <seg>&vim-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + <tip> + <title>Alternatives to Vim</title> + + <para>If you prefer another editor—such as Emacs, Joe, or + Nano—please refer to <ulink + url="&blfs-root;view/svn/postlfs/editors.html"/> for suggested + installation instructions.</para> + </tip> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Vim</title> + + <para>First, unpack both + <filename>vim-&vim-version;.tar.bz2</filename> and (optionally) + <filename>vim-&vim-version;-lang.tar.gz</filename> archives into the + same directory. Then, patch Vim with several fixes from upstream + developers since the initial release of Vim-&vim-version;:</para> + +<screen><userinput>patch -Np1 -i ../&vim-fixes-patch;</userinput></screen> + + <para>This version of Vim installs translated man pages and places + them into directories that will not be searched by Man-DB. Patch Vim + so that it installs its man pages into searchable directories and + ultimately allows Man-DB to transcode the page into the desired format + at run-time:</para> + +<screen><userinput>patch -Np1 -i ../&vim-mandir-patch;</userinput></screen> + + <para>Finally, change the default location of the + <filename>vimrc</filename> configuration file to <filename + class="directory">/etc</filename>:</para> + +<screen><userinput>echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h</userinput></screen> + + <para>Now prepare Vim for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --enable-multibyte</userinput></screen> + + <variablelist> + <title>The meaning of the configure options:</title> + + <varlistentry> + <term><parameter>--enable-multibyte</parameter></term> + <listitem> + <para>This switch enables support for editing files in multibyte + character encodings. This is needed if using a locale with a + multibyte character set. This switch is also helpful to be able + to edit text files initially created in Linux distributions like + Fedora Core that use UTF-8 as a default character set.</para> + </listitem> + </varlistentry> + + </variablelist> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: <userinput>make test</userinput>. However, + this test suite outputs a lot of binary data to the screen, which can cause + issues with the settings of the current terminal. This can be resolved by + redirecting the output to a log file.</para> + + <para>Install the package:</para> + +<screen><userinput>make install</userinput></screen> + + <para>In UTF-8 locales, the <command>vimtutor</command> program tries to + convert the tutorials from ISO-8859-1 to UTF-8. Since some tutorials are + not in ISO-8859-1, the text in them is thus made unreadable. If you + unpacked the <filename>vim-&vim-version;-lang.tar.gz</filename> archive + and are going to use a UTF-8 based locale, remove non-ISO-8859-1 tutorials. + An English tutorial will be used instead.</para> + <!-- Removal is used instead of conversion in order for the user to be able to + painlessly revert his UTF-8 locale choice. --> + +<screen><userinput>rm -f /usr/share/vim/vim70/tutor/tutor.{gr,pl,ru,sk} +rm -f /usr/share/vim/vim70/tutor/tutor.??.*</userinput></screen> + + <para>Many users are used to using <command>vi</command> instead of + <command>vim</command>. To allow execution of <command>vim</command> + when users habitually enter <command>vi</command>, create a + symlink for both the binary and the man page in the provided + languages:</para> + +<screen><userinput>ln -sv vim /usr/bin/vi +for L in "" fr it pl ru; do + ln -sv vim.1 /usr/share/man/$L/man1/vi.1 +done</userinput></screen> + + <para>By default, Vim's documentation is installed in <filename + class="directory">/usr/share/vim</filename>. The following symlink + allows the documentation to be accessed via <filename + class="directory">/usr/share/doc/vim-&vim-version;</filename>, making + it consistent with the location of documentation for other packages:</para> + +<screen><userinput>ln -sv ../vim/vim70/doc /usr/share/doc/vim-&vim-version;</userinput></screen> + + <para>If an X Window System is going to be installed on the LFS + system, it may be necessary to recompile Vim after installing X. Vim + comes with a GUI version of the editor that requires X and some + additional libraries to be installed. For more information on this + process, refer to the Vim documentation and the Vim installation page + in the BLFS book at <ulink + url="&blfs-root;view/svn/postlfs/editors.html#postlfs-editors-vim"/>.</para> + + </sect2> + + <sect2 id="conf-vim" role="configuration"> + <title>Configuring Vim</title> + + <indexterm zone="conf-vim"> + <primary sortas="e-/etc/vimrc">/etc/vimrc</primary> + </indexterm> + + <para>By default, <command>vim</command> runs in vi-incompatible mode. + This may be new to users who have used other editors in the past. The + <quote>nocompatible</quote> setting is included below to highlight the + fact that a new behavior is being used. It also reminds those who would + change to <quote>compatible</quote> mode that it should be the first + setting in the configuration file. This is necessary because it changes + other settings, and overrides must come after this setting. Create a default + <command>vim</command> configuration file by running the following:</para> + +<screen><userinput>cat > /etc/vimrc << "EOF" +<literal>" Begin /etc/vimrc + +set nocompatible +set backspace=2 +syntax on +if (&term == "iterm") || (&term == "putty") + set background=dark +endif + +" End /etc/vimrc</literal> +EOF</userinput></screen> + + <para>The <parameter>set nocompatible</parameter> makes + <command>vim</command> behave in a more useful way (the default) than + the vi-compatible manner. Remove the <quote>no</quote> to keep the + old <command>vi</command> behavior. The <parameter>set + backspace=2</parameter> allows backspacing over line breaks, + autoindents, and the start of insert. The <parameter>syntax + on</parameter> enables vim's syntax highlighting. Finally, the + <emphasis>if</emphasis> statement with the <parameter>set + background=dark</parameter> corrects <command>vim</command>'s guess + about the background color of some terminal emulators. This gives the + highlighting a better color scheme for use on the black background of + these programs.</para> + + <para>Documentation for other available options can be obtained by + running the following command:</para> + +<screen role="nodump"><userinput>vim -c ':options'</userinput></screen> + + <note> + <para>By default, Vim only installs spell files for the English language. + To install spell files for your preferred language, please read the README + file located here: <ulink url="ftp://ftp.vim.org/pub/vim/runtime/spell/" /></para> + </note> + + </sect2> + + <sect2 id="contents-vim" role="content"> + <title>Contents of Vim</title> + + <segmentedlist> + <segtitle>Installed programs</segtitle> + + <seglistitem> + <seg>efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, + pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, + tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, + vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="efm_filter.pl"> + <term><command>efm_filter.pl</command></term> + <listitem> + <para>A filter for creating an error file that can be read + by <command>vim</command></para> + <indexterm zone="ch-system-vim efm_filter.pl"> + <primary sortas="b-efm_filter.pl">efm_filter.pl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="efm_perl.pl"> + <term><command>efm_perl.pl</command></term> + <listitem> + <para>Reformats the error messages of the Perl interpreter for use + with the <quote>quickfix</quote> mode of <command>vim</command></para> + <indexterm zone="ch-system-vim efm_perl.pl"> + <primary sortas="b-efm_perl.pl">efm_perl.pl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ex"> + <term><command>ex</command></term> + <listitem> + <para>Starts <command>vim</command> in ex mode</para> + <indexterm zone="ch-system-vim ex"> + <primary sortas="b-ex">ex</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="less.sh"> + <term><command>less.sh</command></term> + <listitem> + <para>A script that starts <command>vim</command> with less.vim</para> + <indexterm zone="ch-system-vim less.sh"> + <primary sortas="b-less.sh">less.sh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="mve.awk"> + <term><command>mve.awk</command></term> + <listitem> + <para>Processes <command>vim</command> errors</para> + <indexterm zone="ch-system-vim mve.awk"> + <primary sortas="b-mve.awk">mve.awk</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="pltags.pl"> + <term><command>pltags.pl</command></term> + <listitem> + <para>Creates a tags file for Perl code for use by + <command>vim</command></para> + <indexterm zone="ch-system-vim pltags.pl"> + <primary sortas="b-pltags.pl">pltags.pl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="ref"> + <term><command>ref</command></term> + <listitem> + <para>Checks the spelling of arguments</para> + <indexterm zone="ch-system-vim ref"> + <primary sortas="b-ref">ref</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rview"> + <term><command>rview</command></term> + <listitem> + <para>Is a restricted version of <command>view</command>; no shell + commands can be started and <command>view</command> cannot be + suspended</para> + <indexterm zone="ch-system-vim rview"> + <primary sortas="b-rview">rview</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="rvim"> + <term><command>rvim</command></term> + <listitem> + <para>Is a restricted version of <command>vim</command>; no shell + commands can be started and <command>vim</command> cannot be + suspended</para> + <indexterm zone="ch-system-vim rvim"> + <primary sortas="b-rvim">rvim</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="shtags.pl"> + <term><command>shtags.pl</command></term> + <listitem> + <para>Generates a tags file for Perl scripts</para> + <indexterm zone="ch-system-vim shtags.pl"> + <primary sortas="b-shtags.pl">shtags.pl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="tcltags"> + <term><command>tcltags</command></term> + <listitem> + <para>Generates a tags file for TCL code</para> + <indexterm zone="ch-system-vim tcltags"> + <primary sortas="b-tcltags">tcltags</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="view"> + <term><command>view</command></term> + <listitem> + <para>Starts <command>vim</command> in read-only mode</para> + <indexterm zone="ch-system-vim view"> + <primary sortas="b-view">view</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vi"> + <term><command>vi</command></term> + <listitem> + <para>Link to <command>vim</command></para> + <indexterm zone="ch-system-vim vi"> + <primary sortas="b-vi">vi</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vim"> + <term><command>vim</command></term> + <listitem> + <para>Is the editor</para> + <indexterm zone="ch-system-vim vim"> + <primary sortas="b-vim">vim</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vim132"> + <term><command>vim132</command></term> + <listitem> + <para>Starts <command>vim</command> with the terminal in 132-column + mode</para> + <indexterm zone="ch-system-vim vim132"> + <primary sortas="b-vim132">vim132</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vim2html.pl"> + <term><command>vim2html.pl</command></term> + <listitem> + <para>Converts Vim documentation to HypterText Markup Language + (HTML)</para> + <indexterm zone="ch-system-vim vim2html.pl"> + <primary sortas="b-vim2html.pl">vim2html.pl</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vimdiff"> + <term><command>vimdiff</command></term> + <listitem> + <para>Edits two or three versions of a file with <command>vim</command> + and show differences</para> + <indexterm zone="ch-system-vim vimdiff"> + <primary sortas="b-vimdiff">vimdiff</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vimm"> + <term><command>vimm</command></term> + <listitem> + <para>Enables the DEC locator input model on a remote terminal</para> + <indexterm zone="ch-system-vim vimm"> + <primary sortas="b-vimm">vimm</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vimspell.sh"> + <term><command>vimspell.sh</command></term> + <listitem> + <para>Spell checks a file and generates the syntax statements + necessary to highlight in <command>vim</command>. This script + requires the old Unix <command>spell</command> command, which + is provided neither in LFS nor in BLFS</para> + <indexterm zone="ch-system-vim vimspell.sh"> + <primary sortas="b-vimspell.sh">vimspell.sh</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="vimtutor"> + <term><command>vimtutor</command></term> + <listitem> + <para>Teaches the basic keys and commands of + <command>vim</command></para> + <indexterm zone="ch-system-vim vimtutor"> + <primary sortas="b-vimtutor">vimtutor</primary> + </indexterm> + </listitem> + </varlistentry> + + <varlistentry id="xxd"> + <term><command>xxd</command></term> + <listitem> + <para>Creates a hex dump of the given file; it can + also do the reverse, so it can be used for binary patching</para> + <indexterm zone="ch-system-vim xxd"> + <primary sortas="b-xxd">xxd</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> diff --git a/chapter06/zlib.xml b/chapter06/zlib.xml new file mode 100644 index 000000000..b5bca5e1c --- /dev/null +++ b/chapter06/zlib.xml @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-zlib" role="wrap"> + <?dbhtml filename="zlib.html"?> + + <title>Zlib-&zlib-version;</title> + + <indexterm zone="ch-system-zlib"> + <primary sortas="a-Zlib">Zlib</primary> + </indexterm> + + <sect2 role="package"> + <title/> + + <para>The Zlib package contains compression and decompression routines used by + some programs.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&zlib-ch6-sbu;</seg> + <seg>&zlib-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Zlib</title> + + <note> + <para>Zlib is known to build its shared library incorrectly if + <envar>CFLAGS</envar> is specified in the environment. If using + a specified <envar>CFLAGS</envar> variable, be sure to add the + <parameter>-fPIC</parameter> directive to the <envar>CFLAGS</envar> + variable for the duration of the configure command below, then + remove it afterwards.</para> + </note> + + <para>Prepare Zlib for compilation:</para> + +<screen><userinput>./configure --prefix=/usr --shared --libdir=/lib</userinput></screen> + + <para>Compile the package:</para> + +<screen><userinput>make</userinput></screen> + + <para>To test the results, issue: + <userinput>make check</userinput>.</para> + + <para>Install the shared library:</para> + +<screen><userinput>make install</userinput></screen> + + <para>The previous command installed a <filename + class="extension">.so</filename> file in <filename + class="directory">/lib</filename>. We will remove it and relink it into + <filename class="directory">/usr/lib</filename>:</para> + +<screen><userinput>rm -v /lib/libz.so +ln -sfv ../../lib/libz.so.&zlib-version; /usr/lib/libz.so</userinput></screen> + + <para>Build the static library:</para> + +<screen><userinput>make clean +./configure --prefix=/usr +make</userinput></screen> + + <para>To test the results again, issue: + <userinput>make check</userinput>.</para> + + <para>Install the static library:</para> + +<screen><userinput>make install</userinput></screen> + + <para>Fix the permissions on the static library:</para> + +<screen><userinput>chmod -v 644 /usr/lib/libz.a</userinput></screen> + + </sect2> + + <sect2 id="contents-zlib" role="content"> + <title>Contents of Zlib</title> + + <segmentedlist> + <segtitle>Installed libraries</segtitle> + + <seglistitem> + <seg>libz.{a,so}</seg> + </seglistitem> + </segmentedlist> + + <variablelist> + <bridgehead renderas="sect3">Short Descriptions</bridgehead> + <?dbfo list-presentation="list"?> + <?dbhtml list-presentation="table"?> + + <varlistentry id="libz"> + <term><filename class="libraryfile">libz</filename></term> + <listitem> + <para>Contains compression and decompression functions used by + some programs</para> + <indexterm zone="ch-system-zlib libz"> + <primary sortas="c-libz">libz</primary> + </indexterm> + </listitem> + </varlistentry> + + </variablelist> + + </sect2> + +</sect1> |