From 81fd230419b0cfd052b08fc1ed352bb7d49975df Mon Sep 17 00:00:00 2001 From: Gerard Beekmans Date: Sat, 19 Feb 2005 22:16:42 +0000 Subject: Trunk is now identical to Testing git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4648 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/aboutdebug.xml | 41 +- chapter06/autoconf.xml | 101 ++++- chapter06/automake.xml | 173 ++++++++- chapter06/bash.xml | 73 +++- chapter06/binutils.xml | 230 +++++++++++- chapter06/bison.xml | 54 ++- chapter06/bzip2.xml | 140 ++++++- chapter06/changingowner.xml | 28 +- chapter06/chroot.xml | 46 ++- chapter06/coreutils.xml | 785 ++++++++++++++++++++++++++++++++++++++- chapter06/createfiles.xml | 6 +- chapter06/creatingdirs.xml | 37 +- chapter06/devices.xml | 47 ++- chapter06/diffutils.xml | 55 ++- chapter06/e2fsprogs.xml | 330 +++++++++++++++- chapter06/file.xml | 40 +- chapter06/findutils.xml | 90 ++++- chapter06/flex.xml | 78 +++- chapter06/gawk.xml | 86 ++++- chapter06/gcc.xml | 162 +++++++- chapter06/gettext.xml | 266 ++++++++++++- chapter06/glibc.xml | 587 +++++++++++++++++++++++++++-- chapter06/grep.xml | 44 ++- chapter06/groff.xml | 327 +++++++++++++++- chapter06/grub.xml | 81 +++- chapter06/gzip.xml | 142 ++++++- chapter06/hotplug.xml | 126 ++++++- chapter06/iana-etc.xml | 39 +- chapter06/inetutils.xml | 136 ++++++- chapter06/introduction.xml | 61 ++- chapter06/iproute2.xml | 253 +++++++++++-- chapter06/kbd.xml | 248 ++++++++++++- chapter06/kernfs.xml | 21 +- chapter06/less.xml | 57 ++- chapter06/libol.xml | 39 +- chapter06/libtool.xml | 45 ++- chapter06/linux-libc-headers.xml | 37 +- chapter06/m4.xml | 35 +- chapter06/make.xml | 29 +- chapter06/man-pages.xml | 26 +- chapter06/man.xml | 135 ++++++- chapter06/mktemp.xml | 55 ++- chapter06/module-init-tools.xml | 120 +++++- chapter06/ncurses.xml | 162 +++++++- chapter06/patch.xml | 37 +- chapter06/perl.xml | 280 +++++++++++++- chapter06/procps.xml | 158 +++++++- chapter06/psmisc.xml | 82 +++- chapter06/pwdgroup.xml | 60 ++- chapter06/readjusting.xml | 84 ++++- chapter06/readline.xml | 66 +++- chapter06/revisedchroot.xml | 29 +- chapter06/sed.xml | 28 +- chapter06/shadow.xml | 354 +++++++++++++++++- chapter06/strippingagain.xml | 38 +- chapter06/syslogng.xml | 39 +- chapter06/sysvinit.xml | 191 +++++++++- chapter06/tar.xml | 37 +- chapter06/texinfo.xml | 99 ++++- chapter06/udev.xml | 105 +++++- chapter06/util-linux.xml | 572 +++++++++++++++++++++++++++- chapter06/vim.xml | 283 ++++++++++++-- chapter06/zlib.xml | 45 ++- 63 files changed, 7911 insertions(+), 349 deletions(-) (limited to 'chapter06') diff --git a/chapter06/aboutdebug.xml b/chapter06/aboutdebug.xml index f0ac8956f..7ef47d71c 100644 --- a/chapter06/aboutdebug.xml +++ b/chapter06/aboutdebug.xml @@ -7,6 +7,45 @@ About Debugging Symbols -See testing +Most programs and libraries are, by default, compiled with +debugging symbols included (with gcc's +-g 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. + +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: + + + +a bash binary +with debugging symbols: 1200 KB + +a bash binary +without debugging symbols: 480 KB + +Glibc and GCC files (/lib +and /usr/lib) +with debugging symbols: 87 MB + +Glibc and GCC files +without debugging symbols: 16 MB + + + +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. + +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 &hints-root; optimization.txt. + diff --git a/chapter06/autoconf.xml b/chapter06/autoconf.xml index ad766f602..790d1408b 100644 --- a/chapter06/autoconf.xml +++ b/chapter06/autoconf.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Autoconf-&autoconf-version; Autoconf +<para>The Autoconf package contains programs for producing shell scripts that +can automatically configure source code.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.5 SBU</seg><seg>7.7 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Autoconf installation depends on</segtitle> +<seglistitem><seg>Bash, Coreutils, Diffutils, Grep, +M4, Make, Perl, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -31,7 +38,7 @@ <screen><userinput>make</userinput></screen> <para>To test the results, issue: -<userinput>make check</userinput></para> +<userinput>make check</userinput>. This takes a long time, about 2 SBUs.</para> <para>Install the package:</para> @@ -39,11 +46,97 @@ </sect2> - <sect2 id="contents-autoconf" role="content"><title>Contents of Autoconf -See testing + +Installed programs +autoconf, autoheader, autom4te, +autoreconf, autoscan, autoupdate, and ifnames + + +Short Descriptions + + + +autoconf + +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 autoconf program. +autoconf + + + + +autoheader + +A tool for creating template files of C +#define statements for configure to use +autoheader + + + + +autom4te + +A wrapper for the M4 macro processor +autom4te + + + + +autoreconf + +Automatically runs autoconf, +autoheader, aclocal, +automake, gettextize, and +libtoolize in the correct order to save time +when changes are made to autoconf and +automake template files +autoreconf + + + + +autoscan + +Helps to create a configure.in file for a +software package; it examines the source files in a directory tree, +searching them for common portability issues, and creates a +configure.scan file that serves as as a +preliminary configure.in file for the +package +autoscan + + + + +autoupdate + +Modifies a configure.in file that still +calls autoconf macros by their old names to use the +current macro names +autoupdate + + + + +ifnames + +Helps when writing configure.in 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 +configure needs to check for. It can also fill in +gaps in a configure.in file generated by +autoscan +ifnames + + + + diff --git a/chapter06/automake.xml b/chapter06/automake.xml index ae50cd74b..ebf4ad482 100644 --- a/chapter06/automake.xml +++ b/chapter06/automake.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Automake-&automake-version; Automake +<para>The Automake package contains programs for generating Makefiles for use +with Autoconf.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>6.8 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Automake installation depends on</segtitle> +<seglistitem><seg>Autoconf, Bash, Coreutils, +Diffutils, Grep, M4, Make, Perl, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -31,7 +38,7 @@ <screen><userinput>make</userinput></screen> <para>To test the results, issue: -<userinput>make check</userinput></para> +<userinput>make check</userinput>. This takes a long time, about 5 SBUs.</para> <para>Install the package:</para> @@ -42,8 +49,168 @@ <sect2 id="contents-automake" role="content"><title>Contents of Automake -See testing + +Installed programs +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 + + +Short Descriptions + + + +acinstall + +A script that installs aclocal-style M4 files +acinstall + + + + +aclocal + +Generates aclocal.m4 +files based on the contents of configure.in files +aclocal + + + + +aclocal-&automake-version; + +A hard link to aclocal +aclocal-&automake-version; + + + + +automake + +A tool for automatically generating +Makefile.in files from +Makefile.am files. To create all the +Makefile.in files for a package, run this program +in the top-level directory. By scanning the +configure.in file, it automatically finds each +appropriate Makefile.am file and generate the +corresponding Makefile.in file +automake + + + + +automake-&automake-version; + +A hard link to automake +automake-&automake-version; + + + + +compile + +A wrapper for compilers +compile + + + + +config.guess + +A script that attempts to guess +the canonical triplet for the given build, host, or target architecture +config.guess + + + + +config.sub + +A configuration validation subroutine script +config.sub + + + + +depcomp + +A script for compiling a program so that dependency information +is generated in addition to the desired output +depcomp + + + + +elisp-comp + +Byte-compiles Emacs Lisp code +elisp-comp + + + + +install-sh + +A script that installs a program, script, or data file +install-sh + + + + +mdate-sh + +A script that prints the modification time of a file or directory +mdate-sh + + + + +missing + +A script acting as a common stub for missing GNU programs during +an installation +missing + + + + +mkinstalldirs + +A script that creates a directory tree +mkinstalldirs + + + + +py-compile + +Compiles a Python program +py-compile + + + + +symlink-tree + +A script to create a symlink tree of a directory tree +symlink-tree + + + + +ylwrap + +A wrapper for lex and yacc +ylwrap + + + + diff --git a/chapter06/bash.xml b/chapter06/bash.xml index 8803aad6a..b7c459f1e 100644 --- a/chapter06/bash.xml +++ b/chapter06/bash.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Bash-&bash-version; Bash +<para>The Bash package contains the Bourne-Again SHell.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,16 +18,24 @@ <seglistitem><seg>1.2 SBU</seg><seg>27 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Bash installation depends on</segtitle> +<seglistitem><seg>Binutils, Coreutils, Diffutils, Gawk, +GCC, Glibc, Grep, Make, Ncurses, and Sed.</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Bash -Apply a patch: + +The following patch fixes various issues, including a problem where Bash +will sometimes only show 33 characters on a line, then wrap to the next: patch -Np1 -i ../bash-&bash-version;-fixes-1.patch -Apply another patch: +Bash also has issues when compiled against newer versions of Glibc. The +following patch resolves this problem: patch -Np1 -i ../bash-&bash-version;-avoid_WCONTINUED-1.patch @@ -35,6 +44,17 @@ ./configure --prefix=/usr --bindir=/bin \ --without-bash-malloc --with-installed-readline +The meaning of the configure option: + + + +--with-installed-readline +This options tells Bash to use the +readline library that is already installed +on the system rather than using its own readline version. + + + Compile the package: make @@ -46,17 +66,60 @@ make install -Run the newly compiled bash program: +Run the newly compiled bash program (replacing the one that is +currently being executed): exec /bin/bash --login +h +The parameters used make the bash +process an interactive login shell and continue to disable hashing so +that new programs are found as they become available. + Contents of Bash -See testing + +Installed programs +bash, bashbug, and sh (link to bash) + + +Short Descriptions + + + +bash + +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 +bash + + + + +bashbug + +A shell script to help the user compose and mail bug reports +concerning bash in a standard format +bashbug + + + + +sh + +A symlink to the bash program; when invoked +as sh, bash tries to mimic the +startup behavior of historical versions of sh as +closely as possible, while conforming to the POSIX standard as well +sh + + + + diff --git a/chapter06/binutils.xml b/chapter06/binutils.xml index f749f0864..c3032612a 100644 --- a/chapter06/binutils.xml +++ b/chapter06/binutils.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Binutils-&binutils-version; Binutils +<para>The Binutils package contains a linker, an assembler, and other tools for +handling object files.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,21 +19,45 @@ <seglistitem><seg>1.4 SBU</seg><seg>167 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Binutils installation depends on</segtitle> +<seglistitem><seg>Bash, Bison, Coreutils, Diffutils, Flex, GCC, Gettext, +Glibc, Grep, M4, Make, Perl, Sed, and Texinfo</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Binutils -Check if there is PTYs for the test suites: +This package is known to have issues when its default +optimization flags (including the -march and +-mcpu options) are changed. If any environment +variables that override default optimizations have been defined, such +as CFLAGS and CXXFLAGS, +unset them when building Binutils. + +Verify that the PTYs are working properly inside the chroot +environment. Check that everything is set up correctly by performing a +simple test: expect -c "spawn ls" -Create the build directory: +If the following message shows up, the chroot environment is not +set up for proper PTY operation: + +The system has no more ptys. +Ask your system administrator to create more. + +This issue needs to be resolved before running the test suites +for Binutils and GCC. + +The Binutils documentation recommends building Binutils outside of the +source directory in a dedicated build directory: mkdir ../binutils-build cd ../binutils-build -Now prepare Binutils for compilation: +Prepare Binutils for compilation: ../binutils-&binutils-version;/configure --prefix=/usr \ --enable-shared @@ -40,19 +66,33 @@ cd ../binutils-build make tooldir=/usr -Test the results: +Normally, the tooldir (the directory where the executables will +ultimately be located) is set to $(exec_prefix)/$(target_alias), which +expands into /usr/i686-pc-linux-gnu/usr/i686-pc- +linux-gnu. Because this is a custom system, this +target-specific directory in /usr is not required. This setup 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). - -make -k check +The test suite for Binutils in this section is +considered critical. Do not skip it under any +circumstances. -The test suite notes from are still -very much appropriate here.. +Test the results: + +make check Install the package: make tooldir=/usr install -Install the libiberty header file: +Install the libiberty header file that is needed by +some packages: cp ../binutils-&binutils-version;/include/libiberty.h /usr/include @@ -61,8 +101,176 @@ very much appropriate here.. Contents of Binutils -See testing + +Installed programs +Installed libraries +addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump, +ranlib, readelf, size, strings, and strip +libiberty.a, libbfd.[a,so], and libopcodes.[a,so] + + +Short Descriptions + + + +addr2line + +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 +addr2line + + + + +ar + +Creates, modifies, and extracts from archives +ar + + + + +as + +An assembler that assembles the output of gcc +into object files +as + + + + +c++filt + +Used by the linker to de-mangle C++ and Java symbols and to keep +overloaded functions from clashing +c++filt + + + + +gprof + +Displays call graph profile data +gprof + + + + +ld + +A linker that combines a number of object and archive files into a single file, +relocating their data and tying up symbol references +ld + + + + +nm + +Lists the symbols occurring in a given object file +nm + + + + +objcopy + +Translates one type of object file into another +objcopy + + + + +objdump + +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 +objdump + + + + +ranlib + +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 +ranlib + + + + +readelf + +Displays information about ELF type binaries +readelf + + + + +size + +Lists the section sizes and the total size for the given object files +size + + + + +strings + +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 +strings + + + + +strip + +Discards symbols from object files +strip + + + + +libiberty + +Contains routines used by various GNU programs, including +getopt, obstack, +strerror, strtol, and +strtoul +libiberty + + + + +libbfd + +The Binary File Descriptor library +libbfd + + + + +libopcodes + +A library for dealing with opcodes—the readable +text versions of instructions for the processor; +it is used for building utilities like +objdump. +libopcodes + + + + diff --git a/chapter06/bison.xml b/chapter06/bison.xml index ad2b668bc..8626349bf 100644 --- a/chapter06/bison.xml +++ b/chapter06/bison.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Bison-&bison-version; Bison +<para>The Bison package contains a parser generator.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.6 SBU</seg><seg>10.6 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Bison installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Gettext, Glibc, Grep, M4, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,17 +39,57 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> </sect2> - <sect2 id="contents-bison" role="content"><title>Contents of Bison -See testing + +Installed programs +Installed library +bison and yaccliby.a + + +Short Descriptions + + + +bison + +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) +bison + + + + +yacc + +a wrapper for bison, meant for programs +that still call yacc instead of bison; +it calls bison with the -y option +yacc + + + + +liby.a + +the Yacc library containing implementations of Yacc-compatible +yyerror and main functions; +this library is normally not very useful, but POSIX requires +it +liby.a + + + + diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml index 2751da0dd..24f83aab9 100644 --- a/chapter06/bzip2.xml +++ b/chapter06/bzip2.xml @@ -3,13 +3,16 @@ %general-entities; ]> - + Bzip2-&bzip2-version; Bzip2 +<para>The Bzip2 package contains programs for compressing and decompressing +files. Text files yield a much better compression than with the +traditional <command>gzip</command>.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +20,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>3.0 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Bzip2 installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, and Make</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -27,15 +35,27 @@ <screen><userinput>make -f Makefile-libbz2_so make clean</userinput></screen> +<para>The <parameter>-f</parameter> flag 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> + <para>Compile the package:</para> <screen><userinput>make</userinput></screen> -<para>Install the package:</para> +<para>If reinstalling Bzip2, perform +<userinput>rm -f /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>Do some location changes:</para> +<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 bzip2-shared /bin/bzip2 cp -a libbz2.so* /lib @@ -49,8 +69,120 @@ ln -s bzip2 /bin/bzcat</userinput></screen> <sect2 id="contents-bzip2" role="content"><title>Contents of Bzip2 -See testing + +Installed programs +Installed libraries +bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, +bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore +libbz2.a, libbz2.so (link to libbz2.so.1.0), libbz2.so.1.0 (link to +libbz2.so.&bzip2-version;), and libbz2.so.&bzip2-version; + + +Short Descriptions + + + +bunzip2 + +Decompresses bzipped files +bunzip2 + + + + +bzcat + +Decompresses to standard output +bzcat + + + + +bzcmp + +Runs cmp on bzipped files +bzcmp + + + + +bzdiff + +Runs diff on bzipped files +bzdiff + + + + +bzgrep + +Runs grep on bzipped files +bzgrep + + + + +bzegrep + +Runs egrep on bzipped files +bzegrep + + + + +bzfgrep + +Runs fgrep on bzipped files +bzfgrep + + + + +bzip2 + +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 +Lempel-Ziv algorithms, like gzip +bzip2 + + + + +bzip2recover + +Tries to recover data from damaged bzipped files +bzip2recover + + + + +bzless + +Runs less on bzipped files +bzless + + + + +bzmore + +Runs more on bzipped files +bzmore + + + + +libbz2* + +The library implementing lossless, block-sorting data +compression, using the Burrows-Wheeler algorithm +libbz2* + + + + diff --git a/chapter06/changingowner.xml b/chapter06/changingowner.xml index 9d53404f6..a22e199c5 100644 --- a/chapter06/changingowner.xml +++ b/chapter06/changingowner.xml @@ -7,8 +7,34 @@ Changing Ownership -Change the owner of /tools: +Currently, the /tools +directory is owned by the user lfs, a user that +exists only on the host system. Although the /tools directory can be deleted once the +LFS system has been finished, it can be retained to build additional +LFS systems. If the /tools +directory is kept as is, the files are owned by a user ID without a +corresponding account. This is dangerous because a user account +created later could get this same user ID and would own the /tools directory and all the files +therein, thus exposing these files to possible malicious +manipulation. + +To avoid this issue, add the lfs user to +the new LFS system later when creating the +/etc/passwd file, taking care to assign it the +same user and group IDs as on the host system. Alternatively, assign +the contents of the /tools +directory to user root by running the following +command: chown -R 0:0 /tools +The command uses 0:0 instead of +root:root, because chown +is unable to resolve the name root until the password +file has been created. This book assumes you ran this +chown command. + + diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml index 9ef1cca3e..c9afcdc13 100644 --- a/chapter06/chroot.xml +++ b/chapter06/chroot.xml @@ -7,11 +7,55 @@ Entering the Chroot Environment -Enter the chroot environment: +It is time to enter the chroot environment to begin +building and installing the final LFS system. As user +root, run the following command to enter the +realm that is, at the moment, populated with only the temporary +tools: 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 +The -i option given to the +env command will clear all variables of the chroot +environment. After that, only the HOME, +TERM, PS1, and +PATH variables are set again. The +TERM=$TERM construct will set the +TERM variable inside chroot to the same value as +outside chroot. This variable is needed for programs like +vim and less to operate +properly. If other variables are needed, such as +CFLAGS or CXXFLAGS, this is +a good place to set them again. + +From this point on, there is no need to use the +LFS variable anymore, because all work will be +restricted to the LFS file system. This is because the Bash shell is +told that $LFS is now the root +(/) directory. + +Notice that /tools/bin +comes last in the PATH. This means that a +temporary tool will not be used anymore as soon as its final version +is installed. This occurs when the shell does not remember the +locations of executed binaries—for this reason, hashing is switched +off by passing the +h option to bash. + +It is important that all the commands throughout the remainder +of this chapter and the following chapters be run from within the +chroot environment. If you leave this environment for any reason +(rebooting for example), remember to first mount the proc and devpts file systems (discussed in the +previous section) and enter chroot again before continuing with the +installations. + +Note that the bash prompt will say I have no +name! This is normal because the +/etc/passwd file has not been created yet. + + diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index d4c93c84b..6df281e33 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Coreutils-&coreutils-version; Coreutils +<para>The Coreutils package contains utilities for showing and setting the +basic system characteristics.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,16 +19,25 @@ <seglistitem><seg>0.9 SBU</seg><seg>69 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Coreutils installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, GCC, +Gettext, Glibc, Grep, Make, Perl, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Coreutils -Apply a patch: +A known issue with the uname program from +this package is that the -p switch always +returns unknown. The following patch +fixes this behavior for Intel architectures: patch -Np1 -i ../coreutils-&coreutils-version;-uname-2.patch -Apply another patch: +Prevent Coreutils from installing binaries that will be later be +installed by other packages: patch -Np1 -i \ ../coreutils-&coreutils-version;-suppress_uptime_kill_su-1.patch @@ -39,21 +50,30 @@ make +The test suite of Coreutils makes several assumptions about the +presence of files and users that are not valid this early in the LFS +build. Therefore, additional items need to be set up before running +the tests. Skip down to Install the package if +not running the test suite. + Create two dummy groups and a dummy user name: echo "dummy1:x:1000:" >> /etc/group echo "dummy2:x:1001:dummy" >> /etc/group echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd -Run the root tests: +Now the test suite is ready to be run. First, run the tests that +are meant to be run as user root: make NON_ROOT_USERNAME=dummy check-root -Run the user tests: +Then run the remainder of the tests as the +dummy user: src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check" -Remove the dummy user and groups: +When testing is complete, remove the dummy user and +groups: sed -i '/dummy/d' /etc/passwd /etc/group @@ -61,7 +81,7 @@ echo "dummy:x:1000:1000:::/bin/bash" >> /etc/passwd make install -And move some programs to their proper locations: +Move programs to the proper locations: mv /usr/bin/{[,basename,cat,chgrp,chmod,chown,cp,dd,df} /bin mv /usr/bin/{date,echo,false,head,hostname,install,ln} /bin @@ -69,7 +89,7 @@ mv /usr/bin/{ls,mkdir,mknod,mv,pwd,rm,rmdir,sync} /bin mv /usr/bin/{sleep,stty,test,touch,true,uname} /bin mv /usr/bin/chroot /usr/sbin -Create a symlink: +Finally, create a symlink to be FHS-compliant: ln -s ../../bin/install /usr/bin @@ -78,8 +98,755 @@ mv /usr/bin/chroot /usr/sbin Contents of Coreutils -See testing + +Installed programs +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 + + +Short Descriptions + + + +basename + +Strips any path and a given suffix from a file name +basename + + + + +cat + +Concatenates files to standard output +cat + + + + +chgrp + +Changes the group ownership of each given file to the given +group; the group can either be either given a name or a numeric +ID +chgrp + + + + +chmod + +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 +chmod + + + + +chown + +Changes the user and/or group ownership of +each given file to the given user/group pair +chown + + + + +chroot + +Runs a command with the specified directory as the +/ directory +chroot + + + + +cksum + +Prints the Cyclic Redundancy Check (CRC) checksum and the byte +counts of each specified file +cksum + + + + +comm + +Compares two sorted files, outputting in three columns the lines +that are unique and the lines that are common +comm + + + + +cp + +Copies files +cp + + + + +csplit + +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 +csplit + + + + +cut + +Prints sections of lines, selecting the parts according to given +fields or positions +cut + + + + +date + +Displays the current time in the given format, or sets the +system date +date + + + + +dd + +Copies a file using the given block size and count, while +optionally performing conversions on it +dd + + + + +df + +Reports the amount of disk space available (and used) on all +mounted file systems, or only on the file systems holding the selected +files +df + + + + +dir + +Lists the contents of each given directory (the same as +the ls command) +dir + + + + +dircolors + +Outputs commands to set the LS_COLOR +environment variable to change the color scheme used by +ls +dircolors + + + + +dirname + +Strips the non-directory suffix from a file name +dirname + + + + +du + +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 +du + + + + +echo + +Displays the given strings +echo + + + + +env + +Runs a command in a modified environment +env + + + + +expand + +Converts tabs to spaces +expand + + + + +expr + +Evaluates expressions +expr + + + + +factor + +Prints the prime factors of all specified integer numbers +factor + + + + +false + +Does nothing, unsuccessfully; it always exits with a status code +indicating failure +false + + + + +fmt + +Reformats the paragraphs in the given files +fmt + + + + +fold + +Wraps the lines in the given files +fold + + + + +groups + +Reports a user's group memberships +groups + + + + +head + +Prints the first ten lines (or the given number of lines) of each given file +head + + + + +hostid + +Reports the numeric identifier (in hexadecimal) of the host +hostid + + + + +hostname + +Reports or sets the name of the host +hostname + + + + +id + +Reports the effective user ID, group ID, and +group memberships of the current user or specified user +id + + + + +install + +Copies files while setting their +permission modes and, if possible, their owner and group +install + + + + +join + +Joins the lines that have identical join fields from two +separate files +join + + + + +link + +Creates a hard link with the given name to a file +link + + + + +ln + +Makes hard links or soft (symbolic) links between files +ln + + + + +logname + +Reports the current user's login name +logname + + + + +ls + +Lists the contents of each given directory +ls + + + + +md5sum + +Reports or checks Message Digest 5 (MD5) checksums +md5sum + + + + +mkdir + +Creates directories with the given names +mkdir + + + + +mkfifo + +Creates First-In, First-Outs (FIFOs), a named +pipe in UNIX parlance, with the given names +mkfifo + + + + +mknod + +Creates device nodes with the given names; a device node is a +character special file, a block special file, or a FIFO +mknod + + + + +mv + +Moves or renames files or directories +mv + + + + +nice + +Runs a program with modified scheduling priority +nice + + + + +nl + +Numbers the lines from the given files +nl + + + + +nohup + +Runs a command immune to hangups, with its output redirected to +a log file +nohup + + + + +od + +Dumps files in octal and other formats +od + + + + +paste + +Merges the given files, joining sequentially corresponding lines +side by side, separated by tab characters +paste + + + + +pathchk + +Checks if file names are valid or portable +pathchk + + + + +pinky + +Is a lightweight finger client; it reports some information about the given users +pinky + + + + +pr + +Paginates and columnates files for printing +pr + + + + +printenv + +Prints the environment +printenv + + + + +printf + +Prints the given arguments according to the given format, much +like the C printf function +printf + + + + +ptx + +Produces a permuted index from the contents of the given files, +with each keyword in its context +ptx + + + + +pwd + +Reports the name of the current working directory +pwd + + + + +readlink + +Reports the value of the given symbolic link +readlink + + + + +rm + +Removes files or directories +rm + + + + +rmdir + +Removes directories if they are empty +rmdir + + + + +seq + +Prints a sequence of numbers within a given range and with a +given increment +seq + + + + +sha1sum + +Prints or checks 160-bit Secure Hash Algorithm 1 (SHA1) checksums +sha1sum + + + + +shred + +Overwrites the given files repeatedly with complex patterns, +making it difficult to recover the data +shred + + + + +sleep + +Pauses for the given amount of time +sleep + + + + +sort + +Sorts the lines from the given files +sort + + + + +split + +Splits the given file into pieces, by size or by number of lines +split + + + + +stat + +Displays file or filesystem status +stat + + + + +stty + +Sets or reports terminal line settings +stty + + + + +sum + +Prints checksum and block counts for each given file +sum + + + + +sync + +Flushes file system buffers; it forces changed blocks to disk +and updates the super block +sync + + + + +tac + +Concatenates the given files in reverse +tac + + + + +tail + +Prints the last ten lines (or the given number of lines) of each +given file +tail + + + + +tee + +Reads from standard input while writing both to standard output +and to the given files +tee + + + + +test + +Compares values and checks file types +test + + + + +touch + +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 +touch + + + + +tr + +Translates, squeezes, and deletes the given characters from +standard input +tr + + + + +true + +Does nothing, successfully; it always exits with a status code +indicating success +true + + + + +tsort + +Performs a topological sort; it writes a completely ordered list +according to the partial ordering in a given file +tsort + + + + +tty + +Reports the file name of the terminal connected to standard +input +tty + + + + +uname + +Reports system information +uname + + + + +unexpand + +Converts spaces to tabs +unexpand + + + + +uniq + +Discards all but one of successive identical lines +unexpand + + + + +unlink + +Removes the given file +unlink + + + + +users + +Reports the names of the users currently logged on +users + + + + +vdir + +Is the same as ls -l +vdir + + + + +wc + +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 +wc + + + + +who + +Reports who is logged on +who + + + + +whoami + +Reports the user name associated with the current effective user ID +whoami + + + + +yes + +Repeatedly outputs y or a given string until +killed +yes + + + + diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml index de27a6c76..7e5ddc97a 100644 --- a/chapter06/createfiles.xml +++ b/chapter06/createfiles.xml @@ -7,7 +7,10 @@ Creating Essential Symlinks -Create some needed links. +Some programs hard-wire paths to programs which do not yet +exist. 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. ln -s /tools/bin/{bash,cat,pwd,stty} /bin ln -s /tools/bin/perl /usr/bin @@ -15,3 +18,4 @@ ln -s /tools/lib/libgcc_s.so{,.1} /usr/lib ln -s bash /bin/sh + diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml index b989b7879..e7881c982 100644 --- a/chapter06/creatingdirs.xml +++ b/chapter06/creatingdirs.xml @@ -7,7 +7,9 @@ Creating Directories -Create a dirs tree: +It is time to create some structure in the LFS file system. +Create a directory tree. Issuing the following commands will create a +standard tree: install -d /{bin,boot,dev,etc/opt,home,lib,mnt} install -d /{sbin,srv,usr/local,var,opt} @@ -29,4 +31,37 @@ install -d /var/{opt,cache,lib/{misc,locate},local} install -d /opt/{bin,doc,include,info} install -d /opt/{lib,man/man{1,2,3,4,5,6,7,8}} +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 +root, and another to the directories for +temporary files. + +The first mode change ensures that not just anybody can enter +the /root 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 /tmp and /var/tmp directories, but cannot remove +other users' files from them. The latter is prohibited by the +so-called sticky bit, the highest bit (1) in the 1777 +bit mask. + + +FHS Compliance Note + +The directory tree is based on the Filesystem Hierarchy Standard +(FHS) standard (available at ). Besides the tree created above, +this standard stipulates the existence of /usr/local/games and /usr/share/games. We do not recommend +these for a base system, however, feel free to make the system +FHS-compliant. The FHS is not precise as to the structure of the +/usr/local/share subdirectory, +so we created only the directories that are needed. + + + + diff --git a/chapter06/devices.xml b/chapter06/devices.xml index 4663f4caf..e46cf8ba5 100644 --- a/chapter06/devices.xml +++ b/chapter06/devices.xml @@ -3,20 +3,42 @@ %general-entities; ]> - + Populating /dev -Create the initial device nodes +/dev/* + + +Creating Initial Device Nodes + +When the kernel boots the system, it requires the presence of a few device +nodes, in particular the console and +null devices. Create these by +running the following commands: mknod -m 600 /dev/console c 5 1 mknod -m 666 /dev/null c 1 3 + + + +Mounting ramfs and Populating /dev -Mount a ramfs in /dev +The ideal way to populate /dev is to mount a ramfs onto /dev, like tmpfs, and create the devices on there +during each bootup. Since the system has not been booted, it is +necessary to do what the bootscripts would otherwise do and populate +/dev. Begin by mounting +/dev: mount -n -t ramfs none /dev -Create a minimal set of device nodes: + +Since the Udev package will not be installed until later on in the +process, create a minimal set of device nodes used for building: mknod -m 622 /dev/console c 5 1 mknod -m 666 /dev/null c 1 3 @@ -26,8 +48,10 @@ mknod -m 666 /dev/tty c 5 0 mknod -m 444 /dev/random c 1 8 mknod -m 444 /dev/urandom c 1 9 chown root:tty /dev/{console,ptmx,tty} + -Create some symlinks and directories: +There are some symlinks and directories required by LFS that are +not created by Udev, so create those here: ln -s /proc/self/fd /dev/fd ln -s /proc/self/fd/0 /dev/stdin @@ -37,10 +61,21 @@ ln -s /proc/kcore /dev/core mkdir /dev/pts mkdir /dev/shm -Mount the virtual file systems: +Finally, mount the proper virtual (kernel) file systems on the +newly-created directories: mount -t devpts -o gid=4,mode=620 none /dev/pts mount -t tmpfs none /dev/shm +The mount commands executed above may result +in the following warning message: + +can't open /etc/fstab: No such file or directory. + +This file—/etc/fstab—has not +been created yet but is also not required for the file systems to be +properly mounted. As such, the warning can be safely ignored. + + diff --git a/chapter06/diffutils.xml b/chapter06/diffutils.xml index dfe1e4d2d..3649469f2 100644 --- a/chapter06/diffutils.xml +++ b/chapter06/diffutils.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Diffutils-&diffutils-version; Diffutils +<para>The Diffutils package contains programs that show the differences +between files or directories.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>7.5 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Diffutils installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, GCC, +Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -30,7 +37,9 @@ <screen><userinput>make</userinput></screen> -<para>Install it:</para> +<para>This package does not come with a test suite.</para> + +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -39,8 +48,48 @@ <sect2 id="contents-diffutils" role="content"><title>Contents of Diffutils -See testing + +Installed programs +cmp, diff, diff3, and sdiff + + +Short Descriptions + + + +cmp + +Compares two files and reports whether or in which bytes they differ +cmp + + + + +diff + +Compares two files or directories and reports which lines in the files differ +diff + + + + +diff3 + +Compares three files line by line +diff3 + + + + +sdiff + +Merges two files and interactively outputs the results +sdiff + + + + diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml index 2a134265c..b3e5ecc30 100644 --- a/chapter06/e2fsprogs.xml +++ b/chapter06/e2fsprogs.xml @@ -3,13 +3,16 @@ %general-entities; ]> - + E2fsprogs-&e2fsprogs-version; E2fsprogs +<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> @@ -17,12 +20,18 @@ <seglistitem><seg>0.6 SBU</seg><seg>4.9 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>E2fsprogs installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, Gawk, GCC, Gettext, Glibc, Grep, Make, Sed, and Texinfo</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of E2fsprogs -Create a build directory: +It is recommended that E2fsprogs be built in a subdirectory of the source tree: + mkdir build cd build @@ -32,6 +41,39 @@ cd build ../configure --prefix=/usr --with-root-prefix="" \ --enable-elf-shlibs --disable-evms +The meaning of the configure options: + + + +--with-root-prefix="" +Certain programs (such as the +e2fsck program) are considered essential programs. +When, for example, /usr is not +mounted, these essential programs need to be available. They belong in +directories like /lib and +/sbin. If this option is not +passed to E2fsprogs' configure, the programs are installed into the +/usr directory, which is not +where they should be. + + + +--enable-elf-shlibs +This creates the shared libraries which some programs +in this package use. + + + +--disable-evms +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 for more +information regarding EVMS. + + + Compile the package: make @@ -43,16 +85,296 @@ cd build make install -Also install the shared libraries: +Install the shared libraries: make install-libs + + Contents of E2fsprogs -See testing + +Installed programs +Installed libraries +badblocks, blkid, chattr, +compile_et, debugfs, dumpe2fs, e2fsck, e2image, e2label, findfs, fsck, +fsck.ext2, fsck.ext3, logsave, lsattr, mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, +mklost+found, resize2fs, tune2fs, and uuidgen. +libblkid.[a,so], libcom_err.[a,so], libe2p.[a,so], +libext2fs.[a,so], libss.[a,so], and libuuid.[a,so] + + +Short Descriptions + + + +badblocks + +Searches a device (usually a disk partition) for bad blocks +badblocks + + + + +blkid + +A command line utility to locate and print block device attributes +blkid + + + + +chattr + +Changes the attributes of files on an ext2 file system; it also changes ext3 file systems, the journaling version of +ext2 file systems +chattr + + + + +compile_et + +An error table compiler; it converts a table of error-code names and +messages into a C source file suitable for use with the com_err library +compile_et + + + + +debugfs + +A file system debugger; it can be used to examine and change the +state of an ext2 file system +debugfs + + + + +dumpe2fs + +Prints the super block and blocks group information for the file +system present on a given device +dumpe2fs + + + + +e2fsck + +Is used to check, and optionally repair ext2 file systems and ext3 file systems +e2fsck + + + + +e2image + +Is used to save critical ext2 +file system data to a file +e2image + + + + +e2label + +Displays or changes the file system label on the ext2 file system present on a given device +e2label + + + + +findfs + +Finds a file system by label or Universally Unique Identifier (UUID) +findfs + + + + +fsck + +Is used to check, and optionally repair, file systems +fsck + + + + +fsck.ext2 + +By default checks ext2 +file systems +fsck.ext2 + + + + +fsck.ext3 + +By default checks ext3 +file systems +fsck.ext3 + + + + +logsave + +Saves the output of a command in a log file +logsave + + + + +lsattr + +Lists the attributes of files on a second extended file system +lsattr + + + + +mk_cmds + +Converts a table of command names and helps messages into a C +source file suitable for use with the libss subsystem library +mk_cmds + + + + +mke2fs + +Is used to create a second extended file system on the given +device +mke2fs + + + + +mkfs.ext2 + +By default creates ext2 +file systems +mkfs.ext2 + + + + +mkfs.ext3 + +By default creates ext3 +file systems +mkfs.ext3 + + + + +mklost+found + +Used to create a lost+found +directory on an ext2 file system; +it pre-allocates disk blocks to this directory to lighten the task of +e2fsck +mklost+found + + + + +resize2fs + +Can be used to enlarge or shrink an ext2 file system +resize2fs + + + + +tune2fs + +Adjusts tunable file system parameters on an ext2 file system +tune2fs + + + + +uuidgen + +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 +uuidgen + + + + +libblkid + +Contains routines for device identification and token extraction +libblkid + + + + +libcom_err + +The common error display routine +libcom_err + + + + +libe2p + +Used by dumpe2fs, chattr, +and lsattr +libe2p + + + + +libext2fs + +Contains routines to enable user-level programs to manipulate an +ext2 file system +libext2fs + + + + +libss + +Used by debugfs +libss + + + + +libuuid + +Contains routines for generating unique identifiers for objects +that may be accessible beyond the local system +libuuid + + + + diff --git a/chapter06/file.xml b/chapter06/file.xml index 6079e8ebc..639353cd2 100644 --- a/chapter06/file.xml +++ b/chapter06/file.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + File-&file-version; File +<para>The File package contains a utility for determining the type of files.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>6.3 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>File installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, Sed, and Zlib</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -30,7 +36,7 @@ <screen><userinput>make</userinput></screen> -<para>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -39,8 +45,36 @@ <sect2 id="contents-file" role="content"><title>Contents of File -See testing + +Installed programs +Installed library +filelibmagic.[a,so] + + +Short Descriptions + + + +file + +Tries to classify each given file; it does this by performing +several tests—file system tests, magic number tests, and language +tests +file + + + + +libmagic + +Contains routines for magic number recognition, used by the +file program +libmagic + + + + diff --git a/chapter06/findutils.xml b/chapter06/findutils.xml index 15e61801c..1bbbccc06 100644 --- a/chapter06/findutils.xml +++ b/chapter06/findutils.xml @@ -3,13 +3,17 @@ %general-entities; ]> - + Findutils-&findutils-version; Findutils +<para>The Findutils package contains programs to find files. Processes +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> @@ -17,6 +21,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>7.5 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Findutils installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -27,6 +36,10 @@ <screen><userinput>./configure --prefix=/usr --libexecdir=/usr/lib/locate \ --localstatedir=/var/lib/locate</userinput></screen> +<para>The <parameter>localstatedir</parameter> directive above changes the +location of the <command>locate</command> database to be in <filename +class="directory">/var/lib/locate</filename>, which is FHS-compliant.</para> + <para>Compile the package:</para> <screen><userinput>make</userinput></screen> @@ -34,17 +47,86 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> </sect2> - <sect2 id="contents-findutils" role="content"><title>Contents of Findutils -See testing + +Installed programs +bigram, code, find, frcode, locate, updatedb, and xargs + + +Short Descriptions + + + +bigram + +Was formerly used to produce locate databases +bigram + + + + +code + +Was formerly used to produce locate +databases; it is the ancestor of frcode. +code + + + + +find + +Searches given directory trees for files matching the specified criteria +find + + + + +frcode + +Is called by updatedb to compress the list of file names; it uses +front-compression, reducing the database size by a factor of four to +five. +frcode + + + + +locate + +Searches through a database of file names and reports the names +that contain a given string or match a given pattern +locate + + + + +updatedb + +Updates the locate 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 +updatedb + + + + +xargs + +Can be used to apply a given command to a list of files +xargs + + + + diff --git a/chapter06/flex.xml b/chapter06/flex.xml index 9772cfcf4..90282002b 100644 --- a/chapter06/flex.xml +++ b/chapter06/flex.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Flex-&flex-version; Flex +<para>The Flex package contains a utility for generating programs that +recognize patterns in text.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,20 +19,28 @@ <seglistitem><seg>0.1 SBU</seg><seg>3.4 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Flex installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Bison, Coreutils, Diffutils, +GCC, Gettext, Glibc, Grep, M4, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Flex -Apply a patch: +Flex contains several known bugs. Fix these with the following patch: patch -Np1 -i ../flex-&flex-version;-debian_fixes-2.patch -Touch the man-page: +The GNU autotools detects that the Flex source code has been +modified by the previous patch and tries to update the manual page +accordingly. This does not work correctly on many systems, and the +default page is fine, so make sure it does not get regenerated: touch doc/flex.1 -Now prepare Flex for compilation: +Prepare Flex for compilation: ./configure --prefix=/usr @@ -41,15 +51,21 @@ To test the results, issue: make check. -Now install the package: +Install the package: make install -Create a symlink: +There are some packages that expect to find the +lex library in /usr/lib. Create a symlink to account for +this: ln -s libfl.a /usr/lib/libl.a -Create a lex script: +A few programs do not know about flex yet and +try to run its predecessor, lex. To support those +programs, create a wrapper script named lex that +calls flex in lex emulation mode: cat > /usr/bin/lex << "EOF" #!/bin/sh @@ -66,8 +82,54 @@ chmod 755 /usr/bin/lex Contents of Flex -See testing + +Installed programs +Installed library +flex, flex++ (link to flex), and lex +libfl.a + + +Short Descriptions + + + +flex + +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 +flex + + + + +flex++ + +Invokes a version of flex that is used exclusively for C++ scanners +flex++ + + + + +lex + +Script that runs flex in lex +emulation mode +lex + + + + +libfl.a + +The flex library +libfl.a + + + + diff --git a/chapter06/gawk.xml b/chapter06/gawk.xml index 02d6cd526..c9968b531 100644 --- a/chapter06/gawk.xml +++ b/chapter06/gawk.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Gawk-&gawk-version; Gawk +<para>The Gawk package contains programs for manipulating text files.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>17 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Gawk installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,7 +39,7 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +48,82 @@ <sect2 id="contents-gawk" role="content"><title>Contents of Gawk -See testing + +Installed programs +awk (link to gawk), gawk, gawk-&gawk-version;, grcat, igawk, +pgawk, pgawk-&gawk-version;, and pwcat + + +Short Descriptions + + + +awk + +A link to gawk +awk + + + + +gawk + +A program for manipulating text files; it is the GNU +implementation of awk +gawk + + + + +gawk-&gawk-version; + +A hard link to gawk +gawk-&gawk-version; + + + + +grcat + +Dumps the group database /etc/group +grcat + + + + +igawk + +Gives gawk the ability to include files +igawk + + + + +pgawk + +The profiling version of gawk +pgawk + + + + +pgawk-&gawk-version; + +Hard link to pgawk +pgawk-&gawk-version; + + + + +pwcat + +Dumps the password database /etc/passwd +pwcat + + + + diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml index bb0e6a172..4015b693a 100644 --- a/chapter06/gcc.xml +++ b/chapter06/gcc.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + GCC-&gcc-version; GCC +<para>The GCC package contains the GNU compiler collection, which includes +the C and C++ compilers.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,29 +19,54 @@ <seglistitem><seg>11.7 SBU</seg><seg>294 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>GCC installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, Findutils, +Gawk, Gettext, Glibc, Grep, Make, Perl, Sed, and Texinfo</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of GCC -Apply a patch: +This package is known to have issues when its default +optimization flags (including the -march and +-mcpu options) are changed. If any environment +variables that override default optimizations have been defined, such +as CFLAGS and CXXFLAGS, +unset them when building GCC. + +Unpack both the gcc-core and the gcc-g++ tarballs—they will +unpack into the same directory. Likewise, extract the gcc-testsuite +package. The full GCC package contains additional compilers. +Instructions for building these can be found at . + +Apply only the No-Fixincludes patch (not the Specs patch) also +used in the previous chapter: patch -Np1 -i ../gcc-&gcc-version;-no_fixincludes-1.patch -Apply another patch: +GCC fails to compile some packages outside of a base Linux From Scratch +install (e.g., Mozilla and kdegraphics) when used in conjunction with newer +versions of Binutils. Apply the following patch to fix this issue: patch -Np1 -i ../gcc-&gcc-version;-linkonce-1.patch -Apply a sed substitution: +Apply a sed substitution that will suppress the installation of +libiberty.a. The version of +libiberty.a provided by +Binutils will be used instead: sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in -Create a build directory: +The GCC documentation recommends building GCC outside of the source +directory in a dedicated build directory: mkdir ../gcc-build cd ../gcc-build -Now prepare GCC for compilation: +Prepare GCC for compilation: ../gcc-&gcc-version;/configure --prefix=/usr \ --libexecdir=/usr/lib --enable-shared \ @@ -50,35 +77,140 @@ cd ../gcc-build make -Test the results): +In this section, the test suite for GCC is considered +critical. Do not skip it under any circumstance. + +Test the results, but do not stop at errors: make -k check -The test suite notes from are still very -much appropriate here. +Some of the errors are known issues and were noted in the +previous chapter. The test suite notes from are still relevant here. Be sure to +refer back to them as necessary. -Now install the package: +Install the package: make install -Create this symlink: +Some packages expect the C PreProcessor to be installed in the +/lib directory. +To support those packages, create this symlink: ln -s ../usr/bin/cpp /lib -Create another symlink: +Many packages use the name cc to call the C +compiler. To satisfy those packages, create a symlink: ln -s gcc /usr/bin/cc -Refer back to -and repeat the check. +At this point, it is strongly recommended to repeat the +sanity check performed earlier in this chapter. Refer back to and repeat the check. If the results +are in error, then the most likely reason is that the GCC Specs patch +from was erroneously applied +here. Contents of GCC -See testing + +Installed programs +Installed libraries +c++, cc (link to gcc), cpp, g++, gcc, gccbug, and +gcov +libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.[a,so], and libsupc++.a + + +Short Descriptions + + + +cc + +The C compiler +cc + + + + +cpp + +The C preprocessor; it is used by the compiler to expand the +#include, #define, and similar statements in the source files +cpp + + + + +c++ + +The C++ compiler +c++ + + + + +g++ + +The C++ compiler +g++ + + + + +gcc + +The C compiler +gcc + + + + +gccbug + +A shell script used to help create useful bug reports +gccbug + + + + +gcov + +A coverage testing tool; it is used to analyze programs to +determine where optimizations will have the most effect +gcov + + + + +libgcc + +Contains run-time support for gcc +libgcc* + + + + +libstdc++ + +The standard C++ library +libstdc++ + + + + +libsupc++ + +Provides supporting routines for the C++ programming language +libsupc++ + + + + diff --git a/chapter06/gettext.xml b/chapter06/gettext.xml index 04e6b233e..50d338227 100644 --- a/chapter06/gettext.xml +++ b/chapter06/gettext.xml @@ -3,13 +3,16 @@ %general-entities; ]> - + Gettext-&gettext-version; Gettext +<para>The Gettext package contains utilities for internationalization and +localization. These allow programs to be compiled with NLS, enabling them +to output messages in the user's native language.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +20,11 @@ <seglistitem><seg>0.5 SBU</seg><seg>55 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Gettext installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Bison, Coreutils, +Diffutils, Gawk, GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -31,9 +39,10 @@ <screen><userinput>make</userinput></screen> <para>To test the results, issue: -<userinput>make check</userinput>.</para> +<userinput>make check</userinput>. This takes a very long time, around +7 SBUs.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +51,257 @@ <sect2 id="contents-gettext" role="content"><title>Contents of Gettext -See testing + +Installed programs +Installed libraries +autopoint, config.charset, config.rpath, envsubst, gettext, +gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, +msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, +ngettext, and xgettext +libasprintf[a,so], libgettextlib[a,so], libgettextpo[a,so] and libgettextsrc[a,so] + + +Short Descriptions + + + +autopoint + +Copies standard Gettext infrastructure files into a source package +autopoint + + + + +config.charset + +Outputs a system-dependent table of character encoding aliases +config.charset + + + + +config.rpath + +Outputs a system-dependent set of variables, describing how to set the +runtime search path of shared libraries in an executable +config.rpath + + + + +envsubst + +Substitutes environment variables in shell format strings +envsubst + + + + +gettext + +Translates a natural language message into the user's language +by looking up the translation in a message catalog +gettext + + + + +gettextize + +Copies all standard Gettext files into the given top-level +directory of a package to begin internationalizing it +gettextize + + + + +hostname + +Displays a network hostname in various forms +hostname + + + + +msgattrib + +Filters the messages of a translation catalog according to their +attributes and manipulates the attributes +msgattrib + + + + +msgcat + +Concatenates and merges the given .po files +msgcat + + + + +msgcmp + +Compares two .po +files to check that both contain the same set of msgid strings +msgcmp + + + + +msgcomm + +Finds the messages that are common to +to the given .po files +msgcomm + + + + +msgconv + +Converts a translation catalog to a different character encoding +msgconv + + + + +msgen + +Creates an English translation catalog +msgen + + + + +msgexec + +Applies a command to all translations of a translation catalog +msgexec + + + + +msgfilter + +Applies a filter to all translations of a translation catalog +msgfilter + + + + +msgfmt + +Generates a binary message catalog from from a translation catalog +msgfmt + + + + +msggrep + +Extracts all messages of a translation catalog that match a +given pattern or belong to some given source files +msggrep + + + + +msginit + +Creates a new .po file, initializing the meta +information with values from the user's environment +msginit + + + + +msgmerge + +Combines two raw translations into a single file +msgmerge + + + + +msgunfmt + +Decompiles a binary message catalog into raw translation text +msgunfmt + + + + +msguniq + +Unifies duplicate translations in a translation catalog +msguniq + + + + +ngettext + +Displays native language translations of a textual message whose +grammatical form depends on a number +ngettext + + + + +xgettext + +Extracts the translatable message lines from the given source +files to make the first translation template +xgettext + + + + +libasprintf + +defines the autosprintf class, which makes +C formatted output routines usable in C++ programs, for use with the +<string> strings and the +<iostream> streams +libasprintf + + + + +libgettextlib + +a private library containing common routines used by the various Gettext +programs; these are not intended for general use +libgettextlib + + + + +libgettextpo + +Used to write specialized programs that process .po files; this library is used when the +standard applications shipped with Gettext (such as +msgcomm, msgcmp, +msgattrib, and msgen) will not +suffice +libgettextpo + + + + +libgettextsrc + +A private library containing common routines used by the various Gettext +programs; these are not intended for general use +libgettextsrc + + + + diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index c2bd6519c..8e7732795 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -3,13 +3,17 @@ %general-entities; ]> - + Glibc-&glibc-version; Glibc +<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> @@ -17,56 +21,131 @@ <seglistitem><seg>12.3 SBU</seg><seg>784 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Glibc installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +Gawk, GCC, Gettext, Grep, Make, Perl, Sed, and Texinfo</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Glibc -The linuxthreads tarball contains the man pages for the threading -libraries installed by glibc. Unpack the tarball from within the glibc source -directory: +This package is known to have issues when its default +optimization flags (including the -march and +-mcpu options) are changed. If any environment +variables that override default optimizations have been defined, such +as CFLAGS and CXXFLAGS, +unset them when building Glibc. + +The Glibc build system is self-contained and will install +perfectly, even though the compiler specs file and linker are still +pointing at /tools. 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. -tar xjvf ../glibc-linuxthreads-&glibc-version;.tar.bz2 +The linuxthreads tarball contains the man pages for the +threading libraries installed by glibc. Unpack the tarball from +within the glibc source directory: -Create a build directory: +tar xjvf /sources/glibc-linuxthreads-&glibc-version;.tar.bz2 + +The Glibc documentation recommends building Glibc outside of the source +directory in a dedicated build directory: mkdir ../glibc-build cd ../glibc-build -Now prepare Glibc for compilation: +Prepare Glibc for compilation: ../glibc-&glibc-version;/configure --prefix=/usr \ --disable-profile --enable-add-ons \ --enable-kernel=2.6.0 --without-cvs \ --libexecdir=/usr/lib/glibc +The meaning of the new configure option: + + + +--libexecdir=/usr/lib/glibc +This changes the location of the +pt_chown program from its default of /usr/libexec to /usr/lib/glibc. + + + Compile the package: make +In this section, the test suite for Glibc is +considered critical. Do not skip it under any +circumstance. + Test the results: make check -The Glibc test suite is highly dependent on certain functions of your host -system. See testing for explanations. - -Fix an annoying little warning with: +The Glibc test suite is highly dependent on certain functions of +the host system, in particular the kernel. In general, the Glibc test +suite is always expected to pass. However, in certain circumstances, +some failures are unavoidable. This is a list of the most common +issues: + + +The math tests sometimes fail when running +on systems where the CPU is not a relatively new genuine Intel or authentic AMD. +Certain optimization settings are also known to be a factor here. + +The gettext test sometimes fails due to +host system issues. The exact reasons are not yet clear. + +The atime test sometimes fails +when the LFS partition is mounted with the +noatime option. + +The shm test can fail when the +host system is using the devfs file system but does not have +the tmpfs file system +mounted at /dev/shm. This +occurs because of a lack of support for tmpfs in the +kernel. + +When running on older and slower hardware, some tests +can fail because of test timeouts being exceeded. + + +Though it is a harmless message, the install stage of Glibc will +complain about the absence of /etc/ld.so.conf. +Prevent this warning with: touch /etc/ld.so.conf -And install the package: +Install the package: make install -To install the Glibc locales, use the following -command: +The locales that can make the system respond in a different +language were not installed by the above command. Install this +with: make localedata/install-locales -An alternative to running the previous command is to install only those -locales which you need or want. The following instructions, instead of the -install-locales target above, will install the minimum set of locales necessary +To save time, an alternative to running the +previous command (which generates and installs every locale Glibc is +aware of) is to install only those locales that are wanted and needed. +This can be achieved by using the localedef +command. Information on this command is located in the +INSTALL file in the Glibc source. However, there +are a number of locales that are essential in order for the tests of +future packages to pass, in particular, the +libstdc++ tests from GCC. The following +instructions, instead of the install-locales +target used above, will install the minimum set of locales necessary for the tests to run successfully: mkdir -p /usr/lib/locale @@ -82,18 +161,40 @@ localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro localedef -i it_IT -f ISO-8859-1 it_IT localedef -i ja_JP -f EUC-JP ja_JP -Build the linuxthreads man pages: +Some locales installed by the make +localedata/install-locales command above are not properly +supported by some applications that are in the LFS and BLFS books. +Because of the various problems that arise due to application +programmers making assumptions that break in such locales, LFS should +not be used in locales that utilize multibyte character sets +(including UTF-8) or right-to-left writing order. Numerous unofficial +and unstable patches are required to fix these problems, and it has +been decided by the LFS developers not to support such complex locales. This applies to the +ja_JP and fa_IR locales as well—they have been installed only for +GCC and Gettext tests to pass, and the watch program +(part of the Procps package) does not work properly in them. Various +attempts to circumvent these restrictions are documented in +internationalization-related hints. + +Build the linuxthreads man pages, which are a great reference +on the threading API (applicable to NPTL as well): make -C ../glibc-&glibc-version;/linuxthreads/man -And install these pages: +Install these pages: make -C ../glibc-&glibc-version;/linuxthreads/man install - Configuring Glibc +/etc/nsswitch.conf +/etc/localtime + +The /etc/nsswitch.conf file needs to be +created because, although Glibc provides defaults when this file is +missing or corrupt, the Glibc defaults do not work well with +networking. The time zone also needs to be set up. Create a new file /etc/nsswitch.conf by running the following: @@ -116,20 +217,56 @@ rpc: files # End /etc/nsswitch.conf EOF -To find out what time zone you're in, run the following script: +To determine the local time zone, run the following script: tzselect -Then create the /etc/localtime file by running: +After answering a few questions about the location, the script +will output the name of the time zone (e.g., +EST5EDT or Canada/Eastern). +Then create the /etc/localtime file by +running: cp --remove-destination /usr/share/zoneinfo/[xxx] \ /etc/localtime +Replace [xxx] with the name of the time zone that the +tzselect provided (e.g., Canada/Eastern). + +The meaning of the cp option: + + + +--remove-destination +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 /usr is on a separate partition. This +could be important when booted into single user +mode. + + + Configuring Dynamic Loader +/etc/ld.so.conf + +By default, the dynamic loader (/lib/ld-linux.so.2) searches through +/lib and /usr/lib for dynamic libraries that are +needed by programs as they are run. However, if there are libraries in +directories other than /lib and +/usr/lib, these need to be +added to the /etc/ld.so.conf file in order +for the dynamic loader to find them. Two directories that are commonly +known to contain additional libraries are /usr/local/lib and /opt/lib, so add those directories to the +dynamic loader's search path. Create a new file /etc/ld.so.conf by running the following: @@ -145,11 +282,413 @@ EOF - Contents of Glibc -See testing + +Installed programs +Installed libraries +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 +ld.so, libBrokenLocale.[a,so], +libSegFault.so, libanl.[a,so], libbsd-compat.a, libc.[a,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] + + +Short Descriptions + + + +catchsegv + +Can be used to create a stack trace when a program +terminates with a segmentation fault +catchsegv + + + + +gencat + +Generates message catalogues +gencat + + + + +getconf + +Displays the system configuration values for file system specific variables +getconf + + + + +getent + +Gets entries from an administrative database +getent + + + + +iconv + +Performs character set conversion +iconv + + + + +iconvconfig + +Creates fastloading iconv module configuration files +iconvconfig + + + + +ldconfig + +Configures the dynamic linker runtime bindings +ldconfig + + + + +ldd + +Reports which shared libraries are required +by each given program or shared library +ldd + + + + +lddlibc4 + +Assists ldd with object files +lddlibc4 + + + + +locale + +Tells the compiler to enable or disable the use of POSIX locales +for built-in operations +locale + + + + +localedef + +Compiles locale specifications +localedef + + + + +mtrace + +Reads and interprets a memory trace file and +ouputs a summary in human-readable format +mtrace + + + + +nscd + +A daemon that provides a cache for the most common name +service requests +nscd + + + + +nscd_nischeck + +Checks whether or not secure mode is necessary for NIS+ lookup +nscd_nischeck + + + + +pcprofiledump + +Dumps information generated by PC profiling +pcprofiledump + + + + +pt_chown + +A helper program for grantpt to set +the owner, group and access permissions of a slave pseudo terminal +pt_chown + + + + +rpcgen + +Generates C code to implement the Remote Procecure Call (RPC) protocol +rpcgen + + + + +rpcinfo + +Makes an RPC call to an RPC server +rpcinfo + + + + +sln + +A statically linked ln program +sln + + + + +sprof + +Reads and displays shared object profiling data +sprof + + + + +tzselect + +Asks the user about the location of the +system and reports the corresponding time zone description +tzselect + + + + +xtrace + +Traces the execution of a program by +printing the currently executed function +xtrace + + + + +zdump + +The time zone dumper +zdump + + + + +zic + +The time zone compiler +zic + + + + +ld.so + +The helper program for shared library executables +ld.so + + + + +libBrokenLocale + +Used by programs, such as Mozilla, to solve broken locales +libBrokenLocale + + + + +libSegFault + +The segmentation fault signal handler +libSegFault + + + + +libanl + +An asynchronous name lookup library +libanl + + + + +libbsd-compat + +Provides the portability needed +in order to run certain Berkey Software Distribution (BSD) programs under Linux +libbsd-compat + + + + +libc + +The main C library +libc + + + + +libcrypt + +The cryptography library +libcrypt + + + + +libdl + +The dynamic linking interface library +libdl + + + + +libg + +A runtime library for g++ +libg + + + + +libieee + +The Institute of Electrical and Electronic Engineers (IEEE) floating point library +libieee + + + + +libm + +The mathematical library +libm + + + + +libmcheck + +Contains code run at boot +libmcheck + + + + +libmemusage + +Used by memusage to help collect +information about the memory usage of a program +libmemusage + + + + +libnsl + +The network services library +libnsl + + + + +libnss + +The Name Service Switch libraries, +containing functions for resolving host names, user names, group names, +aliases, services, protocols, etc +libnss + + + + +libpcprofile + +Contains profiling functions used +to track the amount of CPU time spent in specific source code lines +libpcprofile + + + + +libpthread + +The POSIX threads library +libpthread + + + + +libresolv + +Contains functions for creating, +sending, and interpreting packets to the Internet domain name servers +libresolv + + + + +librpcsvc + +Contains functions providing miscellaneous RPC services +librpcsvc + + + + +librt + +Contains functions providing most of the +interfaces specified by the POSIX.1b Realtime Extension +librt + + + + +libthread_db + +Contains functions useful for +building debuggers for multi-threaded programs +libthread_db + + + + +libutil + +Contains code for standard functions used in many different Unix utilities +libutil + + + + diff --git a/chapter06/grep.xml b/chapter06/grep.xml index 2753ceca4..2a526d400 100644 --- a/chapter06/grep.xml +++ b/chapter06/grep.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Grep-&grep-version; Grep +<para>The Grep package contains programs for searching through files.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>5.8 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Grep installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Make, Sed, and Texinfo</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,7 +39,7 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +48,40 @@ <sect2 id="contents-grep" role="content"><title>Contents of Grep -See testing + +Installed programs +egrep (link to grep), fgrep (link to grep), and grep + + +Short Descriptions + + + +egrep + +Prints lines matching an extended regular expression +egrep + + + + +fgrep + +Prints lines matching a list of fixed strings +fgrep + + + + +grep + +Prints lines matching a basic regular expression +grep + + + + diff --git a/chapter06/groff.xml b/chapter06/groff.xml index eae23fc23..5289367b8 100644 --- a/chapter06/groff.xml +++ b/chapter06/groff.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Groff-&groff-version; Groff +<para>The Groff package contains programs for processing and formatting text.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,11 +18,21 @@ <seglistitem><seg>0.5 SBU</seg><seg>43 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Groff installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +Gawk, GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Groff +Groff expects the environment variable PAGE +to contain the default paper size. For users in the United States, +PAGE=letter is appropriate. Elsewhere, +PAGE=A4 may be more suitable. + Prepare Groff for compilation: PAGE=[paper_size] ./configure --prefix=/usr @@ -30,11 +41,12 @@ make -Now install it: +Install the package: make install -Create the following symlinks: +Some documentation programs, such as xman, +will not work properly without the following symlinks: ln -s soelim /usr/bin/zsoelim ln -s eqn /usr/bin/geqn @@ -45,8 +57,315 @@ ln -s tbl /usr/bin/gtbl Contents of Groff -See testing + +Installed programs +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, troff, and zsoelim (link to soelim) + + +Short Descriptions + + + +addftinfo + +Reads a troff font file and adds some +additional font-metric information that is used by the groff system +addftinfo + + + + +afmtodit + +Creates a font file for use with groff and grops +afmtodit + + + + +eqn + +Compiles descriptions of equations embedded +within troff input files into commands that are understood by troff +eqn + + + + +eqn2graph + +Converts a troff EQN (equation) into a cropped image +eqn2graph + + + + +eqn + +A link to eqn +geqn + + + + +grn + +A groff preprocessor for gremlin files +grn + + + + +grodvi + +A driver for groff that produces TeX dvi format +grodvi + + + + +groff + +A front-end to the groff document +formatting system; normally, it runs the troff program and a post-processor +appropriate for the selected device +groff + + + + +groffer + +Displays groff files and man pages on X and tty terminals +groffer + + + + +grog + +Reads files and guesses which of the groff +options -e, -man, +-me, -mm, +-ms, -p, -s, +and -t are required for printing +files, and reports the groff command including those options +grog + + + + +grolbp + +Is a groff driver for Canon CAPSL printers +(LBP-4 and LBP-8 series laser printers) +grolbp + + + + +grolj4 + +Is a driver for groff that produces output +in PCL5 format suitable for an HP Laserjet 4 printer +grolj4 + + + + +grops + +Translates the output of GNU troff to PostScript +grops + + + + +grotty + +Translates the output of GNU troff into +a form suitable for typewriter-like devices +grotty + + + + +gtbl + +Is the GNU implementation of tbl +gtbl + + + + +hpftodit + +Creates a font file for use with +groff -Tlj4 from an HP-tagged font metric file +hpftodit + + + + +indxbib + +Creates an inverted index for the bibliographic databases with a specified file for +use with refer, lookbib, and lkbib +indxbib + + + + +lkbib + +Searches bibliographic databases for references that contain +specified keys and reports any references found +lkbib + + + + +lookbib + +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 +lookbib + + + + +mmroff + +A simple preprocessor for groff +mmroff + + + + +neqn + +Formats equations for American Standard Code for Information +Interchange (ASCII) output +neqn + + + + +nroff + +A script that emulates the nroff command using groff +nroff + + + + +pfbtops + +Translates a PostScript font in .pfb format to ASCII +pfbtops + + + + +pic + +Compiles descriptions of pictures embedded +within troff or TeX input files into commands understood by TeX or troff +pic + + + + +pic2graph + +Converts a PIC diagram into a cropped image +pic2graph + + + + +post-grohtml + +Translates the output of GNU troff to html +post-grohtml + + + + +pre-grohtml + +Translates the output of GNU troff to html +pre-grohtml + + + + +refer + +Copies the contents of a file to the standard output, except +that lines between .[ and .] +are interpreted as citations, and lines between +.R1 and .R2 are interpreted +as commands for how citations are to be processed +refer + + + + +soelim + +Reads files and replaces lines of the form +.so file by the contents of the mentioned +file +soelim + + + + +tbl + +Compiles descriptions of tables embedded +within troff input files into commands that are understood by troff +tbl + + + + +tfmtodit + +Creates a font file for use with groff -Tdvi +tfmtodit + + + + +troff + +Is highly compatible with Unix troff; it +should usually be invoked using the +groff command, which will also run preprocessors and post-processors in the +appropriate order and with the appropriate options +troff + + + + +zsoelim + +Is the GNU implementation of soelim +zsoelim + + + + diff --git a/chapter06/grub.xml b/chapter06/grub.xml index 721c2731e..9f5a0efe0 100644 --- a/chapter06/grub.xml +++ b/chapter06/grub.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Grub-&grub-version; Grub +<para>The Grub package contains the Grand Unified Bootloader.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,28 +18,49 @@ <seglistitem><seg>0.2 SBU</seg><seg>10 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Grub installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Grub +This package is known to have issues when its default +optimization flags (including the -march and +-mcpu options) are changed. If any environment +variables that override default optimizations have been defined, such +as CFLAGS and CXXFLAGS, +unset them when building Grub. + Prepare Grub for compilation: ./configure --prefix=/usr -Now compile the package: +Compile the package: make To test the results, issue: make check. -Now install it: +Note that the test results will always show the error +ufs2_stage1_5 is too big. This is due to a compiler +issue, but can be ignored unless you plan to boot from an UFS +partition. The partitions are normally only used by Sun +workstations. + +Install the package: make install mkdir /boot/grub cp /usr/lib/grub/i386-pc/stage{1,2} /boot/grub +Replace i386-pc with whatever +directory is appropriate for the hardware in use. + The i386-pc directory contains a number of *stage1_5 files, different ones for different file systems. Review the files available and copy @@ -52,9 +74,58 @@ copy the e2fs_stage1_5 and/or Contents of Grub -See testing + +Installed programs +grub, grub-install, +grub-md5-crypt, grub-terminfo, and mbchk + - +Short Descriptions + + + +grub + +The Grand Unified Bootloader's command shell +grub + + + + +grub-install + +Installs GRUB on the given device +grub-install + + + + +grub-md5-crypt + +Encrypts a password in MD5 format +grub-md5-crypt + + + + +grub-terminfo + +Generates a terminfo command from a terminfo name; it can be +employed if an unknown terminal is being used +grub-terminfo + + + + +mbchk + +Checks the format of a multi-boot kernel +mbchk + + + + + diff --git a/chapter06/gzip.xml b/chapter06/gzip.xml index ea1c677b1..e7e35fa3f 100644 --- a/chapter06/gzip.xml +++ b/chapter06/gzip.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Gzip-&gzip-version; Gzip +<para>The Gzip package contains programs for compressing and decompressing +files.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>2.6 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Gzip installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,7 +33,10 @@ <screen><userinput>./configure --prefix=/usr</userinput></screen> -<para>Issue a sed command:</para> +<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> @@ -51,8 +61,134 @@ ln -s gunzip /bin/uncompress</userinput></screen> <sect2 id="contents-gzip" role="content"><title>Contents of Gzip -See testing + +Installed programs +gunzip (link to gzip), gzexe, +gzip, uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, +zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew + + +Short Descriptions + + + +gunzip + +Decompresses gzipped files +gunzip + + + + +gzexe + +Creates self-uncompressing executable files +gzexe + + + + +gzip + +Compresses the given files using Lempel-Ziv (LZ77) coding +gzip + + + + +uncompress + +Decompresses compressed files +uncompress + + + + +zcat + +Uncompresses the given gzipped files to standard output +zcat + + + + +zcmp + +Runs cmp on gzipped files +zcmp + + + + +zdiff + +Runs diff on gzipped files +zdiff + + + + +zegrep + +Runs egrep on gzipped files +zegrep + + + + +zfgrep + +Runs fgrep on gzipped files +zfgrep + + + + +zforce + +Forces a .gz extension on all given files +that are gzipped files, so that gzip will not compress them again; this can be +useful when file names were truncated during a file transfer +zforce + + + + +zgrep + +Runs grep on gzipped files +zgrep + + + + +zless + +Runs less on gzipped files +zless + + + + +zmore + +Runs more on gzipped files +zmore + + + + +znew + +Re-compresses files from compress format to +gzip format—.Z +to .gz +znew + + + + diff --git a/chapter06/hotplug.xml b/chapter06/hotplug.xml index 12a3e0d0f..cfa04326d 100644 --- a/chapter06/hotplug.xml +++ b/chapter06/hotplug.xml @@ -10,6 +10,12 @@ Hotplug +<para>The Hotplug package contains scripts that react upon hotplug events +generated by the kernel. Such events correspond to every change in the kernel +state visible in the <systemitem class="filesystem">sysfs</systemitem> +filesystem, e.g., the addition and removal of hardware. This package also +detects existing hardware during boot and inserts the relevant modules into the +running kernel.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +23,10 @@ <seglistitem><seg>0.01 SBU</seg><seg>0.1 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Hotplug installation depends on</segtitle> +<seglistitem><seg>Unchecked</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,15 +36,17 @@ <screen><userinput>make install</userinput></screen> -<para>Copy a file that the "install" target omits.</para> +<para>Copy a file that the <quote>install</quote> target omits.</para> <screen><userinput>cp etc/hotplug/pnp.distmap /etc/hotplug</userinput></screen> -<para>Remove Hotplug's init script:</para> +<para>Remove the init script that Hotplug installs, since we're going to be +using the script included with LFS-Bootscripts:</para> <screen><userinput>rm -rf /etc/init.d</userinput></screen> -<para>Remove the network hotplug agent:</para> +<para>Network device hotplugging is not supported by LFS bootscripts yet. For +that reason, remove the network hotplug agent:</para> <screen><userinput>rm -f /etc/hotplug/net.agent</userinput></screen> </sect2> @@ -42,7 +54,113 @@ <sect2 id="contents-hotplug" role="content"><title>Contents of Hotplug -See testing + +Installed program +Installed scripts +Installed files +hotplug +/etc/hotplug/*.rc, /etc/hotplug/*.agent +/etc/hotplug/hotplug.functions, /etc/hotplug/blacklist, /etc/hotplug/{pci,usb}, +/etc/hotplug/usb.usermap, /etc/hotplug.d + +Short Descriptions + + + +hotplug + +hotplug +This script is called by default by Linux kernel when something +changes in its internal state (e.g., a new device is added or removed). + + + + +/etc/hotplug/*.rc + +/etc/hotplug/*.rc +These scripts are used for cold plugging, i.e., detection and other +specific actions upon hardware already present during system startup. +They are called by the hotplug initscript that comes +from the LFS-Bootscripts package. +The *.rc +scripts try to recover hotplug events that were lost during system boot +because, e.g., the root filesystem was not mounted by the kernel. + + + + + +/etc/hotplug/*.agent + +/etc/hotplug/*.agent +These scripts are called by hotplug +in response to different types of hotplug events generated by the kernel. +Their action is to insert corresponding kernel modules and call user-provided +scripts, if any. + + + + + +/etc/hotplug/hotplug.functions + +/etc/hotplug/hotplug.functions +This file contains common functions used by other scripts in Hotplug +package. + + + + + +/etc/hotplug/blacklist + +/etc/hotplug/blacklist +This file contains the list of modules that should never be +inserted into the kernel by hotplug scripts. + + + + + +/etc/hotplug/{pci,usb} + +/etc/hotplug/{pci,usb} +These directories are supposed to contain user-written handlers for +hotplug events. + + + + + +/etc/hotplug/usb.usermap + +/etc/hotplug/usb.usermap +This file contains rules that determine which user-defined handlers to +call for each USB device, based on its vendor, id and other attributes. + + + + + +/etc/hotplug.d + +/etc/hotplug.d +This directory contains programs (or symlinks to them) +that are interested in receiving hotplug events. E.g., +Udev puts its symlink here during installation. + + + + diff --git a/chapter06/iana-etc.xml b/chapter06/iana-etc.xml index c37ce147c..3f10e728e 100644 --- a/chapter06/iana-etc.xml +++ b/chapter06/iana-etc.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Iana-Etc-&iana-etc-version; Iana-Etc +<para>The Iana-Etc package provides data for network services and protocols.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,10 @@ <seglistitem><seg>0.1 SBU</seg><seg>641 KB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Iana-Etc installation depends on</segtitle> +<seglistitem><seg>Make</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,7 +31,7 @@ <screen><userinput>make</userinput></screen> -<para>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -35,9 +40,35 @@ <sect2 id="contents-iana-etc" role="content"><title>Contents of Iana-Etc -See testing + +Installed files +/etc/protocols and /etc/services + - +Short Descriptions + + + +/etc/protocols + +Describes the various DARPA Internet protocols that are +available from the TCP/IP subsystem +/etc/protocols + + + + +/etc/services + +Provides a mapping between friendly textual names for internet +services, and their underlying assigned port numbers and protocol +types +/etc/services + + + + + diff --git a/chapter06/inetutils.xml b/chapter06/inetutils.xml index 41571c3b5..e489dfc06 100644 --- a/chapter06/inetutils.xml +++ b/chapter06/inetutils.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Inetutils-&inetutils-version; Inetutils +<para>The Inetutils package contains programs for basic networking.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,35 +18,84 @@ <seglistitem><seg>0.2 SBU</seg><seg>11 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Inetutils installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Inetutils -Apply a patch patch: +Inetutils has issues with the Linux 2.6 kernel series. Fix these +issues by applying the following patch: patch -Np1 -i ../inetutils-&inetutils-version;-kernel_headers-1.patch -Apply another patch: +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: patch -Np1 -i ../inetutils-&inetutils-version;-no_server_man_pages-1.patch -Now prepare Inetutils for compilation: +Prepare Inetutils for compilation: ./configure --prefix=/usr --libexecdir=/usr/sbin \ --sysconfdir=/etc --localstatedir=/var \ --disable-logger --disable-syslogd \ --disable-whois --disable-servers +The meaning of the configure options: + + + +--disable-logger +This option +prevents Inetutils from installing the logger 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. + + + +--disable-syslogd +This option +prevents Inetutils from installing the System Log Daemon, which is +installed with the Sysklogd package. + + + +--disable-whois +This option disables +the building of the Inetutils whois client, which is out of date. +Instructions for a better whois client are in the BLFS book. + + + +--disable-servers +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 . Note that +better replacements are available for many of these +servers. + + + Compile the package: make -Install it: +Install the package: make install -Move the ping program: +Move the ping program to its FHS-compliant +place: mv /usr/bin/ping /bin @@ -54,8 +104,80 @@ Contents of Inetutils -See testing + +Installed programs +ftp, ping, rcp, rlogin, rsh, talk, telnet, and tftp + + +Short Descriptions + + + +ftp + +Is the file transfer protocol program +ftp + + + + +ping + +Sends echo-request packets and reports how long the replies take +ping + + + + +rcp + +Performs remote file copy +rcp + + + + +rlogin + +Performs remote login +rlogin + + + + +rsh + +Runs a remote shell +rsh + + + + +talk + +Is used to chat with another user +talk + + + + +telnet + +An interface to the TELNET protocol +telnet + + + + +tftp + +A trivial file transfer program +tftp + + + + diff --git a/chapter06/introduction.xml b/chapter06/introduction.xml index a26434375..b19f69e45 100644 --- a/chapter06/introduction.xml +++ b/chapter06/introduction.xml @@ -7,6 +7,65 @@ Introduction -See testing +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. + +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. + +If using the compiler optimizations provided in this chapter, +please review the optimization hint at . 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. 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. + +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 /tools +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 /tools, which will +cause the program to stop working when that directory is +removed. + +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, how much disk space is required during this building +process, and any other packages needed to successfully build the +package. Following the installation instructions, there is a list of +programs and libraries (along with brief descriptions of these) that +the package installs. + +To keep track of which package installs particular files, a package +manager can be used. For a general overview of different styles of package +managers, please refer to . +For a package management method specifically geared towards LFS, we recommend . + +The remainder of this book is to be performed while logged +in as user root and no longer as user +lfs. + diff --git a/chapter06/iproute2.xml b/chapter06/iproute2.xml index 3cce62619..cf492bd64 100644 --- a/chapter06/iproute2.xml +++ b/chapter06/iproute2.xml @@ -3,16 +3,17 @@ %general-entities; ]> - -Iproute2-&iproute2-version; + + Iproute2-&iproute2-version; - - iproute2 + Iproute2 - + <para>The Iproute2 package contains programs for basic and advanced + IPV4-based networking. + </para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> @@ -21,42 +22,244 @@ <seg>.6 MB</seg> </seglistitem> </segmentedlist> - + <segmentedlist> + <segtitle>Iproute2 installation depends on</segtitle> + <seglistitem> + <seg>GCC, Glibc, Make, Linux-Headers, and Sed</seg> + </seglistitem> + </segmentedlist> </sect2> - <sect2 role="installation"> <title>Installation of Iproute2 - - Apply a patch + The arpd binary included in this package is + dependent on Berkeley DB. Because arpd is not a very + common requirement on a base Linux system, remove the dependency on + Berkeley DB by applying the patch using the command below. If + the arpd binary is needed, instructions for + compiling Berkeley DB can be found in the BLFS Book at . + patch -Np1 -i ../iproute2-&iproute2-patch-version;-remove_db-1.patch - - The patch below fixes the issue with the newer versions of findutils, - the issue will give an error message it options are not in the proper order. - This patch corrects this issue for IPRoute2. +The patch below fixes the issue with the newer versions of +findutils whose find command will report an error +message when its options are not in the proper order. - patch -Np1 -i ../iproute2-&iproute2-patch-version;-find_update-1.patch +patch -Np1 -i ../iproute2-&iproute2-patch-version;-find_update-1.patch - Prepare iproute2 for compilation: - + + Prepare Iproute2 for compilation: ./configure Compile the package: make SBINDIR=/sbin - Now install it: - - - make install SBINDIR=/sbin - + The meaning of the make option: + + + + SBINDIR=/sbin + This makes sure that the Iproute2 binaries will install into + /sbin. This is the correct + location according to the FHS, because some of the Iproute2 binaries are used + in the bootscripts. + + + + + Install the package: + + make SBINDIR=/sbin install - Contents of Iproute2 - - See testing - + Contents of Iproute2 + + Installed programs + + ifstat, ip, nstat, routef, routel, rtmon, rtstat, ss, and tc. + + + + Short Descriptions + + + + + ifstat + + + Shows the interfaces statistic, including the amount of transmitted + and received packages by interface. + + ifstat + + + + + + + ip + + + + The main executable. It has several different functions: + + ip link [device] + allows users to look at the state of devices and to make changes. + + + ip addr allows users to look at addresses and + their properties, add new addresses, and delete old ones. + + + ip neighbor allows users to look at + neighbor bindings and their properties, add new + neighbor entries, and delete old ones. + + + ip rule allows users to look at the routing + policies and change them. + + + ip route allows users to look at the routing + table and change routing table rules. + + + ip tunnel allows users to look at the IP + tunnels and their properties, and change them. + + + ip maddr allows users to look at the multicast + addresses and their properties, and change them. + + + ip mroute allows users to set, change, or + delete the multicast routing. + + + ip monitor allows users to + continously monitor the state of devices, addresses and routes. + + + ip + + + + + + + nstat + + + Shows network statistics. + + nstat + + + + + + + routef + + + A component of ip route. This is for flushing the routing + tables. + + + routef + + + + + + + routel + + + A component of ip route. This is for listing the routing + tables. + + + routel + + + + + + + rtmon + + + Route monitoring utility. + + rtmon + + + + + + + rtstat + + + Route status utility + + rtstat + + + + + + + ss + + + Similar to the netstat command; shows active connections + + ss + + + + + + + tc + + + Traffic Controlling Executable; this is for Quality Of +Service (QOS) and Class Of Service (COS) + implementations + + + tc qdisc allows users to setup the queueing + discipline + + + tc class allows users to setup classes based on + the queuing discipline scheduling + + + tc estimator allows users to estimate the + network flow into a network + + + tc filter allows users to setup the QOS/COS + packet filtering + + + tc policy allows users to setup the QOS/COS + policies + + + tc + + + + + diff --git a/chapter06/kbd.xml b/chapter06/kbd.xml index 99acf19cd..055a81d9f 100644 --- a/chapter06/kbd.xml +++ b/chapter06/kbd.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Kbd-&kbd-version; Kbd +<para>The Kbd package contains key-table files and keyboard utilities.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>12 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Kbd installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Bison, Coreutils, +Diffutils, Flex, GCC, Gettext, Glibc, Grep, Gzip, M4, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -30,7 +36,7 @@ <screen><userinput>make</userinput></screen> -<para>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -38,8 +44,244 @@ <sect2 id="contents-kbd" role="content"><title>Contents of Kbd -See testing + +Installed programs +chvt, deallocvt, dumpkeys, +fgconsole, getkeycodes, getunimap, kbd_mode, kbdrate, loadkeys, loadunimap, +mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to +psfxtable), psfstriptable (link to psfxtable), psfxtable, resizecons, +setfont, setkeycodes, setleds, setlogcons, setmetamode, setvesablank, +showconsolefont, showkey, unicode_start, and unicode_stop + + +Short Descriptions + + + +chvt + +Changes the foreground virtual terminal +chvt + + + + +deallocvt + +Deallocates unused virtual terminals +deallocvt + + + + +dumpkeys + +Dumps the keyboard translation tables +dumpkeys + + + + +fgconsole + +Prints the number of the active virtual terminal +fgconsole + + + + +getkeycodes + +Prints the kernel scancode-to-keycode mapping table +getkeycodes + + + + +getunimap + +Prints the currently used unimap +getunimap + + + + +kbd_mode + +Reports or sets the keyboard mode +kbd_mode + + + + +kbdrate + +Sets the keyboard repeat and delay rates +kbdrate + + + + +loadkeys + +Loads the keyboard translation tables +loadkeys + + + + +loadunimap + +Loads the kernel unicode-to-font mapping table +loadunimap + + + + +mapscrn + +An obsolete program that used to load +a user-defined output character mapping table into the console driver; this is +now done by setfont +mapscrn + + + + +openvt + +Starts a program on a new virtual terminal (VT) +openvt + + + + +psfaddtable + +A link to psfxtable +psfaddtable + + + + +psfgettable + +A link to psfxtable +psfgettable + + + + +psfstriptable + +A link to psfxtable +psfstriptable + + + + +psfxtable + +Handle Unicode character tables for console fonts +psfxtable + + + + +resizecons + +Changes the kernel idea of the console size +resizecons + + + + +setfont + +Changes the Enhanced Graphic Adapter (EGA) and Video Graphics +Array (VGA) fonts on the console +setfont + + + + +setkeycodes + +Loads kernel scancode-to-keycode mapping table entries; this is +useful if there are unusual keys on the keyboard +setkeycodes + + + + +setleds + +Sets the keyboard flags and Light Emitting Diodes (LEDs) +setleds + + + + +setlogcons + +Sends kernel messages to the console +setlogcons + + + + +setmetamode + +Defines the keyboard meta-key handling +setmetamode + + + + +setvesablank + +Lets the user adjust the built-in hardware screensaver (a blank +screen) +setvesablank + + + + +showconsolefont + +Shows the current EGA/VGA console screen font +showconsolefont + + + + +showkey + +Reports the scancodes, keycodes, and ASCII codes of the keys +pressed on the keyboard +showkey + + + + +unicode_start + +Puts the keyboard and console in UNICODE mode. Never use it on LFS, +because applications are not configured to support UNICODE. +unicode_start + + + + +unicode_stop + +Reverts keyboard and console from UNICODE mode +unicode_stop + + + + diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml index a82a03b96..0f925c979 100644 --- a/chapter06/kernfs.xml +++ b/chapter06/kernfs.xml @@ -1,10 +1,17 @@ - + + %general-entities; +]> Mounting Virtual Kernel File Systems -Create the dirs: +Various file systems exported by the kernel do not exist on the +hard drive, but are used to communicate to and from the kernel +itself. + +Begin by creating directories onto which the file systems will be mounted: mkdir -p $LFS/{proc,sys} @@ -13,10 +20,18 @@ mount -t proc proc $LFS/proc mount -t sysfs sysfs $LFS/sys -Do some fake mounts: +Remember that if for any reason you stop working on the LFS +system and start again later, it is important to check that these file +systems are mounted again before entering the chroot +environment. + +Additional file systems will soon be mounted from within the +chroot environment. To keep the host up to date, perform a fake +mount for each of these now: mount -f -t ramfs ramfs $LFS/dev mount -f -t tmpfs tmpfs $LFS/dev/shm mount -f -t devpts -o gid=4,mode=620 devpts $LFS/dev/pts + diff --git a/chapter06/less.xml b/chapter06/less.xml index ccae7af41..fffd1f3ed 100644 --- a/chapter06/less.xml +++ b/chapter06/less.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Less-&less-version; Less +<para>The Less package contains a text file viewer.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>3.4 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Less installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,20 +32,63 @@ <screen><userinput>./configure --prefix=/usr --bindir=/bin --sysconfdir=/etc</userinput></screen> +<para>The meaning of the configure option:</para> + +<variablelist> +<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>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> - </sect2> <sect2 id="contents-less" role="content"><title>Contents of Less -See testing + +Installed programs +less, lessecho, and lesskey + + +Short Descriptions + + + +less + +a file viewer or pager; it displays the contents of the given +file, letting the user scroll, find strings, and jump to marks +less + + + + +lessecho + +needed to expand meta-characters, such as * +and ?, in filenames on Unix systems +lessecho + + + + +lesskey + +used to specify the key bindings for less +lesskey + + + + diff --git a/chapter06/libol.xml b/chapter06/libol.xml index abb38e48f..a593f1e17 100644 --- a/chapter06/libol.xml +++ b/chapter06/libol.xml @@ -10,6 +10,7 @@ Libol +<para>The Libol package contains support libraries needed by Syslog-ng.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,10 @@ <seglistitem><seg>Unchecked</seg><seg>Unchecked</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Libol installation depends on</segtitle> +<seglistitem><seg>Unchecked</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -24,14 +29,13 @@ <para>Prepare Libol for compilation</para> -<!--NEW--> <screen><userinput>./configure --prefix=/usr</userinput></screen> -<para>Compile Libol:</para> +<para>Compile the package:</para> <screen><userinput>make</userinput></screen> -<para>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -40,7 +44,34 @@ <sect2 id="contents-libol" role="content"><title>Contents of Libol -See testing + +Installed programs +Unchecked + + + diff --git a/chapter06/libtool.xml b/chapter06/libtool.xml index 13691bb8b..403d2e968 100644 --- a/chapter06/libtool.xml +++ b/chapter06/libtool.xml @@ -3,13 +3,16 @@ %general-entities; ]> - + Libtool-&libtool-version; Libtool +<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> @@ -17,6 +20,11 @@ <seglistitem><seg>1.5 SBU</seg><seg>20 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Libtool installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -42,8 +50,41 @@ <sect2 id="contents-libtool" role="content"><title>Contents of Libtool -See testing + +Installed programs +Installed libraries +libtool and libtoolizelibltdl.[a,so] + + +Short Descriptions + + + +libtool + +Provides generalized library-building support services +libtool + + + + +libtoolize + +Provides a standard way to add libtool support to a package +libtoolize + + + + +libltdl + +Hides the various difficulties of dlopening libraries +libltdl + + + + diff --git a/chapter06/linux-libc-headers.xml b/chapter06/linux-libc-headers.xml index 5db583994..aa14b87bf 100644 --- a/chapter06/linux-libc-headers.xml +++ b/chapter06/linux-libc-headers.xml @@ -12,6 +12,8 @@ +<para>The Linux-Libc-Headers package contains the +<quote>sanitized</quote> kernel headers.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -19,21 +21,34 @@ <seglistitem><seg>0.1 SBU</seg><seg>22 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Linux-Libc-Headers installation depends on</segtitle> +<seglistitem><seg>Coreutils</seg></seglistitem> +</segmentedlist> + </sect2> <sect2 role="installation"> <title>Installation of Linux-Libc-Headers +For years it has been common practice to use raw +kernel headers (straight from a kernel tarball) in /usr/include, 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. + Install the header files: cp -R include/asm-i386 /usr/include/asm cp -R include/linux /usr/include -Assure that all the headers are owned by root: +Ensure that all the headers are owned by root: chown -R root:root /usr/include/{asm,linux} -And make sure all the users can read the headers: +Make sure the users can read the headers: find /usr/include/{asm,linux} -type d -exec chmod 755 {} \; find /usr/include/{asm,linux} -type f -exec chmod 644 {} \; @@ -43,8 +58,24 @@ find /usr/include/{asm,linux} -type f -exec chmod 644 {} \; Contents of Linux-Libc-Headers -See testing + +Installed headers +/usr/include/{asm,linux}/*.h + + +Short Descriptions + + + +/usr/include/{asm,linux}/*.h + +The Linux headers API +/usr/include/{asm,linux}/*.h + + + + diff --git a/chapter06/m4.xml b/chapter06/m4.xml index f81e5c583..ba350ab94 100644 --- a/chapter06/m4.xml +++ b/chapter06/m4.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + M4-&m4-version; M4 +<para>The M4 package contains a macro processor.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>3.0 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>M4 installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, GCC, +Gettext, Glibc, Grep, Make, Perl, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,7 +39,7 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>And install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +48,31 @@ <sect2 id="contents-m4" role="content"><title>Contents of M4 -See testing + +Installed program +m4 + + +Short Descriptions + + + +m4 + +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, +m4 has +built-in functions for including named files, running Unix commands, +performing integer arithmetic, manipulating text, recursion, etc. The +m4 program can be used either as a front-end to a compiler or as a +macro processor in its own right. +m4 + + + + diff --git a/chapter06/make.xml b/chapter06/make.xml index a0dd5ce18..585f94ca3 100644 --- a/chapter06/make.xml +++ b/chapter06/make.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Make-&make-version; Make +<para>The Make package contains a program for compiling large packages.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>8.8 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Make installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Gettext, Glibc, Grep, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,7 +39,7 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +48,25 @@ <sect2 id="contents-make" role="content"><title>Contents of Make -See testing + +Installed program +make + + +Short Descriptions + + + +make + +Automatically determines which pieces of a large package need to +be recompiled and then issues the relevant commands +make + + + + diff --git a/chapter06/man-pages.xml b/chapter06/man-pages.xml index e9fcaeeed..ce568ae14 100644 --- a/chapter06/man-pages.xml +++ b/chapter06/man-pages.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Man-pages-&man-pages-version; Man-pages +<para>The Man-pages package contains over 1,200 manual pages.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,10 @@ <seglistitem><seg>0.1 SBU</seg><seg>15 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Man-pages installation depends on</segtitle> +<seglistitem><seg>Bash, Coreutils, and Make</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -31,8 +36,25 @@ <sect2 id="contents-manpages" role="content"><title>Contents of Man-pages -See testing + +Installed files +various manual pages + + +Short Descriptions + + + +manual pages + +Describe the C and C++ functions, important +device files, and significant configuration files +manual pages + + + + diff --git a/chapter06/man.xml b/chapter06/man.xml index 042cb5fee..1a0bce0ff 100644 --- a/chapter06/man.xml +++ b/chapter06/man.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Man-&man-version; Man +<para>The Man package contains programs for finding and viewing manual pages.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,40 +18,160 @@ <seglistitem><seg>0.1 SBU</seg><seg>1.9MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Man installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Gawk, GCC, +Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Man -Issue a sed substitution: +Two adjustments need to be made to the sources of Man. + +The first is a sed substitution to add the +-R switch to the PAGER +variable so that escape sequences are properly handled by Less: sed -i 's@-is@&R@g' configure -Issue another sed substitution: +The second is also a sed substitution to comment out the +MANPATH /usr/man line in the +man.conf file to prevent redundant results when +using programs such as whatis: sed -i 's@MANPATH./usr/man@#&@g' src/man.conf.in -Now prepare Man for compilation: +Prepare Man for compilation: ./configure -confdir=/etc +The meaning of the configure options: + + + +-confdir=/etc +This tells the man program to look for the +man.conf configuration file in the /etc directory. + + + Compile the package: make -Lastly, install it: +Install the package: make install -For some internazionalitation issues, see testing. +To disable Select Graphic Rendition (SGR) escape +sequences, edit the man.conf file and +add the -c switch to +the NROFF variable. + +If the character set uses 8-bit characters, search for the line +beginning with NROFF in +/etc/man.conf, and verify that it looks as +follows: + +NROFF /usr/bin/nroff -Tlatin1 -mandoc + +Note that latin1 should be used even if it is not +the character set of the locale. The reason is that, according to the +specification, groff has no means of typesetting +characters outside International Organization for Standards +(ISO) 8859-1 without some strange escape codes. When formatting manual +pages, groff thinks that they are in the ISO 8859-1 +encoding and this -Tlatin1 switch tells +groff to use the same encoding for output. Since +groff does no recoding of input characters, the +formatted result is really in the same encoding as input, and therefore +it is usable as the input for a pager. + +This does not solve the problem of a non-working +man2dvi program for localized manual pages in +non-ISO 8859-1 locales. Also, it does not work with multibyte +character sets. The first problem does not currently have a solution. +The second issue is not of concern because the LFS installation does +not support multibyte character sets. + +Additional information with regards to the compression of +man and info pages can be found in the BLFS book at +http://www.linuxfromscratch.org/blfs/view/cvs/postlfs/ +compressdoc.html. Contents of Man -See testing + +Installed programs +apropos, makewhatis, man, +man2dvi, man2html, and whatis + + +Short Descriptions + + + +apropos + +Searches the whatis database and displays the short descriptions +of system commands that contain a given string +apropos + + + + +makewhatis + +Builds the whatis database; it reads all the manual pages in the +manpath and writes the name and a short description in the whatis +database for each page +makewhatis + + + + +man + +Formats and displays the requested on-line manual page +man + + + + +man2dvi + +Converts a manual page into dvi format +man2dvi + + + + +man2html + +Converts a manual page into HTML +man2html + + + + +whatis + +Searches the whatis database and displays the short descriptions +of system commands that contain the given keyword as a separate +word +whatis + + + + diff --git a/chapter06/mktemp.xml b/chapter06/mktemp.xml index b71176dfb..d478ab874 100644 --- a/chapter06/mktemp.xml +++ b/chapter06/mktemp.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Mktemp-&mktemp-version; Mktemp +<para>The Mktemp package contains programs used to create secure temporary +files in shell scripts.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,24 +19,42 @@ <seglistitem><seg>0.1 SBU</seg><seg>317 KB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Mktemp installation depends on</segtitle> +<seglistitem><seg>Coreutils, Make, and Patch</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Mktemp -Apply a patch: +Many scripts still use the deprecated +tempfile program, which has functionality similar +to mktemp. Patch Mktemp to include a +tempfile wrapper: patch -Np1 -i ../mktemp-&mktemp-version;-add_tempfile-1.patch -Now prepare Mktemp for compilation: +Prepare Mktemp for compilation: ./configure --prefix=/usr --with-libc +The meaning of the configure option: + + + +--with-libc +This causes the mktemp program to +use the mkstemp and mkdtemp +functions from the system C library. + + + Compile the package: make -Now install it: +Install the package: make install make install-tempfile @@ -44,8 +64,33 @@ make install-tempfile Contents of Mktemp -See testing + +Installed programs +mktemp and tempfile + + +Short Descriptions + + + +mktemp + +Creates temporary files in a secure manner; it is used in scripts +mktemp + + + + +tempfile + +Creates temporary files in a less secure manner than +mktemp; it is installed for backwards-compatibility +tempfile + + + + diff --git a/chapter06/module-init-tools.xml b/chapter06/module-init-tools.xml index d6e84cf5d..26a8a1ad6 100644 --- a/chapter06/module-init-tools.xml +++ b/chapter06/module-init-tools.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Module-Init-Tools-&module-init-tools-version; Module-Init-Tools +<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> @@ -17,6 +19,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>650 KB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Module-Init-Tools installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Bison, +Coreutils, Diffutils, Flex, GCC, Glibc, Grep, M4, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -30,10 +37,14 @@ <screen><userinput>make DOCBOOKTOMAN=""</userinput></screen> +<!-- Edit me --> +<para>The <command>DOCBOOKTOMAN</command> option allows the compile process to +complete without regenerating the man pages.</para> + <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +53,111 @@ <sect2 id="contents-module-init-tools" role="content"><title>Contents of Module-Init-Tools -See testing + +Installed programs +depmod, genksyms, insmod, +insmod_ksymoops_clean, kallsyms (link to insmod), kernelversion, ksyms +(link to insmod), lsmod (link to insmod), modinfo, modprobe (link to +insmod), and rmmod (link to insmod) + + +Short Descriptions + + + +depmod + +Creates a dependency file based on the symbols it finds in the +existing set of modules; this dependency file is used by modprobe to +automatically load the required modules +depmod + + + + +genksyms + +Generates symbol version information +genksyms + + + + +insmod + +Installs a loadable module in the running kernel +insmod + + + + +insmod_ksymoops_clean + +Deletes saved ksyms and modules not accessed for two days +insmod_ksymoops_clean + + + + +kallsyms + +Extracts all kernel symbols for debugging +kallsyms + + + + +kernelversion + +Reports the major version of the running kernel +kernelversion + + + + +ksyms + +Displays exported kernel symbols +ksyms + + + + +lsmod + +Lists currently loaded modules +lsmod + + + + +modinfo + +Examines an object file associated with a kernel module and +displays any information that it can glean +modinfo + + + + +modprobe + +Uses a dependency file, created by +depmod, to automatically load relevant modules +modprobe + + + + +rmmod + +Unloads modules from the running kernel +rmmod + + + + diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index 61050f6ca..90ff64b51 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Ncurses-&ncurses-version; Ncurses +<para>The Ncurses package contains libraries for terminal-independent +handling of character screens.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.6 SBU</seg><seg>27 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Ncurses installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +Gawk, GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -30,6 +37,8 @@ <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> @@ -38,15 +47,17 @@ <screen><userinput>chmod 755 /usr/lib/*.&ncurses-version;</userinput></screen> -<para>Now fix a library:</para> +<para>Fix a library that should not be executable:</para> <screen><userinput>chmod 644 /usr/lib/libncurses++.a</userinput></screen> -<para>Move the libraries to the <filename class="directory">/lib</filename> directory:</para> +<para>Move the libraries to the <filename class="directory">/lib</filename> directory, +where they are expected to reside:</para> <screen><userinput>mv /usr/lib/libncurses.so.5* /lib</userinput></screen> -<para>Recreate some symlinks:</para> +<para>Because the libraries have been moved, a few symlinks are pointing to +non-existent files. Recreate those symlinks:</para> <screen><userinput>ln -sf ../../lib/libncurses.so.5 /usr/lib/libncurses.so ln -sf libncurses.so /usr/lib/libcurses.so</userinput></screen> @@ -55,8 +66,149 @@ ln -sf libncurses.so /usr/lib/libcurses.so</userinput></screen> <sect2 id="contents-ncurses" role="content"><title>Contents of Ncurses -See testing + +Installed programs +Installed libraries +captoinfo (link to tic), clear, infocmp, infotocap (link to tic), +reset (link to tset), tack, tic, toe, tput, and tset +libcurses.[a,so] (link to libncurses.[a,so]), libform.[a,so], libmenu.[a,so], +libncurses++.a, libncurses.[a,so], and libpanel.[a,so] + + +Short Descriptions + + + +captoinfo + +Converts a termcap description into a terminfo description +captoinfo + + + + +clear + +Clears the screen, if possible +clear + + + + +infocmp + +Compares or prints out terminfo descriptions +infocmp + + + + +infotocap + +Converts a terminfo description into a termcap description +infotocap + + + + +reset + +Reinitializes a terminal to its default values +reset + + + + +tack + +The terminfo action checker; it is mainly used to test the +accuracy of an entry in the terminfo database +tack + + + + +tic + +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 +tic + + + + +toe + +Lists all available terminal types, giving the primary name and +description for each +toe + + + + +tput + +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 +tput + + + + +tset + +Can be used to initialize terminals +tset + + + + +libcurses + +A link to libncurses +libcurses + + + + +libncurses + +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 make menuconfig +libncurses + + + + +libform + +Contains functions to implement forms +libform + + + + +libmenu + +Contains functions to implement menus +libmenu + + + + +libpanel + +Contains functions to implement panels +libpanel + + + + diff --git a/chapter06/patch.xml b/chapter06/patch.xml index 5d28069f6..d935dfc14 100644 --- a/chapter06/patch.xml +++ b/chapter06/patch.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Patch-&patch-version; Patch +<para>The Patch package contains a program for modifying files.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,12 +18,19 @@ <seglistitem><seg>0.1 SBU</seg><seg>1.9 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Patch installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Patch -Prepare Patch for compilation: +Prepare Patch for compilation. The preprocessor flag +-D_GNU_SOURCE is only needed on the PowerPC +platform. It can be left it out on other architectures: CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/usr @@ -30,7 +38,9 @@ make -Now install it: +This package does not come with a test suite. + +Install the package: make install @@ -39,8 +49,27 @@ Contents of Patch -See testing + +Installed program +patch + + +Short Descriptions + + + +patch + +Modifies files according to a patch file. A patch file is normally +a difference listing created with the diff program. By applying +these differences to the original files, patch creates the patched +versions. +patch + + + + diff --git a/chapter06/perl.xml b/chapter06/perl.xml index 1bc1397ff..1faa7a9c1 100644 --- a/chapter06/perl.xml +++ b/chapter06/perl.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Perl-&perl-version; Perl +<para>The Perl package contains the Practical Extraction and Report Language.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,24 +18,44 @@ <seglistitem><seg>2.9 SBU</seg><seg>143 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Perl installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +Gawk, GCC, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Perl -Prepare Perl for compilation: +To have full control over the way Perl is set up, run the +interactive Configure script and hand-pick the way +this package is built. If the defaults it auto-detects are suitable, +prepare Perl for compilation with: ./configure.gnu --prefix=/usr -Dpager="/bin/less -isR" +The meaning of the configure option: + + + +-Dpager="/bin/less -isR" +This corrects an error in the perldoc code with the invocation +of the less program. + + + Compile the package: make -Create a basic /etc/hosts file: +To run the test suite, first create a basic +/etc/hosts file which is needed by a couple of +tests to resolve the network name localhost: echo "127.0.0.1 localhost $(hostname)" > /etc/hosts -Run the tests: +Now run the tests, if desired: make test @@ -47,8 +68,257 @@ Contents of Perl -See testing + +Installed programs +Installed libraries +a2p, c2ph, dprofpp, enc2xs, +find2perl, h2ph, h2xs, 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 +Several hundred which cannot all be listed here + + +Short Descriptions + + + +a2p + +Translates awk to Perl +a2p + + + + +c2ph + +Dumps C structures as generated from cc -g -S +c2ph + + + + +dprofpp + +Displays Perl profile data +dprofpp + + + + +en2cxs + +Builds a Perl extension for the Encode module from either +Unicode Character Mappings or Tcl Encoding Files +en2cxs + + + + +find2perl + +Translates find commands to Perl +find2perl + + + + +h2ph + +Converts .h C header files to +.ph Perl header files +h2ph + + + + +h2xs + +Converts .h C header files to Perl extensions +h2xs + + + + +libnetcfg + +Can be used to configure the libnet +libnetcfg + + + + +perl + +Combines some of the best features of C, sed, awk and sh into a +single swiss-army language +perl + + + + +perl&perl-version; + +A hard link to perl +perl&perl-version; + + + + + +perlbug + +Used to generate bug reports about Perl, or the modules that come +with it, and mail them +perlbug + + + + +perlcc + +Generates executables from Perl programs +perlcc + + + + +perldoc + +Displays a piece of documentation in pod format that is embedded +in the Perl installation tree or in a Perl script +perldoc + + + + +perlivp + +The Perl Installation Verification Procedure; it can be used to +verify that Perl and its libraries have been installed +correctly +perlivp + + + + +piconv + +A Perl version of the character encoding converter +iconv +piconv + + + + +pl2pm + +A rough tool for converting Perl4 .pl +files to Perl5 .pm modules +pl2pm + + + + +pod2html + +Converts files from pod format to HTML format +pod2html + + + + +pod2latex + +Converts files from pod format to LaTeX format +pod2latex + + + + +pod2man + +Converts pod data to formatted *roff input +pod2man + + + + +pod2text + +Converts pod data to formatted ASCII text +pod2text + + + + +pod2usage + +Prints usage messages from embedded pod docs in files +pod2usage + + + + +podchecker + +Checks the syntax of pod format documentation files +podchecker + + + + +podselect + +Displays selected sections of pod documentation +podselect + + + + +psed + +A Perl version of the stream editor sed +psed + + + + +pstruct + +Dumps C structures as generated from cc -g -S stabs +pstruct + + + + +s2p + +Translates sed to Perl +s2p + + + + +splain + +Is used to force verbose warning diagnostics in Perl +splain + + + + +xsubpp + +Converts Perl XS code into C code +xsubpp + + + + diff --git a/chapter06/procps.xml b/chapter06/procps.xml index 09dcfafe4..102836c9a 100644 --- a/chapter06/procps.xml +++ b/chapter06/procps.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Procps-&procps-version; Procps +<para>The Procps package contains programs for monitoring processes.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,16 +18,21 @@ <seglistitem><seg>0.1 SBU</seg><seg>6.2 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Procps installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, GCC, Glibc, +Make, and Ncurses</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Procps -Compile Procps: +Compile the package: make -Install it: +Install the package: make install @@ -35,8 +41,152 @@ Contents of Procps -See testing + +Installed programs +Installed library +free, kill, pgrep, pkill, +pmap, ps, skill, snice, sysctl, tload, top, uptime, vmstat, w, and watch +libproc.so + + +Short Descriptions + + + +free + +Reports the amount of free and used memory (both physical and +swap memory) in the system +free + + + + +kill + +Sends signals to processes +kill + + + + +pgrep + +Looks up processes based on their name and other attributes +pgrep + + + + +pkill + +Signals processes based on their name and other attributes +pkill + + + + +pmap + +Reports the memory map of the given process +pmap + + + + +ps + +Lists the current running processes +ps + + + + +skill + +Sends signals to processes matching the given criteria +skill + + + + +snice + +Changes the scheduling priority of processes matching the given criteria +snice + + + + +sysctl + +Modifies kernel parameters at run time +sysctl + + + + +tload + +Prints a graph of the current system load average +tload + + + + +top + +Displays the top CPU processes; it provides an ongoing look at +processor activity in real time +top + + + + +uptime + +Reports how long the system has been running, how many users are +logged on, and the system load averages +uptime + + + + +vmstat + +Reports virtual memory statistics, giving information about +processes, memory, paging, block Input/Output (IO), traps, and CPU activity +vmstat + + + + +w + +Shows which users are currently logged on, where, and since when +w + + + + +watch + +Runs a given command repeatedly, displaying the first screen-full of its +output; this allows a user to watch the output change over time +watch + + + + +libproc + +Contains the functions used by most programs in this package +libproc + + + + diff --git a/chapter06/psmisc.xml b/chapter06/psmisc.xml index 5cdaa6c0f..bcceec79a 100644 --- a/chapter06/psmisc.xml +++ b/chapter06/psmisc.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Psmisc-&psmisc-version; Psmisc +<para>The Psmisc package contains programs for displaying information on +processes.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.1 SBU</seg><seg>2.2 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Psmisc installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Gettext, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,20 +33,44 @@ <screen><userinput>./configure --prefix=/usr --exec-prefix=""</userinput></screen> +<para>The meaning of the configure option:</para> + +<variablelist> +<varlistentry> +<term><parameter>--exec-prefix=""</parameter></term> +<listitem><para>This causes the binaries to be installed in <filename +class="directory">/bin</filename> instead of <filename +class="directory">/usr/bin</filename>. Because the Psmisc programs are +often used in bootscripts, they should be available when the <filename +class="directory">/usr</filename> file system is not +mounted.</para></listitem> +</varlistentry> +</variablelist> + <para>Compile the package:</para> <screen><userinput>make</userinput></screen> -<para>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> -<para>Move a program:</para> +<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>. Also, there is no need for +<command>pstree.x11</command> to exist as a separate program. Make it +a symbolic link to <command>pstree</command> instead:</para> <screen><userinput>mv /bin/pstree* /usr/bin ln -sf pstree /usr/bin/pstree.x11</userinput></screen> -<para>If you're not going to use Sysvinit, you should create the following symlink:</para> +<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 -s killall /bin/pidof</userinput></screen> @@ -48,8 +79,49 @@ ln -sf pstree /usr/bin/pstree.x11</userinput></screen> <sect2 id="contents-psmisc" role="content"><title>Contents of Psmisc -See testing + +Installed programs +fuser, killall, pstree, and pstree.x11 (link to pstree) + + +Short Descriptions + + + +fuser + +Reports the Process IDs (PIDs) of processes that use the given files or file systems +fuser + + + + +killall + +Kills processes by name; it sends a signal to all processes +running any of the given commands +killall + + + + +pstree + +Displays running processes as a tree +pstree + + + + +pstree.x11 + +Same as pstree, except that it waits for confirmation before exiting +pstree.x11 + + + + diff --git a/chapter06/pwdgroup.xml b/chapter06/pwdgroup.xml index 864c818f3..990fe976e 100644 --- a/chapter06/pwdgroup.xml +++ b/chapter06/pwdgroup.xml @@ -7,13 +7,30 @@ Creating the passwd, group, and log Files -Create the /etc/passwd file: +/etc/passwd +/etc/group +/var/run/utmp +/var/log/btmp +/var/log/lastlog +/var/log/wtmp + +In order for user root to be able to login +and for the name root to be recognized, there need to +be relevant entries in the /etc/passwd and +/etc/group files. + +Create the /etc/passwd file by running the following +command: cat > /etc/passwd << "EOF" root:x:0:0:root:/root:/bin/bash EOF -Create the /etc/group file: +The actual password for root (the x +used here is just a placeholder) will be set later. + +Create the /etc/group file by running the following +command: cat > /etc/group << "EOF" root:x:0: @@ -33,14 +50,49 @@ utmp:x:13: usb:x:14: EOF -Start a new shell: +The created groups are not part of any standard—they are some +of the groups that the Udev configuration will be using in the next +section. The Linux Standard Base (LSB, available at ) recommends only that, besides the +group root with a Group ID (GID) of 0, a group +bin with a GID of 1 be present. All other group names +and GIDs can be chosen freely by the system administrator since +well-written packages do not depend on GID numbers, but rather use the +group's name. + +To remove the I have no name! prompt, start a new +shell. Since a full Glibc was installed in and the +/etc/passwd and /etc/group +files have been created, user name and group name resolution will now +work. exec /tools/bin/bash --login +h -Initialize the log files and give them their proper permissions: +Note the use of the +h directive. This +tells bash not to use its internal path hashing. +Without this directive, bash would remember the +paths to binaries it has executed. In order to use the newly compiled +binaries as soon as they are installed, turn off this function for the +duration of this chapter. + +The login, agetty, and +init 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: touch /var/run/utmp /var/log/{btmp,lastlog,wtmp} chgrp utmp /var/run/utmp /var/log/lastlog chmod 664 /var/run/utmp /var/log/lastlog +The /var/run/utmp file records the users +that are currently logged in. The /var/log/wtmp +file records all logins and logouts. The +/var/log/lastlog file records when +each user last logged in. The /var/log/btmp file +records the bad login attempts. + + diff --git a/chapter06/readjusting.xml b/chapter06/readjusting.xml index cda2768f1..5d07a94e8 100644 --- a/chapter06/readjusting.xml +++ b/chapter06/readjusting.xml @@ -7,31 +7,99 @@ Re-adjusting the Toolchain -Install the adjusted linker by running the following from within the -binutils-build directory: +Now that the new and 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 the same process used in the +Adjusting phase in the beginning of , even though it looks to be +reversed. In , the chain was +guided from the host's /{,usr/}lib directories to the new +/tools/lib directory. Now, the +chain will be guided from that same /tools/lib directory to the LFS +/{,usr/}lib directories. + +Start by adjusting the linker. The source and build directories +from the second pass over Binutils were retained for this purpose. +Install the adjusted linker by running the following command from +within the binutils-build +directory: make -C ld INSTALL=/tools/bin/install install -Amend the GCC specs file: +If the earlier warning to retain the Binutils source and +build directories from the second pass in was missed, or if they were +accidentally deleted or are inaccessible, ignore the above command. +The result will be that the next package, Binutils, will link against +the C libraries in /tools +rather than in /{,usr/}lib. +This is not ideal, however, testing has shown that the resulting +Binutils program binaries should be identical. + +From now on, every compiled program will link only against the +libraries in /usr/lib and +/lib. The extra +INSTALL=/tools/bin/install option is needed +because the Makefile file created during the +second pass still contains the reference to +/usr/bin/install, which has not been installed yet. +Some host distributions contain a ginstall symbolic link which takes +precedence in the Makefile file and can cause a +problem. The above command takes care of this issue. + +Remove the Binutils source and build directories now. + +Next, amend the GCC specs file so that it points to the new +dynamic linker. A perl command accomplishes this: perl -pi -e 's@ /tools/lib/ld-linux.so.2@ /lib/ld-linux.so.2@g;' \ -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' \ `gcc --print-file specs` -Perform a simple sanity check: +It is a good idea to visually inspect the specs file to verify the intended +change was actually made. + +If working on a platform where the name of the +dynamic linker is something other than +ld-linux.so.2, substitute +ld-linux.so.2 with the name of the platform's +dynamic linker in the above commands. Refer back to if +necessary. + +It is imperative at this point to stop and ensure that +the basic functions (compiling and linking) of the adjusted toolchain +are working as expected. To do this, perform a sanity +check: echo 'main(){}' > dummy.c cc dummy.c readelf -l a.out | grep ': /lib' -The output of the last command will be: +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): [Requesting program interpreter: /lib/ld-linux.so.2] -Once you are satisfied that all is well, clean up the test files: +Note that /lib is now +the prefix of our dynamic linker. -rm dummy.c a.out - +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 amendment +above. Any issues will need to be resolved before continuing on with +the process. +Once everything is working correctly, clean up the test +files: + +rm dummy.c a.out + diff --git a/chapter06/readline.xml b/chapter06/readline.xml index cd15918ec..7c3a1b3d0 100644 --- a/chapter06/readline.xml +++ b/chapter06/readline.xml @@ -3,27 +3,35 @@ %general-entities; ]> - + Readline-&readline-version; Readline +<para>The Readline package contains the Readline command-line library.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> -<seglistitem><seg>XXX SBU</seg><seg>3.8 MB</seg></seglistitem> +<seglistitem><seg>0.11 SBU</seg><seg>3.8 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Readline installation depends on</segtitle> +<seglistitem><seg>Binutils, Coreutils, Diffutils, Gawk, +GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Readline - -Apply a patch. +The following patch includes a fix for the problem where +Readline sometimes only shows 33 characters on a line and then wraps +to the next line. It also includes other fixes recommended by the +Readline author. patch -Np1 -i ../readline-&readline-version;-fixes-1.patch @@ -35,31 +43,71 @@ make SHLIB_XLDFLAGS=-lncurses +The meaning of the make option: + + + +SHLIB_XLDFLAGS=-lncurses +This option forces Readline to link against the +libncurses library. + + + Install the package: make install -Give Readline's dynamic libraries to a more appropriate permissions: +Give Readline's dynamic libraries more appropriate permissions: chmod 755 /lib/lib{readline,history}.so* -Now we move the static libraries to a more appropriate location: +Now we move the static libraries to a more appropriate +location: mv /lib/lib{readline,history}.a /usr/lib -Now we will remove the old, .so files in /lib and relink them into /usr/lib. +Next we will remove the old, .so files in +/lib and relink them into +/usr/lib. rm /lib/lib{readline,history}.so ln -sf ../../lib/libreadline.so.5 /usr/lib/libreadline.so ln -sf ../../lib/libhistory.so.5 /usr/lib/libhistory.so + Contents of Readline + +Installed libraries +libhistory.[a,so], and libreadline.[a,so] + -See testing +Short Descriptions + + + +libhistory + +Provides a consistent user interface +for recalling lines of history +libhistory + + + + +libreadline + +Aids in the consistency of user interface +across discrete programs that need to provide a command line +interface +libreadline + + + + - + diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml index c6afe2bf9..00f627602 100644 --- a/chapter06/revisedchroot.xml +++ b/chapter06/revisedchroot.xml @@ -7,11 +7,38 @@ Cleaning Up -Modified chroot command: +From now on, when reentering the chroot environment after +exiting, use the following modified chroot command: chroot "$LFS" /usr/bin/env -i \ HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /bin/bash --login +The reason for this is that, since the programs in /tools are no longer needed, the +directory can be deleted to regain space. Before actually deleting the +directory, exit from chroot and reenter it with the above command. +Also, before removing /tools, +tar it up and store it in a safe place in case another LFS system will +be built. + +Removing /tools +will also remove the temporary copies of Tcl, Expect, and DejaGNU +which were used for running the toolchain tests. To use these programs +later on, they will need to be recompiled and re-installed. The +installation instructions are the same as in , apart from changing the prefix +from /tools to /usr. The BLFS book discusses a slightly +different approach to installing Tcl (see ). + +The packages and patches stored in /sources can also be moved to a more +usual location, such as /usr/src/packages. The entire directory +can also be deleted if its contents have been burned to a CD. + + diff --git a/chapter06/sed.xml b/chapter06/sed.xml index 2b971d9ce..e16857a5f 100644 --- a/chapter06/sed.xml +++ b/chapter06/sed.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Sed-&sed-version; Sed +<para>The Sed package contains a stream editor.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>5.2 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Sed installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make, and Texinfo</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,7 +39,7 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,10 +48,24 @@ <sect2 id="contents-sed" role="content"><title>Contents of Sed -See testing + +Installed program +sed + - +Short Descriptions + + +sed + +Filters and transforms text files in a single pass +sed + + + + + diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml index 7dc58a043..91948b3a4 100644 --- a/chapter06/shadow.xml +++ b/chapter06/shadow.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Shadow-&shadow-version; Shadow +<para>The Shadow package contains programs for handling passwords in a secure +way.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.4 SBU</seg><seg>11 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Shadow installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Bison, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,7 +33,8 @@ <screen><userinput>./configure --libdir=/lib --enable-shared</userinput></screen> -<para>Remove the installation of the groups program, and it's man page:</para> +<para>Remove 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 sed -i '/groups/d' man/Makefile</userinput></screen> @@ -35,31 +43,48 @@ sed -i '/groups/d' man/Makefile</userinput></screen> <screen><userinput>make</userinput></screen> -<para>Then install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> -<para>Install two config files:</para> +<para id="shadow-limits-login_access">Shadow uses two files to configure +authentication settings for the system. Install these two config 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 etc/{limits,login.access} /etc</userinput></screen> -<para>Change a configuration file while copying it:</para> +<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.linux > /etc/login.defs</userinput></screen> -<para>Move a program:</para> +<para>Move a misplaced program to its proper location:</para> <screen><userinput>mv /usr/bin/passwd /bin</userinput></screen> -<para>Move the library:</para> +<para>Move Shadow's libraries to more appropriate locations:</para> <screen><userinput>mv /lib/libshadow.*a /usr/lib rm /lib/libshadow.so ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> -<para>Create a dir:</para> +<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 /etc/default</userinput></screen> @@ -67,8 +92,21 @@ ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen> <sect2 id="conf-shadow" role="configuration"><title>Configuring Shadow - -To enable shadowed passwords: + +Shadow +configuring + +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 +password shadowing means, see the +doc/HOWTO 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. + +To enable shadowed passwords, run the following command: pwconv @@ -76,23 +114,313 @@ ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so grpconv +Under normal circumstances, passwords will not have been created +yet. However, if returning to this section later to enable shadowing, +reset any current user passwords with the passwd +command or any group passwords with the gpasswd +command. + Setting the root password -Choose a password for user root and set it via: +Choose a password for user root and set it +by running: passwd root - Contents of Shadow -See testing + +Installed programs +Installed libraries +chage, chfn, chpasswd, chsh, expiry, faillog, gpasswd, +groupadd, groupdel, groupmod, groups, grpck, grpconv, grpunconv, lastlog, login, +logoutd, mkpasswd, newgrp, newusers, passwd, pwck, pwconv, pwunconv, sg +(link to newgrp), useradd, userdel, usermod, vigr (link to vipw), and vipw +libshadow[.a,so] + + + +Short Descriptions + + + +chage + +Used to change the maximum number of days between obligatory +password changes +chage + + + + +chfn + +Used to change a user's full name and other info +chfn + + + + +chpasswd + +Used to update the passwords of an entire series of user +accounts +chpasswd + + + + +chsh + +Used to change a user's default login shell +chsh + + + + +expiry + +Checks and enforces the current password expiration policy +expiry + + + + +faillog + +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 +faillog + + + + +gpasswd + +Is used to add and delete members and administrators to groups +gpasswd + + + + +groupadd + +Creates a group with the given name +groupadd + + + + +groupdel + +Deletes the group with the given name +groupdel + + + + +groupmod + +Is used to modify the given group's name or GID +groupmod + + + + +groups + +Reports the groups of which the given users are members +groups + + + + +grpck + +Verifies the integrity of the group files /etc/group +and /etc/gshadow +grpck + + + + +grpconv + +Creates or updates the shadow group file from the normal group file +grpconv + + + + +grpunconv + +Updates /etc/group +from /etc/gshadow and then deletes the latter +grpunconv + + + + +lastlog + +Reports the most recent login of all users or of a given user +lastlog + + + + +login + +Is used by the system to let users sign on +login + + + + +logoutd + +Is a daemon used to enforce restrictions on log-on time and ports +logoutd + + + + +mkpasswd + +Generates random passwords +mkpasswd + + + + +newgrp + +Is used to change the current GID during a login session +newgrp + + + + +newusers + +Is used to create or update an entire series of user accounts +newusers + + + + +passwd + +Is used to change the password for a user or group account +passwd + + + + +pwck + +Verifies the integrity of the password files +/etc/passwd and /etc/shadow +pwck + + + + +pwconv + +Creates or updates the shadow password file from the normal +password file +pwconv + + + + +pwunconv + +Updates /etc/passwd +from /etc/shadow and then deletes the latter +pwunconv + + + + +sg + +Executes a given command while the user's GID +is set to that of the given group +sg + + + + +su + +su +Runs a shell with substitute user and group IDs + + + + +useradd + +Creates a new user with the given name, or updates the default +new-user information +useradd + + + + +userdel + +Deletes the given user account +userdel + + + + +usermod + +Is used to modify the given user's login name, User +Identification (UID), +shell, initial group, home directory, etc. +usermod + + + + +vigr + +Edits the /etc/group or +/etc/gshadow files +vigr + + + + +vipw + +Edits the /etc/passwd or +/etc/shadow files +vipw + + + + +libshadow + +Contains functions used by most programs in this package +libshadow + + + + diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml index e0531df3e..f6c5fa2ec 100644 --- a/chapter06/strippingagain.xml +++ b/chapter06/strippingagain.xml @@ -1,24 +1,54 @@ - + + %general-entities; +]> Stripping Again -Exit from chroot: +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 200 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. + +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 +strip command, it is a good idea to make a +backup of the current situation. + +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 + first exit from +chroot: logout -Reenter with: +Then reenter it with: chroot $LFS /tools/bin/env -i \ HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ PATH=/bin:/usr/bin:/sbin:/usr/sbin \ /tools/bin/bash --login -Strip the binaries and libraries: +Now the binaries and libraries can be safely stripped: /tools/bin/find /{,usr/}{bin,lib,sbin} -type f \ -exec /tools/bin/strip --strip-debug '{}' ';' +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. + +If disk space is very tight, the +--strip-all option can be used on the binaries +in /{,usr/}{bin,sbin} to gain +several more megabytes. Do not use this option on libraries—they will +be destroyed. + diff --git a/chapter06/syslogng.xml b/chapter06/syslogng.xml index 249fdbc99..04b432af6 100644 --- a/chapter06/syslogng.xml +++ b/chapter06/syslogng.xml @@ -10,6 +10,8 @@ Syslog-ng +<para>The Syslog-ng package contains programs for logging system messages, such +as those given by the kernel when unusual things happen.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,10 @@ <seglistitem><seg>Unchecked</seg><seg>Unchecked</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Syslog-ng installation depends on</segtitle> +<seglistitem><seg>Unchecked</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -26,11 +32,11 @@ <screen><userinput>./configure --prefix=/usr --sysconfdir=/etc</userinput></screen> -<para>Compile Syslog-ng:</para> +<para>Compile the package:</para> <screen><userinput>make</userinput></screen> -<para>Now install it:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -38,8 +44,14 @@ <sect2 id="conf-syslogng" role="configuration"><title>Configuring Syslog-ng + +Syslog-ng +configuring + +/etc/syslog-ng/syslog-ng.conf -Create a /etc/syslog-ng/syslog-ng.conf file: +Create a new /etc/syslog-ng/syslog-ng.conf file by +running the following: mkdir -p /etc/syslog-ng cat > /etc/syslog-ng/syslog-ng.conf << "EOF" @@ -121,7 +133,26 @@ EOF Contents of Syslog-ng -See testing + +Installed programs +Unchecked + + +Short Descriptions + + + +syslog-ng + +syslog-ng +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. + + + + diff --git a/chapter06/sysvinit.xml b/chapter06/sysvinit.xml index b3cfab986..65af49d7f 100644 --- a/chapter06/sysvinit.xml +++ b/chapter06/sysvinit.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Sysvinit-&sysvinit-version; Sysvinit +<para>The Sysvinit package contains programs for controlling the startup, +running, and shutdown of the system.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,21 +19,34 @@ <seglistitem><seg>0.1 SBU</seg><seg> 0.9 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Sysvinit installation depends on</segtitle> +<seglistitem><seg>Binutils, Coreutils, GCC, Glibc, and Make</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Sysvinit -Issue a sed sustitution: +When run-levels are changed (for example, when halting the +system), init sends termination signals to those +processes that init itself started and that should +not be running in the new run-level. While doing this, +init outputs messages like Sending processes +the TERM signal 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 +Sending processes started by init the TERM signal +instead: sed -i 's@Sending processes@& started by init@g' \ src/init.c -Compile Sysvinit: +Compile the package: make -C src -Then install it: +Install the package: make -C src install @@ -39,8 +54,14 @@ Configuring Sysvinit + +Sysvinit +configuring + +/etc/inittab -Create a /etc/inittab file: +Create a new file /etc/inittab by running the +following: cat > /etc/inittab << "EOF" # Begin /etc/inittab @@ -71,14 +92,90 @@ su:S016:once:/sbin/sulogin # End /etc/inittab EOF +The -I '\033(K' option tells +agetty to send this escape sequence to the terminal +before doing anything else. This escape sequence switches the console +character set to a user-defined one, which can be modified by running +the setfont program. The console +initscript from the LFS-Bootscripts package calls the setfont +program during system startup. Sending this escape sequence is +necessary for people who use non-ISO 8859-1 screen fonts, but it does +not effect native English speakers. + Contents of Sysvinit -See testing + +Installed programs +halt, init, killall5, last, lastb (link to last), mesg, pidof (link to +killall5), poweroff (link to halt), reboot (link to halt), runlevel, shutdown, sulogin, telinit +(link to init), utmpdump, and wall + - + +pidof + +Reports the PIDs of the given programs +pidof + + + + +poweroff + +Tells the kernel to halt the system and switch off the computer +(see halt) +poweroff + + + + +reboot + +Tells the kernel to reboot the system (see +halt) +reboot + + + + +runlevel + +Reports the previous and the current run-level, as noted in the last run-level +record in /var/run/utmp +runlevel + + + + +shutdown + +Brings the system down in a secure way, signaling all processes +and notifying all logged-in users +shutdown + + + + +sulogin + +Allows root to log in; it is +normally invoked by init when the system goes into single user mode +sulogin + + + + +telinit + +Tells init which run-level to change to +telinit + + + + +utmpdump + +Displays the content of the given login file in a more +user-friendly format +utmpdump + + + + +wall + +Writes a message to all logged-in users +wall + + + + diff --git a/chapter06/tar.xml b/chapter06/tar.xml index 48c821b2f..9c6b581b5 100644 --- a/chapter06/tar.xml +++ b/chapter06/tar.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Tar-&tar-version; Tar +<para>The Tar package contains an archiving program.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +18,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>10 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Tar installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -33,7 +39,7 @@ <para>To test the results, issue: <userinput>make check</userinput>.</para> -<para>Now install the package:</para> +<para>Install the package:</para> <screen><userinput>make install</userinput></screen> @@ -42,8 +48,33 @@ <sect2 id="contents-tar" role="content"><title>Contents of Tar -See testing + +Installed programs +rmt and tar + + +Short Descriptions + + + +rmt + +Remotely manipulates a magnetic +tape drive through an interprocess communication connection +rmt + + + + +tar + +Creates and extracts files from archives, also known as tarballs +tar + + + + diff --git a/chapter06/texinfo.xml b/chapter06/texinfo.xml index 65b0a6d9d..7560a62a0 100644 --- a/chapter06/texinfo.xml +++ b/chapter06/texinfo.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Texinfo-&texinfo-version; Texinfo +<para>The Texinfo package contains programs for reading, writing, and +converting Info documents.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,6 +19,11 @@ <seglistitem><seg>0.2 SBU</seg><seg>17 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Texinfo installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> @@ -37,12 +44,29 @@ <screen><userinput>make install</userinput></screen> -<para>Optionally install the components belonging in a TeX installation:</para> +<para>Optionally, install the components belonging in a TeX installation:</para> <screen><userinput>make TEXMF=/usr/share/texmf install-tex</userinput></screen> -<para>If ever you need to recreate the -<filename>/usr/share/info/dir</filename> file, run this:</para> +<para>The meaning of the make parameter:</para> + +<variablelist> +<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 step with the Info manuals 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><userinput>cd /usr/share/info rm dir @@ -52,11 +76,74 @@ done</userinput></screen> </sect2> - <sect2 id="contents-texinfo" role="content"><title>Contents of Texinfo -See testing + +Installed programs +info, infokey, install-info, +makeinfo, texi2dvi, and texindex + + +Short Descriptions + + + +info + +Used to read Info documents which are similar to man +pages, but often go much deeper than just explaining all the command +line options. For example, compare man bison and +info bison. +info + + + + +infokey + +Compiles a source file containing Info customizations into a +binary format +infokey + + + + +install-info + +Used to install Info files; it updates entries in the Info index +file +install-info + + + + +makeinfo + +Translates the given Texinfo source documents into +info files, plain text, or HTML +makeinfo + + + + +texi2dvi + +Used to format the given Texinfo document into a +device-independent file that can be printed +texi2dvi + + + + +texindex + +Used to sort Texinfo index files +texindex + + + + diff --git a/chapter06/udev.xml b/chapter06/udev.xml index b1a34c51d..e25ed756d 100644 --- a/chapter06/udev.xml +++ b/chapter06/udev.xml @@ -10,6 +10,7 @@ Udev +<para>The Udev package contains programs for dynamic creation of device nodes.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,36 +18,128 @@ <seglistitem><seg>0.2 SBU</seg><seg>5.2 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Udev installation depends on</segtitle> +<seglistitem><seg>Coreutils and Make</seg></seglistitem> +</segmentedlist> + </sect2> <sect2 role="installation"> <title>Installation of Udev -Compile Udev: +Compile the package: make udevdir=/dev -Install it: + + +udevdir=/dev +This tells udev in which directory +devices nodes are to be created. + + + +This package does not come with a test suite. + +Install the package: make udevdir=/dev install -Install our configuration files: +Udev's configuration is far from ideal by default, so install +the configuration files here: cp ../udev-config-2.permissions \ /etc/udev/permissions.d/25-lfs.permissions cp ../udev-config-1.rules /etc/udev/rules.d/25-lfs.rules -Create the full compliment of device nodes: + +Run the udevstart program to create our full +compliment of device nodes. /sbin/udevstart - Contents of Udev -See testing + +Installed programs +Installed directory +udev, udevd, udevsend, udevstart, udevinfo, and udevtest +/etc/udev + +Short Descriptions + + + +udev + +Creates device nodes in /dev or renames network interfaces (not +in LFS) in response to hotplug events +udev + + + +udevd + +A daemon that reorders hotplug events before submitting them to +udev, +thus avoiding various race conditions +udevd + + + +udevsend + +Delivers hotplug events to udevd +udevsend + + + +udevstart + +Creates device nodes in /dev that correspond to drivers compiled directly +into the kernel; it performs that task by simulating hotplug events presumably +dropped by the kernel before invocation of this program (e.g., because the root +filesystem has not been mounted) and submitting such synthetic hotplug events +to udev +udevstart + + + + +udevinfo + +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 sysfs tree to help create udev +rules +udevinfo + + + +udevtest + +Simulates a udev run for the given device, +and prints out the name of the node the real udev would +have created or (not in LFS) the name of the renamed network interface +udevtest + + + +/etc/udev + +Contains udev configuation files, +device permissions, and rules for device naming +/etc/udev + + + diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 8ea6d5b2b..fcdc35383 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -3,13 +3,16 @@ %general-entities; ]> - + Util-linux-&util-linux-version; Util-linux +<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> @@ -17,12 +20,22 @@ <seglistitem><seg>0.2 SBU</seg><seg>16 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Util-linux installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, +Diffutils, GCC, Gettext, Glibc, Grep, Make, Ncurses, Sed, and Zlib</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>FHS compliance notes -Issue a sed sustitution: +The FHS recommends using the /var/lib/hwclock directory instead of the +usual /etc directory as the +location for the adjtime file. To make the +hwclock program FHS-compliant, run the +following: sed -i 's@etc/adjtime@var/lib/hwclock/adjtime@g' \ hwclock/hwclock.c @@ -46,17 +59,566 @@ linux-libc-headers. The following patch properly fixes that issue make HAVE_KILL=yes HAVE_SLN=yes -Now install the package: +The meaning of the make parameters: + + + +HAVE_KILL=yes +This prevents the +kill program (already installed by Procps) from being +built and installed again. + + + +HAVE_SLN=yes +This prevents the sln program (a +statically linked version of ln already installed +by Glibc) from being built and installed again. + + + +This package does not come with a test suite. + +Install the package: make HAVE_KILL=yes HAVE_SLN=yes install - Contents of Util-linux -See testing + +Installed programs +agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, +colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, fdisk, +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, swapdev, swapoff (link to swapon), swapon, tunelp, ul, umount, vidmode (link to rdev), +whereis, and write + + +Short Descriptions + + + +agetty + +Opens a tty port, prompts for a login name, +and then invokes the login program +agetty + + + + +arch + +Reports the machine's architecture +arch + + + + +blockdev + +Allows users to call block device ioctls from the command line +blockdev + + + + +cal + +Displays a simple calendar +cal + + + + +cfdisk + +Manipulates the partition table of the given device +cfdisk + + + + +chkdupexe + +Finds duplicate executables +chkdupexe + + + + +col + +Filters out reverse line feeds +col + + + + +colcrt + +Filters nroff output for terminals +that lack some capabilities, such as overstriking and half-lines +colcrt + + + + +colrm + +Filters out the given columns +colrm + + + + +column + +Formats a given file into multiple columns +column + + + + +ctrlaltdel + +Sets the function of the Ctrl+Alt+Del key combination to a hard or a +soft reset +ctrlaltdel + + + + +cytune + +Tunes the parameters of the serial line drivers for +Cyclades cards +cytune + + + + +ddate + +Gives the Discordian date or converts the given Gregorian date +to a Discordian one +ddate + + + + +dmesg + +Dumps the kernel boot messages +dmesg + + + + +elvtune + +Tunes the performance and interactivity of a block +device +elvtune + + + + +fdformat + +Low-level formats a floppy disk +fdformat + + + + +fdisk + +Manipulates the partition table of the given device +fdisk + + + + +fsck.cramfs + +Performs a consistency check on the Cramfs file system on the +given device +fsck.cramfs + + + + +fsck.minix + +Performs a consistency check on the Minix file system on the +given device +fsck.minix + + + + +getopt + +Parses options in the given command line +getopt + + + + +hexdump + +Dumps the given file in hexadecimal or in another given format +hexdump + + + + +hwclock + +Reads or sets the system's hardware clock, also called +the Real-Time Clock (RTC)) or Basic Input-Output System (BIOS) +clock +hwclock + + + + +ipcrm + +Removes the given Inter-Process Communication (IPC) resource +ipcrm + + + + +ipcs + +Provides IPC status information +ipcs + + + + +isosize + +Reports the size of an iso9660 file system +isosize + + + + +line + +Copies a single line +line + + + + +logger + +Enters the given message into the system log +logger + + + + +look + +Displays lines that begin with the given string +look + + + + +losetup + +Sets up and controls loop devices +losetup + + + + +mcookie + +Generates magic cookies (128-bit random hexadecimal numbers) for +xauth +mcookie + + + + +mkfs + +Builds a file system on a device (usually a hard disk +partition) +mkfs + + + + +mkfs.bfs + +Creates an Santa Cruz Operations (SCO) bfs file system +mkfs.bfs + + + + +mkfs.cramfs + +Creates a cramfs file system +mkfs.cramfs + + + + +mkfs.minix + +Creates a Minix file system +mkfs.minix + + + + +mkswap + +Initializes the given device or file to be used as a swap area +mkswap + + + + +more + +A filter for paging through text one screen at a time +more + + + + +mount + +Attaches the file system on the given device to a specified +directory in the file-system tree +mount + + + + +namei + +Shows the symbolic links in the given pathnames +namei + + + + +pg + +Displays a text file one screen full at a time +pg + + + + +pivot_root + +Makes the given file system the new root file system of the +current process +pivot_root + + + + +ramsize + +Sets the size of the RAM disk in a bootable image +ramsize + + + + +raw + +Used to bind a Linux raw character device to a block +device +raw + + + + +rdev + +Queries and sets the root device, among other things, in a +bootable image +rdev + + + + +readprofile + +Reads kernel profiling information +readprofile + + + + +rename + +Renames the given files, replacing a given string with another +rename + + + + +renice + +Alters the priority of running processes +renice + + + + +rev + +Reverses the lines of a given file +rev + + + + +rootflags + +Sets the rootflags in a bootable image +rootflags + + + + +script + +Makes a typescript of a terminal session +script + + + + +setfdprm + +Sets user-provided floppy disk parameters +setfdprm + + + + +setsid + +Runs the given program in a new session +setsid + + + + +setterm + +Sets terminal attributes +setterm + + + + +sfdisk + +A disk partition table manipulator +sfdisk + + + + +swapdev + +Sets the swap device in a bootable image +swapdev + + + + +swapoff + +Disables devices and files for paging and swapping +swapoff + + + + +swapon + +Enables devices and files for paging and swapping +swapon + + + + +tunelp + +Tunes the parameters of the line printer +tunelp + + + + +ul + +A filter for translating underscores into +escape sequences indicating underlining for the terminal in use +ul + + + + +umount + +Disconnects a file system from the system's file tree +umount + + + + +vidmode + +Sets the video mode in a bootable image +vidmode + + + + +whereis + +Reports the location of binary, the source, and the manual page +for the given command +whereis + + + + +write + +Sends a message to the given user +if that user has not disabled receipt of such messages +write + + + + diff --git a/chapter06/vim.xml b/chapter06/vim.xml index aeeaf535c..ec263cced 100644 --- a/chapter06/vim.xml +++ b/chapter06/vim.xml @@ -3,13 +3,14 @@ %general-entities; ]> - + Vim-&vim-version; Vim +<para>The Vim package contains a powerful text editor.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,12 +18,30 @@ <seglistitem><seg>0.4 SBU</seg><seg>34 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Vim installation depends on</segtitle> +<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils, +GCC, Glibc, Grep, Make, Ncurses, and Sed</seg></seglistitem> +</segmentedlist> + +<tip> +<title>Alternatives to Vim +If you prefer another editor—such as Emacs, Joe, or +Nano—please refer to +for suggested installation instructions. + Installation of Vim -Change the default locations of the configuration files: +First, unpack both +vim-&vim-version;.tar.bz2 and (optionally) +vim-&vim-version;-lang.tar.gz archives into the +same directory. Then, change the default locations of the +vimrc and gvimrc +configuration files to /etc: echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h echo '#define SYS_GVIMRC_FILE "/etc/gvimrc"' >> src/feature.h @@ -36,28 +55,56 @@ following patch fixes the problem: ./configure --prefix=/usr --enable-multibyte +The optional but highly recommended +--enable-multibyte switch includes support for +editing files in multibyte character encodings into +vim. 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. + Compile the package: make To test the results, issue: -make test +make test. However, this test suite outputs a +lot of chaotic characters to the screen, which can cause issues with +the settings of the current terminal. Therefore, running the test +suite here is optional. -Now install the package: +Install the package: make install -Create a symlink: +Many users are used to using vi instead of +vim. To allow execution of vim +when users habitually enter vi, create a +symlink: ln -s vim /usr/bin/vi - +If the 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 . + Configuring Vim +/etc/vim -Create a default vim configuration file by running -the following: +By default, vim runs in vi-incompatible mode. +This may be new to users who have used other editors in the past. The +nocompatible setting is included below to highlight the +fact that a new behavior is being used. It also reminds those who +would change to compatible mode that it should appear +first. This is necessary because it changes other settings, and +overrides must come after this setting. Create a default vim +configuration file by running the following: cat > /etc/vimrc << "EOF" " Begin /etc/vimrc @@ -65,7 +112,6 @@ the following: set nocompatible set backspace=2 syntax on - if (&term == "iterm") || (&term == "putty") set background=dark endif @@ -73,32 +119,215 @@ endif " End /etc/vimrc EOF - - -Documentation for other available options can be obtained by running -the following command: +The set nocompatible makes +vim behave in a more useful way (the default) than +the vi-compatible manner. Remove the no to keep the +old vi behavior. The set +backspace=2 allows backspacing over line breaks, +autoindents, and the start of insert. The syntax +on enables vim's syntax highlighting. Finally, the +if statement with the set +background=dark corrects vim'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. + +Documentation for other available options can be obtained by +running the following command: vim -c ':options' - Contents of Vim -See testing + +Installed programs +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 + + +Short Descriptions + + + +efm_filter.pl + +A filter for creating an error file that can be read by vim +efm_filter.pl + + + + +efm_perl.pl + +Reformats the error messages of the +Perl interpreter for use with the quickfix mode of vim +efm_perl.pl + + + + +ex + +Starts vim in ex mode +ex + + + + +less.sh + +A script that starts vim with less.vim +less.sh + + + + +mve.awk + +Processes vim errors +mve.awk + + + + +pltags.pl + +Creates a tags file for Perl code for use by vim +pltags.pl + + + + +ref + +Checks the spelling of arguments +ref + + + + +rview + +Is a restricted version of view; no shell +commands can be started and view cannot be suspended +rview + + + + +rvim + +Is a restricted version of vim; no shell +commands can be started and vim cannot be suspended +rvim + + + + +shtags.pl + +Generates a tag file for Perl scripts +shtags.pl + + + + +tcltags + +Generates a tag file for TCL code +tcltags + + + + +view + +Starts vim in read-only mode +view + + + + +vi + +Is the editor +vi + + + + +vim + +Is the editor +vim + + + + +vim132 + +Starts vim with the terminal in 132-column mode +vim132 + + + + +vim2html.pl + +Converts Vim documentation to HypterText Markup Language (HTML) +vim2html.pl + + + + +vimdiff + +Edits two or three versions of a file with vim and show differences +vimdiff + + + + +vimm + +Enables the DEC locator input model on a remote terminal +vimm + + + + +vimspell.sh + +Spells a file and generates the syntax statements necessary +to highlight in vim. This script requires the old Unix spell +command, which is provided neither in LFS nor in BLFS +vimspell.sh + + + + +vimtutor + +Teaches the basic keys and commands of vim +vimtutor + + + + +xxd + +Creates a hex dump of the given file; it can +also do the reverse, so it can be used for binary patching +xxd + + + + diff --git a/chapter06/zlib.xml b/chapter06/zlib.xml index 606751c8d..77c731ba9 100644 --- a/chapter06/zlib.xml +++ b/chapter06/zlib.xml @@ -3,13 +3,15 @@ %general-entities; ]> - + Zlib-&zlib-version; Zlib +<para>The Zlib package contains compression and un-compression routines used by +some programs.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> @@ -17,12 +19,22 @@ <seglistitem><seg>0.1 SBU</seg><seg>1.5 MB</seg></seglistitem> </segmentedlist> +<segmentedlist> +<segtitle>Zlib installation depends on</segtitle> +<seglistitem><seg>Binutils, Coreutils, GCC, Glibc, Make, and Sed</seg></seglistitem> +</segmentedlist> </sect2> <sect2 role="installation"> <title>Installation of Zlib - +Zlib is known to build its shared library incorrectly if +CFLAGS is specified in the environment. If using a +specified CFLAGS +variable, be sure to add the -fPIC directive to +the CFLAGS variable for the duration of the +configure command below, then remove it afterwards. + Prepare Zlib for compilation: ./configure --prefix=/usr --shared --libdir=/lib @@ -38,25 +50,27 @@ make install -Now we will remove the old, .so files in /lib and relink them into /usr/lib. +Next we will remove the old, .so files in +the /lib directory and relink them +into /usr/lib. rm /lib/libz.so ln -sf ../../lib/libz.so.&zlib-version; /usr/lib/libz.so -Now also build the non-shared (static) library: +Build the static library: make clean ./configure --prefix=/usr make -To again test the results, issue: +To test the results again, issue: make check. Install the static library: make install -And fix the permissions on the static library: +Fix the permissions on the static library: chmod 644 /usr/lib/libz.a @@ -65,8 +79,25 @@ make Contents of Zlib -See testing + +Installed libraries +libz[a,so] + + +Short Descriptions + + + +libz + +Contains compression and un-compression +functions used by some programs +libz + + + + -- cgit v1.2.3-54-g00ecf