From fcc027677da55c41dcaea045f5b9ff8b088e6495 Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Sun, 7 Jun 2020 20:16:00 +0000 Subject: Initial commit of alternative cross LFS git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/cross2@11897 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 --- chapter06/aboutdebug.xml | 52 -- chapter06/acl.xml | 148 ----- chapter06/adjusting.xml | 126 ---- chapter06/attr.xml | 147 ----- chapter06/autoconf.xml | 194 ------ chapter06/automake.xml | 155 ----- chapter06/bash.xml | 137 +--- chapter06/bc.xml | 129 ---- chapter06/binutils-pass1.xml | 156 +++++ chapter06/binutils-pass2.xml | 94 +++ chapter06/binutils.xml | 436 ------------- chapter06/bison.xml | 110 +--- chapter06/bzip2.xml | 202 +----- chapter06/changingowner.xml | 41 ++ chapter06/chapter06.xml | 93 +-- chapter06/check.xml | 109 ---- chapter06/chroot.xml | 65 ++ chapter06/coreutils.xml | 1264 ++---------------------------------- chapter06/createfiles.xml | 204 ++++++ chapter06/creatingdirs.xml | 59 ++ chapter06/dbus.xml | 241 ------- chapter06/dejagnu.xml | 96 +++ chapter06/diffutils.xml | 85 +-- chapter06/e2fsprogs.xml | 541 ---------------- chapter06/eudev.xml | 191 ------ chapter06/expat.xml | 117 ---- chapter06/expect.xml | 139 ++++ chapter06/file.xml | 75 +-- chapter06/findutils.xml | 124 +--- chapter06/flex.xml | 127 +--- chapter06/gawk.xml | 86 +-- chapter06/gcc-pass1.xml | 208 ++++++ chapter06/gcc-pass2.xml | 160 +++++ chapter06/gcc.xml | 626 ------------------ chapter06/gdbm.xml | 156 ----- chapter06/generalinstructions.xml | 120 ++++ chapter06/gettext.xml | 410 +----------- chapter06/glibc.xml | 980 ++++------------------------ chapter06/gmp.xml | 164 ----- chapter06/gperf.xml | 95 --- chapter06/grep.xml | 73 +-- chapter06/groff.xml | 607 ------------------ chapter06/grub.xml | 374 ----------- chapter06/gzip.xml | 196 +----- chapter06/iana-etc.xml | 93 --- chapter06/inetutils.xml | 249 -------- chapter06/intltool.xml | 141 ---- chapter06/introduction.xml | 79 +-- chapter06/iproute2.xml | 322 ---------- chapter06/kbd.xml | 392 ------------ chapter06/kernfs.xml | 115 ++++ chapter06/kmod.xml | 211 ------ chapter06/less.xml | 125 ---- chapter06/libcap.xml | 166 ----- chapter06/libelf.xml | 88 --- chapter06/libffi.xml | 133 ---- chapter06/libpipeline.xml | 92 --- chapter06/libstdc++-pass2.xml | 114 ++++ chapter06/libstdc++.xml | 122 ++++ chapter06/libtool.xml | 129 ---- chapter06/linux-headers.xml | 207 ++++++ chapter06/m4.xml | 64 +- chapter06/make.xml | 76 +-- chapter06/man-db.xml | 456 ------------- chapter06/man-pages.xml | 80 --- chapter06/meson.xml | 109 ---- chapter06/mpc.xml | 100 --- chapter06/mpfr.xml | 105 --- chapter06/ncurses.xml | 339 ++-------- chapter06/ninja.xml | 132 ---- chapter06/openssl.xml | 176 ----- chapter06/patch.xml | 58 +- chapter06/perl.xml | 485 +------------- chapter06/pkgconfig.xml | 121 ---- chapter06/pkgmgt.xml | 291 --------- chapter06/procps.xml | 292 --------- chapter06/psmisc.xml | 160 ----- chapter06/python.xml | 233 +------ chapter06/readline.xml | 156 ----- chapter06/revisedchroot.xml | 70 -- chapter06/sed.xml | 67 +- chapter06/shadow.xml | 608 ------------------ chapter06/stripping.xml | 53 ++ chapter06/strippingagain.xml | 81 --- chapter06/sysklogd.xml | 136 ---- chapter06/systemd.xml | 830 ------------------------ chapter06/sysvinit.xml | 220 ------- chapter06/tar.xml | 77 +-- chapter06/tcl.xml | 191 ++++++ chapter06/texinfo.xml | 201 +----- chapter06/toolchaintechnotes.xml | 335 ++++++++++ chapter06/util-linux.xml | 1278 ++----------------------------------- chapter06/vim.xml | 319 --------- chapter06/xml-parser.xml | 92 --- chapter06/xz.xml | 335 +--------- chapter06/zlib.xml | 101 --- chapter06/zstd.xml | 136 ---- 97 files changed, 3205 insertions(+), 18048 deletions(-) delete mode 100644 chapter06/aboutdebug.xml delete mode 100644 chapter06/acl.xml delete mode 100644 chapter06/adjusting.xml delete mode 100644 chapter06/attr.xml delete mode 100644 chapter06/autoconf.xml delete mode 100644 chapter06/automake.xml delete mode 100644 chapter06/bc.xml create mode 100644 chapter06/binutils-pass1.xml create mode 100644 chapter06/binutils-pass2.xml delete mode 100644 chapter06/binutils.xml create mode 100644 chapter06/changingowner.xml delete mode 100644 chapter06/check.xml create mode 100644 chapter06/chroot.xml create mode 100644 chapter06/createfiles.xml create mode 100644 chapter06/creatingdirs.xml delete mode 100644 chapter06/dbus.xml create mode 100644 chapter06/dejagnu.xml delete mode 100644 chapter06/e2fsprogs.xml delete mode 100644 chapter06/eudev.xml delete mode 100644 chapter06/expat.xml create mode 100644 chapter06/expect.xml create mode 100644 chapter06/gcc-pass1.xml create mode 100644 chapter06/gcc-pass2.xml delete mode 100644 chapter06/gcc.xml delete mode 100644 chapter06/gdbm.xml create mode 100644 chapter06/generalinstructions.xml delete mode 100644 chapter06/gmp.xml delete mode 100644 chapter06/gperf.xml delete mode 100644 chapter06/groff.xml delete mode 100644 chapter06/grub.xml delete mode 100644 chapter06/iana-etc.xml delete mode 100644 chapter06/inetutils.xml delete mode 100644 chapter06/intltool.xml delete mode 100644 chapter06/iproute2.xml delete mode 100644 chapter06/kbd.xml create mode 100644 chapter06/kernfs.xml delete mode 100644 chapter06/kmod.xml delete mode 100644 chapter06/less.xml delete mode 100644 chapter06/libcap.xml delete mode 100644 chapter06/libelf.xml delete mode 100644 chapter06/libffi.xml delete mode 100644 chapter06/libpipeline.xml create mode 100644 chapter06/libstdc++-pass2.xml create mode 100644 chapter06/libstdc++.xml delete mode 100644 chapter06/libtool.xml create mode 100644 chapter06/linux-headers.xml delete mode 100644 chapter06/man-db.xml delete mode 100644 chapter06/man-pages.xml delete mode 100644 chapter06/meson.xml delete mode 100644 chapter06/mpc.xml delete mode 100644 chapter06/mpfr.xml delete mode 100644 chapter06/ninja.xml delete mode 100644 chapter06/openssl.xml delete mode 100644 chapter06/pkgconfig.xml delete mode 100644 chapter06/pkgmgt.xml delete mode 100644 chapter06/procps.xml delete mode 100644 chapter06/psmisc.xml delete mode 100644 chapter06/readline.xml delete mode 100644 chapter06/revisedchroot.xml delete mode 100644 chapter06/shadow.xml create mode 100644 chapter06/stripping.xml delete mode 100644 chapter06/strippingagain.xml delete mode 100644 chapter06/sysklogd.xml delete mode 100644 chapter06/systemd.xml delete mode 100644 chapter06/sysvinit.xml create mode 100644 chapter06/tcl.xml create mode 100644 chapter06/toolchaintechnotes.xml delete mode 100644 chapter06/vim.xml delete mode 100644 chapter06/xml-parser.xml delete mode 100644 chapter06/zlib.xml delete mode 100644 chapter06/zstd.xml (limited to 'chapter06') diff --git a/chapter06/aboutdebug.xml b/chapter06/aboutdebug.xml deleted file mode 100644 index f49618c83..000000000 --- a/chapter06/aboutdebug.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - %general-entities; -]> - - - - - About Debugging Symbols - - 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. - - diff --git a/chapter06/acl.xml b/chapter06/acl.xml deleted file mode 100644 index f9f2eddbe..000000000 --- a/chapter06/acl.xml +++ /dev/null @@ -1,148 +0,0 @@ - - - %general-entities; -]> - - - - - - acl - &acl-version; -
&acl-url;
-
- - Acl-&acl-version; - - - Acl - - - - - - <para>The Acl package contains utilities to administer Access Control Lists, - which are used to define more fine-grained discretionary access rights for - files and directories.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&acl-ch6-sbu;</seg> - <seg>&acl-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Acl - - Prepare Acl for compilation: - -./configure --prefix=/usr \ - --bindir=/bin \ - --disable-static \ - --libexecdir=/usr/lib \ - --docdir=/usr/share/doc/acl-&acl-version; - - -./configure --prefix=/usr \ - --disable-static \ - --libexecdir=/usr/lib \ - --docdir=/usr/share/doc/acl-&acl-version; - - Compile the package: - -make - - The Acl tests need to be run on a filesystem that supports access - controls after Coreutils has been built with the - Acl libraries. If desired, return to this package and run make - check after Coreutils has been built - later in this chapter. - - Install the package: - -make install - - The shared library needs to be moved to - /lib, and as a result the - .so file in - /usr/lib will need to be recreated: - -mv -v /usr/lib/libacl.so.* /lib -ln -sfv ../../lib/$(readlink /usr/lib/libacl.so) /usr/lib/libacl.so - - - - - Contents of Acl - - - Installed programs - Installed library - Installed directories - - - chacl, getfacl, and setfacl - libacl.so - /usr/include/acl and /usr/share/doc/acl-&acl-version; - - - - - Short Descriptions - - - - - chacl - - Changes the access control list of a file - or directory - - chacl - - - - - - getfacl - - Gets file access control lists - - getfacl - - - - - - setfacl - - Sets file access control lists - - setfacl - - - - - - libacl - - Contains the library functions for manipulating Access Control Lists - - libacl - - - - - - - - -
diff --git a/chapter06/adjusting.xml b/chapter06/adjusting.xml deleted file mode 100644 index 3e6b49e19..000000000 --- a/chapter06/adjusting.xml +++ /dev/null @@ -1,126 +0,0 @@ - - - %general-entities; -]> - - - - - Adjusting the Toolchain - - Now that the final C libraries have been installed, it is time to adjust - the toolchain so that it will link any - newly compiled program against these new libraries. - - First, backup the /tools linker, - and replace it with the adjusted linker we made in chapter 5. We'll also create - a link to its counterpart in - /tools/$(uname -m)-pc-linux-gnu/bin: - -mv -v /tools/bin/{ld,ld-old} -mv -v /tools/$(uname -m)-pc-linux-gnu/bin/{ld,ld-old} -mv -v /tools/bin/{ld-new,ld} -ln -sv /tools/bin/ld /tools/$(uname -m)-pc-linux-gnu/bin/ld - - the next command amends the GCC specs file to achieve three goals: - first point GCC to the new dynamic linker. Simply deleting all instances of - /tools should leave us with the correct path to the dynamic - linker. Second, let GCC know where to find the Glibc start files. Third, - add the /usr/include directory at the end of the default search path, so - that header files added in chapter 6 are found. - A sed command accomplishes this: - -gcc -dumpspecs | sed -e 's@/tools@@g' \ - -e '/\*startfile_prefix_spec:/{n;s@.*@/usr/lib/ @}' \ - -e '/\*cpp:/{n;s@$@ -idirafter /usr/include@}' > \ - `dirname $(gcc --print-libgcc-file-name)`/specs - - It is a good idea to visually inspect the specs file to verify the - intended change was actually made. - - It is imperative at this point to ensure that the basic - functions (compiling and linking) of the adjusted toolchain are working - as expected. To do this, perform the following sanity checks: - -echo 'int main(){}' > dummy.c -cc dummy.c -v -Wl,--verbose &> dummy.log -readelf -l a.out | grep ': /lib' - - 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: /lib64/ld-linux-x86-64.so.2] - - Note that on 64-bit systems /lib is - the location of our dynamic linker, but is accessed via a symbolic link - in /lib64. - - On 32-bit systems the interpreter should be - /lib/ld-linux.so.2. - - Now make sure that we're setup to use the correct start files: - -grep -o '/usr/lib.*/crt[1in].*succeeded' dummy.log - - The output of the last command should be: - -/usr/lib/../lib/crt1.o succeeded -/usr/lib/../lib/crti.o succeeded -/usr/lib/../lib/crtn.o succeeded - - Verify that the compiler is searching for the correct header - files: - -grep -B4 '^ /usr/include' dummy.log - - This command should return the following output: - -#include <...> search starts here: - /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include - /tools/include - /tools/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed - /usr/include - - On a 32 bit system, x86_64 is replaced with i686. - - Next, verify that the new linker is being used with the correct search paths: - -grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' - - References to paths that have components with '-linux-gnu' should - be ignored, but otherwise the output of the last command should be: - -SEARCH_DIR("/usr/lib") -SEARCH_DIR("/lib") - - Next make sure that we're using the correct libc: - -grep "/lib.*/libc.so.6 " dummy.log - - The output of the last command should be: - -attempt to open /lib/libc.so.6 succeeded - - Lastly, make sure GCC is using the correct dynamic linker: - -grep found dummy.log - - The output of the last command should be (allowing for - platform-specific differences in dynamic linker name): - -found ld-linux-x86-64.so.2 at /lib/ld-linux-x86-64.so.2 - - If the output does not appear as shown above or is not received - at all, then something is seriously wrong. Investigate and retrace the - steps to find out where the problem is and correct it. The most likely - reason is that something went wrong with the specs file adjustment. Any - issues will need to be resolved before continuing with the process. - - Once everything is working correctly, clean up the test files: - -rm -v dummy.c a.out dummy.log - - diff --git a/chapter06/attr.xml b/chapter06/attr.xml deleted file mode 100644 index 10c6eec53..000000000 --- a/chapter06/attr.xml +++ /dev/null @@ -1,147 +0,0 @@ - - - %general-entities; -]> - - - - - - attr - &attr-version; -
&attr-url;
-
- - Attr-&attr-version; - - - Attr - - - - - - <para>The attr package contains utilities to administer the extended - attributes on filesystem objects.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&attr-ch6-sbu;</seg> - <seg>&attr-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Attr - - Prepare Attr for compilation: - - -./configure --prefix=/usr \ - --bindir=/bin \ - --disable-static \ - --sysconfdir=/etc \ - --docdir=/usr/share/doc/attr-&attr-version; - - -./configure --prefix=/usr \ - --disable-static \ - --sysconfdir=/etc \ - --docdir=/usr/share/doc/attr-&attr-version; - - Compile the package: - -make - - The tests need to be run on a filesystem that supports extended - attributes such as the ext2, ext3, or ext4 filesystems. - To test the results, issue: - -make check - - Install the package: - -make install - - The shared library needs to be moved to - /lib, and as a result the - .so file in - /usr/lib will need to be recreated: - -mv -v /usr/lib/libattr.so.* /lib -ln -sfv ../../lib/$(readlink /usr/lib/libattr.so) /usr/lib/libattr.so - - - - - Contents of Attr - - - Installed programs - Installed library - Installed directories - - - attr, getfattr, and setfattr - libattr.so - /usr/include/attr and /usr/share/doc/attr-&attr-version; - - - - - Short Descriptions - - - - - attr - - Extends attributes on filesystem objects - - attr - - - - - - getfattr - - Gets the extended attributes of filesystem objects - - getfattr - - - - - - setfattr - - Sets the extended attributes of filesystem objects - - setfattr - - - - - - libattr - - Contains the library functions for manipulating extended attributes - - libattr - - - - - - - - -
diff --git a/chapter06/autoconf.xml b/chapter06/autoconf.xml deleted file mode 100644 index 6652747fd..000000000 --- a/chapter06/autoconf.xml +++ /dev/null @@ -1,194 +0,0 @@ - - - %general-entities; -]> - - - - - - autoconf - &autoconf-version; -
&autoconf-url;
-
- - 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> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&autoconf-ch6-sbu;</seg> - <seg>&autoconf-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Autoconf - - First, fix a bug generated by Perl 5.28. - -sed '361 s/{/\\{/' -i bin/autoscan.in - - Prepare Autoconf for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - - The test suite is currently broken by bash-5 and libtool-2.4.3. - To run the tests anyway, issue: - -make check - - Install the package: - -make install - - - - - Contents of Autoconf - - - Installed programs - Installed directory - - - autoconf, autoheader, autom4te, autoreconf, autoscan, autoupdate, - and ifnames - /usr/share/autoconf - - - - - 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 deleted file mode 100644 index 11dccfad3..000000000 --- a/chapter06/automake.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - %general-entities; -]> - - - - - - automake - &automake-version; -
&automake-url;
-
- - Automake-&automake-version; - - - Automake - - - - - - <para>The Automake package contains programs for generating Makefiles for use - with Autoconf.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&automake-ch6-sbu;</seg> - <seg>&automake-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Automake - - Fix a failing test: - -sed -i "s/''/etags/" t/tags-lisp-space.sh - - Prepare Automake for compilation: - -./configure --prefix=/usr --docdir=/usr/share/doc/automake-&automake-version; - - Compile the package: - -make - - - - Using the -j4 make option speeds up the tests, even on systems with - only one processor, due to internal delays in individual tests. To test - the results, issue: - - - -make -j4 check - - - One test is known to fail in the LFS environment: - tags-lisp-space.sh. - - Install the package: - -make install - - - - - - Contents of Automake - - - Installed programs - Installed directories - - - aclocal, aclocal-&am-minor-version; (hard linked with aclocal), automake, and - automake-&am-minor-version; (hard linked with automake) - /usr/share/aclocal-&am-minor-version;, /usr/share/automake-&am-minor-version;, and - /usr/share/doc/automake-&automake-version; - - - - - Short Descriptions - - - - - aclocal - - Generates aclocal.m4 files based on the - contents of configure.in files - - aclocal - - - - - - aclocal-&am-minor-version; - - A hard link to aclocal - - aclocal-&am-minor-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 generates the - corresponding Makefile.in file.] - - automake - - - - - - automake-&am-minor-version; - - A hard link to automake - - automake-&am-minor-version; - - - - - - - - -
diff --git a/chapter06/bash.xml b/chapter06/bash.xml index 650c33ade..92627e92c 100644 --- a/chapter06/bash.xml +++ b/chapter06/bash.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,22 +16,25 @@ Bash-&bash-version; - + Bash + tools - <para>The Bash package contains the Bourne-Again SHell.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/bash.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&bash-ch6-sbu;</seg> - <seg>&bash-ch6-du;</seg> + <seg>&bash-ch5-sbu;</seg> + <seg>&bash-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -40,27 +43,24 @@ <sect2 role="installation"> <title>Installation of Bash - Incorporate some upstream fixes: - -patch -Np1 -i ../&bash-fixes-patch; - Prepare Bash for compilation: -./configure --prefix=/usr \ - --docdir=/usr/share/doc/bash-&bash-version; \ - --without-bash-malloc \ - --with-installed-readline +./configure --prefix=/usr \ + --build=$(support/config.guess) \ + --host=$LFS_TGT \ + --without-bash-malloc - The meaning of the new configure option: + The meaning of the configure options: - --with-installed-readline + --without-bash-malloc - This option tells Bash to use the readline library that is already - installed on the system rather than using its own readline - version. + This option turns off the use of Bash's memory allocation + (malloc) function which is known to cause + segmentation faults. By turning this option off, Bash will use + the malloc functions from Glibc which are + more stable. @@ -70,103 +70,26 @@ make - Skip down to Install the - package if not running the test suite. - - To prepare the tests, ensure that the tester user can write to the sources tree: - -chown -Rv tester . + Install the package: - Now, run the tests as the tester user: +make DESTDIR=$LFS install -su tester << EOF -PATH=$PATH make tests < $(tty) -EOF - - Install the package and move the main executable to - /bin: + Move the excutable to where it is expected to be: -make install -mv -vf /usr/bin/bash /bin +mv $LFS/usr/bin/bash $LFS/bin/bash - Run the newly compiled bash program (replacing the one that is - currently being executed): + Make a link for the programs that use sh for + a shell: -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. - +ln -sv bash $LFS/bin/sh - - Contents of Bash - - - Installed programs - Installed directory - - - bash, bashbug, and sh (link to bash) - /usr/include/bash, /usr/lib/bash, and - /usr/share/doc/bash-&bash-version; - - - - - 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 standard - formatted bug reports concerning bash - - 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 - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-bash" role="."/></para> </sect2> diff --git a/chapter06/bc.xml b/chapter06/bc.xml deleted file mode 100644 index d848ad365..000000000 --- a/chapter06/bc.xml +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-bc" role="wrap"> - <?dbhtml filename="bc.html"?> - - <sect1info condition="script"> - <productname>bc</productname> - <productnumber>&bc-version;</productnumber> - <address>&bc-url;</address> - </sect1info> - - <title>Bc-&bc-version; - - - Bc - - - - - - <para>The Bc package contains an arbitrary precision numeric processing - language.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&bc-ch6-sbu;</seg> - <seg>&bc-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Bc - - Prepare Bc for compilation: - -PREFIX=/usr CC=gcc CFLAGS="-std=c99" ./configure.sh -G -O3 - - - The meaning of the configure options: - - - CC=gcc CFLAGS="-std=c99" - - These parameters specify the compiler and the C standard to use. - - - - - -O3 - - Specify the optimization to use. - - - - - -G - - Omit parts of the test suite that won't work - without a GNU bc present. - - - - - Compile the package: - -make - - To test bc, run: - -make test - - - Install the package: - -make install - - - - - Contents of Bc - - - Installed programs - - - bc and dc - - - - - Short Descriptions - - - - - bc - - A command line calculator - - bc - - - - - - dc - - A reverse-polish command line calculator - - dc - - - - - - - - - diff --git a/chapter06/binutils-pass1.xml b/chapter06/binutils-pass1.xml new file mode 100644 index 000000000..8658cfcfe --- /dev/null +++ b/chapter06/binutils-pass1.xml @@ -0,0 +1,156 @@ + + + %general-entities; +]> + + + + + + binutils-pass1 + &binutils-version; +
&binutils-url;
+
+ + Binutils-&binutils-version; - Pass 1 + + + Binutils + tools, pass 1 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter06/binutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&binutils-ch5p1-sbu;</seg> + <seg>&binutils-ch5p1-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Cross Binutils + + Go back and re-read the notes in the previous section. + Understanding the notes labeled important will save you a lot + of problems later. + + It is important that Binutils be the first package compiled + because both Glibc and GCC perform various tests on the available + linker and assembler to determine which of their own features to + enable. + + The Binutils documentation recommends building Binutils + in a dedicated build directory: + +mkdir -v build +cd build + + + In order for the SBU values listed in the rest of the book + to be of any use, measure the time it takes to build this package from + the configuration, up to and including the first install. To achieve + this easily, wrap the commands in a time + command like this: time { ./configure ... && ... + && make install; }. + + + Now prepare Binutils for compilation: + +../configure --prefix=$LFS/tools \ + --with-sysroot=$LFS \ + --target=$LFS_TGT \ + --disable-nls \ + --disable-werror + + + The meaning of the configure options: + + + --prefix=$LFS/tools + + This tells the configure script to prepare to install the + Binutils programs in the $LFS/tools directory. + + + + + --with-sysroot=$LFS + + For cross compilation, this tells the build system to look in + $LFS for the target system libraries as needed. + + + + + --target=$LFS_TGT + + Because the machine description in the LFS_TGT + variable is slightly different than the value returned by the + config.guess script, this switch will tell the + configure script to adjust Binutil's build system + for building a cross linker. + + + + + --disable-nls + + This disables internationalization as i18n is not needed for the + temporary tools. + + + + + --disable-werror + + This prevents the build from stopping in the event that there + are warnings from the host's compiler. + + + + + + Continue with compiling the package: + +make + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-binutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/binutils-pass2.xml b/chapter06/binutils-pass2.xml new file mode 100644 index 000000000..d88bb84e2 --- /dev/null +++ b/chapter06/binutils-pass2.xml @@ -0,0 +1,94 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-binutils-pass2" role="wrap"> + <?dbhtml filename="binutils-pass2.html"?> + + <sect1info condition="script"> + <productname>binutils-pass2</productname> + <productnumber>&binutils-version;</productnumber> + <address>&binutils-url;</address> + </sect1info> + + <title>Binutils-&binutils-version; - Pass 2 + + + Binutils + tools, pass 2 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/binutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&binutils-ch5p2-sbu;</seg> + <seg>&binutils-ch5p2-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Binutils + + Create a separate build directory again: + +mkdir -v build +cd build + + Prepare Binutils for compilation: + +../configure \ + --prefix=/usr \ + --build=$(../config.guess) \ + --host=$LFS_TGT \ + --disable-nls \ + --enable-shared \ + --disable-werror + + + The meaning of the new configure options: + + + --host=$LFS_TGT + + This tells the configure script that we want to build + this pass of binutils for the $LFS_TGT machine, using our just + built cross-compiler. This prevents the linker from searching + through library directories on the host. + + + + + + Compile the package: + +make + + Install the package: + +make DESTDIR=$LFS install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-binutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/binutils.xml b/chapter06/binutils.xml deleted file mode 100644 index 04dbd199c..000000000 --- a/chapter06/binutils.xml +++ /dev/null @@ -1,436 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-binutils" role="wrap"> - <?dbhtml filename="binutils.html"?> - - <sect1info condition="script"> - <productname>binutils</productname> - <productnumber>&binutils-version;</productnumber> - <address>&binutils-url;</address> - </sect1info> - - <title>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> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&binutils-ch6-sbu;</seg> - <seg>&binutils-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Binutils - - Verify that the PTYs are working properly inside the chroot - environment by performing a simple test: - -expect -c "spawn ls" - - This command should output the following: - -spawn ls - - If, instead, the output includes the message below, then the environment - is not set up for proper PTY operation. This issue needs to be resolved before - running the test suites for Binutils and GCC: - -The system has no more ptys. -Ask your system administrator to create more. - - Now remove one test that prevents the tests from running - to completion, and fix other tests in the gold test suite, which - need to be adjusted for GCC 10: - -sed -i '/@\tincremental_copy/d' gold/testsuite/Makefile.in -patch -Np1 -i ../binutils-&binutils-version;-gcc10_gold_test_fix-1.patch - - The Binutils documentation recommends building Binutils - in a dedicated build directory: - -mkdir -v build -cd build - - Prepare Binutils for compilation: - -../configure --prefix=/usr \ - --enable-gold \ - --enable-ld=default \ - --enable-plugins \ - --enable-shared \ - --disable-werror \ - --enable-64-bit-bfd \ - --with-system-zlib - - The meaning of the configure parameters: - - - --enable-gold - - Build the gold linker and install it as ld.gold (along side the - default linker). - - - - - --enable-ld=default - - Build the original bfd linker and install it as both ld (the - default linker) and ld.bfd. - - - - - --enable-plugins - - Enables plugin support for the linker. - - - - - --enable-64-bit-bfd - - Enables 64-bit support (on hosts with narrower word sizes). - May not be needed on 64-bit systems, but does no harm. - - - - - --with-system-zlib - - Use the installed zlib library rather than building the - included version. - - - - - - Compile the package: - -make tooldir=/usr - - - The meaning of the make parameter: - - - tooldir=/usr - - Normally, the tooldir (the directory where the executables will - ultimately be located) is set to $(exec_prefix)/$(target_alias). For - example, x86_64 machines would expand that to /usr/x86_64-unknown-linux-gnu. Because this is - a custom system, this target-specific directory in /usr is not required. $(exec_prefix)/$(target_alias) 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). - - - - - - - The test suite for Binutils in this section is considered critical. - Do not skip it under any circumstances. - - - Test the results: - -make -k check - - - - Install the package: - -make tooldir=/usr install - - - - - Contents of Binutils - - - Installed programs - Installed libraries - Installed directory - - - addr2line, ar, as, c++filt, dwp, elfedit, gprof, ld, ld.bfd, ld.gold, nm, - objcopy, objdump, ranlib, readelf, size, strings, and strip - libbfd.{a,so} and libopcodes.{a,so} - /usr/lib/ldscripts - - - - - 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 - - - - - - dwp - - The DWARF packaging utility - - dwp - - - - - - elfedit - - Updates the ELF header of ELF files - - elfedit - - - - - - 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 - - - - - - ld.gold - - A cut down version of ld that only supports the - elf object file format - - ld.gold - - - - - - ld.bfd - - Hard link to ld - - ld.bfd - - - - - - 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 - - - - - - libbfd - - The Binary File Descriptor library - - libbfd - - - - - - libctf - - The Compat ANSI-C Type Format debugging support library - - libctf - - - - - - libctf-nobfd - - A libctf variant which does not use libbfd functionality - - libctf-nobfd - - - - - - 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 23b6f0a95..afe84a403 100644 --- a/chapter06/bison.xml +++ b/chapter06/bison.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,22 +16,25 @@ Bison-&bison-version; - + Bison + tools - <para>The Bison package contains a parser generator.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/bison.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&bison-ch6-sbu;</seg> - <seg>&bison-ch6-du;</seg> + <seg>&bison-ch5-sbu;</seg> + <seg>&bison-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -39,103 +42,40 @@ <sect2 role="installation"> <title>Installation of Bison - Prepare Bison for compilation: -./configure --prefix=/usr --docdir=/usr/share/doc/bison-&bison-version; +./configure --prefix=/usr \ + --docdir=/usr/share/doc/bison-&bison-version; - + Compile the package: make - To test the results (about 5.5 SBU), issue: - -make check - - Fourteen tests fail in the "Diagnostics" section, probably because of - missing locales. - - - Install the package: make install - - Contents of Bison - - - Installed programs - Installed library - Installed directory - - - bison and yacc - liby.a - /usr/share/bison - - - - - 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 - - The Yacc library containing implementations of Yacc-compatible - yyerror and main functions; - this library is normally not very useful, but POSIX requires it - - liby - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-bison" role="."/></para> </sect2> diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml index edf2f5bd4..828b7fc0f 100644 --- a/chapter06/bzip2.xml +++ b/chapter06/bzip2.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="ch-system-bzip2" role="wrap"> +<sect1 id="ch-tools-bzip2" role="wrap"> <?dbhtml filename="bzip2.html"?> <sect1info condition="script"> @@ -16,25 +16,25 @@ <title>Bzip2-&bzip2-version; - + Bzip2 + tools - <para>The Bzip2 package contains programs for compressing and decompressing - files. Compressing text files with <command>bzip2</command> yields a much - better compression percentage than with the traditional - <command>gzip</command>.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter06/bzip2.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&bzip2-ch6-sbu;</seg> - <seg>&bzip2-ch6-du;</seg> + <seg>&bzip2-ch5-sbu;</seg> + <seg>&bzip2-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,11 +43,13 @@ <sect2 role="installation"> <title>Installation of Bzip2 - Apply a patch that will install the documentation for this package: + Apply a patch that will install the documentation for this + package: patch -Np1 -i ../&bzip2-docs-patch; - The following command ensures installation of symbolic links are relative: + The following command ensures installation of symbolic links are + relative: sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile @@ -55,9 +57,12 @@ sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile - Prepare Bzip2 for compilation with: + The Bzip2 package does not contain a configure + script. There are two Makefile, one for the shared + library, and the other for the static library. Since we need both, We + do the compilation in two stages. First the shared library: -make -f Makefile-libbz2_so +make CC=$LFS_TGT-gcc -f Makefile-libbz2_so make clean @@ -76,174 +81,31 @@ make clean - Compile and test the package: + Compile and test the package with: -make +make CC=$LFS_TGT-gcc AR=$LFS_TGT-ar RANLIB=$LFS_TGT-ranlib - Install the programs: + Install the package: -make PREFIX=/usr install +make PREFIX=$LFS/usr install Install the shared bzip2 binary into the - /bin directory, make - some necessary symbolic links, and clean up: + /bin directory, make some necessary + symbolic links, and clean up: -cp -v bzip2-shared /bin/bzip2 -cp -av libbz2.so* /lib +cp -v bzip2-shared $LFS/bin/bzip2 +cp -av libbz2.so* $LFS/lib ln -sv ../../lib/libbz2.so.1.0 $LFS/usr/lib/libbz2.so -rm -v /usr/bin/{bunzip2,bzcat,bzip2} -ln -sv bzip2 /bin/bunzip2 -ln -sv bzip2 /bin/bzcat +rm -v $LFS/usr/bin/{bunzip2,bzcat,bzip2} +ln -sv bzip2 $LFS/bin/bunzip2 +ln -sv bzip2 $LFS/bin/bzcat - - Contents of Bzip2 - - - Installed programs - Installed libraries - Installed directory - - - bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp (link to - bzdiff), bzdiff, bzegrep (link to bzgrep), bzfgrep (link to bzgrep), - bzgrep, bzip2, bzip2recover, bzless (link to bzmore), and bzmore - libbz2.{a,so} - /usr/share/doc/bzip2-&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 - - - - - - bzegrep - - Runs egrep on bzipped files - - bzegrep - - - - - - bzfgrep - - Runs fgrep on bzipped files - - bzfgrep - - - - - - bzgrep - - Runs grep on bzipped files - - bzgrep - - - - - - 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 - - - - - + + + <para>Details on this package are located in + <xref linkend="contents-bzip2" role="."/></para> </sect2> diff --git a/chapter06/changingowner.xml b/chapter06/changingowner.xml new file mode 100644 index 000000000..43a902821 --- /dev/null +++ b/chapter06/changingowner.xml @@ -0,0 +1,41 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-changingowner"> + <?dbhtml filename="changingowner.html"?> + + <title>Changing Ownership + + + The commands in the remainder of this book must be performed while + logged in as user root and no + longer as user lfs. Also, double + check that $LFS is set in root's environment. + + + Currently, the whole directory hierarchy in $LFS + is owned by the user lfs, a user + that exists only on the host system. If the directories under $LFS are kept as they are, the files are + owned by a user ID without a corresponding account. This is dangerous because + a user account created later could get this same user ID and would own all + the files under $LFS, thus exposing + these files to possible malicious manipulation. + + To avoid this issue, you could 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. Better yet, change the + ownership of the $LFS/* directories to + user root by running the following + command: + +chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,lib64,tools} + + diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml index 7fc83b374..eadff3cf7 100644 --- a/chapter06/chapter06.xml +++ b/chapter06/chapter06.xml @@ -5,101 +5,30 @@ %general-entities; ]> - + - Installing Basic System Software + Cross Compiling Temporary Tools - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - + + - - - - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/chapter06/check.xml b/chapter06/check.xml deleted file mode 100644 index bd4306b28..000000000 --- a/chapter06/check.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - %general-entities; -]> - - - - - - check - &check-version; -
&check-url;
-
- - Check-&check-version; - - - Check - - - - - - <para>Check is a unit testing framework for C.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&check-ch5-sbu;</seg> - <seg>&check-ch5-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Check - - Prepare Check for compilation: - -./configure --prefix=/usr - - Build the package: - -make - - Compilation is now complete. To run the Check test suite, issue the - following command: - -make check - - Note that the Check test suite may take a relatively long - (up to 4 SBU) time. - - Install the package: - - make docdir=/usr/share/doc/check-&check-version; install - - - - - Contents of Check - - - Installed program - Installed library - - - checkmk - libcheck.{a,so} - - - - - Short Descriptions - - - - - checkmk - - Awk script for generating C unit tests for use with the Check - unit testing framework - - checkmk - - - - - - libcheck.{a,so} - - Contains functions that allow Check to be called from a test - program - - libcheck - - - - - - - - -
diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml new file mode 100644 index 000000000..5b6310af7 --- /dev/null +++ b/chapter06/chroot.xml @@ -0,0 +1,65 @@ + + + %general-entities; +]> + + + + + Entering the Chroot Environment + + Now that all the packages which depend on themselves for being built + are on the system, it is time to enter the chroot environment to finish + installing the remaining temporary tools. This environment will be in use + also for installing the final system. As user root, run the following command to enter the + realm that is, at the moment, populated with only the temporary tools: + +chroot "$LFS" /usr/bin/env -i \ + HOME=/root \ + TERM="$TERM" \ + PS1='(lfs chroot) \u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /bin/bash --login +h + + 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 is not + anymore in the PATH. This means that a temporary tool will no longer be + used once 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. + + Note that the bash prompt will say + I have no name! This is normal because the + /etc/passwd file has not been created yet. + + + It is important that all the commands throughout the remainder of this + chapter and the following chapters are run from within the chroot + environment. If you leave this environment for any reason (rebooting for + example), ensure that the virtual kernel filesystems are mounted as + explained in and and enter chroot again before continuing + with the installation. + + + diff --git a/chapter06/coreutils.xml b/chapter06/coreutils.xml index 5a4079d78..378abebff 100644 --- a/chapter06/coreutils.xml +++ b/chapter06/coreutils.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,23 +16,25 @@ Coreutils-&coreutils-version; - + Coreutils + tools - <para>The Coreutils package contains utilities for showing and setting the - basic system characteristics.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/coreutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&coreutils-ch6-sbu;</seg> - <seg>&coreutils-ch6-du;</seg> + <seg>&coreutils-ch5-sbu;</seg> + <seg>&coreutils-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -41,59 +43,23 @@ <sect2 role="installation"> <title>Installation of Coreutils - POSIX requires that programs from Coreutils recognize character - boundaries correctly even in multibyte locales. The following patch fixes - this non-compliance and other internationalization-related bugs. + Prepare Coreutils for compilation: -patch -Np1 -i ../&coreutils-i18n-patch; - - - In the past, many bugs were found in this patch. When reporting new - bugs to Coreutils maintainers, please check first if they are reproducible - without this patch. - - - - Suppress a test which on some machines can loop forever: - -sed -i '/test.lock/s/^/#/' gnulib-tests/gnulib.mk - - Now prepare Coreutils for compilation: - -autoreconf -fiv -FORCE_UNSAFE_CONFIGURE=1 ./configure \ - --prefix=/usr \ +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) \ + --enable-install-program=hostname \ --enable-no-install-program=kill,uptime The meaning of the configure options: - autoreconf - - This command updates generated configuration files - consistent with the latest version of automake. - - - - - - FORCE_UNSAFE_CONFIGURE=1 - - This environment variable allows the package to be - built as the root user. - - - - - - --enable-no-install-program=kill,uptime + --enable-install-program=hostname - The purpose of this switch is to prevent Coreutils from - installing binaries that will be installed by other packages later. - + This enables the hostname binary to be built + and installed – it is disabled by default but is required by the + Perl test suite. @@ -102,1185 +68,37 @@ FORCE_UNSAFE_CONFIGURE=1 ./configure \ make - Skip down to Install the - package if not running the test suite. - - 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=tester check-root - - We're going to run the remainder of the tests as the - tester user. Certain tests, - however, require that the user be a member of more than one group. So that - these tests are not skipped we'll add a temporary group and make the - user tester a part of it: - -echo "dummy:x:102:tester" >> /etc/group - - Fix some of the permissions so that the non-root user can compile and - run the tests: - -chown -Rv tester . - - Now run the tests: - -su tester -c "PATH=$PATH make RUN_EXPENSIVE_TESTS=yes check" - - - Remove the temporary group: - -sed -i '/dummy/d' /etc/group Install the package: -make install - - Move programs to the locations specified by the FHS: - -mv -v /usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} /bin -mv -v /usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} /bin -mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin -mv -v /usr/bin/chroot /usr/sbin -mv -v /usr/share/man/man1/chroot.1 /usr/share/man/man8/chroot.8 -sed -i s/\"1\"/\"8\"/1 /usr/share/man/man8/chroot.8 - - Some of the scripts in the LFS-Bootscripts package - depend on head, nice, - sleep, and touch. As /usr may not be available during the early and - late stages of booting, those binaries need to be on the root partition to - maintain FHS compliance: +make DESTDIR=$LFS install + + Move programs to their final expected locations. Although this is + not necessary in this temporary environment, we must do so because some + programs harcode executable locations: + +mv -v $LFS/usr/bin/{cat,chgrp,chmod,chown,cp,date,dd,df,echo} $LFS/bin +mv -v $LFS/usr/bin/{false,ln,ls,mkdir,mknod,mv,pwd,rm} $LFS/bin +mv -v $LFS/usr/bin/{rmdir,stty,sync,true,uname} $LFS/bin +mv -v $LFS/usr/bin/chroot $LFS/usr/sbin +mkdir -pv $LFS/usr/share/man/man8 +mv -v $LFS/usr/share/man/man1/chroot.1 $LFS/usr/share/man/man8/chroot.8 +sed -i s/\"1\"/\"8\"/1 $LFS/usr/share/man/man8/chroot.8 +mv -v $LFS/usr/bin/{head,nice,sleep,touch} $LFS/bin - - Contents of Coreutils - - - Installed programs - Installed library - Installed directory - - - [, b2sum, base32, base64, basename, basenc, cat, chcon, 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, id, install, join, link, ln, logname, ls, md5sum, mkdir, - mkfifo, mknod, mktemp, mv, nice, nl, nohup, nproc, numfmt, od, paste, - pathchk, pinky, pr, printenv, printf, ptx, pwd, readlink, realpath, rm, - rmdir, runcon, seq, sha1sum, sha224sum, sha256sum, sha384sum, - sha512sum, shred, shuf, sleep, sort, split, stat, stdbuf, stty, sum, - sync, tac, tail, tee, test, timeout, touch, tr, true, truncate, tsort, - tty, uname, unexpand, uniq, unlink, users, vdir, wc, who, whoami, and - yes - libstdbuf.so (in /usr/libexec/coreutils) - /usr/libexec/coreutils - - - - - Short Descriptions - - - - - base32 - - Encodes and decodes data according to the base32 specification - (RFC 4648) - - base64 - - - - - - base64 - - Encodes and decodes data according to the base64 specification - (RFC 4648) - - base64 - - - - - - b2sum - - Prints or checks BLAKE2 (512-bit) checksums - - b2sum - - - - - - basename - - Strips any path and a given suffix from a file name - - basename - - - - - - basenc - - Encodes or decodes data using various algorithms - - basenc - - - - - - cat - - Concatenates files to standard output - - cat - - - - - - chcon - - Changes security context for files and directories - - chcon - - - - - - chgrp - - Changes the group ownership of files and directories - - 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 files and - directories - - 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 - - - - - - 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 - - - - - - mktemp - - Creates temporary files in a secure manner; it is used in scripts - - mktemp - - - - - - 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 - - - - - - nproc - - Prints the number of processing units available to a - process - - nproc - - - - - - numfmt - - Converts numbers to or from human-readable strings - - numfmt - - - - - - 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 - - - - - - realpath - - Prints the resolved path - - realpath - - - - - - rm - - Removes files or directories - - rm - - - - - - rmdir - - Removes directories if they are empty - - rmdir - - - - - - runcon - - Runs a command with specified security context - - runcon - - - - - - 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 - - - - - - sha224sum - - Prints or checks 224-bit Secure Hash Algorithm checksums - - sha224sum - - - - - - sha256sum - - Prints or checks 256-bit Secure Hash Algorithm checksums - - sha256sum - - - - - - sha384sum - - Prints or checks 384-bit Secure Hash Algorithm checksums - - sha384sum - - - - - - sha512sum - - Prints or checks 512-bit Secure Hash Algorithm checksums - - sha512sum - - - - - - shred - - Overwrites the given files repeatedly with complex patterns, - making it difficult to recover the data - - shred - - - - - - shuf - - Shuffles lines of text - - shuf - - - - - - 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 - - - - - - stdbuf - - Runs commands with altered buffering operations for its standard - streams - - stdbuf - - - - - - 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 - - - - - - timeout - - Runs a command with a time limit - - timeout - - - - - - 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 - - - - - - truncate - - Shrinks or expands a file to the specified size - - truncate - - - - - - 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 - - uniq - - - - - - 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 - - - - - - libstdbuf - - Library used by stdbuf - - libstdbuf - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-coreutils" role="."/></para> </sect2> diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml new file mode 100644 index 000000000..aed8d79da --- /dev/null +++ b/chapter06/createfiles.xml @@ -0,0 +1,204 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-createfiles"> + <?dbhtml filename="createfiles.html"?> + + <title>Creating Essential Files and Symlinks + + + /etc/passwd + + + + /etc/group + + + + /var/run/utmp + + + + /var/log/btmp + + + + /var/log/lastlog + + + + /var/log/wtmp + + + Historically, Linux maintains a list of the mounted file systems in the + file /etc/mtab. Modern kernels maintain this list + internally and exposes it to the user via the /proc filesystem. To satisfy utilities that + expect the presence of /etc/mtab, create the following + symbolic link: + +ln -sv /proc/self/mounts /etc/mtab + + In order for user root to be + able to login and for the name root to be recognized, there + must 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 +bin:x:1:1:bin:/dev/null:/bin/false +daemon:x:6:6:Daemon User:/dev/null:/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/bin/false +EOF + +cat > /etc/passwd << "EOF" +root:x:0:0:root:/root:/bin/bash +bin:x:1:1:bin:/dev/null:/bin/false +daemon:x:6:6:Daemon User:/dev/null:/bin/false +messagebus:x:18:18:D-Bus Message Daemon User:/var/run/dbus:/bin/false +systemd-bus-proxy:x:72:72:systemd Bus Proxy:/:/bin/false +systemd-journal-gateway:x:73:73:systemd Journal Gateway:/:/bin/false +systemd-journal-remote:x:74:74:systemd Journal Remote:/:/bin/false +systemd-journal-upload:x:75:75:systemd Journal Upload:/:/bin/false +systemd-network:x:76:76:systemd Network Management:/:/bin/false +systemd-resolve:x:77:77:systemd Resolver:/:/bin/false +systemd-timesync:x:78:78:systemd Time Synchronization:/:/bin/false +systemd-coredump:x:79:79:systemd Core Dumper:/:/bin/false +nobody:x:99:99:Unprivileged User:/dev/null:/bin/false +EOF + + 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: +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +input:x:24: +mail:x:34: +kvm:x:61: +wheel:x:97: +nogroup:x:99: +users:x:999: +EOF + +cat > /etc/group << "EOF" +root:x:0: +bin:x:1:daemon +sys:x:2: +kmem:x:3: +tape:x:4: +tty:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +adm:x:16: +messagebus:x:18: +systemd-journal:x:23: +input:x:24: +mail:x:34: +kvm:x:61: +systemd-bus-proxy:x:72: +systemd-journal-gateway:x:73: +systemd-journal-remote:x:74: +systemd-journal-upload:x:75: +systemd-network:x:76: +systemd-resolve:x:77: +systemd-timesync:x:78: +systemd-coredump:x:79: +wheel:x:97: +nogroup:x:99: +users:x:999: +EOF + + The created groups are not part of any standard—they are groups + decided on in part by the requirements of the Udev configuration in the next + chapter, and in part by common convention employed by a number of existing + Linux distributions. In addition, some test suites rely on specific users + or groups. The Linux Standard Base (LSB, available at ) 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 programs do not depend on GID numbers, but + rather use the group's name. + + Some tests in need a regular + user. We add this user here and delete this account at the end of that + chapter. + +echo "tester:x:$(ls -n $(tty) | cut -d" " -f3):101::/home/tester:/bin/bash" >> /etc/passwd +echo "tester:x:101:" >> /etc/group +install -o tester -d /home/tester + + To remove the I have no name! prompt, start a new + shell. Since the + /etc/passwd and /etc/group + files have been created, user name and group name resolution will now + work: + +exec /bin/bash --login +h + + 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. To ensure the use of the newly compiled binaries as soon as they are + installed, the +h directive will be used 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/log/{btmp,lastlog,faillog,wtmp} +chgrp -v utmp /var/log/lastlog +chmod -v 664 /var/log/lastlog +chmod -v 600 /var/log/btmp + + 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/faillog file records + failed login attempts. The /var/log/btmp file records + the bad login attempts. + + The /run/utmp file records the users that + are currently logged in. This file is created dynamically in the boot + scripts. + + diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml new file mode 100644 index 000000000..359717ff7 --- /dev/null +++ b/chapter06/creatingdirs.xml @@ -0,0 +1,59 @@ + + + %general-entities; +]> + + + + + Creating Directories + + It is time to create the full structure in the LFS file system. Create + a standard directory tree by issuing the following commands: + +mkdir -pv /{bin,boot,etc/{opt,sysconfig},home,lib/firmware,mnt,opt} +mkdir -pv /{media/{floppy,cdrom},srv,var} +install -dv -m 0750 /root +install -dv -m 1777 /tmp /var/tmp +mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} +mkdir -pv /usr/{,local/}share/{color,dict,doc,info,locale,man} +mkdir -pv /usr/{,local/}share/{misc,terminfo,zoneinfo} +mkdir -pv /usr/{,local/}share/man/man{1..8} + +mkdir -v /var/{log,mail,spool} +ln -sv /run /var/run +ln -sv /run/lock /var/lock +mkdir -pv /var/{opt,cache,lib/{color,misc,locate},local} + + 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 + another user's 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) (available at ). The FHS also specifies + the optional existence of some directories such as /usr/local/games and /usr/share/games. We create only the + directories that are needed. However, feel free to create these + directories. + + + + diff --git a/chapter06/dbus.xml b/chapter06/dbus.xml deleted file mode 100644 index bb4bffc76..000000000 --- a/chapter06/dbus.xml +++ /dev/null @@ -1,241 +0,0 @@ - - - %general-entities; -]> - - - - - - dbus - &dbus-version; -
&dbus-url;
-
- - D-Bus-&dbus-version; - - - D-Bus - - - - - - <para>D-Bus is a message bus system, a simple way for applications to talk - to one another. D-Bus supplies both a system daemon (for events such as - "new hardware device added" or "printer queue changed") and a - per-user-login-session daemon (for general IPC needs among user - applications). Also, the message bus is built on top of a general one-to-one - message passing framework, which can be used by any two applications to - communicate directly (without going through the message bus daemon).</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&dbus-ch6-sbu;</seg> - <seg>&dbus-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of D-Bus - - Prepare D-Bus for compilation: - -./configure --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --disable-static \ - --disable-doxygen-docs \ - --disable-xml-docs \ - --docdir=/usr/share/doc/dbus-&dbus-version; \ - --with-console-auth-dir=/run/console - - - The meaning of the configure options: - - - --with-console-auth-dir=/run/console - - This specifies the location of the ConsoleKit auth - directory. - - - - - - Compile the package: - -make - - This package does come with a test suite, but it requires several - packages that are not included in LFS. Instructions for running the - test suite can be found in the BLFS book at - . - - Install the package: - -make install - - The shared library needs to be moved to - /lib, and as a result the - .so file in - /usr/lib will need to be recreated: - -mv -v /usr/lib/libdbus-1.so.* /lib -ln -sfv ../../lib/$(readlink /usr/lib/libdbus-1.so) /usr/lib/libdbus-1.so - - Create a symlink, so that D-Bus and systemd can use the same - machine-id file: - -ln -sfv /etc/machine-id /var/lib/dbus - - Move the socket file to /run instead of the deprecated - /var/run: - - sed -i 's:/var/run:/run:' /lib/systemd/system/dbus.socket - - - - - Contents of D-Bus - - - Installed programs - Installed libraries - Installed directories - - - dbus-cleanup-sockets, dbus-daemon, dbus-launch, dbus-monitor, - dbus-run-session, dbus-send, dbus-test-tool, - dbus-update-activation-environment, and dbus-uuidgen - libdbus-1.{a,so} - /etc/dbus-1, /usr/include/dbus-1.0, /usr/lib/dbus-1.0, - /usr/share/dbus-1, /usr/share/doc/dbus-&dbus-version;, - and /var/lib/dbus - - - - - Short Descriptions - - - - - dbus-cleanup-sockets - - Used to clean up leftover sockets in a directory - - dbus-cleanup-sockets - - - - - - dbus-daemon - - The D-Bus message bus daemon - - dbus-daemon - - - - - - dbus-launch - - Starts dbus-daemon from a shell - script - - dbus-launch - - - - - - dbus-monitor - - Monitors messages passing through a D-Bus message bus - - dbus-monitor - - - - - - dbus-run-session - - Starts a session bus instance of dbus-daemon - from a shell script and starts a specified program in that - session - - dbus-run-session - - - - - - dbus-send - - Sends a message to a D-Bus message bus - - dbus-send - - - - - - dbus-test-tool - - A tool to help packages test - D-Bus - - dbus-test-tool - - - - - - - dbus-update-activation-environment - - Updates environment variables that will be set for - D-Bus session services - - dbus-update-activation-environment - - - - - - dbus-uuidgen - - Generates a universally unique ID - - dbus-uuidgen - - - - - - libdbus-1 - - Contains API functions used to communicate with the D-Bus - message bus - - libdbus-1 - - - - - - - - -
diff --git a/chapter06/dejagnu.xml b/chapter06/dejagnu.xml new file mode 100644 index 000000000..8f1ab7648 --- /dev/null +++ b/chapter06/dejagnu.xml @@ -0,0 +1,96 @@ + + + %general-entities; +]> + + + + + + dejagnu + &dejagnu-version; +
&dejagnu-url;
+
+ + DejaGNU-&dejagnu-version; + + + DejaGNU + + + + + + <para>The <application>DejaGnu</application> package contains a framework for running test + suites on GNU tools. It is written in <command>expect</command>, which itself + uses <application>Tcl</application> (Tool Command Language).</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&dejagnu-ch5-sbu;</seg> + <seg>&dejagnu-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of DejaGNU + + Prepare DejaGNU for compilation: + +./configure --prefix=/usr +makeinfo --html --no-split -o doc/dejagnu.html doc/dejagnu.texi +makeinfo --plaintext -o doc/dejagnu.txt doc/dejagnu.texi + + Build and install the package: + +make install +install -v -dm755 /usr/share/doc/dejagnu-&dejagnu-version; +install -v -m644 doc/dejagnu.{html,txt} \ + /usr/share/doc/dejagnu-&dejagnu-version; + + To test the results, issue: + +make check + + + + + + Contents of DejaGNU + + + Installed program + + + runtest + + + + + Short Descriptions + + + + + runtest + + A wrapper script that locates the proper + expect shell and then runs DejaGNU + + runtest + + + + + + + + +
diff --git a/chapter06/diffutils.xml b/chapter06/diffutils.xml index 0d8bd5c77..6594058be 100644 --- a/chapter06/diffutils.xml +++ b/chapter06/diffutils.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,23 +16,25 @@ Diffutils-&diffutils-version; - + Diffutils + tools - <para>The Diffutils package contains programs that show the differences - between files or directories.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/diffutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&diffutils-ch6-sbu;</seg> - <seg>&diffutils-ch6-du;</seg> + <seg>&diffutils-ch5-sbu;</seg> + <seg>&diffutils-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,82 +45,23 @@ <para>Prepare Diffutils for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> - -<screen><userinput remap="test">make check</userinput></screen> - <para>Install the package:</para> -<screen><userinput remap="install">make install</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> </sect2> + <sect2 role="content"> + <title/> - <sect2 id="contents-diffutils" role="content"> - <title>Contents of Diffutils - - - 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 - - - - - + Details on this package are located in + diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml deleted file mode 100644 index 984ba6db9..000000000 --- a/chapter06/e2fsprogs.xml +++ /dev/null @@ -1,541 +0,0 @@ - - - %general-entities; -]> - - - - - - e2fsprogs - &e2fsprogs-version; -
&e2fsprogs-url;
-
- - 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> and - <systemitem class="filesystem">ext4</systemitem> journaling - file systems.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&e2fsprogs-ch6-sbu;</seg> - <seg>&e2fsprogs-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of E2fsprogs - - The E2fsprogs documentation recommends that the package be built in - a subdirectory of the source tree: - -mkdir -v build -cd build - - Prepare E2fsprogs for compilation: - -../configure --prefix=/usr \ - --bindir=/bin \ - --with-root-prefix="" \ - --enable-elf-shlibs \ - --disable-libblkid \ - --disable-libuuid \ - --disable-uuidd \ - --disable-fsck - - - The meaning of the environment variable and configure options: - - - --with-root-prefix="" and - --bindir=/bin - - Certain programs (such as the e2fsck - program) are considered essential programs. When, for example, - /usr is not mounted, these - programs still 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. - - - - - --enable-elf-shlibs - - This creates the shared libraries which some programs - in this package use. - - - - - --disable-* - - This prevents E2fsprogs from building and installing the - libuuid and - libblkid libraries, the - uuidd daemon, and the - fsck wrapper, as Util-Linux installs more - recent versions. - - - - - - Compile the package: - -make - - To run the tests, issue: - -make check - - One of the E2fsprogs tests will attempt to allocate 256 MB of memory. - If you do not have significantly more RAM than this, be sure to enable - sufficient swap space for the test. See and - for details on creating and enabling swap space. - - Install the package: - -make install - - Make the installed static libraries writable so debugging symbols can - be removed later: - -chmod -v u+w /usr/lib/{libcom_err,libe2p,libext2fs,libss}.a - - This package installs a gzipped - .info file but doesn't update the - system-wide dir file. Unzip this file and then update - the system dir file using the following - commands: - -gunzip -v /usr/share/info/libext2fs.info.gz -install-info --dir-file=/usr/share/info/dir /usr/share/info/libext2fs.info - - If desired, create and install some additional documentation by - issuing the following commands: - -makeinfo -o doc/com_err.info ../lib/et/com_err.texinfo -install -v -m644 doc/com_err.info /usr/share/info -install-info --dir-file=/usr/share/info/dir /usr/share/info/com_err.info - - - - Contents of E2fsprogs - - - Installed programs - Installed libraries - Installed directories - - - badblocks, chattr, compile_et, debugfs, dumpe2fs, e2freefrag, - e2fsck, e2image, e2label, e2mmpstatus, e2scrub, e2scrub_all, e2undo, - e4crypt, e4defrag, filefrag, fsck.ext2, - fsck.ext3, fsck.ext4, logsave, lsattr, mk_cmds, mke2fs, - mkfs.ext2, mkfs.ext3, mkfs.ext4, mklost+found, - resize2fs, and tune2fs - libcom_err.so, libe2p.so, libext2fs.so, and libss.so - /usr/include/e2p, /usr/include/et, /usr/include/ext2fs, - /usr/include/ss, /usr/lib/e2fsprogs, /usr/share/et, and - /usr/share/ss - - - - - Short Descriptions - - - - - badblocks - - Searches a device (usually a disk partition) for bad - blocks - - badblocks - - - - - - 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 - - - - - - e2freefrag - - Reports free space fragmentation information - - e2freefrag - - - - - - 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 - - - - - - e2mmpstatus - - Checks MMP status of an ext4 filesystem - - e2mmpstatus - - - - - - e2scrub - - Checks the contents of a mounted ext[234] filesystem - - e2scrub - - - - - - e2scrub_all - - Checks all mounted ext[234] filesystems for errors - - e2scrub_all - - - - - - e2undo - - Replays the undo log undo_log for an ext2/ext3/ext4 filesystem - found on a device [This can be used to undo a failed operation by an - e2fsprogs program.] - - e2undo - - - - - - e4crypt - - Ext4 filesystem encryption utility - - e4crypt - - - - - - e4defrag - - Online defragmenter for ext4 filesystems - - e4defrag - - - - - - filefrag - - Reports on how badly fragmented a particular file might be - - filefrag - - - - - - fsck.ext2 - - By default checks ext2 - file systems and is a hard link to e2fsck - - fsck.ext2 - - - - - - fsck.ext3 - - By default checks ext3 - file systems and is a hard link to e2fsck - - fsck.ext3 - - - - - - fsck.ext4 - - By default checks ext4 - file systems and is a hard link to e2fsck - - fsck.ext4 - - - - - - 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 help messages into a C - source file suitable for use with the libss subsystem library - - mk_cmds - - - - - - mke2fs - - Creates an ext2 - or ext3 file system on - the given device - - mke2fs - - - - - - mkfs.ext2 - - By default creates ext2 - file systems and is a hard link to mke2fs - - mkfs.ext2 - - - - - - mkfs.ext3 - - By default creates ext3 - file systems and is a hard link to mke2fs - - mkfs.ext3 - - - - - - mkfs.ext4 - - By default creates ext4 - file systems and is a hard link to mke2fs - - mkfs.ext4 - - - - - - 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 - - - - - - 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 - - - - - - - - -
diff --git a/chapter06/eudev.xml b/chapter06/eudev.xml deleted file mode 100644 index 71511c3e7..000000000 --- a/chapter06/eudev.xml +++ /dev/null @@ -1,191 +0,0 @@ - - - %general-entities; -]> - - - - - - eudev - &eudev-version; -
&eudev-url;
-
- - Eudev-&eudev-version; - - - Eudev - - - - - - <para>The Eudev package contains programs for dynamic creation of device - nodes.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&eudev-ch6-sbu;</seg> - <seg>&eudev-ch6-du;</seg> - </seglistitem> - </segmentedlist> - </sect2> - - <sect2 role="installation"> - <title>Installation of Eudev - - - - Prepare Eudev for compilation: - -./configure --prefix=/usr \ - --bindir=/sbin \ - --sbindir=/sbin \ - --libdir=/usr/lib \ - --sysconfdir=/etc \ - --libexecdir=/lib \ - --with-rootprefix= \ - --with-rootlibdir=/lib \ - --enable-manpages \ - --disable-static - - Compile the package: - -make - - Create some directories now that are needed for tests, but - will also be used as a part of installation: - -mkdir -pv /lib/udev/rules.d -mkdir -pv /etc/udev/rules.d - - To test the results, issue: - -make check - - Install the package: - -make install - - Install some custom rules and support files useful in an LFS - environment: - -tar -xvf ../&udev-lfs-version;.tar.xz -make -f &udev-lfs-version;/Makefile.lfs install - - - - - Configuring Eudev - - - Eudev - configuring - - - - /etc/udev/hwdb.bin - - - Information about hardware devices is maintained in the - /etc/udev/hwdb.d and - /lib/udev/hwdb.d directories. - Eudev needs that information to be compiled - into a binary database /etc/udev/hwdb.bin. Create the - initial database: - -udevadm hwdb --update - - This command needs to be run each time the hardware information is - updated. - - - - - Contents of Eudev - - - Installed programs - Installed libraries - Installed directories - - - udevadm and udevd - - libudev.so - - /etc/udev, /lib/udev, and /usr/share/doc/udev-&udev-lfs-version; - - - - - Short Descriptions - - - - udevadm - - Generic udev administration tool: controls the udevd daemon, - provides info from the Udev database, monitors uevents, waits for - uevents to finish, tests Udev configuration, and triggers uevents - for a given device - - udevadm - - - - - - udevd - - A daemon that listens for uevents on the netlink socket, - creates devices and runs the configured external programs in - response to these uevents - - udevd - - - - - - libudev - - A library interface to udev device information - - libudev - - - - - - /etc/udev - - Contains Udev configuration files, - device permissions, and rules for device naming - - /etc/udev - - - - - - - - -
diff --git a/chapter06/expat.xml b/chapter06/expat.xml deleted file mode 100644 index df9f709c9..000000000 --- a/chapter06/expat.xml +++ /dev/null @@ -1,117 +0,0 @@ - - - %general-entities; -]> - - - - - - expat - &expat-version; -
&expat-url;
-
- - Expat-&expat-version; - - - Expat - - - - - - <para>The Expat package contains a stream oriented C library for - parsing XML.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&expat-ch6-sbu;</seg> - <seg>&expat-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Expat - - First fix a problem with the regression tests in the LFS environment: - -sed -i 's|usr/bin/env |bin/|' run.sh.in - - Prepare Expat for compilation: - -./configure --prefix=/usr \ - --disable-static \ - --docdir=/usr/share/doc/expat-&expat-version; - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install - - If desired, install the documentation: - -install -v -m644 doc/*.{html,png,css} /usr/share/doc/expat-&expat-version; - - - - - Contents of Expat - - - Installed program - Installed libraries - Installed directory - - - xmlwf - libexpat.so - /usr/share/doc/expat-&expat-version; - - - - - Short Descriptions - - - - - xmlwf - - Is a non-validating utility to check whether or not - XML documents are well formed - - xmlwf - - - - - - libexpat - - Contains API functions for parsing XML - - libexpat - - - - - - - - -
diff --git a/chapter06/expect.xml b/chapter06/expect.xml new file mode 100644 index 000000000..20b227ea5 --- /dev/null +++ b/chapter06/expect.xml @@ -0,0 +1,139 @@ + + + %general-entities; +]> + + + + + + expect + &expect-version; +
&expect-url;
+
+ + Expect-&expect-version; + + + Expect + + + + + + <para>The <application>Expect</application> package contains tools for + automating, via scripted dialogues, interactive applications such as + <command>telnet</command>, <command>ftp</command>, + <command>passwd</command>, <command>fsck</command>, + <command>rlogin</command>, and <command>tip</command>. + <application>Expect</application> is also useful for testing these same + applications as well as easing all sorts of tasks that are prohibitively + difficult with anything else. The <application>DejaGnu</application> + framework is written in <application>Expect</application>.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&expect-ch5-sbu;</seg> + <seg>&expect-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Expect + + Prepare Expect for compilation: + + +./configure --prefix=/usr \ + --with-tcl=/usr/lib \ + --enable-shared \ + --mandir=/usr/share/man \ + --with-tclinclude=/usr/include + + + The meaning of the configure options: + + + --with-tcl=/usr/lib + + This parameter is needed to tell the + configure where the + tclConfig.sh is located. + + + + + --with-tclinclude=/usr/include + + This explicitly tells Expect where to find Tcl's internal + headers. Using this option avoids conditions where + configure fails because it cannot automatically + discover the location of Tcl's headers. + + + + + + Build the package: + +make + + Install the package: + +make install +ln -svf expect&expect-version;/libexpect&expect-version;.so /usr/lib + + + + + Contents of Expect + + + Installed program + Installed library + + + expect + libexpect-&expect-lib-version;.so + + + + + Short Descriptions + + + + + expect + + Communicates with other interactive programs according + to a script + + expect + + + + + + libexpect-&expect-lib-version;.so + + Contains functions that allow Expect to be used as a Tcl + extension or to be used directly from C or C++ (without Tcl) + + libexpect-&expect-lib-version; + + + + + + + + +
diff --git a/chapter06/file.xml b/chapter06/file.xml index b5e28f244..83a473b70 100644 --- a/chapter06/file.xml +++ b/chapter06/file.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,23 +16,25 @@ File-&file-version; - + File + tools - <para>The File package contains a utility for determining the type of a given - file or files.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/file.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&file-ch6-sbu;</seg> - <seg>&file-ch6-du;</seg> + <seg>&file-ch5-sbu;</seg> + <seg>&file-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,65 +45,28 @@ <para>Prepare File for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr \ + --host=$LFS_TGT</userinput></screen> +<!-- devs: if using - -build here, the build system wants to compile + the signature file with "file" on the build system, but stops if it is not + the same version. One possibility would be to build "file" on the build + system first, but it is simpler to have the system think it is not + cross-compiling, and use the just built "file". --> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> - -<screen><userinput remap="test">make check</userinput></screen> - <para>Install the package:</para> -<screen><userinput remap="install">make install</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> </sect2> - - <sect2 id="contents-file" role="content"> - <title>Contents of File - - - Installed programs - Installed library - - - file - libmagic.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 - - - - - + + + <para>Details on this package are located in<!-- TODO + <xref linkend="contents-file" role="."/> --></para> </sect2> diff --git a/chapter06/findutils.xml b/chapter06/findutils.xml index 37393f0de..bf9f9c62a 100644 --- a/chapter06/findutils.xml +++ b/chapter06/findutils.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="ch-system-findutils" role="wrap"> +<sect1 id="ch-tools-findutils" role="wrap"> <?dbhtml filename="findutils.html"?> <sect1info condition="script"> @@ -16,25 +16,25 @@ <title>Findutils-&findutils-version; - + Findutils + tools - <para>The Findutils package contains programs to find files. These programs - are provided to recursively search through a directory tree and to - create, maintain, and search a database (often faster than the recursive - find, but unreliable if the database has not been recently updated).</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/findutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&findutils-ch6-sbu;</seg> - <seg>&findutils-ch6-du;</seg> + <seg>&findutils-ch5-sbu;</seg> + <seg>&findutils-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -45,116 +45,30 @@ <para>Prepare Findutils for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr --localstatedir=/var/lib/locate</userinput></screen> - - <variablelist> - <title>The meaning of the configure options: - - - --localstatedir - - This option changes the location of the locate - database to be in /var/lib/locate, - which is FHS-compliant. - - - - +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) Compile the package: make - To test the results, issue: - -chown -Rv tester . -su tester -c "PATH=$PATH make check" - Install the package: -make install - - Some of the scripts in the LFS-Bootscripts package - depend on find. As /usr may not be available during the early - stages of booting, this program needs to be on the root partition. The - updatedb script also needs to be modified to correct an - explicit path: +make DESTDIR=$LFS install - Some packages in BLFS and beyond expect the - find program in /bin, so make sure it's placed there: + Move the excutable to its final expected location: -mv -v /usr/bin/find /bin -sed -i 's|find:=${BINDIR}|find:=/bin|' /usr/bin/updatedb +mv -v $LFS/usr/bin/find $LFS/bin +sed -i 's|find:=${BINDIR}|find:=/bin|' $LFS/usr/bin/updatedb - - Contents of Findutils - - - Installed programs - Installed directory - - - find, locate, updatedb, and xargs - /var/lib/locate - - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="find"> - <term><command>find</command></term> - <listitem> - <para>Searches given directory trees for files matching the specified - criteria</para> - <indexterm zone="ch-system-findutils find"> - <primary sortas="b-find">find</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="locate"> - <term><command>locate</command></term> - <listitem> - <para>Searches through a database of file names and reports the names - that contain a given string or match a given pattern</para> - <indexterm zone="ch-system-findutils locate"> - <primary sortas="b-locate">locate</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="updatedb"> - <term><command>updatedb</command></term> - <listitem> - <para>Updates the <command>locate</command> database; it scans the - entire file system (including other file systems that are currently - mounted, unless told not to) and puts every file name it finds into - the database</para> - <indexterm zone="ch-system-findutils updatedb"> - <primary sortas="b-updatedb">updatedb</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="xargs"> - <term><command>xargs</command></term> - <listitem> - <para>Can be used to apply a given command to a list of files</para> - <indexterm zone="ch-system-findutils xargs"> - <primary sortas="b-xargs">xargs</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-findutils" role="."/></para> </sect2> diff --git a/chapter06/flex.xml b/chapter06/flex.xml index bd4bd545f..88e263413 100644 --- a/chapter06/flex.xml +++ b/chapter06/flex.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="ch-system-flex" role="wrap"> +<sect1 id="ch-tools-flex" role="wrap"> <?dbhtml filename="flex.html"?> <sect1info condition="script"> @@ -16,23 +16,25 @@ <title>Flex-&flex-version; - + Flex + tools - <para>The Flex package contains a utility for generating programs that - recognize patterns in text.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter06/flex.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&flex-ch6-sbu;</seg> - <seg>&flex-ch6-du;</seg> + <seg>&flex-ch5-sbu;</seg> + <seg>&flex-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -41,108 +43,45 @@ <sect2 role="installation"> <title>Installation of Flex - - Prepare Flex for compilation: - -./configure --prefix=/usr --docdir=/usr/share/doc/flex-&flex-version; +./configure --prefix=/usr \ + --docdir=/usr/share/doc/flex-&flex-version; + Compile the package: make - To test the results (about 0.5 SBU), issue: - -make check - Install the package: make install - A few programs do not know about flex yet and - try to run its predecessor, lex. To support those - programs, create a symbolic link named lex that - runs flex in lex emulation - mode: - -ln -sv flex /usr/bin/lex - - - Contents of Flex - - - Installed programs - Installed libraries - Installed directory - - - flex, flex++ (link to flex), and lex (link to flex) - libfl.so - /usr/share/doc/flex-&flex-version; - - - - - 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++ - - An extension of flex, is used for generating C++ code - and classes. It is a symbolic link to flex - - flex++ - - - - - - lex - - A symbolic link that runs flex in - lex emulation mode - - lex - - - - - - libfl - - The flex library - - libfl - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-flex" role="."/></para> </sect2> diff --git a/chapter06/gawk.xml b/chapter06/gawk.xml index b112eb10d..105abdb8e 100644 --- a/chapter06/gawk.xml +++ b/chapter06/gawk.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="ch-system-gawk" role="wrap"> +<sect1 id="ch-tools-gawk" role="wrap"> <?dbhtml filename="gawk.html"?> <sect1info condition="script"> @@ -16,22 +16,25 @@ <title>Gawk-&gawk-version; - + Gawk + tools - <para>The Gawk package contains programs for manipulating text files.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/gawk.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&gawk-ch6-sbu;</seg> - <seg>&gawk-ch6-du;</seg> + <seg>&gawk-ch5-sbu;</seg> + <seg>&gawk-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -46,82 +49,25 @@ <para>Prepare Gawk for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(./config.guess)</userinput></screen> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> - -<screen><userinput remap="test">make check</userinput></screen> - <para>Install the package:</para> -<screen><userinput remap="install">make install</userinput></screen> - - <para>If desired, install the documentation:</para> - -<screen><userinput remap="install">mkdir -v /usr/share/doc/gawk-&gawk-version; -cp -v doc/{awkforai.txt,*.{eps,pdf,jpg}} /usr/share/doc/gawk-&gawk-version;</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> </sect2> - <sect2 id="contents-gawk" role="content"> - <title>Contents of Gawk - - - Installed programs - Installed libraries - Installed directories - - - awk (link to gawk), gawk, and awk-&gawk-version; - filefuncs.so, fnmatch.so, fork.so, inplace.so, intdiv.so, ordchr.so, - readdir.so, readfile.so, revoutput.so, revtwoway.so, rwarray.so, - and time.so (all in /usr/lib/gawk) - /usr/lib/gawk, /usr/libexec/awk, /usr/share/awk, and - /usr/share/doc/gawk-&gawk-version; - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="awk"> - <term><command>awk</command></term> - <listitem> - <para>A link to <command>gawk</command></para> - <indexterm zone="ch-system-gawk awk"> - <primary sortas="b-awk">awk</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="gawk"> - <term><command>gawk</command></term> - <listitem> - <para>A program for manipulating text files; it is the GNU - implementation of <command>awk</command></para> - <indexterm zone="ch-system-gawk gawk"> - <primary sortas="b-gawk">gawk</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="gawk-version"> - <term><command>gawk-&gawk-version;</command></term> - <listitem> - <para>A hard link to <command>gawk</command></para> - <indexterm zone="ch-system-gawk gawk-version"> - <primary sortas="b-gawk-&gawk-version;">gawk-&gawk-version;</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-gawk" role="."/></para> </sect2> diff --git a/chapter06/gcc-pass1.xml b/chapter06/gcc-pass1.xml new file mode 100644 index 000000000..1bd308f09 --- /dev/null +++ b/chapter06/gcc-pass1.xml @@ -0,0 +1,208 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gcc-pass1" role="wrap" xreflabel="gcc-pass1"> + <?dbhtml filename="gcc-pass1.html"?> + + <sect1info condition="script"> + <productname>gcc-pass1</productname> + <productnumber>&gcc-version;</productnumber> + <address>&gcc-url;</address> + </sect1info> + + <title>GCC-&gcc-version; - Pass 1 + + + GCC + tools, pass 1 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter06/gcc.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gcc-ch5p1-sbu;</seg> + <seg>&gcc-ch5p1-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Cross GCC + + GCC requires the GMP, MPFR and MPC packages. As these packages may + not be included in your host distribution, they will be built with + GCC. Unpack each package into the GCC source directory and rename the + resulting directories so the GCC build procedures will automatically + use them: + + There are frequent misunderstandings about this chapter. The + procedures are the same as every other chapter as explained earlier (). First extract the gcc tarball from the sources + directory and then change to the directory created. Only then should you + proceed with the instructions below. + +tar -xf ../mpfr-&mpfr-version;.tar.xz +mv -v mpfr-&mpfr-version; mpfr +tar -xf ../gmp-&gmp-version;.tar.xz +mv -v gmp-&gmp-version; gmp +tar -xf ../mpc-&mpc-version;.tar.gz +mv -v mpc-&mpc-version; mpc + + On x86_64 hosts, set the default directory name for + 64-bit libraries to lib: + +case $(uname -m) in + x86_64) + sed -e '/m64=/s/lib64/lib/' \ + -i.orig gcc/config/i386/t-linux64 + ;; +esac + + The GCC documentation recommends building GCC + in a dedicated build directory: + +mkdir -v build +cd build + + Prepare GCC for compilation: + +../configure \ + --target=$LFS_TGT \ + --prefix=$LFS/tools \ + --with-glibc-version=2.11 \ + --with-sysroot=$LFS \ + --with-newlib \ + --without-headers \ + --enable-initfini-array \ + --disable-nls \ + --disable-shared \ + --disable-multilib \ + --disable-decimal-float \ + --disable-threads \ + --disable-libatomic \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-libssp \ + --disable-libvtv \ + --disable-libstdcxx \ + --enable-languages=c,c++ + + The meaning of the configure options: + + + --with-glibc-version=2.11 + + This option ensures the package will be compatible with the host's + version of glibc. It is set to the minimum glibc requirement + specified in the . + + + + + --with-newlib + + Since a working C library is not yet available, this ensures + that the inhibit_libc constant is defined when building libgcc. This prevents + the compiling of any code that requires libc support. + + + + + --without-headers + + When creating a complete cross-compiler, GCC requires + standard headers compatible with the target system. For our + purposes these headers will not be needed. This switch prevents + GCC from looking for them. + + + + + --disable-shared + + This switch forces GCC to link its internal libraries + statically. We need this because the shared libraries require glibc, + which is not yet installed on the target system. + + + + + --disable-decimal-float, --disable-threads, + --disable-libatomic, --disable-libgomp, + --disable-libquadmath, --disable-libssp, --disable-libvtv, + --disable-libstdcxx + + These switches disable support for the decimal floating point + extension, threading, libatomic, libgomp, libquadmath, libssp, + libvtv, and the C++ standard library respectively. These features + will fail to compile when building a cross-compiler and are not + necessary for the task of cross-compiling the temporary libc. + + + + + --disable-multilib + + On x86_64, LFS does not yet support a multilib configuration. + This switch is harmless for x86. + + + + + --enable-languages=c,c++ + + This option ensures that only the C and C++ compilers are built. + These are the only languages needed now. + + + + + + Compile GCC by running: + +make + + Install the package: + + make install + + This build of GCC has installed a couple of internal system + headers. Normally one of them, limits.h, would in turn + include the corresponding system limits.h header, in + this case, $LFS/usr/include/limits.h. However, at the + time of this build of gcc $LFS/usr/include/limits.h + does not exist, so the internal header that has just been installed is a + partial, self-contained file and does not include the extended features of + the system header. This is adequate for building glibc, but the full + internal header will be needed later. Create a full version of the internal + header using a command that is identical to what the GCC build system does + in normal circumstances: + +cd .. +cat gcc/limitx.h gcc/glimits.h gcc/limity.h > \ + `dirname $($LFS_TGT-gcc -print-libgcc-file-name)`/install-tools/include/limits.h + + + + + + <para>Details on this package are located in + <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/gcc-pass2.xml b/chapter06/gcc-pass2.xml new file mode 100644 index 000000000..7f7d7a021 --- /dev/null +++ b/chapter06/gcc-pass2.xml @@ -0,0 +1,160 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gcc-pass2" role="wrap"> + <?dbhtml filename="gcc-pass2.html"?> + + <sect1info condition="script"> + <productname>gcc-pass2</productname> + <productnumber>&gcc-version;</productnumber> + <address>&gcc-url;</address> + </sect1info> + + <title>GCC-&gcc-version; - Pass 2 + + + GCC + tools, pass 2 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/gcc.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gcc-ch5p2-sbu;</seg> + <seg>&gcc-ch5p2-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of GCC + + As in the first build of GCC, the GMP, MPFR, and MPC packages are + required. Unpack the tarballs and move them into the required directory + names: + +tar -xf ../mpfr-&mpfr-version;.tar.xz +mv -v mpfr-&mpfr-version; mpfr +tar -xf ../gmp-&gmp-version;.tar.xz +mv -v gmp-&gmp-version; gmp +tar -xf ../mpc-&mpc-version;.tar.gz +mv -v mpc-&mpc-version; mpc + + If building on x86_64, change the default directory name for 64-bit + libraries to lib: + +case $(uname -m) in + x86_64) + sed -e '/m64=/s/lib64/lib/' \ + -i.orig gcc/config/i386/t-linux64 + ;; +esac + + Fix an issue with GCC-10.1 when building with a cross + compiler: + +patch -Np1 -i ../&gcc-cross-patch; + + Create a separate build directory again: + +mkdir -v build +cd build + + Create a symlink that allos libgcc to be built with posix threads + support: + +mkdir -pv $LFS_TGT/libgcc +ln -s ../../../libgcc/gthr-posix.h $LFS_TGT/libgcc/gthr-default.h + + Before starting to build GCC, remember to unset any environment + variables that override the default optimization flags. + + Now prepare GCC for compilation: + +../configure \ + --build=$(../config.guess) \ + --host=$LFS_TGT \ + --prefix=/usr \ + CC_FOR_TARGET=$LFS_TGT-gcc \ + --with-build-sysroot=$LFS \ + --enable-initfini-array \ + --disable-nls \ + --disable-multilib \ + --disable-decimal-float \ + --disable-libatomic \ + --disable-libgomp \ + --disable-libquadmath \ + --disable-libssp \ + --disable-libvtv \ + --disable-libstdcxx \ + --enable-languages=c,c++ + + + The meaning of the new configure options: + + + -with-build-sysroot=$LFS + + Normally, using --host= ensures that + a cross-compiler is used for building gcc, and that compiler knows + that it has to look for headers and libraries in $LFS. But the build system of GCC uses + other tools, which are not aware of this location. This switch is + needed to have them find the needed files in $LFS, and not on the host. + + + + + --enable-initfini-array + + This option is automatically enabled when building a native + compiler with a native compiler on x86. But here, we build with + a cross compiler, so we need to explicitely set this option. + + + + + + Compile the package: + +make + + Install the package: + +make DESTDIR=$LFS install + + As a finishing touch, create a symlink. Many programs and scripts + run cc instead of gcc, which is + used to keep programs generic and therefore usable on all kinds of UNIX + systems where the GNU C compiler is not always installed. Running + cc leaves the system administrator free to decide + which C compiler to install: + +ln -sv gcc $LFS/usr/bin/cc + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml deleted file mode 100644 index 9e4c53ec5..000000000 --- a/chapter06/gcc.xml +++ /dev/null @@ -1,626 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-gcc" role="wrap"> - <?dbhtml filename="gcc.html"?> - - <sect1info condition="script"> - <productname>gcc</productname> - <productnumber>&gcc-version;</productnumber> - <address>&gcc-url;</address> - </sect1info> - - <title>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> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&gcc-ch6-sbu;</seg> - <seg>&gcc-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of GCC - - If building on x86_64, change the default directory name for 64-bit - libraries to lib: - -case $(uname -m) in - x86_64) - sed -e '/m64=/s/lib64/lib/' \ - -i.orig gcc/config/i386/t-linux64 - ;; -esac - - The GCC documentation recommends building GCC in a dedicated build directory: - -mkdir -v build -cd build - - Prepare GCC for compilation: - -../configure --prefix=/usr \ - LD=ld \ - --enable-languages=c,c++ \ - --disable-multilib \ - --disable-bootstrap \ - --with-system-zlib - - Note that for other languages, there are some prerequisites that - are not yet available. See the - BLFS Book - for instructions on how to build all of GCC's supported languages. - - - The meaning of the new configure parameter: - - - --with-system-zlib - - This switch tells GCC to link to the system installed copy of - the Zlib library, rather than its own internal copy. - - - - - Compile the package: - -make - - - In this section, the test suite for GCC is considered - critical. Do not skip it under any circumstance. - - - One set of tests in the GCC test suite is known to exhaust the stack, - so increase the stack size prior to running the tests: - -ulimit -s 32768 - - Test the results as a non-privileged user, but do not stop at errors: - -chown -Rv tester . -su tester -c "PATH=$PATH make -k check" - - To receive a summary of the test suite results, run: - -../contrib/test_summary - - For only the summaries, pipe the output through - grep -A7 Summ. - - Results can be compared with those located at and - . - - Six tests related to get_time are known to fail. These are - apparently related to the en_HK locale. - - Two tests named lookup.cc and reverse.cc in experimental/net - are known to fail in LFS chroot environment because they require - /etc/hosts and iana-etc. - - A few unexpected failures cannot always be avoided. The GCC developers - are usually aware of these issues, but have not resolved them yet. - Unless the test results are vastly different from those at the above URL, - it is safe to continue. - - - - Install the package and remove an unneeded directory: - -make install -rm -rf /usr/lib/gcc/$(gcc -dumpmachine)/&gcc-version;/include-fixed/bits/ - - The GCC build directory is owned by - tester now and the ownership of the installed header - directory (and its content) will be incorrect. Change the ownership to - root user and group: - -chown -v -R root:root \ - /usr/lib/gcc/*linux-gnu/&gcc-version;/include{,-fixed} - - Create a symlink required by the FHS - for "historical" reasons. - -ln -sv ../usr/bin/cpp /lib - - Add a compatibility symlink to enable building programs with - Link Time Optimization (LTO): - -install -v -dm755 /usr/lib/bfd-plugins -ln -sfv ../../libexec/gcc/$(gcc -dumpmachine)/&gcc-version;/liblto_plugin.so \ - /usr/lib/bfd-plugins/ - - Now that our final toolchain is in place, it is important to again ensure - that compiling and linking will work as expected. We do this by performing - the same sanity checks as we did earlier in the chapter: - - - - - - - - - - - - - -/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crt1.o succeeded -/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crti.o succeeded -/usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/../../../../lib/crtn.o succeeded - - Depending on your machine architecture, the above may differ slightly, - the difference usually being the name of the directory - after /usr/lib/gcc. The important - thing to look for here is that gcc has found all three - crt*.o files under the - /usr/lib directory. - - - -grep -B4 '^ /usr/include' dummy.log - - - -#include <...> search starts here: - /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include - /usr/local/include - /usr/lib/gcc/x86_64-pc-linux-gnu/&gcc-version;/include-fixed - /usr/include - - Again, note that the directory named after your target triplet may be - different than the above, depending on your architecture. - - - - - - - - - -SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64") -SEARCH_DIR("/usr/local/lib64") -SEARCH_DIR("/lib64") -SEARCH_DIR("/usr/lib64") -SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib") -SEARCH_DIR("/usr/local/lib") -SEARCH_DIR("/lib") -SEARCH_DIR("/usr/lib"); - - A 32-bit system may see a few different directories. For example, here - is the output from an i686 machine: - -SEARCH_DIR("/usr/i686-pc-linux-gnu/lib32") -SEARCH_DIR("/usr/local/lib32") -SEARCH_DIR("/lib32") -SEARCH_DIR("/usr/lib32") -SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") -SEARCH_DIR("/usr/local/lib") -SEARCH_DIR("/lib") -SEARCH_DIR("/usr/lib"); - - - - - - - - - - - - - - - - - - - - - - - - Finally, move a misplaced file: - -mkdir -pv /usr/share/gdb/auto-load/usr/lib -mv -v /usr/lib/*gdb.py /usr/share/gdb/auto-load/usr/lib - - - - - Contents of GCC - - - Installed programs - Installed libraries - Installed directories - - - c++, cc (link to gcc), cpp, g++, gcc, - gcc-ar, gcc-nm, gcc-ranlib, gcov, gcov-dump, and gcov-tool - - libasan.{a,so}, libatomic.{a,so}, libcc1.so, libgcc.a, libgcc_eh.a, - libgcc_s.so, libgcov.a, libgomp.{a,so}, libitm.{a,so}, - liblsan.{a,so}, liblto_plugin.so, - libquadmath.{a,so}, libssp.{a,so}, libssp_nonshared.a, - libstdc++.{a,so}, libstdc++fs.a, libsupc++.a, libtsan.{a,so}, - and libubsan.{a,so} - - /usr/include/c++, /usr/lib/gcc, /usr/libexec/gcc, and - /usr/share/gcc-&gcc-version; - - - - - Short Descriptions - - - - - c++ - - The C++ compiler - - c++ - - - - - - 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 - - - - - - g++ - - The C++ compiler - - g++ - - - - - - gcc - - The C compiler - - gcc - - - - - - gcc-ar - - A wrapper around ar that adds a - plugin to the command line. This program is only used - to add "link time optimization" and is not useful with the - default build options - - gc-ar - - - - - - gcc-nm - - A wrapper around nm that adds a - plugin to the command line. This program is only used - to add "link time optimization" and is not useful with the - default build options - - gc-nm - - - - - - gcc-ranlib - - A wrapper around ranlib that adds a - plugin to the command line. This program is only used - to add "link time optimization" and is not useful with the - default build options - - gc-ranlib - - - - - - gcov - - A coverage testing tool; it is used to analyze programs to - determine where optimizations will have the most effect - - gcov - - - - - - gcov-dump - - Offline gcda and gcno profile dump tool - - gcov-dump - - - - - - gcov-tool - - Offline gcda profile processing tool - - gcov-tool - - - - - - libasan - - The Address Sanitizer runtime library - - libasan - - - - - - libatomic - - GCC atomic built-in runtime library - - libatomic - - - - - - libcc1 - - The C preprocessing library - - libcc1 - - - - - - libgcc - - Contains run-time support for gcc - - libgcc - - - - - - libgcov - - This library is linked in to a program when GCC is instructed - to enable profiling - - libgcov - - - - - - libgomp - - GNU implementation of the OpenMP API for multi-platform - shared-memory parallel programming in C/C++ and Fortran - - libgomp - - - - - - liblsan - - The Leak Sanitizer runtime library - - liblsan - - - - - - liblto_plugin - - GCC's Link Time Optimization (LTO) plugin allows GCC to perform - optimizations across compilation units - - liblto_plugin - - - - - - libquadmath - - GCC Quad Precision Math Library API - - libquadmath - - - - - - libssp - - Contains routines supporting GCC's stack-smashing protection - functionality - - libssp - - - - - - libstdc++ - - The standard C++ library - - libstdc++ - - - - - - libstdc++fs - - ISO/IEC TS 18822:2015 Filesystem library - - libstdc++fs - - - - - - libsupc++ - - Provides supporting routines for the C++ programming - language - - libsupc++ - - - - - - libtsan - - The Thread Sanitizer runtime library - - libtsan - - - - - - libubsan - - The Undefined Behavior Sanitizer runtime library - - libubsan - - - - - - - - - diff --git a/chapter06/gdbm.xml b/chapter06/gdbm.xml deleted file mode 100644 index f953b63f9..000000000 --- a/chapter06/gdbm.xml +++ /dev/null @@ -1,156 +0,0 @@ - - - %general-entities; -]> - - - - - - gdbm - &gdbm-version; -
&gdbm-url;
-
- - GDBM-&gdbm-version; - - - GDBM - - - - - - <para>The GDBM package contains the GNU Database Manager. It is a library - of database functions that use extensible hashing and work similar to the - standard UNIX dbm. The library provides primitives for storing key/data - pairs, searching and retrieving the data by its key and deleting a key - along with its data. </para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&gdbm-ch6-sbu;</seg> - <seg>&gdbm-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of GDBM - - First, fix an issue first identified by gcc-10: - -sed -r -i '/^char.*parseopt_program_(doc|args)/d' src/parseopt.c - - Prepare GDBM for compilation: - -./configure --prefix=/usr \ - --disable-static \ - --enable-libgdbm-compat - - - The meaning of the configure option: - - - --enable-libgdbm-compat - - This switch enables the libgdbm compatibility library to be - built, as some packages outside of LFS may require the older DBM - routines it provides. - - - - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install - - - - - Contents of GDBM - - - Installed programs - Installed libraries - - - gdbm_dump, gdbm_load, and gdbmtool - libgdbm.so and libgdbm_compat.so - - - - - Short Descriptions - - - - - gdbm_dump - - Dumps a GDBM database to a file - - gdbm_dump - - - - - - gdbm_load - - Recreates a GDBM database from a dump file - - gdbm_load - - - - - - gdbmtool - - Tests and modifies a GDBM database - - gdbmtool - - - - - - libgdbm - - Contains functions to manipulate a hashed database - - libgdbm - - - - - - libgdbm_compat - - Compatibility library containing older DBM functions - - libgdbm_compat - - - - - - - - -
diff --git a/chapter06/generalinstructions.xml b/chapter06/generalinstructions.xml new file mode 100644 index 000000000..05b88b98c --- /dev/null +++ b/chapter06/generalinstructions.xml @@ -0,0 +1,120 @@ + + + %general-entities; +]> + + + + + General Compilation Instructions + + When building packages there are several assumptions made within + the instructions: + + + + + Several of the packages are patched before compilation, but only when + the patch is needed to circumvent a problem. A patch is often needed in + both this and the next chapter, but sometimes in only one or the other. + Therefore, do not be concerned if instructions for a downloaded patch seem + to be missing. Warning messages about offset or + fuzz may also be encountered when applying a patch. Do + not worry about these warnings, as the patch was still successfully + applied. + + + + During the compilation of most packages, there will be several + warnings that scroll by on the screen. These are normal and can safely be + ignored. These warnings are as they appear—warnings about + deprecated, but not invalid, use of the C or C++ syntax. C standards change + fairly often, and some packages still use the older standard. This is not a + problem, but does prompt the warning. + + + + Check one last time that the LFS environment variable + is set up properly: + +echo $LFS + + Make sure the output shows the path to the LFS partition's mount + point, which is /mnt/lfs, using our + example. + + + + + Finally, two important items must be emphasized: + + + + The build instructions assume that the , including symbolic links, have + been set properly: + + + + bash is the shell + in use. + + sh is a symbolic + link to bash. + + /usr/bin/awk is a + symbolic link to gawk. + + /usr/bin/yacc is a + symbolic link to bison or a small script that + executes bison. + + + + + + To re-emphasize the build process: + + + + Place all the sources and patches in a directory that will be + accessible from the chroot environment such as + /mnt/lfs/sources/. + + + Change to the sources directory. + + + For each package: + + + Using the tar program, extract the package + to be built. In Chapter 5, ensure you are the lfs + user when extracting the package. + + + Change to the directory created when the package was + extracted. + + + Follow the book's instructions for building the package. + + + Change back to the sources directory. + + + Delete the extracted source directory unless instructed otherwise. + + + + + + + + + + diff --git a/chapter06/gettext.xml b/chapter06/gettext.xml index 2c4683804..34d0ee32e 100644 --- a/chapter06/gettext.xml +++ b/chapter06/gettext.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,25 +16,25 @@ Gettext-&gettext-version; - + Gettext + tools - <para>The Gettext package contains utilities for internationalization and - localization. These allow programs to be compiled with NLS (Native Language - Support), enabling them to output messages in the user's native - language.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/gettext.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&gettext-ch6-sbu;</seg> - <seg>&gettext-ch6-du;</seg> + <seg>&gettext-ch5-sbu;</seg> + <seg>&gettext-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,402 +43,42 @@ <sect2 role="installation"> <title>Installation of Gettext - - - - - - Prepare Gettext for compilation: -./configure --prefix=/usr \ - --disable-static \ - --docdir=/usr/share/doc/gettext-&gettext-version; +./configure --disable-shared - Compile the package: - -make BISON_LOCALEDIR=/usr/share/locale - - - The meaning of the make parameter: + + The meaning of the configure option: - BISON_LOCALEDIR=/usr/share/locale + --disable-shared - Since bison is not yet installed in /usr, configure hardcodes - the directory containing translations for the bison program (the - "locale" directory) as /tools/share/locale. Passing this variable - to make allows overriding the choice made by configure. + We do not need to install any of the shared Gettext libraries at + this time, therefore there is no need to build them. - To test the results (this takes a long time, around 3 SBUs), - issue: + Compile the package: -make check +make - Install the package: + Install the msgfmt, msgmerge and + xgettext programs: -make install -chmod -v 0755 /usr/lib/preloadable_libintl.so +cp -v gettext-tools/src/{msgfmt,msgmerge,xgettext} /usr/bin - - Contents of Gettext - - - Installed programs - Installed libraries - Installed directories - - - autopoint, envsubst, gettext, gettext.sh, - gettextize, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, - msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, - ngettext, recode-sr-latin, and xgettext - libasprintf.so, libgettextlib.so, libgettextpo.so, - libgettextsrc.so, libtextstyle.so, and preloadable_libintl.so - /usr/lib/gettext, /usr/share/doc/gettext-&gettext-version;, - /usr/share/gettext, and /usr/share/gettext-0.19.8 - - - - - Short Descriptions - - - - - autopoint - - Copies standard Gettext infrastructure files into a source - package - - autopoint - - - - - - 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 - - - - - - gettext.sh - - Primarily serves as a shell function library for gettext - - gettext.sh - - - - - - gettextize - - Copies all standard Gettext files into the given top-level - directory of a package to begin internationalizing it - - gettextize - - - - - - 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 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 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 - - - - - - recode-sr-latin - - Recodes Serbian text from Cyrillic to Latin script - - recode-sr-latin - - - - - - 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 - - - - - - libtextstyle - - Text styling library - - libtextstyle - - - + + - <varlistentry id="preloadable_libintl"> - <term><filename class="libraryfile">preloadable_libintl</filename></term> - <listitem> - <para>A library, intended to be used by LD_PRELOAD that assists - <filename class="libraryfile">libintl</filename> in logging - untranslated messages</para> - <indexterm zone="ch-system-gettext preloadable_libintl"> - <primary sortas="c-preloadable_libintl">preloadable_libintl</primary> - </indexterm> - </listitem> - </varlistentry> - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-gettext" role="."/></para> </sect2> diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml index a422c8d3c..5213c23e5 100644 --- a/chapter06/glibc.xml +++ b/chapter06/glibc.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="ch-system-glibc" role="wrap"> +<sect1 id="ch-tools-glibc" role="wrap"> <?dbhtml filename="glibc.html"?> <sect1info condition="script"> @@ -16,25 +16,25 @@ <title>Glibc-&glibc-version; - + Glibc + tools - <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> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter06/glibc.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&glibc-ch6-sbu;</seg> - <seg>&glibc-ch6-du;</seg> + <seg>&glibc-ch5-sbu;</seg> + <seg>&glibc-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,927 +43,187 @@ <sect2 role="installation"> <title>Installation of Glibc + First, create two symbolic links, which are needed for proper + operation of the dynamic library loader: + +ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64 +ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3 + Some of the Glibc programs use the non-FHS compliant - /var/db directory to store - their runtime data. Apply the following patch to make such programs - store their runtime data in the FHS-compliant locations: + /var/db directory to store their + runtime data. Apply the following patch to make such programs store their + runtime data in the FHS-compliant locations: + +patch -Np1 -i ../glibc-&glibc-version;-fhs-1.patch -patch -Np1 -i ../&glibc-fhs-patch; - - The Glibc documentation recommends building Glibc in a dedicated build directory: mkdir -v build cd build - Prepare Glibc for compilation: + Next, prepare Glibc for compilation: + +../configure \ + --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(../scripts/config.guess) \ + --enable-kernel=&min-kernel; \ + --with-headers=$LFS/usr/include \ + libc_cv_slibdir=/lib + -../configure --prefix=/usr \ - --disable-werror \ - --enable-kernel=&min-kernel; \ - --enable-stack-protector=strong \ - --with-headers=/usr/include \ - libc_cv_slibdir=/lib - - The meaning of the options and new configure parameters: + The meaning of the configure options: - CC="gcc -ffile-prefix-map=$LFS_DIR=$DIR" + --host=$LFS_TGT, --build=$(../scripts/config.guess) - Make GCC record any references to files in /usr/lib/gcc/x86_64-lfs-linux-gnu - in result of the compilation as if the files resided in /usr/lib/gcc/x86_64-pc-linux-gnu. - This avoids introduction of invalid paths in debugging - symbols. + The combined effect of these switches is that Glibc's build system + configures itself to be cross-compiled, using the cross-linker and + cross-compiler in /tools. - --disable-werror + --enable-kernel=&min-kernel; - This option disables the -Werror option passed to - GCC. This is necessary for running the test suite. + This tells Glibc to compile the library with support + for &min-kernel; and later Linux kernels. Workarounds for older + kernels are not enabled. - --enable-stack-protector=strong - - This option increases system security by adding - extra code to check for buffer overflows, such as stack - smashing attacks. - - - - - --with-headers=/usr/include + --with-headers=$LFS/usr/include - This option tells the build system where to find the - kernel API headers. + This tells Glibc to compile itself against the headers recently + installed to the usr/include directory, so that it knows exactly what + features the kernel has and can optimize itself accordingly. libc_cv_slibdir=/lib - This variable sets the correct library for all - systems. We do not want lib64 to be used. + This ensures that the library is installed in /lib instead + of the default /lib64 on 64 bit machines. - - - - Compile the package: - -make - - - In this section, the test suite for Glibc is considered critical. - Do not skip it under any circumstance. - - - Generally a few tests do not pass. The test failures listed below - are usually safe to ignore. - - -case $(uname -m) in - i?86) ln -sfnv $PWD/elf/ld-linux.so.2 /lib ;; - x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;; -esac - - The symbolic link above is needed to run the tests at this - stage of building in the chroot environment. It will be overwritten - in the install phase below. - -make check - - You may see some test failures. The Glibc test suite is - somewhat dependent on the host system. This is a list of the most common - issues seen for some versions of LFS: - - - - - misc/tst-ttyname - is known to fail in the LFS chroot environment. - - - - inet/tst-idna_name_classify - is known to fail in the LFS chroot environment. - - - - posix/tst-getaddrinfo4 and - posix/tst-getaddrinfo5 - may fail on some architectures. - - - - The nss/tst-nss-files-hosts-multi - test may fail for reasons that have not been determined. - - - - The rt/tst-cputimer{1,2,3} tests depend on - the host system kernel. Kernels 4.14.91–4.14.96, - 4.19.13–4.19.18, and 4.20.0–4.20.5 are known to - cause these tests to fail. - - - - - The math tests sometimes fail when running on - systems where the CPU is not a relatively new Intel or - AMD processor. - - - - 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 - - Fix the generated Makefile to skip an unneeded sanity check - that fails in the LFS partial environment: - - -sed '/test-installation/s@$(PERL)@echo not running@' -i ../Makefile - - Install the package: - -make install - - Install the configuration file and runtime directory for - nscd: - -cp -v ../nscd/nscd.conf /etc/nscd.conf -mkdir -pv /var/cache/nscd - - Install the systemd support files for - nscd: - - install -v -Dm644 ../nscd/nscd.tmpfiles /usr/lib/tmpfiles.d/nscd.conf -install -v -Dm644 ../nscd/nscd.service /lib/systemd/system/nscd.service - - Next, install the locales that can make the system respond in a - different language. None of the locales are required, but if some of them - are missing, the test suites of future packages would skip important - testcases. - - Individual locales can be installed using the - localedef program. E.g., the first - localedef command below combines the - /usr/share/i18n/locales/cs_CZ - charset-independent locale definition with the - /usr/share/i18n/charmaps/UTF-8.gz - charmap definition and appends the result to the - /usr/lib/locale/locale-archive file. - The following instructions will install the minimum set of - locales necessary for the optimal coverage of tests: - -mkdir -pv /usr/lib/locale -localedef -i POSIX -f UTF-8 C.UTF-8 2> /dev/null || true -localedef -i cs_CZ -f UTF-8 cs_CZ.UTF-8 -localedef -i de_DE -f ISO-8859-1 de_DE -localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro -localedef -i de_DE -f UTF-8 de_DE.UTF-8 -localedef -i el_GR -f ISO-8859-7 el_GR -localedef -i en_GB -f UTF-8 en_GB.UTF-8 -localedef -i en_HK -f ISO-8859-1 en_HK -localedef -i en_PH -f ISO-8859-1 en_PH -localedef -i en_US -f ISO-8859-1 en_US -localedef -i en_US -f UTF-8 en_US.UTF-8 -localedef -i es_MX -f ISO-8859-1 es_MX -localedef -i fa_IR -f UTF-8 fa_IR -localedef -i fr_FR -f ISO-8859-1 fr_FR -localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro -localedef -i fr_FR -f UTF-8 fr_FR.UTF-8 -localedef -i it_IT -f ISO-8859-1 it_IT -localedef -i it_IT -f UTF-8 it_IT.UTF-8 -localedef -i ja_JP -f EUC-JP ja_JP -localedef -i ja_JP -f SHIFT_JIS ja_JP.SIJS 2> /dev/null || true -localedef -i ja_JP -f UTF-8 ja_JP.UTF-8 -localedef -i ru_RU -f KOI8-R ru_RU.KOI8-R -localedef -i ru_RU -f UTF-8 ru_RU.UTF-8 -localedef -i tr_TR -f UTF-8 tr_TR.UTF-8 -localedef -i zh_CN -f GB18030 zh_CN.GB18030 -localedef -i zh_HK -f BIG5-HKSCS zh_HK.BIG5-HKSCS - - In addition, install the locale for your own country, language and - character set. - - Alternatively, install all locales listed in the - glibc-&glibc-version;/localedata/SUPPORTED file - (it includes every locale listed above and many more) at once with the - following time-consuming command: - -make localedata/install-locales - - Then use the localedef command to create and - install locales not listed in the - glibc-&glibc-version;/localedata/SUPPORTED file - in the unlikely case you need them. - - Glibc now uses libidn2 when resolving internationalized - domain names. This is a run time dependency. If this capability - is needed, the instructions for installing libidn2 are in the - BLFS libidn2 page. - - - - - - Configuring Glibc - - - /etc/nsswitch.conf - - - - /etc/localtime - - - - Adding nsswitch.conf - - The /etc/nsswitch.conf file needs to be created - because the Glibc defaults do not work well in a networked environment. - - - Create a new file /etc/nsswitch.conf by running the - following: - -cat > /etc/nsswitch.conf << "EOF" -# Begin /etc/nsswitch.conf - -passwd: files -group: files -shadow: files - -hosts: files dns -networks: files - -protocols: files -services: files -ethers: files -rpc: files - -# End /etc/nsswitch.conf -EOF - - - - - Adding time zone data - - Install and set up the time zone data with the following: -tar -xf ../../tzdata&tzdata-version;.tar.gz - -ZONEINFO=/usr/share/zoneinfo -mkdir -pv $ZONEINFO/{posix,right} - -for tz in etcetera southamerica northamerica europe africa antarctica \ - asia australasia backward pacificnew systemv; do - zic -L /dev/null -d $ZONEINFO ${tz} - zic -L /dev/null -d $ZONEINFO/posix ${tz} - zic -L leapseconds -d $ZONEINFO/right ${tz} -done - -cp -v zone.tab zone1970.tab iso3166.tab $ZONEINFO -zic -d $ZONEINFO -p America/New_York -unset ZONEINFO - - - The meaning of the zic commands: - - - zic -L /dev/null ... - - This creates posix time zones, without any leap seconds. It is - conventional to put these in both - zoneinfo and - zoneinfo/posix. It is - necessary to put the POSIX time zones in - zoneinfo, otherwise various - test-suites will report errors. On an embedded system, where space is - tight and you do not intend to ever update the time zones, you could save - 1.9MB by not using the posix - directory, but some applications or test-suites might produce some - failures. - - - - zic -L leapseconds ... - - This creates right time zones, including leap seconds. On an - embedded system, where space is tight and you do not intend to - ever update the time zones, or care about the correct time, you could - save 1.9MB by omitting the right - directory. - - - zic ... -p ... - - This creates the posixrules file. We use - New York because POSIX requires the daylight savings time rules - to be in accordance with US rules. - - - - - - One way to determine the local time zone is to run the following - script: - -tzselect - - After answering a few questions about the location, the script will - output the name of the time zone (e.g., - America/Edmonton). There are also some other possible - time zones listed in /usr/share/zoneinfo such as - Canada/Eastern or EST5EDT that - are not identified by the script but can be used. - - Then create the /etc/localtime file by - running: - -ln -sfv /usr/share/zoneinfo/<xxx> /etc/localtime - - Replace <xxx> with the name of the - time zone selected (e.g., Canada/Eastern). - - - - - Configuring the 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: - -cat > /etc/ld.so.conf << "EOF" -# Begin /etc/ld.so.conf -/usr/local/lib -/opt/lib - -EOF - - If desired, the dynamic loader can also search a directory and - include the contents of files found there. Generally the files in - this include directory are one line specifying the desired library path. - To add this capability run the following commands: - -cat >> /etc/ld.so.conf << "EOF" -# Add an include directory -include /etc/ld.so.conf.d/*.conf - -EOF -mkdir -pv /etc/ld.so.conf.d - - - - - - Contents of Glibc - - - Installed programs - Installed libraries - Installed directories - - - catchsegv, gencat, getconf, getent, iconv, iconvconfig, ldconfig, - ldd, lddlibc4, locale, localedef, makedb, mtrace, nscd, - pcprofiledump, pldd, sln, sotruss, sprof, tzselect, xtrace, - zdump, and zic - ld-&glibc-version;.so, libBrokenLocale.{a,so}, libSegFault.so, libanl.{a,so}, - libc.{a,so}, libc_nonshared.a, - libcrypt.{a,so}, libdl.{a,so}, libg.a, libm.{a,so}, - libmcheck.a, libmemusage.so, libmvec.{a,so}, libnsl.{a,so}, - libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, - libpcprofile.so, libpthread.{a,so}, - libpthread_nonshared.a, libresolv.{a,so}, librt.{a,so}, - libthread_db.so, and libutil.{a,so} - /usr/include/arpa, /usr/include/bits, /usr/include/gnu, - /usr/include/net, /usr/include/netash, /usr/include/netatalk, - /usr/include/netax25, /usr/include/neteconet, /usr/include/netinet, - /usr/include/netipx, /usr/include/netiucv, /usr/include/netpacket, - /usr/include/netrom, /usr/include/netrose, /usr/include/nfs, - /usr/include/protocols, /usr/include/rpc, - /usr/include/sys, /usr/lib/audit, /usr/lib/gconv, /usr/lib/locale, - /usr/libexec/getconf, /usr/share/i18n, /usr/share/zoneinfo, - /var/cache/nscd, and /var/lib/nss_db - - - - - 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 + libc_cv_c_cleanup=yes - Prints various information about the current locale - - locale - + Similarly, we pass libc_cv_c_cleanup=yes through to the + configure script so that the test is skipped and C + cleanup handling support is configured. - - localedef - - Compiles locale specifications - - localedef - - - - - - makedb - - Creates a simple database from textual input - - makedb - - - - - - mtrace - - Reads and interprets a memory trace file and displays a summary - in human-readable format - - mtrace - - - - - - nscd - - A daemon that provides a cache for the most common name - service requests - - nscd - - - - - - pcprofiledump + + libc_cv_ctors_header=yes - Dump information generated by PC profiling - - pcprofiledump - + Similarly, we pass libc_cv_ctors_header=yes through to the + configure script so that the test is skipped and + gcc constructor support is configured. - + --> - - pldd - - Lists dynamic shared objects used by running processes - - pldd - - - - - - sln - - A statically linked ln program - - sln - - - + - - sotruss - - Traces shared library procedure calls of a specified command - - sotruss - - - + During this stage the following warning might appear: - - sprof - - Reads and displays shared object profiling data - - sprof - - - +
+configure: WARNING: +*** These auxiliary programs are missing or +*** incompatible versions: msgfmt +*** some features will be disabled. +*** Check the INSTALL file for required versions. +
- - tzselect - - Asks the user about the location of the system and reports - the corresponding time zone description - - tzselect - - - + The missing or incompatible msgfmt program is + generally harmless. This msgfmt program is part of the + Gettext package which the host distribution should provide. - - xtrace - - Traces the execution of a program by printing the currently - executed function - - xtrace - - - + There have been reports that this package may fail when + building as a "parallel make". If this occurs, rerun the make command + with a "-j1" option. - - zdump - - The time zone dumper - - zdump - - - + Compile the package: - - zic - - The time zone compiler - - zic - - - +make - - ld-&glibc-version;.so - - The helper program for shared library executables - - ld-&glibc-version;.so - - - + Install the package: - - libBrokenLocale - - Used internally by Glibc as a gross hack to get broken programs - (e.g., some Motif applications) running. See comments in - glibc-&glibc-version;/locale/broken_cur_max.c - for more information - - libBrokenLocale - - - +make DESTDIR=$LFS install - - libSegFault - - The segmentation fault signal handler, used by - catchsegv - - libSegFault - - - + + The meaning of the <command>make install</command> option: - - libanl + + DESTDIR=$LFS - An asynchronous name lookup library - - libanl - + The DESTDIR make variable is used by almost all + packages to define the location where the package should be + installed. If it is not set, it defaults to the root (/) directory. Here we specify that + the package be installed in $LFS + , which will become the root after . - - libc - - The main C library - - libc - - - + - - libcrypt - - The cryptography library - - libcrypt - - - + + At this point, it is imperative to stop and ensure that the basic + functions (compiling and linking) of the new toolchain are working as + expected. To perform a sanity check, run the following commands: - - libdl - - The dynamic linking interface library - - libdl - - - +echo 'int main(){}' > dummy.c +$LFS_TGT-gcc dummy.c +readelf -l a.out | grep '/ld-linux' - - libg - - Dummy library containing no functions. Previously was a runtime - library for g++ - - libg - - - + If everything is working correctly, there should be no errors, + and the output of the last command will be of the form: - - libm - - The mathematical library - - libm - - - +[Requesting program interpreter: /lib64/ld-linux-x86-64.so.2] - - libmcheck - - Turns on memory allocation checking when linked to - - libmcheck - - - + Note that for 32-bit machines, the interpreter name will be + /lib/ld-linux.so.2. - - libmemusage - - Used by memusage to help collect - information about the memory usage of a program - - libmemusage - - - + If the output is not shown as above or there was no output at all, + then something is wrong. Investigate and retrace the steps to find out + where the problem is and correct it. This issue must be resolved before + continuing on. - - libnsl - - The network services library - - libnsl - - - + Once all is well, clean up the test files: - - libnss - - The Name Service Switch libraries, containing functions for - resolving host names, user names, group names, aliases, services, - protocols, etc. - - libnss - - - +rm -v dummy.c a.out - - libpcprofile - - Can be preloaded to PC profile an executable - - libpcprofile - - - + - - libpthread - - The POSIX threads library - - libpthread - - - + Building packages in the next sections will serve as an + additional check that the toolchain has been built properly. If some + package, especially binutils-pass2 or gcc-pass2, fails to build, it is + an indication that something has gone wrong with the + previous Binutils, GCC, or Glibc installations. - - libresolv - - Contains functions for creating, sending, and interpreting - packets to the Internet domain name servers - - libresolv - - - + Now that our cross-toolchain is complete, finalize the installation + of the limits.h header. For doing so, run an utility provided by the GCC + developers: - - librt - - Contains functions providing most of the interfaces specified - by the POSIX.1b Realtime Extension - - librt - - - +$LFS/tools/libexec/gcc/$LFS_TGT/&gcc-version;/install-tools/mkheaders - - 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 - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-glibc" role="."/></para> </sect2> diff --git a/chapter06/gmp.xml b/chapter06/gmp.xml deleted file mode 100644 index 4bc361a56..000000000 --- a/chapter06/gmp.xml +++ /dev/null @@ -1,164 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-gmp" role="wrap"> - <?dbhtml filename="gmp.html"?> - - <sect1info condition="script"> - <productname>gmp</productname> - <productnumber>&gmp-version;</productnumber> - <address>&gmp-url;</address> - </sect1info> - - <title>GMP-&gmp-version; - - - GMP - - - - - - <para>The GMP package contains math libraries. These have useful functions - for arbitrary precision arithmetic.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&gmp-ch6-sbu;</seg> - <seg>&gmp-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of GMP - - - If you are building for 32-bit x86, but you have a CPU which is - capable of running 64-bit code and you have specified - CFLAGS in the environment, the configure script will - attempt to configure for 64-bits and fail. - Avoid this by invoking the configure command below with -ABI=32 ./configure ... - - - - The default settings of GMP produce libraries optimized for - the host processor. If libraries suitable for processors less - capable than the host's CPU are desired, generic libraries can be - created by running the following: - -cp -v configfsf.guess config.guess -cp -v configfsf.sub config.sub - - - Prepare GMP for compilation: - -./configure --prefix=/usr \ - --enable-cxx \ - --disable-static \ - --docdir=/usr/share/doc/gmp-&gmp-version; - - - The meaning of the new configure options: - - - --enable-cxx - - This parameter enables C++ support - - - - - --docdir=/usr/share/doc/gmp-&gmp-version; - - This variable specifies the correct place for the - documentation. - - - - - - Compile the package and generate the HTML documentation: - -make -make html - - - The test suite for GMP in this section is considered critical. - Do not skip it under any circumstances. - - - Test the results: - -make check 2>&1 | tee gmp-check-log - - The code in gmp is highly optimized for the processor where - it is built. Occasionally, the code that detects the processor misidentifies - the system capabilities and there will be errors in the tests or other - applications using the gmp libraries with the message "Illegal - instruction". In this case, gmp should be reconfigured with the option - --build=x86_64-unknown-linux-gnu and rebuilt. - - Ensure that all 197 tests in the test suite passed. - Check the results by issuing the following command: - -awk '/# PASS:/{total+=$3} ; END{print total}' gmp-check-log - - Install the package and its documentation: - -make install -make install-html - - - - - Contents of GMP - - - Installed Libraries - Installed directory - - - libgmp.so and libgmpxx.so - /usr/share/doc/gmp-&gmp-version; - - - - - Short Descriptions - - - - - libgmp - - Contains precision math functions - - libgmp - - - - - - libgmpxx - - Contains C++ precision math functions - - libgmpxx - - - - - - - -
diff --git a/chapter06/gperf.xml b/chapter06/gperf.xml deleted file mode 100644 index d8c5b6594..000000000 --- a/chapter06/gperf.xml +++ /dev/null @@ -1,95 +0,0 @@ - - - %general-entities; -]> - - - - - - gperf - &gperf-version; -
&gperf-url;
-
- - Gperf-&gperf-version; - - - Gperf - - - - - - <para>Gperf generates a perfect hash function from a key set.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&gperf-ch6-sbu;</seg> - <seg>&gperf-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Gperf - - Prepare Gperf for compilation: - -./configure --prefix=/usr --docdir=/usr/share/doc/gperf-&gperf-version; - - Compile the package: - -make - - The tests are known to fail if running multiple - simultaneous tests (-j option greater than 1). To test - the results, issue: - -make -j1 check - - Install the package: - -make install - - - - - Contents of Gperf - - - Installed program - Installed directory - - - gperf - /usr/share/doc/gperf-&gperf-version; - - - - - Short Descriptions - - - - - gperf - - Generates a perfect hash from a key set - - gperf - - - - - - - - -
diff --git a/chapter06/grep.xml b/chapter06/grep.xml index 58b0db366..6a8ada4b8 100644 --- a/chapter06/grep.xml +++ b/chapter06/grep.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,22 +16,25 @@ Grep-&grep-version; - + Grep + tools - <para>The Grep package contains programs for searching through files.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/grep.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&grep-ch6-sbu;</seg> - <seg>&grep-ch6-du;</seg> + <seg>&grep-ch5-sbu;</seg> + <seg>&grep-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -42,69 +45,25 @@ <para>Prepare Grep for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr --bindir=/bin</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr \ + --host=$LFS_TGT \ + --bindir=/bin</userinput></screen> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> - -<screen><userinput remap="test">make check</userinput></screen> - <para>Install the package:</para> -<screen><userinput remap="install">make install</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> </sect2> - <sect2 id="contents-grep" role="content"> - <title>Contents of Grep - - - Installed programs - - - egrep, fgrep, and grep - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="egrep"> - <term><command>egrep</command></term> - <listitem> - <para>Prints lines matching an extended regular expression</para> - <indexterm zone="ch-system-grep egrep"> - <primary sortas="b-egrep">egrep</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="fgrep"> - <term><command>fgrep</command></term> - <listitem> - <para>Prints lines matching a list of fixed strings</para> - <indexterm zone="ch-system-grep fgrep"> - <primary sortas="b-fgrep">fgrep</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="grep"> - <term><command>grep</command></term> - <listitem> - <para>Prints lines matching a basic regular expression</para> - <indexterm zone="ch-system-grep grep"> - <primary sortas="b-grep">grep</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-grep" role="."/></para> </sect2> diff --git a/chapter06/groff.xml b/chapter06/groff.xml deleted file mode 100644 index aad0cbf85..000000000 --- a/chapter06/groff.xml +++ /dev/null @@ -1,607 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-groff" role="wrap"> - <?dbhtml filename="groff.html"?> - - <sect1info condition="script"> - <productname>groff</productname> - <productnumber>&groff-version;</productnumber> - <address>&groff-url;</address> - </sect1info> - - <title>Groff-&groff-version; - - - Groff - - - - - - <para>The Groff package contains programs for processing and formatting - text.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&groff-ch6-sbu;</seg> - <seg>&groff-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Groff - - 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. While the default - paper size is configured during compilation, it can be overridden later - by echoing either A4 or letter to the - /etc/papersize file. - - Prepare Groff for compilation: - -PAGE=<paper_size> ./configure --prefix=/usr - - This package does not support parallel build. Compile the package: - -make -j1 - - This package does not come with a test suite. - - Install the package: - -make install - - - - - Contents of Groff - - - Installed programs - Installed directories - - - addftinfo, afmtodit, chem, eqn, eqn2graph, gdiffmk, glilypond, - gperl, gpinyin, grap2graph, grn, grodvi, groff, groffer, grog, grolbp, - grolj4, gropdf, grops, grotty, hpftodit, indxbib, lkbib, lookbib, - mmroff, neqn, nroff, pdfmom, pdfroff, pfbtops, pic, pic2graph, - post-grohtml, preconv, pre-grohtml, refer, roff2dvi, roff2html, - roff2pdf, roff2ps, roff2text, roff2x, soelim, tbl, tfmtodit, and - troff - /usr/lib/groff and /usr/share/doc/groff-&groff-version;, - /usr/share/groff - - - - - 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 - - - - - - chem - - Groff preprocessor for producing chemical structure diagrams - - chem - - - - - - 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 - - - - - - gdiffmk - - Marks differences between groff/nroff/troff files - - gdiffmk - - - - - - glilypond - - Transforms sheet music written in the lilypond language into - the groff language - - glilypond - - - - - - gperl - - Preprocesor for groff, allowing addition of perl code - into groff files - - gperl - - - - - - gpinyin - - Preprocesor for groff, allowing addition of Chinese - European-like language Pinyin into groff files. - - gpinyin - - - - - - grap2graph - - Converts a grap diagram into a cropped bitmap image - - grap2graph - - - - - - 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 , , , - , , , - , and 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 - - - - - - gropdf - - Translates the output of GNU troff to - PDF - - gropdf - - - - - - 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 - - - - - - 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 - - - - - - pdfmom - - Is a wrapper around groff that facilitates the production of PDF - documents from files formatted with the mom macros. - - pdfmom - - - - - - pdfroff - - Creates pdf documents using groff - - pdfroff - - - - - - 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 - - - - - - preconv - - Converts encoding of input files to something GNU - troff understands - - preconv - - - - - - 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 - - - - - - roff2dvi - - Transforms roff files into DVI format - - roff2dvi - - - - - - roff2html - - Transforms roff files into HTML format - - roff2html - - - - - - roff2pdf - - Transforms roff files into PDFs - - roff2pdf - - - - - - roff2ps - - Transforms roff files into ps files - - roff2ps - - - - - - roff2text - - Transforms roff files into text files - - roff2text - - - - - - roff2x - - Transforms roff files into other formats - - roff2x - - - - - - 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 - - - - - - - - - diff --git a/chapter06/grub.xml b/chapter06/grub.xml deleted file mode 100644 index 25a61077b..000000000 --- a/chapter06/grub.xml +++ /dev/null @@ -1,374 +0,0 @@ - - - %general-entities; -]> - - - - - - grub - &grub-version; -
&grub-url;
-
- - GRUB-&grub-version; - - - GRUB - - - - - - <para>The GRUB package contains the GRand Unified Bootloader.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&grub-ch6-sbu;</seg> - <seg>&grub-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of GRUB - - Prepare GRUB for compilation: - -./configure --prefix=/usr \ - --sbindir=/sbin \ - --sysconfdir=/etc \ - --disable-efiemu \ - --disable-werror - - - The meaning of the new configure options: - - - --disable-werror - - This allows the build to complete with warnings introduced - by more recent Flex versions. - - - - - --disable-efiemu - - This option minimizes what is built by disabling a feature and - testing programs not needed for LFS. - - - - - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make install -mv -v /etc/bash_completion.d/grub /usr/share/bash-completion/completions - - Using GRUB to make your LFS system bootable will be discussed in - . - - - - - Contents of GRUB - - - Installed programs - Installed directories - - - - grub-bios-setup, grub-editenv, grub-file, grub-fstest, - grub-glue-efi, grub-install, grub-kbdcomp, grub-macbless, - grub-menulst2cfg, grub-mkconfig, - grub-mkimage, grub-mklayout, grub-mknetdir, - grub-mkpasswd-pbkdf2, grub-mkrelpath, grub-mkrescue, grub-mkstandalone, - grub-ofpathname, grub-probe, grub-reboot, grub-render-label, - grub-script-check, - grub-set-default, grub-sparc64-setup, and grub-syslinux2cfg - - /usr/lib/grub, /etc/grub.d, /usr/share/grub, and /boot/grub (when grub-install - is first run) - - - - - Short Descriptions - - - - - grub-bios-setup - - Is a helper program for grub-install - - grub-bios-setup - - - - - - grub-editenv - - A tool to edit the environment block - - grub-editenv - - - - - - grub-file - - Checks if FILE is of the specified type. - - grub-file - - - - - - grub-fstest - - Tool to debug the filesystem driver - - grub-fstest - - - - - - grub-glue-efi - - Processes ia32 and amd64 EFI images and glues them - according to Apple format. - - grub-glue-efi - - - - - - grub-install - - Install GRUB on your drive - - grub-install - - - - - - grub-kbdcomp - - Script that converts an xkb layout into one recognized by - GRUB - - grub-kbdcomp - - - - - - grub-macbless - - Mac-style bless on HFS or HFS+ files - - grub-macbless - - - - - - grub-menulst2cfg - - Converts a GRUB Legacy menu.lst - into a grub.cfg for use with GRUB 2 - - grub-menulst2cfg - - - - - - grub-mkconfig - - Generate a grub config file - - grub-mkconfig - - - - - - grub-mkimage - - Make a bootable image of GRUB - - grub-mkimage - - - - - - grub-mklayout - - Generates a GRUB keyboard layout file - - grub-mklayout - - - - - - grub-mknetdir - - Prepares a GRUB netboot directory - - grub-mknetdir - - - - - - grub-mkpasswd-pbkdf2 - - Generates an encrypted PBKDF2 password for use in the boot - menu - - grub-mkpasswd-pbkdf2 - - - - - - grub-mkrelpath - - Makes a system pathname relative to its root - - grub-mkrelpath - - - - - - grub-mkrescue - - Make a bootable image of GRUB suitable for a floppy disk or CDROM/DVD - - grub-mkrescue - - - - - - grub-mkstandalone - - Generates a standalone image - - grub-mkstandalone - - - - - - grub-ofpathname - - Is a helper program that prints the path of a GRUB device - - grub-ofpathname - - - - - - grub-probe - - Probe device information for a given path or device - - grub-probe - - - - - - grub-reboot - - Sets the default boot entry for GRUB for the next boot only - - grub-reboot - - - - - - grub-render-label - - Render Apple .disk_label for Apple Macs - - grub-render-label - - - - - - grub-script-check - - Checks GRUB configuration script for syntax errors - - grub-script-check - - - - - - grub-set-default - - Sets the default boot entry for GRUB - - grub-set-default - - - - - - grub-sparc64-setup - - Is a helper program for grub-setup - - grub-setup - - - - - - grub-syslinux2cfg - - Transform a syslinux config file into grub.cfg format - - grub-syslinux2cfg - - - - - - - - -
diff --git a/chapter06/gzip.xml b/chapter06/gzip.xml index 09eebbdf7..e5b5d0a37 100644 --- a/chapter06/gzip.xml +++ b/chapter06/gzip.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,23 +16,25 @@ Gzip-&gzip-version; - + Gzip + tools - <para>The Gzip package contains programs for compressing and decompressing - files.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/gzip.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&gzip-ch6-sbu;</seg> - <seg>&gzip-ch6-du;</seg> + <seg>&gzip-ch5-sbu;</seg> + <seg>&gzip-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,193 +45,27 @@ <para>Prepare Gzip for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr --host=$LFS_TGT</userinput></screen> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> - -<screen><userinput remap="test">make check</userinput></screen> - - <para>Two tests are known to fail in the LFS environment: - help-version and zmore.</para> - <para>Install the package:</para> -<screen><userinput remap="install">make install</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> - <para>Move a program that needs to be on the root filesystem:</para> + <para>Move the excutable to its final expected location:</para> -<screen><userinput remap="install">mv -v /usr/bin/gzip /bin</userinput></screen> +<screen><userinput remap="install">mv -v $LFS/usr/bin/gzip $LFS/bin</userinput></screen> </sect2> - <sect2 id="contents-gzip" role="content"> - <title>Contents of Gzip - - - Installed programs - - - gunzip, gzexe, gzip, uncompress (hard link with gunzip), zcat, zcmp, - zdiff, zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="gunzip"> - <term><command>gunzip</command></term> - <listitem> - <para>Decompresses gzipped files</para> - <indexterm zone="ch-system-gzip gunzip"> - <primary sortas="b-gunzip">gunzip</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="gzexe"> - <term><command>gzexe</command></term> - <listitem> - <para>Creates self-decompressing executable files</para> - <indexterm zone="ch-system-gzip gzexe"> - <primary sortas="b-gzexe">gzexe</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="gzip"> - <term><command>gzip</command></term> - <listitem> - <para>Compresses the given files using Lempel-Ziv (LZ77) coding</para> - <indexterm zone="ch-system-gzip gzip"> - <primary sortas="b-gzip">gzip</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="uncompress"> - <term><command>uncompress</command></term> - <listitem> - <para>Decompresses compressed files</para> - <indexterm zone="ch-system-gzip uncompress"> - <primary sortas="b-uncompress">uncompress</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zcat"> - <term><command>zcat</command></term> - <listitem> - <para>Decompresses the given gzipped files to standard output</para> - <indexterm zone="ch-system-gzip zcat"> - <primary sortas="b-zcat">zcat</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zcmp"> - <term><command>zcmp</command></term> - <listitem> - <para>Runs <command>cmp</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zcmp"> - <primary sortas="b-zcmp">zcmp</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zdiff"> - <term><command>zdiff</command></term> - <listitem> - <para>Runs <command>diff</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zdiff"> - <primary sortas="b-zdiff">zdiff</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zegrep"> - <term><command>zegrep</command></term> - <listitem> - <para>Runs <command>egrep</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zegrep"> - <primary sortas="b-zegrep">zegrep</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zfgrep"> - <term><command>zfgrep</command></term> - <listitem> - <para>Runs <command>fgrep</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zfgrep"> - <primary sortas="b-zfgrep">zfgrep</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zforce"> - <term><command>zforce</command></term> - <listitem> - <para>Forces a <filename class="extension">.gz</filename> extension on - all given files that are gzipped files, so that <command>gzip</command> - will not compress them again; this can be useful when file names were - truncated during a file transfer</para> - <indexterm zone="ch-system-gzip zforce"> - <primary sortas="b-zforce">zforce</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zgrep"> - <term><command>zgrep</command></term> - <listitem> - <para>Runs <command>grep</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zgrep"> - <primary sortas="b-zgrep">zgrep</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zless"> - <term><command>zless</command></term> - <listitem> - <para>Runs <command>less</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zless"> - <primary sortas="b-zless">zless</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="zmore"> - <term><command>zmore</command></term> - <listitem> - <para>Runs <command>more</command> on gzipped files</para> - <indexterm zone="ch-system-gzip zmore"> - <primary sortas="b-zmore">zmore</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="znew"> - <term><command>znew</command></term> - <listitem> - <para>Re-compresses files from <command>compress</command> format to - <command>gzip</command> format—<filename - class="extension">.Z</filename> to <filename - class="extension">.gz</filename></para> - <indexterm zone="ch-system-gzip znew"> - <primary sortas="b-znew">znew</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-gzip" role="."/></para> </sect2> diff --git a/chapter06/iana-etc.xml b/chapter06/iana-etc.xml deleted file mode 100644 index 42ab25c34..000000000 --- a/chapter06/iana-etc.xml +++ /dev/null @@ -1,93 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-iana-etc" role="wrap"> - <?dbhtml filename="iana-etc.html"?> - - <sect1info condition="script"> - <productname>iana-etc</productname> - <productnumber>&iana-etc-version;</productnumber> - <address>&iana-etc-url;</address> - </sect1info> - - <title>Iana-Etc-&iana-etc-version; - - - Iana-Etc - - - - - - <para>The Iana-Etc package provides data for network services and - protocols.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&iana-etc-ch6-sbu;</seg> - <seg>&iana-etc-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Iana-Etc - - For this package, we only need to copy the files into place: - -cp services protocols /etc - - - - - Contents of Iana-Etc - - - 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 deleted file mode 100644 index c8fdd456f..000000000 --- a/chapter06/inetutils.xml +++ /dev/null @@ -1,249 +0,0 @@ - - - %general-entities; -]> - - - - - - inetutils - &inetutils-version; -
&inetutils-url;
-
- - Inetutils-&inetutils-version; - - - Inetutils - - - - - - <para>The Inetutils package contains programs for basic networking.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&inetutils-ch6-sbu;</seg> - <seg>&inetutils-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Inetutils - - Prepare Inetutils for compilation: - -./configure --prefix=/usr \ - --localstatedir=/var \ - --disable-logger \ - --disable-whois \ - --disable-rcp \ - --disable-rexec \ - --disable-rlogin \ - --disable-rsh \ - --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 more recent version. - - - - - --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-r* - - These parameters disable building obsolete programs that should not - be used due to security issues. The functions provided by these - programs can be provided by the openssh - package 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. Note that - better replacements are available for many of these servers. - - - - - - Compile the package: - -make - - To test the results, issue: - -make check - - One test, libls.sh, may fail in the initial chroot - environment but will pass if the test is rerun after the LFS system - is complete. One test, ping-localhost.sh, will fail if the host - system does not have ipv6 capability. - - Install the package: - -make install - - Move some programs so they are available if /usr is not accessible: - -mv -v /usr/bin/{hostname,ping,ping6,traceroute} /bin -mv -v /usr/bin/ifconfig /sbin - - - - - Contents of Inetutils - - - Installed programs - - - dnsdomainname, ftp, ifconfig, hostname, ping, ping6, - talk, telnet, tftp, and traceroute - - - - - Short Descriptions - - - - - dnsdomainname - - Show the system's DNS domain name - - dnsdomainname - - - - - - ftp - - Is the file transfer protocol program - - ftp - - - - - - hostname - - Reports or sets the name of the host - - hostname - - - - - - ifconfig - - Manages network interfaces - - ifconfig - - - - - - ping - - Sends echo-request packets and reports how long the replies - take - - ping - - - - - - ping6 - - A version of ping for IPv6 networks - - ping6 - - - - - - talk - - Is used to chat with another user - - talk - - - - - - telnet - - An interface to the TELNET protocol - - telnet - - - - - - tftp - - A trivial file transfer program - - tftp - - - - - - traceroute - - Traces the route your packets take from the host you are - working on to another host on a network, showing all the intermediate - hops (gateways) along the way - - traceroute - - - - - - - - -
diff --git a/chapter06/intltool.xml b/chapter06/intltool.xml deleted file mode 100644 index 9e9ebad20..000000000 --- a/chapter06/intltool.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - %general-entities; -]> - - - - - - intltool - &intltool-version; -
&intltool-url;
-
- - Intltool-&intltool-version; - - - Intltool - - - - - - <para>The Intltool is an internationalization tool used for extracting - translatable strings from source files.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&intltool-ch6-sbu;</seg> - <seg>&intltool-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Intltool - - First fix a warning that is caused by perl-5.22 and later: - -sed -i 's:\\\${:\\\$\\{:' intltool-update.in - - Prepare Intltool for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install -install -v -Dm644 doc/I18N-HOWTO /usr/share/doc/intltool-&intltool-version;/I18N-HOWTO - - - - - Contents of Intltool - - - Installed programs - Installed directories - - - intltool-extract, intltool-merge, intltool-prepare, - intltool-update, and intltoolize - /usr/share/doc/intltool-&intltool-version; and - /usr/share/intltool - - - - - Short Descriptions - - - - - intltoolize - - Prepares a package to use intltool - - intltoolize - - - - - - intltool-extract - - Generates header files that can be read by gettext - - intltool-extract - - - - - - intltool-merge - - Merges translated strings into various file types - - intltool-merge - - - - - - intltool-prepare - - Updates pot files and merges them with translation files - - intltool-prepare - - - - - - intltool-update - - Updates the po template files and merges them with the translations - - intltool-update - - - - - - - - -
diff --git a/chapter06/introduction.xml b/chapter06/introduction.xml index c8ccb3908..5614270b2 100644 --- a/chapter06/introduction.xml +++ b/chapter06/introduction.xml @@ -5,70 +5,25 @@ %general-entities; ]> - + Introduction - 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 you (or the system) - may need it. - - We do not recommend using optimizations. They can make - a program run slightly faster, but they may also cause compilation - difficulties and problems when running the program. If a package refuses to - compile when using optimization, try to compile it without optimization and - see if that fixes the problem. Even if the package does compile when using - optimization, there is the risk it may have been compiled incorrectly because - of the complex interactions between the code and build tools. Also note that - the and options using values - not specified in the book have not been tested. This may cause problems with - the toolchain packages (Binutils, GCC and Glibc). The small potential gains - achieved in using compiler optimizations are often outweighed by the risks. - First-time builders of LFS are encouraged to build without custom - optimizations. The subsequent system will still run very fast and be stable - at the same time. - - Before the installation instructions, each installation page provides - information about the package, including a concise description of what it - contains, approximately how long it will take to build, and how much disk - space is required during this building process. Following the installation - instructions, there is a list of programs and libraries (along with brief - descriptions of these) that the package installs. - - The SBU values and required disk space includes - test suite data for all applicable packages in Chapter 6. - - - About libraries - - In general, the LFS editors discourage building and installing static - libraries. The original purpose for most static libraries has been made - obsolete in a modern Linux system. In addition linking a static library - into a program can be detrimental. If an update to the library is needed - to remove a security problem, all programs that use the static library will - need to be relinked to the new library. Since the use of static libraries - is not always obvious, the relevant programs (and the procedures needed to - do the linking) may not even be known. - - In the procedures in Chapter 6, we remove or disable installation of - most static libraries. Usually this is done by passing a - option to configure. - In other cases, alternate means are needed. In a few cases, especially - glibc and gcc, the use of static libraries remains essential to the general - package building process. - - For a more complete discussion of libraries, see the discussion - - Libraries: Static or shared? in the BLFS book. - - - + This chapter shows how to build a minimal Linux system. + This system will contain just enough tools to start constructing the final + LFS system in and allow a working + environment with more user convenience than a minimum environment would. + + There are two steps in building this minimal system. The first step + is to build a new and host-independent toolchain (compiler, assembler, + linker, libraries, and a few useful utilities). The second step uses this + toolchain to build the other essential tools. + diff --git a/chapter06/iproute2.xml b/chapter06/iproute2.xml deleted file mode 100644 index 8b868df65..000000000 --- a/chapter06/iproute2.xml +++ /dev/null @@ -1,322 +0,0 @@ - - - %general-entities; -]> - - - - - - iproute2 - &iproute2-version; -
&iproute2-url;
-
- - IPRoute2-&iproute2-version; - - - IPRoute2 - - - - - - <para>The IPRoute2 package contains programs for basic and advanced IPV4-based - networking.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&iproute2-ch6-sbu;</seg> - <seg>&iproute2-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of IPRoute2 - - The arpd program included in this package will not - be built since it is dependent on Berkeley DB, which is not installed in - LFS. However, a directory for arpd and a man page will still - be installed. Prevent this by running the commands below. - If the arpd binary is needed, - instructions for compiling Berkeley DB can be found in the BLFS Book at - . - - -sed -i /ARPD/d Makefile -rm -fv man/man8/arpd.8 - - It is also necessary to disable building two modules that - requires . - -sed -i 's/.m_ipt.o//' tc/Makefile - - Compile the package: - -make - - This package does not have a working test suite. - - - Install the package: - -make DOCDIR=/usr/share/doc/iproute2-&iproute2-version; install - - - - - Contents of IPRoute2 - - - Installed programs - Installed directories - - - bridge, ctstat (link to lnstat), genl, ifcfg, ifstat, ip, lnstat, - nstat, routef, routel, rtacct, rtmon, rtpr, rtstat (link to lnstat), ss, - and tc - /etc/iproute2, /usr/lib/tc, and /usr/share/doc/iproute2-&iproute2-version;, - - - - - - Short Descriptions - - - - - bridge - - Configures network bridges - - bridge - - - - - - ctstat - - Connection status utility - - ctstat - - - - - - genl - - Generic netlink utility frontend - - genl - - - - - - ifcfg - - A shell script wrapper for the ip command - [Note that it requires the arping and - rdisk programs from the - iputils package found at .] - - ifcfg - - - - - - ifstat - - Shows the interface statistics, including the amount of - transmitted and received packets 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 continuously monitor - the state of devices, addresses and routes - - ip - - - - - - lnstat - - Provides Linux network statistics; it is a generalized and more - feature-complete replacement for the old rtstat - program - - lnstat - - - - - - 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 - - - - - - rtacct - - Displays the contents of - /proc/net/rt_acct - - rtacct - - - - - - rtmon - - Route monitoring utility - - rtmon - - - - - - rtpr - - Converts the output of ip -o back into a - readable form - - rtpr - - - - - - 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 deleted file mode 100644 index 2f9cfd3f1..000000000 --- a/chapter06/kbd.xml +++ /dev/null @@ -1,392 +0,0 @@ - - - %general-entities; -]> - - - - - - kbd - &kbd-version; -
&kbd-url;
-
- - Kbd-&kbd-version; - - - Kbd - - - - - - <para>The Kbd package contains key-table files, console fonts, and keyboard - utilities.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&kbd-ch6-sbu;</seg> - <seg>&kbd-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Kbd - - The behaviour of the Backspace and Delete keys is not consistent - across the keymaps in the Kbd package. The following patch fixes this - issue for i386 keymaps: - -patch -Np1 -i ../&kbd-backspace-patch; - - After patching, the Backspace key generates the character with code 127, - and the Delete key generates a well-known escape sequence. - - Remove the redundant resizecons program (it requires - the defunct svgalib to provide the video mode files - for normal use - setfont sizes the console appropriately) together with its - manpage. - -sed -i 's/\(RESIZECONS_PROGS=\)yes/\1no/g' configure -sed -i 's/resizecons.8 //' docs/man/man8/Makefile.in - - Prepare Kbd for compilation: - -./configure --prefix=/usr --disable-vlock - - - The meaning of the configure options: - - - --disable-vlock - - This option prevents the vlock utility from being built, as it - requires the PAM library, which isn't available in the chroot - environment. - - - - - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install - - - For some languages (e.g., Belarusian) the Kbd package doesn't - provide a useful keymap where the stock by keymap assumes - the ISO-8859-5 encoding, and the CP1251 keymap is normally used. Users of - such languages have to download working keymaps separately. - - - If desired, install the documentation: - -mkdir -v /usr/share/doc/kbd-&kbd-version; -cp -R -v docs/doc/* /usr/share/doc/kbd-&kbd-version; - - - - - Contents of Kbd - - - Installed programs - Installed directories - - - chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, kbdinfo, - kbd_mode, kbdrate, loadkeys, loadunimap, - mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to - psfxtable), psfstriptable (link to psfxtable), psfxtable, - setfont, setkeycodes, setleds, setmetamode, setvtrgb, - showconsolefont, showkey, unicode_start, and unicode_stop - /usr/share/consolefonts, /usr/share/consoletrans, /usr/share/keymaps, - /usr/share/doc/kbd-&kbd-version;, and /usr/share/unimaps - - - - - 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 - - - - - - kbdinfo - - Obtains information about the status of a console - - kbdinfo - - - - - - 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 - - Adds a Unicode character table to a console font - - psfaddtable - - - - - - psfgettable - - Extracts the embedded Unicode character table from a console - font - - psfgettable - - - - - - psfstriptable - - Removes the embedded Unicode character table from a console - font - - psfstriptable - - - - - - psfxtable - - Handles Unicode character tables for console fonts - - psfxtable - - - - - - 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 - - - - - - setmetamode - - Defines the keyboard meta-key handling - - setmetamode - - - - - - setvtrgb - - Sets the console color map in all virtual terminals - - setvtrgb - - - - - - 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 [Don't use this - program unless your keymap file is in the ISO-8859-1 encoding. For - other encodings, this utility produces incorrect results.] - - unicode_start - - - - - - unicode_stop - - Reverts keyboard and console from UNICODE mode - - unicode_stop - - - - - - - - -
diff --git a/chapter06/kernfs.xml b/chapter06/kernfs.xml new file mode 100644 index 000000000..dd6b8991c --- /dev/null +++ b/chapter06/kernfs.xml @@ -0,0 +1,115 @@ + + + %general-entities; +]> + + + + + Preparing Virtual Kernel File Systems + + + /dev/* + + + Various file systems exported by the kernel are used to communicate to + and from the kernel itself. These file systems are virtual in that no disk + space is used for them. The content of the file systems resides in + memory. + + Begin by creating directories onto which the file systems will be + mounted: + +mkdir -pv $LFS/{dev,proc,sys,run} + + + 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. The device nodes must be created + on the hard disk so that they are available before udevd + has been started, and additionally when Linux is started with + init=/bin/bash. Create the devices by running the + following commands: + +mknod -m 600 $LFS/dev/console c 5 1 +mknod -m 666 $LFS/dev/null c 1 3 + + + + + Mounting and Populating /dev + + The recommended method of populating the /dev directory with devices is to mount a + virtual filesystem (such as tmpfs) on the /dev directory, and allow the devices to be + created dynamically on that virtual filesystem as they are detected or + accessed. Device creation is generally done during the boot process + by Udev. Since this new system does not yet have Udev and has not yet + been booted, it is necessary to mount and populate /dev manually. This is accomplished by bind + mounting the host system's /dev + directory. A bind mount is a special type of mount that allows you to + create a mirror of a directory or mount point to some other location. Use + the following command to achieve this: + +mount -v --bind /dev $LFS/dev + + + + + Mounting Virtual Kernel File Systems + + Now mount the remaining virtual kernel filesystems: + +mount -v --bind /dev/pts $LFS/dev/pts +mount -vt proc proc $LFS/proc +mount -vt sysfs sysfs $LFS/sys +mount -vt tmpfs tmpfs $LFS/run + + + The meaning of the mount options for devpts: + + + gid=5 + + This ensures that all devpts-created device nodes are owned by + group ID 5. This is the ID we will use later on for the tty group. We use the group ID instead + of a name, since the host system might use a different ID for its + tty group. + + + + + mode=0620 + + This ensures that all devpts-created device nodes have mode 0620 + (user readable and writable, group writable). Together with the + option above, this ensures that devpts will create device nodes that + meet the requirements of grantpt(), meaning the Glibc + pt_chown helper binary (which is not installed by + default) is not necessary. + + + + + + In some host systems, /dev/shm is a + symbolic link to /run/shm. + The /run tmpfs was mounted above so in this case only a + directory needs to be created. + +if [ -h $LFS/dev/shm ]; then + mkdir -pv $LFS/$(readlink $LFS/dev/shm) +fi + + + + diff --git a/chapter06/kmod.xml b/chapter06/kmod.xml deleted file mode 100644 index 6cc3eb168..000000000 --- a/chapter06/kmod.xml +++ /dev/null @@ -1,211 +0,0 @@ - - - %general-entities; -]> - - - - - - kmod - &kmod-version; -
&kmod-url;
-
- - Kmod-&kmod-version; - - - Kmod - - - - - - <para>The Kmod package contains libraries and utilities for loading kernel - modules</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&kmod-ch6-sbu;</seg> - <seg>&kmod-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Kmod - - Prepare Kmod for compilation: - -./configure --prefix=/usr \ - --bindir=/bin \ - --sysconfdir=/etc \ - --with-rootlibdir=/lib \ - --with-xz \ - --with-zlib - - - The meaning of the configure options: - - - --with-xz, --with-zlib - - These options enable Kmod to handle compressed kernel modules. - - - - - --with-rootlibdir=/lib - - This option ensures different library related files are placed - in the correct directories. - - - - - - Compile the package: - -make - - This package does not come with a test suite that can be run in the - LFS chroot environment. At a minimum the git program is required and - several tests will not run outside of a git repository. - - - Install the package, and create symlinks for - compatibility with Module-Init-Tools (the package that previously handled - Linux kernel modules): - -make install - -for target in depmod insmod lsmod modinfo modprobe rmmod; do - ln -sfv ../bin/kmod /sbin/$target -done - -ln -sfv kmod /bin/lsmod - - - - - Contents of Kmod - - - Installed programs - Installed library - - - depmod (link to kmod), insmod (link to kmod), kmod, - lsmod (link to kmod), modinfo (link to kmod), modprobe (link to kmod), - and rmmod (link to kmod) - libkmod.so - - - - - 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 - - - - - - insmod - - Installs a loadable module in the running kernel - - insmod - - - - - - kmod - - Loads and unloads kernel modules - - kmod - - - - - - 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 - - - - - - libkmod - - This library is used by other programs to load and unload kernel - modules - - libkmod - - - - - - - - -
- diff --git a/chapter06/less.xml b/chapter06/less.xml deleted file mode 100644 index 087b2e6a3..000000000 --- a/chapter06/less.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - %general-entities; -]> - - - - - - less - &less-version; -
&less-url;
-
- - Less-&less-version; - - - Less - - - - - - <para>The Less package contains a text file viewer.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&less-ch6-sbu;</seg> - <seg>&less-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Less - - Prepare Less for compilation: - -./configure --prefix=/usr --sysconfdir=/etc - - - The meaning of the configure options: - - - --sysconfdir=/etc - - This option tells the programs created by the package to look - in /etc for the configuration - files. - - - - - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make install - - - - - Contents of Less - - - 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/libcap.xml b/chapter06/libcap.xml deleted file mode 100644 index 8126dfaae..000000000 --- a/chapter06/libcap.xml +++ /dev/null @@ -1,166 +0,0 @@ - - - %general-entities; -]> - - - - - - libcap - &libcap-version; -
&libcap-url;
-
- - Libcap-&libcap-version; - - - Libcap - - - - - - <para>The Libcap package implements the user-space interfaces to the POSIX - 1003.1e capabilities available in Linux kernels. These capabilities are a - partitioning of the all powerful root privilege into a set of distinct - privileges.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&libcap-ch6-sbu;</seg> - <seg>&libcap-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Libcap - - Prevent a static library from being installed: - -sed -i '/install.*STACAPLIBNAME/d' libcap/Makefile - - Compile the package: - -make lib=lib - - - The meaning of the make option: - - - lib=lib - - This parameter sets the library directory to - /lib rather than - /lib64 on x86_64. It has no effect on - x86. - - - - - To test the results, issue: - -make test - - Install the package and do some cleanup: - -make lib=lib PKGCONFIGDIR=/usr/lib/pkgconfig install -chmod -v 755 /lib/libcap.so.&libcap-version; -mv -v /lib/libpsx.a /usr/lib -rm -v /lib/libcap.so -ln -sfv ../../lib/libcap.so.2 /usr/lib/libcap.so - - - - - Contents of Libcap - - - Installed programs - Installed library - - - capsh, getcap, getpcaps, and setcap - libcap.so and libpsx.a - - - - - Short Descriptions - - - - - capsh - - A shell wrapper to explore and constrain capability support - - capsh - - - - - - getcap - - Examines file capabilities - - getcap - - - - - - getpcaps - - Displays the capabilities on the queried process(es) - - getpcaps - - - - - - setcap - - Sets file capabilities - - setcap - - - - - - libcap - - Contains the library functions for manipulating POSIX 1003.1e - capabilities - - libcap - - - - - - libpsx - - Contains functions to support POSIX semantics for syscalls - associated with the pthread library - - libpsx - - - - - - - - -
diff --git a/chapter06/libelf.xml b/chapter06/libelf.xml deleted file mode 100644 index b559e6aa2..000000000 --- a/chapter06/libelf.xml +++ /dev/null @@ -1,88 +0,0 @@ - - - %general-entities; -]> - - - - - - libelf - &elfutils-version; -
&elfutils-url;
-
- - Libelf from Elfutils-&elfutils-version; - - - Libelf - - - - - - <para>Libelf is a library for handling ELF (Executable and Linkable Format) - files.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&elfutils-ch6-sbu;</seg> - <seg>&elfutils-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Libelf - - Libelf is part of elfutils-&elfutils-version; package. Use - the elfutils-&elfutils-version;.tar.bz2 as the source tarball. - - Prepare Libelf for compilation: - -./configure --prefix=/usr --disable-debuginfod - - Compile the package: - -make - - To test the results, issue: - -make check - - - - Install only Libelf: - -make -C libelf install -install -vm644 config/libelf.pc /usr/lib/pkgconfig -rm /usr/lib/libelf.a - - - - - Contents of Libelf - - - Installed Library - Installed Directory - - - - libelf.so - - - /usr/include/elfutils - - - - - - -
diff --git a/chapter06/libffi.xml b/chapter06/libffi.xml deleted file mode 100644 index 6a6f8a458..000000000 --- a/chapter06/libffi.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - %general-entities; -]> - - - - - - libffi - &libffi-version; -
&libffi-url;
-
- - Libffi-&libffi-version; - - - libffi - - - - - - <para>The Libffi library provides a portable, high level programming - interface to various calling conventions. This allows a programmer to call - any function specified by a call interface description at run time.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&libffi-ch6-sbu;</seg> - <seg>&libffi-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Libffi - - - Similar to GMP, libffi builds with optimizations specific - to the proccesor in use. If building for another system, export - CFLAGS and CXXFLAGS to specify a generic build for your architecture. - If this is not done, all applications that link to libffi will trigger - Illegal Operation Errors. - - - Prepare libffi for compilation: - -./configure --prefix=/usr --disable-static --with-gcc-arch=native - - - The meaning of the configure option: - - - --with-gcc-arch=native - - Ensure gcc optimizes for the current system. If this - is not specified, the system is guessed and the code generated - may not be correct for some systems. If the generated code - will be copied from the native system to a less capable - system, use the less capable system as a parameter. For details - about alternative system types, see - the x86 options in the gcc manual. - - - - - - Compile the package: - -make - - To test the results, issue: - -make check - - Six tests, all related to test-callback.c, are known to fail. - - Install the package: - -make install - - - - - Contents of Libffi - - - Installed library - - - libffi.so - - - - - Short Descriptions - - - - - libffi - - contains the libffi API functions. - - libffi - - - - - - - -
- diff --git a/chapter06/libpipeline.xml b/chapter06/libpipeline.xml deleted file mode 100644 index eb5a19438..000000000 --- a/chapter06/libpipeline.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - %general-entities; -]> - - - - - - libpipeline - &libpipeline-version; -
&libpipeline-url;
-
- - Libpipeline-&libpipeline-version; - - - Libpipeline - - - - - - <para>The Libpipeline package contains a library for manipulating pipelines - of subprocesses in a flexible and convenient way.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&libpipeline-ch6-sbu;</seg> - <seg>&libpipeline-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Libpipeline - - Prepare Libpipeline for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install - - - - - Contents of Libpipeline - - - Installed library - - - libpipeline.so - - - - - Short Descriptions - - - - - libpipeline - - This library is used to safely construct pipelines between - subprocesses - - libpipeline - - - - - - - -
diff --git a/chapter06/libstdc++-pass2.xml b/chapter06/libstdc++-pass2.xml new file mode 100644 index 000000000..999a4fa4e --- /dev/null +++ b/chapter06/libstdc++-pass2.xml @@ -0,0 +1,114 @@ + + + %general-entities; +]> + + + + + + gcc-libstdc++ + &gcc-version; +
&gcc-url;
+
+ + Libstdc++ from GCC-&gcc-version;, Pass 2 + + + GCC + tools, libstdc++ pass 2 + + + + + + <para>Again, when building <xref linkend="ch-tools-gcc-pass2"/>, we had to + defer the installation of the C++ standard library, because no suitable + compiler was available to compile it: we could not use the compiler + installed, because this compiler is a native + compiler, and should not be used outside of chroot without being at + risk of polluting the build with some host components.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <!-- TODO --> + <seglistitem> + <seg>&libstdcpp-ch5-sbu;</seg> + <seg>&libstdcpp-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Target Libstdc++ + + + Libstdc++ is part of the GCC sources. + You should first unpack the GCC tarball and change to the + gcc-&gcc-version; directory. + + + Create a link which exists when building Libstdc++ in the gcc + tree: + +ln -s gthr-posix.h libgcc/gthr-default.h + + Create a separate build directory for Libstdc++ and enter it: + +mkdir -v build +cd build + + Prepare Libstdc++ for compilation: + +../libstdc++-v3/configure \ + CXXFLAGS="-g -O2 -D_GNU_SOURCE" \ + --prefix=/usr \ + --disable-multilib \ + --disable-nls \ + --disable-libstdcxx-pch + + + The meaning of the configure options: + + + CXXFLAGS="-g -O2 -D_GNU_SOURCE" + + Those flags are passed by the top level Makefile when doing + a full build of GCC. + + + + + --disable-libstdcxx-pch + + This switch prevents the installation of precompiled + include files, which are not needed at this stage. + + + + + + Compile libstdc++ by running: + +make + + Install the library: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/libstdc++.xml b/chapter06/libstdc++.xml new file mode 100644 index 000000000..3a1b0f2bf --- /dev/null +++ b/chapter06/libstdc++.xml @@ -0,0 +1,122 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-libstdcpp-pass1" role="wrap"> + <?dbhtml filename="gcc-libstdc++-pass1.html"?> + + <sect1info condition="script"> + <productname>gcc-libstdc++</productname> + <productnumber>&gcc-version;</productnumber> + <address>&gcc-url;</address> + </sect1info> + + <title>Libstdc++ from GCC-&gcc-version;, Pass 1 + + + GCC + tools, libstdc++ pass 1 + + + + + + <para>Libstdc++ is the standard C++ library. It is needed + to compile C++ code + (part of GCC is written in C++), but we had to defer its installation + when we built <xref linkend="ch-tools-gcc-pass1"/> + because it depends on glibc, which was not yet available in the target + directory. + </para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&libstdcpp-ch5-sbu;</seg> + <seg>&libstdcpp-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Target Libstdc++ + + + Libstdc++ is part of the GCC sources. + You should first unpack the GCC tarball and change to the + gcc-&gcc-version; directory. + + + Create a separate build directory for Libstdc++ and enter it: + +mkdir -v build +cd build + + Prepare Libstdc++ for compilation: + +../libstdc++-v3/configure \ + --host=$LFS_TGT \ + --build=$(../config.guess) \ + --prefix=/usr \ + --disable-multilib \ + --disable-nls \ + --disable-libstdcxx-pch \ + --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version; + + + The meaning of the configure options: + + + --host=... + + Indicates to use the cross compiler we have just built + instead of the one in /usr/bin. + + + + + --disable-libstdcxx-pch + + This switch prevents the installation of precompiled + include files, which are not needed at this stage. + + + + + --with-gxx-include-dir=/tools/$LFS_TGT/include/c++/&gcc-version; + + This is the location where the standard include files are + searched by the C++ compiler. In a normal build, this information + is automatically passed to the Libstdc++ configure + options from the top level directory. In our case, this information + must be explicitly given. + + + + + + Compile libstdc++ by running: + +make + + Install the library: + +make DESTDIR=$LFS install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/libtool.xml b/chapter06/libtool.xml deleted file mode 100644 index 3093b4164..000000000 --- a/chapter06/libtool.xml +++ /dev/null @@ -1,129 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-libtool" role="wrap"> - <?dbhtml filename="libtool.html"?> - - <sect1info condition="script"> - <productname>libtool</productname> - <productnumber>&libtool-version;</productnumber> - <address>&libtool-url;</address> - </sect1info> - - <title>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> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&libtool-ch6-sbu;</seg> - <seg>&libtool-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Libtool - - Prepare Libtool for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - -To test the results, issue: - -make check - - The test time for libtool can be reduced significantly on a - system with multiple cores. To do this, append - TESTSUITEFLAGS=-j<N> to the line above. For - instance, using -j4 can reduce the test time by over 60 - percent. - - Five tests are known to fail in the LFS build environment due - to a circular dependency, but all tests pass if rechecked after - automake is installed. - - Install the package: - -make install - - - - - - Contents of Libtool - - - Installed programs - Installed libraries - Installed directories - - - libtool and libtoolize - libltdl.so - /usr/include/libltdl and /usr/share/libtool - - - - - 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-headers.xml b/chapter06/linux-headers.xml new file mode 100644 index 000000000..6c1af3173 --- /dev/null +++ b/chapter06/linux-headers.xml @@ -0,0 +1,207 @@ + + + %general-entities; +]> + + + + + + linux-headers + &linux-version; +
&linux-url;
+
+ + Linux-&linux-version; API Headers + + + Linux + tools, API headers + + + + + + <para>The Linux API Headers (in linux-&linux-version;.tar.xz) expose the + kernel's API for use by Glibc.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&linux-headers-ch5-sbu;</seg> + <seg>&linux-headers-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Linux API Headers + + The Linux kernel needs to expose an Application Programming Interface + (API) for the system's C library (Glibc in LFS) to use. This is done + by way of sanitizing various C header files that are shipped in the Linux + kernel source tarball. + + Make sure there are no stale files embedded in the package: + +make mrproper + + Now extract the user-visible kernel headers from the source. + The recommended make target headers_install cannot be + used, because it requires rsync, which may not + be available. The headers are first placed in + ./usr, then copied to the needed + location. + +make headers +find usr/include -name '.*' -delete +rm usr/include/Makefile +cp -rv usr/include $LFS/usr + + + + + Contents of Linux API Headers + + + Installed headers + Installed directories + + + /usr/include/asm/*.h, /usr/include/asm-generic/*.h, + /usr/include/drm/*.h, /usr/include/linux/*.h, /usr/include/misc/*.h, + /usr/include/mtd/*.h, /usr/include/rdma/*.h, /usr/include/scsi/*.h, + /usr/include/sound/*.h, /usr/include/video/*.h, + and /usr/include/xen/*.h + /usr/include/asm, /usr/include/asm-generic, /usr/include/drm, + /usr/include/linux, /usr/include/misc, /usr/include/mtd, + /usr/include/rdma, /usr/include/scsi, /usr/include/sound, + /usr/include/video, and /usr/include/xen + + + + + Short Descriptions + + + + + /usr/include/asm/*.h + + The Linux API ASM Headers + + /usr/include/asm/*.h + + + + + + /usr/include/asm-generic/*.h + + The Linux API ASM Generic Headers + + /usr/include/asm-generic/*.h + + + + + + /usr/include/drm/*.h + + The Linux API DRM Headers + + /usr/include/drm/*.h + + + + + + /usr/include/linux/*.h + + The Linux API Linux Headers + + /usr/include/linux/*.h + + + + + + /usr/include/misc/*.h + + The Linux API Miscellaneous Headers + + /usr/include/misc/*.h + + + + + + /usr/include/mtd/*.h + + The Linux API MTD Headers + + /usr/include/mtd/*.h + + + + + + /usr/include/rdma/*.h + + The Linux API RDMA Headers + + /usr/include/rdma/*.h + + + + + + /usr/include/scsi/*.h + + The Linux API SCSI Headers + + /usr/include/scsi/*.h + + + + + + /usr/include/sound/*.h + + The Linux API Sound Headers + + /usr/include/sound/*.h + + + + + + /usr/include/video/*.h + + The Linux API Video Headers + + /usr/include/video/*.h + + + + + + /usr/include/xen/*.h + + The Linux API Xen Headers + + /usr/include/xen/*.h + + + + + + + + +
diff --git a/chapter06/m4.xml b/chapter06/m4.xml index 7fe282ee7..79559f6da 100644 --- a/chapter06/m4.xml +++ b/chapter06/m4.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,22 +16,25 @@ M4-&m4-version; - + M4 + tools - <para>The M4 package contains a macro processor.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/m4.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&m4-ch6-sbu;</seg> - <seg>&m4-ch6-du;</seg> + <seg>&m4-ch5-sbu;</seg> + <seg>&m4-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -40,64 +43,31 @@ <sect2 role="installation"> <title>Installation of M4 - First, make some fixes required by glibc-2.28: + First, make some fixes introduced by glibc-2.28: sed -i 's/IO_ftrylockfile/IO_EOF_SEEN/' lib/*.c echo "#define _IO_IN_BACKUP 0x100" >> lib/stdio-impl.h Prepare M4 for compilation: -./configure --prefix=/usr +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) Compile the package: make - To test the results, issue: - -make check - Install the package: -make install +make DESTDIR=$LFS install - - Contents of M4 - - - 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 - - - - - + + + <para>Details on this package are located in + <xref linkend="contents-m4" role="."/></para> </sect2> diff --git a/chapter06/make.xml b/chapter06/make.xml index 9c649cdc5..fef5555aa 100644 --- a/chapter06/make.xml +++ b/chapter06/make.xml @@ -4,8 +4,7 @@ <!ENTITY % general-entities SYSTEM "../general.ent"> %general-entities; ]> - -<sect1 id="ch-system-make" role="wrap"> +<sect1 id="ch-tools-make" role="wrap"> <?dbhtml filename="make.html"?> <sect1info condition="script"> @@ -16,22 +15,25 @@ <title>Make-&make-version; - + Make + tools - <para>The Make package contains a program for compiling packages.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/make.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&make-ch6-sbu;</seg> - <seg>&make-ch6-du;</seg> + <seg>&make-ch5-sbu;</seg> + <seg>&make-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -39,60 +41,42 @@ <sect2 role="installation"> <title>Installation of Make - Prepare Make for compilation: -./configure --prefix=/usr +./configure --prefix=/usr \ + --without-guile \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) - Compile the package: + + The meaning of the new configure option: -make + + --without-guile + + Although we are cross-compiling, configure tries to use + guile from the build host if it finds it. This makes compilation + fail, so this switch prevents using it. + + + - The test suite needs to know where supporting perl files are located. - We use an environment variable to accomplish this. To test the - results, issue: + Compile the package: -make check +make Install the package: -make install +make DESTDIR=$LFS install + + - <sect2 id="contents-make" role="content"> - <title>Contents of Make - - - Installed program - - - make - - - - - Short Descriptions - - - - - make - - Automatically determines which pieces of a package need to - be (re)compiled and then issues the relevant commands - - make - - - - - + Details on this package are located in + diff --git a/chapter06/man-db.xml b/chapter06/man-db.xml deleted file mode 100644 index f2f46b891..000000000 --- a/chapter06/man-db.xml +++ /dev/null @@ -1,456 +0,0 @@ - - - %general-entities; -]> - - - - - - man-db - &man-db-version; -
&man-db-url;
-
- - Man-DB-&man-db-version; - - - Man-DB - - - - - - <para>The Man-DB package contains programs for finding and viewing man - pages.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&man-db-ch6-sbu;</seg> - <seg>&man-db-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Man-DB - - Prepare Man-DB for compilation: - -sed -i '/find/s@/usr@@' init/systemd/man-db.service.in - -./configure --prefix=/usr \ - --docdir=/usr/share/doc/man-db-&man-db-version; \ - --sysconfdir=/etc \ - --disable-setuid \ - --enable-cache-owner=bin \ - --with-browser=/usr/bin/lynx \ - --with-vgrind=/usr/bin/vgrind \ - --with-grap=/usr/bin/grap - -./configure --prefix=/usr \ - --docdir=/usr/share/doc/man-db-&man-db-version; \ - --sysconfdir=/etc \ - --disable-setuid \ - --enable-cache-owner=bin \ - --with-browser=/usr/bin/lynx \ - --with-vgrind=/usr/bin/vgrind \ - --with-grap=/usr/bin/grap \ - --with-systemdtmpfilesdir= \ - --with-systemdsystemunitdir= - - - The meaning of the configure options: - - - sed -i '/find/s@/usr@@' init/systemd/man-db.service.in - - This changes a harcoded path to the find - utility, which we install in - /bin. - - - - - --disable-setuid - - This disables making the man program setuid - to user man. - - - - - --enable-cache-owner=bin - - This makes the system-wide cache files be owned by user - bin. - - - - - --with-... - - These three parameters are used to set some default programs. - lynx is a text-based web browser (see - BLFS for installation instructions), vgrind - converts program sources to Groff input, and grap - is useful for typesetting graphs in Groff documents. The - vgrind and grap programs are - not normally needed for viewing manual pages. They are not part of - LFS or BLFS, but you should be able to install them yourself after - finishing LFS if you wish to do so. - - - - - --with-systemd... - - These parameters prevent installing unneeded systemd - directories and files. - - - - - - Compile the package: - -make - - To test the results, issue: - -make check - - One test, man-missing-locales, is known to fail in the LFS chroot envirnment. - - Install the package: - -make install - - - - - Non-English Manual Pages in LFS - - The following table shows the character set that Man-DB assumes - manual pages installed under - /usr/share/man/<ll> will be - encoded with. In addition to this, Man-DB correctly determines if manual - pages installed in that directory are UTF-8 encoded. - - - -Expected character encoding of legacy 8-bit manual pages - - - - - - - - - - - - Language (code) - Encoding - Language (code) - Encoding - - - - - - Danish (da) - ISO-8859-1 - Croatian (hr) - ISO-8859-2 - - - German (de) - ISO-8859-1 - Hungarian (hu) - ISO-8859-2 - - - English (en) - ISO-8859-1 - Japanese (ja) - EUC-JP - - - Spanish (es) - ISO-8859-1 - Korean (ko) - EUC-KR - - - Estonian (et) - ISO-8859-1 - Lithuanian (lt) - ISO-8859-13 - - - Finnish (fi) - ISO-8859-1 - Latvian (lv) - ISO-8859-13 - - - French (fr) - ISO-8859-1 - Macedonian (mk) - ISO-8859-5 - - - Irish (ga) - ISO-8859-1 - Polish (pl) - ISO-8859-2 - - - Galician (gl) - ISO-8859-1 - Romanian (ro) - ISO-8859-2 - - - Indonesian (id) - ISO-8859-1 - Russian (ru) - KOI8-R - - - Icelandic (is) - ISO-8859-1 - Slovak (sk) - ISO-8859-2 - - - Italian (it) - ISO-8859-1 - Slovenian (sl) - ISO-8859-2 - - - Norwegian Bokmal (nb) - ISO-8859-1 - Serbian Latin (sr@latin) - ISO-8859-2 - - - Dutch (nl) - ISO-8859-1 - Serbian (sr) - ISO-8859-5 - - - Norwegian Nynorsk (nn) - ISO-8859-1 - Turkish (tr) - ISO-8859-9 - - - Norwegian (no) - ISO-8859-1 - Ukrainian (uk) - KOI8-U - - - Portuguese (pt) - ISO-8859-1 - Vietnamese (vi) - TCVN5712-1 - - - Swedish (sv) - ISO-8859-1 - Simplified Chinese (zh_CN) - GBK - - - Belarusian (be) - CP1251 - Simplified Chinese, Singapore (zh_SG) - GBK - - - Bulgarian (bg) - CP1251 - Traditional Chinese, Hong Kong (zh_HK) - BIG5HKSCS - - - Czech (cs) - ISO-8859-2 - Traditional Chinese (zh_TW) - BIG5 - - - Greek (el) - ISO-8859-7 - - - - - - - - -
- - - Manual pages in languages not in the list are not supported. - - -
- - - Contents of Man-DB - - - Installed programs - Installed libraries - Installed directories - - - accessdb, apropos (link to whatis), catman, lexgrog, man, mandb, - manpath, and whatis - libman.so and libmandb.so (both in /usr/lib/man-db) - /usr/lib/man-db, /usr/libexec/man-db, - and /usr/share/doc/man-db-&man-db-version; - - - - - Short Descriptions - - - - - accessdb - - Dumps the whatis database contents in - human-readable form - - accessdb - - - - - - apropos - - Searches the whatis database and displays - the short descriptions of system commands that contain a given - string - - apropos - - - - - - catman - - Creates or updates the pre-formatted manual pages - - catman - - - - - - lexgrog - - Displays one-line summary information about a given manual - page - - lexgrog - - - - - - man - - Formats and displays the requested manual page - - man - - - - - - mandb - - Creates or updates the whatis database - - mandb - - - - - - manpath - - Displays the contents of $MANPATH or (if $MANPATH is not set) - a suitable search path based on the settings in man.conf and the - user's environment - - manpath - - - - - - whatis - - Searches the whatis database and displays - the short descriptions of system commands that contain the given - keyword as a separate word - - whatis - - - - - - libman - - Contains run-time support for man - - libman - - - - - - libmandb - - Contains run-time support for man - - libmandb - - - - - - - - -
diff --git a/chapter06/man-pages.xml b/chapter06/man-pages.xml deleted file mode 100644 index 3d2c52046..000000000 --- a/chapter06/man-pages.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - %general-entities; -]> - - - - - - man-pages - &man-pages-version; -
&man-pages-url;
-
- - Man-pages-&man-pages-version; - - - Man-pages - - - - - - <para>The Man-pages package contains over 2,200 man pages.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&man-pages-ch6-sbu;</seg> - <seg>&man-pages-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Man-pages - - Install Man-pages by running: - -make install - - - - - Contents of Man-pages - - - Installed files - - - various man pages - - - - - Short Descriptions - - - - - man pages - - Describe C programming language functions, important - device files, and significant configuration files - - man pages - - - - - - - - -
diff --git a/chapter06/meson.xml b/chapter06/meson.xml deleted file mode 100644 index 0b49c5441..000000000 --- a/chapter06/meson.xml +++ /dev/null @@ -1,109 +0,0 @@ - - - %general-entities; -]> - - - - - - meson - &meson-version; -
&meson-url;
-
- - Meson-&meson-version; - - - Meson - - - - - - <para>Meson is an open source build system meant to be both extremely fast, - and, even more importantly, as user friendly as possible.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - <seglistitem> - <seg>&meson-ch6-sbu;</seg> - <seg>&meson-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Meson - - Compile Meson with the following command: - -python3 setup.py build - - This package does not come with a test suite. - - Install the package: - -python3 setup.py install --root=dest -cp -rv dest/* / - - - The meaning of the install parameters: - - - --root=dest - - By default python3 setup.py install - installs various files (such as man pages) into Python Eggs. - With a specified root location, setup.py installs - these files into a standard hierarchy. Then we can just copy - the hierarchy so the files will be in the standard location. - - - - - - - - - Contents of Meson - - - Installed programs - Installed directory - - - meson - /usr/lib/python&python-minor;/site-packages/meson-&meson-version;-py&python-minor;.egg-info and /usr/lib/python&python-minor;/site-packages/mesonbuild - - - - - Short Descriptions - - - - - meson - - A high productivity build system - - meson - - - - - - - - -
- diff --git a/chapter06/mpc.xml b/chapter06/mpc.xml deleted file mode 100644 index 2d518c8c1..000000000 --- a/chapter06/mpc.xml +++ /dev/null @@ -1,100 +0,0 @@ - - - %general-entities; -]> - - - - - - mpc - &mpc-version; -
&mpc-url;
-
- - MPC-&mpc-version; - - - MPC - - - - - - <para>The MPC package contains a library for the arithmetic of complex - numbers with arbitrarily high precision and correct rounding of the - result.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&mpc-ch6-sbu;</seg> - <seg>&mpc-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of MPC - - Prepare MPC for compilation: - -./configure --prefix=/usr \ - --disable-static \ - --docdir=/usr/share/doc/mpc-&mpc-version; - - Compile the package and generate the HTML documentation: - -make -make html - - To test the results, issue: - -make check - - Install the package and its documentation: - -make install -make install-html - - - - - - Contents of MPC - - - Installed Libraries - Installed Directory - - - libmpc.so - /usr/share/doc/mpc-&mpc-version; - - - - - Short Descriptions - - - - - libmpc - - Contains complex math functions - - libmpc - - - - - - - - -
diff --git a/chapter06/mpfr.xml b/chapter06/mpfr.xml deleted file mode 100644 index ff8e323b7..000000000 --- a/chapter06/mpfr.xml +++ /dev/null @@ -1,105 +0,0 @@ - - - %general-entities; -]> - - - - - - mpfr - &mpfr-version; -
&mpfr-url;
-
- - MPFR-&mpfr-version; - - - MPFR - - - - - - <para>The MPFR package contains functions for multiple precision - math.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&mpfr-ch6-sbu;</seg> - <seg>&mpfr-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of MPFR - - Prepare MPFR for compilation: - -./configure --prefix=/usr \ - --disable-static \ - --enable-thread-safe \ - --docdir=/usr/share/doc/mpfr-&mpfr-version; - - Compile the package and generate the HTML documentation: - -make -make html - - - The test suite for MPFR in this section is considered critical. - Do not skip it under any circumstances. - - - Test the results and ensure that all tests passed: - -make check - - Install the package and its documentation: - -make install -make install-html - - - - - - Contents of MPFR - - - Installed Libraries - Installed directory - - - libmpfr.so - /usr/share/doc/mpfr-&mpfr-version; - - - - - Short Descriptions - - - - - libmpfr - - Contains multiple-precision math functions - - libmpfr - - - - - - - - -
diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml index b37f1f69c..93cf85263 100644 --- a/chapter06/ncurses.xml +++ b/chapter06/ncurses.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,23 +16,25 @@ Ncurses-&ncurses-version; - + Ncurses + tools - <para>The Ncurses package contains libraries for terminal-independent - handling of character screens.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/ncurses.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&ncurses-ch6-sbu;</seg> - <seg>&ncurses-ch6-du;</seg> + <seg>&ncurses-ch5-sbu;</seg> + <seg>&ncurses-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -41,23 +43,45 @@ <sect2 role="installation"> <title>Installation of Ncurses - Don't install a static library that is not handled by configure: + First, ensure that gawk is found first during configuration: -sed -i '/LIBTOOL_INSTALL/d' c++/Makefile.in +sed -i s/mawk// configure + + Then, run the following commands to build the tic + program on the build host: + +mkdir build +cd build +../configure +make -C include +make -C progs tic +cd .. Prepare Ncurses for compilation: -./configure --prefix=/usr \ - --mandir=/usr/share/man \ - --with-shared \ - --without-debug \ - --without-normal \ - --enable-pc-files \ - --enable-widec +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(./config.guess) \ + --mandir=/usr/share/man \ + --with-shared \ + --without-debug \ + --without-ada \ + --without-normal \ + --enable-widec \ + --enable-pc-files The meaning of the new configure options: + + --without-ada + + This ensures that Ncurses does not build support for the Ada + compiler which may be present on the host but will not be available + once we enter the chroot environment. + + + --enable-widec @@ -87,293 +111,46 @@ - + Compile the package: make - This package has a test suite, but it can only be run after the - package has been installed. The tests reside in the - test/ directory. See the - README file in that directory for further details. - - Install the package: - -make install + +make DESTDIR=$LFS TIC_PATH=$(pwd)/build/progs/tic install +ln -s libncursesw.so $LFS/usr/lib/libncurses.so Move the shared libraries to the /lib directory, where they are expected to reside: -mv -v /usr/lib/libncursesw.so.6* /lib +mv -v $LFS/usr/lib/libncursesw.so.6* $LFS/lib Because the libraries have been moved, one symlink points to a non-existent file. Recreate it: -ln -sfv ../../lib/$(readlink /usr/lib/libncursesw.so) /usr/lib/libncursesw.so - - Many applications still expect the linker to be able to find - non-wide-character Ncurses libraries. Trick such applications into linking with - wide-character libraries by means of symlinks and linker scripts: - -for lib in ncurses form panel menu ; do - rm -vf /usr/lib/lib${lib}.so - echo "INPUT(-l${lib}w)" > /usr/lib/lib${lib}.so - ln -sfv ${lib}w.pc /usr/lib/pkgconfig/${lib}.pc -done - - Finally, make sure that old applications that look for - -lcurses at build time are still - buildable: - -rm -vf /usr/lib/libcursesw.so -echo "INPUT(-lncursesw)" > /usr/lib/libcursesw.so -ln -sfv libncurses.so /usr/lib/libcurses.so +ln -sfv ../../lib/$(readlink $LFS/usr/lib/libncursesw.so) $LFS/usr/lib/libncursesw.so - If desired, install the Ncurses documentation: - -mkdir -v /usr/share/doc/ncurses-&ncurses-version; -cp -v -R doc/* /usr/share/doc/ncurses-&ncurses-version; - - - - The instructions above don't create non-wide-character Ncurses - libraries since no package installed by compiling from sources would link - against them at runtime. However, the only known binary-only - applications that link against non-wide-character Ncurses libraries - require version 5. If you must have such libraries because of some binary-only - application or to be compliant with LSB, build the package again with the - following commands: - -make distclean -./configure --prefix=/usr \ - --with-shared \ - --without-normal \ - --without-debug \ - --without-cxx-binding \ - --with-abi-version=5 -make sources libs -cp -av lib/lib*.so.5* /usr/lib - - - Contents of Ncurses - - - Installed programs - Installed libraries - Installed directories - - - - captoinfo (link to tic), - clear, - infocmp, - infotocap (link to tic), - ncursesw6-config, - reset (link to tset), - tabs, - tic, - toe, - tput, and - tset - - - libcursesw.so (symlink and linker script to libncursesw.so), - libformw.so, - libmenuw.so, - libncursesw.so, - libncurses++w.a, - libpanelw.so, and their non-wide-character counterparts without "w" - in the library names. - - /usr/share/tabset, - /usr/share/terminfo, and - /usr/share/doc/ncurses-&ncurses-version; - - - - - - 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 - - - - - - ncursesw6-config - - Provides configuration information for ncurses - - ncursesw6-config - - - - - - reset - - Reinitializes a terminal to its default values - - reset - - - - - - tabs - - Clears and sets tab stops on a terminal - - tabs - - - - - - 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 - - - - - - libcursesw - - A link to libncursesw - - libcursesw - - - - - - libncursesw - - 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 - - libncursesw - - - - - - libformw - - Contains functions to implement forms - - libformw - - - - - - libmenuw - - Contains functions to implement menus - - libmenuw - - - - - - libpanelw - - Contains functions to implement panels - - libpanelw - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-ncurses" role="."/></para> </sect2> diff --git a/chapter06/ninja.xml b/chapter06/ninja.xml deleted file mode 100644 index e998c64fb..000000000 --- a/chapter06/ninja.xml +++ /dev/null @@ -1,132 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-ninja" role="wrap"> - <?dbhtml filename="ninja.html"?> - - <sect1info condition="script"> - <productname>ninja</productname> - <productnumber>&ninja-version;</productnumber> - <address>&ninja-url;</address> - </sect1info> - - <title>Ninja-&ninja-version; - - - Ninja - - - - - - <para>Ninja is a small build system with a focus on speed.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&ninja-ch6-sbu;</seg> - <seg>&ninja-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Ninja - - When run, ninja normally runs a maximum number of processes - in parallel. By default this is the number of cores on the system - plus two. In some cases this can overheat a CPU or run a system out - of memory. If run from the command line, passing a -jN parameter - will limit the number of parallel processes, but some packages - embed the execution of ninja and do not pass a -j parameter. - - Using the optional procedure below allows a user to - limit the number of parallel processes via an environment variable, - NINJAJOBS. For example, setting: - - - - export NINJAJOBS=4 - - will limit ninja to four parallel processes. - - If desired, add the capability to use the environment variable - NINJAJOBS by running: - -sed -i '/int Guess/a \ - int j = 0;\ - char* jobs = getenv( "NINJAJOBS" );\ - if ( jobs != NULL ) j = atoi( jobs );\ - if ( j > 0 ) return j;\ -' src/ninja.cc - - Build Ninja with: - -python3 configure.py --bootstrap - - - The meaning of the build option: - - - --bootstrap - - This parameter forces ninja to rebuild itself for the current - system. - - - - - - To test the results, issue: - -./ninja ninja_test -./ninja_test --gtest_filter=-SubprocessTest.SetWithLots - - Install the package: - -install -vm755 ninja /usr/bin/ -install -vDm644 misc/bash-completion /usr/share/bash-completion/completions/ninja -install -vDm644 misc/zsh-completion /usr/share/zsh/site-functions/_ninja - - - - - Contents of Ninja - - - Installed programs - - - ninja - - - - Short Descriptions - - - - - ninja - - is the Ninja build system. - - ninja - - - - - - - - - - diff --git a/chapter06/openssl.xml b/chapter06/openssl.xml deleted file mode 100644 index f2ff1fa80..000000000 --- a/chapter06/openssl.xml +++ /dev/null @@ -1,176 +0,0 @@ - - - %general-entities; -]> - - - - - - openssl - &openssl-version; -
&openssl-url;
-
- - OpenSSL-&openssl-version; - - - OpenSSL - - - - - - <para>The OpenSSL package contains management tools and libraries relating - to cryptography. These are useful for providing cryptographic functions - to other packages, such as OpenSSH, email applications and web browsers - (for accessing HTTPS sites). </para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&openssl-ch6-sbu;</seg> - <seg>&openssl-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of OpenSSL - - Prepare OpenSSL for compilation: - -./config --prefix=/usr \ - --openssldir=/etc/ssl \ - --libdir=lib \ - shared \ - zlib-dynamic - - Compile the package: - -make - - To test the results, issue: - -make test - - One test 30-test_afalg.t is known to fail on some kernel - configurations (it apparently assumes certain unspecified crypto - options have been selected). - - Install the package: - -sed -i '/INSTALL_LIBS/s/libcrypto.a libssl.a//' Makefile -make MANSUFFIX=ssl install - - If desired, install the documentation: - -mv -v /usr/share/doc/openssl /usr/share/doc/openssl-&openssl-version; -cp -vfr doc/* /usr/share/doc/openssl-&openssl-version; - - - - - Contents of OpenSSL - - - Installed programs - Installed libraries - Installed directories - - - - c_rehash and openssl - - - libcrypto.{so,a} and libssl.{so,a} - - - /etc/ssl, - /usr/include/openssl, - /usr/lib/engines and - /usr/share/doc/openssl-&openssl-version; - - - - - - Short Descriptions - - - - - c_rehash - - - is a Perl script that scans all files in - a directory and adds symbolic links to their hash values. - - - c_rehash - - - - - - openssl - - - is a command-line tool for using the various cryptography functions - of OpenSSL's crypto library from the - shell. It can be used for various functions which are documented in - man 1 openssl. - - - openssl - - - - - - libcrypto.so - - - implements a wide range of cryptographic algorithms used in various - Internet standards. The services provided by this library are used - by the OpenSSL implementations of SSL, - TLS and S/MIME, and they have also been used to implement - OpenSSH, - OpenPGP, and other cryptographic - standards. - - - libcrypto.so - - - - - - libssl.so - - - implements the Transport Layer Security (TLS v1) protocol. - It provides a rich API, documentation - on which can be found by running man 3 ssl. - - - libssl.so - - - - - - - - -
diff --git a/chapter06/patch.xml b/chapter06/patch.xml index 6c6c6852b..ecd5b2c47 100644 --- a/chapter06/patch.xml +++ b/chapter06/patch.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,24 +16,25 @@ Patch-&patch-version; - + Patch + tools - <para>The Patch package contains a program for modifying or creating files - by applying a <quote>patch</quote> file typically created by the - <command>diff</command> program.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/patch.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&patch-ch6-sbu;</seg> - <seg>&patch-ch6-du;</seg> + <seg>&patch-ch5-sbu;</seg> + <seg>&patch-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -44,52 +45,25 @@ <para>Prepare Patch for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess)</userinput></screen> <para>Compile the package:</para> <screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> - -<screen><userinput remap="test">make check</userinput></screen> - <para>Install the package:</para> -<screen><userinput remap="install">make install</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> </sect2> - <sect2 id="contents-patch" role="content"> - <title>Contents of Patch - - - Installed program - - - patch - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="patch"> - <term><command>patch</command></term> - <listitem> - <para>Modifies files according to a patch file [A patch file is - normally a difference listing created with the <command>diff</command> - program. By applying these differences to the original files, - <command>patch</command> creates the patched versions.]</para> - <indexterm zone="ch-system-patch patch"> - <primary sortas="b-patch">patch</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-patch" role="."/></para> </sect2> diff --git a/chapter06/perl.xml b/chapter06/perl.xml index 284464d87..663d3dbc2 100644 --- a/chapter06/perl.xml +++ b/chapter06/perl.xml @@ -5,7 +5,7 @@ %general-entities; ]> -<sect1 id="ch-system-perl" role="wrap"> +<sect1 id="ch-tools-perl" role="wrap"> <?dbhtml filename="perl.html"?> <sect1info condition="script"> @@ -16,23 +16,25 @@ <title>Perl-&perl-version; - + Perl + tools - <para>The Perl package contains the Practical Extraction and Report - Language.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter06/perl.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&perl-ch6-sbu;</seg> - <seg>&perl-ch6-du;</seg> + <seg>&perl-ch5-sbu;</seg> + <seg>&perl-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -41,481 +43,36 @@ <sect2 role="installation"> <title>Installation of Perl - First create a basic /etc/hosts file to be - referenced in one of Perl's configuration files as well as the optional - test suite: + Prepare Perl for compilation: -echo "127.0.0.1 localhost $(hostname)" > /etc/hosts - - This version of Perl now builds the Compress::Raw::Zlib and - Compress::Raw::BZip2 modules. By - default Perl will use an internal copy of the sources for the build. - Issue the following command so that Perl will use the libraries - installed on the system: - -export BUILD_ZLIB=False -export BUILD_BZIP2=0 - - - To have full control over the way Perl is set up, you can remove the - -des options from the following command and hand-pick the way - this package is built. Alternatively, use the command exactly as below to - use the defaults that Perl auto-detects: - -sh Configure -des -Dprefix=/usr \ - -Dvendorprefix=/usr \ - -Dman1dir=/usr/share/man/man1 \ - -Dman3dir=/usr/share/man/man3 \ - -Dpager="/usr/bin/less -isR" \ - -Duseshrplib \ - -Dusethreads +sh Configure -des -Dprefix=/usr - The meaning of the configure options: - - - -Dvendorprefix=/usr - - This ensures perl knows how to - tell packages where they should install their perl modules. - - - - - -Dpager="/usr/bin/less -isR" - - This ensures that less is used instead - of more. - - - - - -Dman1dir=/usr/share/man/man1 - -Dman3dir=/usr/share/man/man3 - - Since Groff is not installed yet, Configure - thinks that we do not want man pages for Perl. Issuing these - parameters overrides this decision. - - - + The meaning of the new Configure options: - -Duseshrplib + -des - Build a shared libperl needed by some perl modules. - - - - - -Dusethreads - - Build perl with support for threads. + This is a combination of three options: -d uses defaults for + all items; -e ensures completion of all tasks; -s silences + non-essential output. - Compile the package: + Build the package: make - To test the results (approximately 11 SBU), issue: - -make test - - - - Install the package and clean up: - -make install -unset BUILD_ZLIB BUILD_BZIP2 +make install - - Contents of Perl - - - Installed programs - Installed libraries - Installed directory - - - corelist, cpan, enc2xs, encguess, h2ph, h2xs, instmodsh, - json_pp, libnetcfg, perl, perl&perl-version; (hard link to perl), - perlbug, perldoc, perlivp, perlthanks (hard link to perlbug), piconv, - pl2pm, pod2html, pod2man, pod2text, pod2usage, podchecker, podselect, - prove, ptar, ptardiff, ptargrep, shasum, - splain, xsubpp, and zipdetails - Many which cannot all be listed here - /usr/lib/perl5 - - - - - Short Descriptions - - - - - corelist - - A commandline frontend to Module::CoreList - - corelist - - - - - - cpan - - Interact with the Comprehensive Perl Archive Network (CPAN) - from the command line - - cpan - - - - - - enc2xs - - Builds a Perl extension for the Encode module from either - Unicode Character Mappings or Tcl Encoding Files - - enc2xs - - - - - - encguess - - Guess the encoding type of one or several files - - encguess - - - - - - h2ph - - Converts .h C header - files to .ph Perl header - files - - h2ph - - - - - - h2xs - - Converts .h C header - files to Perl extensions - - h2xs - - - - - - instmodsh - - Shell script for examining installed Perl modules, - and can create a tarball from an installed module - - instmodsh - - - - - - json_pp - - Converts data between certain input and output formats - - json_pp - - - - - - libnetcfg - - Can be used to configure the - libnet Perl module - - 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 - - - - - - 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 - - - - - - perlthanks - - Used to generate thank you messages to mail to the Perl - developers - - perlthanks - - - - - - 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 - - - - - - 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 - - - - - - prove - - Command line tool for running tests against the Test::Harness - module - - prove - - - - - - ptar - - A tar-like program written in Perl - - ptar - - - - - - ptardiff - - A Perl program that compares an extracted archive with an - unextracted one - - ptardiff - - - - - - ptargrep - - A Perl program that applies pattern matching to the contents - of files in a tar archive - - ptargrep - - - - - - shasum - - Prints or checks SHA checksums - - shasum - - - - - - splain - - Is used to force verbose warning diagnostics in Perl - - splain - - - - - - xsubpp - - Converts Perl XS code into C code - - xsubpp - - - - - - zipdetails - - Displays details about the internal structure of a Zip file - - zipdetails - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-perl" role="."/></para> </sect2> diff --git a/chapter06/pkgconfig.xml b/chapter06/pkgconfig.xml deleted file mode 100644 index 3c311e389..000000000 --- a/chapter06/pkgconfig.xml +++ /dev/null @@ -1,121 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-pkgconfig" role="wrap"> - <?dbhtml filename="pkg-config.html"?> - - <sect1info condition="script"> - <productname>pkg-config</productname> - <productnumber>&pkgconfig-version;</productnumber> - <address>&pkgconfig-url;</address> - </sect1info> - - <title>Pkg-config-&pkgconfig-version; - - - Pkgconfig - - - - - - <para> The pkg-config package contains a tool for passing the include path - and/or library paths to build tools during the configure and make file - execution.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&pkgconfig-ch6-sbu;</seg> - <seg>&pkgconfig-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Pkg-config - - Prepare Pkg-config for compilation: - -./configure --prefix=/usr \ - --with-internal-glib \ - --disable-host-tool \ - --docdir=/usr/share/doc/pkg-config-&pkgconfig-version; - - - The meaning of the new configure options: - - - --with-internal-glib - - This will allow pkg-config to use its internal version of - Glib because an external version is not available in LFS. - - - - - --disable-host-tool - - This option disables the creation of an undesired hard link - to the pkg-config program. - - - - - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install - - - - - Contents of Pkg-config - - - Installed program - Installed directory - - - pkg-config - /usr/share/doc/pkg-config-&pkgconfig-version; - - - - - Short Descriptions - - - - - - pkg-config - - Returns meta information for the specified library or package - - - pkg-config - - - - - - - - - diff --git a/chapter06/pkgmgt.xml b/chapter06/pkgmgt.xml deleted file mode 100644 index d28038467..000000000 --- a/chapter06/pkgmgt.xml +++ /dev/null @@ -1,291 +0,0 @@ - - - %general-entities; -]> - - - - - Package Management - - Package Management is an often requested addition to the LFS Book. A - Package Manager allows tracking the installation of files making it easy to - remove and upgrade packages. As well as the binary and library files, a - package manager will handle the installation of configuration files. Before - you begin to wonder, NO—this section will not talk about nor recommend - any particular package manager. What it provides is a roundup of the more - popular techniques and how they work. The perfect package manager for you may - be among these techniques or may be a combination of two or more of these - techniques. This section briefly mentions issues that may arise when upgrading - packages. - - Some reasons why no package manager is mentioned in LFS or BLFS - include: - - - - Dealing with package management takes the focus away from the goals - of these books—teaching how a Linux system is built. - - - - There are multiple solutions for package management, each having - its strengths and drawbacks. Including one that satisfies all audiences - is difficult. - - - - There are some hints written on the topic of package management. Visit - the Hints Project and see if one of them - fits your need. - - - Upgrade Issues - - A Package Manager makes it easy to upgrade to newer versions when they - are released. Generally the instructions in the LFS and BLFS Book can be - used to upgrade to the newer versions. Here are some points that you should - be aware of when upgrading packages, especially on a running system. - - - - If Glibc needs to be upgraded to a newer version, (e.g. from - glibc-2.19 to glibc-2.20), it is safer to rebuild LFS. Though you - may be able to rebuild all the packages in their - dependency order, we do not recommend it. - - - - If a package containing a shared library is updated, and if the - name of the library changes, then all the packages dynamically linked - to the library need to be recompiled to link against the newer library. - (Note that there is no correlation between the package version and the - name of the library.) For example, consider a package foo-1.2.3 that - installs a shared library with name - libfoo.so.1. Say you upgrade - the package to a newer version foo-1.2.4 that installs a shared library - with name libfoo.so.2. In this - case, all packages that are dynamically linked to - libfoo.so.1 need to be - recompiled to link against - libfoo.so.2. Note that you - should not remove the previous libraries until the dependent packages - are recompiled. - - - - - - - Package Management Techniques - - The following are some common package management techniques. Before - making a decision on a package manager, do some research on the various - techniques, particularly the drawbacks of the particular scheme. - - - It is All in My Head! - - Yes, this is a package management technique. Some folks do not find - the need for a package manager because they know the packages intimately - and know what files are installed by each package. Some users also do not - need any package management because they plan on rebuilding the entire - system when a package is changed. - - - - - Install in Separate Directories - - This is a simplistic package management that does not need any extra - package to manage the installations. Each package is installed in a - separate directory. For example, package foo-1.1 is installed in - /usr/pkg/foo-1.1 - and a symlink is made from /usr/pkg/foo to - /usr/pkg/foo-1.1. When installing - a new version foo-1.2, it is installed in - /usr/pkg/foo-1.2 and the previous - symlink is replaced by a symlink to the new version. - - Environment variables such as PATH, - LD_LIBRARY_PATH, MANPATH, - INFOPATH and CPPFLAGS need to be expanded to - include /usr/pkg/foo. For more than a few packages, - this scheme becomes unmanageable. - - - - - Symlink Style Package Management - - This is a variation of the previous package management technique. - Each package is installed similar to the previous scheme. But instead of - making the symlink, each file is symlinked into the - /usr hierarchy. This removes the - need to expand the environment variables. Though the symlinks can be - created by the user to automate the creation, many package managers have - been written using this approach. A few of the popular ones include Stow, - Epkg, Graft, and Depot. - - The installation needs to be faked, so that the package thinks that - it is installed in /usr though in - reality it is installed in the - /usr/pkg hierarchy. Installing in - this manner is not usually a trivial task. For example, consider that you - are installing a package libfoo-1.1. The following instructions may - not install the package properly: - -./configure --prefix=/usr/pkg/libfoo/1.1 -make -make install - - The installation will work, but the dependent packages may not link - to libfoo as you would expect. If you compile a package that links against - libfoo, you may notice that it is linked to - /usr/pkg/libfoo/1.1/lib/libfoo.so.1 - instead of /usr/lib/libfoo.so.1 - as you would expect. The correct approach is to use the - DESTDIR strategy to fake installation of the package. This - approach works as follows: - -./configure --prefix=/usr -make -make DESTDIR=/usr/pkg/libfoo/1.1 install - - Most packages support this approach, but there are some which do not. - For the non-compliant packages, you may either need to manually install the - package, or you may find that it is easier to install some problematic - packages into /opt. - - - - - Timestamp Based - - In this technique, a file is timestamped before the installation of - the package. After the installation, a simple use of the - find command with the appropriate options can generate - a log of all the files installed after the timestamp file was created. A - package manager written with this approach is install-log. - - Though this scheme has the advantage of being simple, it has two - drawbacks. If, during installation, the files are installed with any - timestamp other than the current time, those files will not be tracked by - the package manager. Also, this scheme can only be used when one package - is installed at a time. The logs are not reliable if two packages are - being installed on two different consoles. - - - - - Tracing Installation Scripts - - In this approach, the commands that the installation scripts perform - are recorded. There are two techniques that one can use: - - The LD_PRELOAD environment variable can be set to - point to a library to be preloaded before installation. During - installation, this library tracks the packages that are being installed by - attaching itself to various executables such as cp, - install, mv and tracking the system - calls that modify the filesystem. For this approach to work, all the - executables need to be dynamically linked without the suid or sgid bit. - Preloading the library may cause some unwanted side-effects during - installation. Therefore, it is advised that one performs some tests to - ensure that the package manager does not break anything and logs all the - appropriate files. - - The second technique is to use strace, which - logs all system calls made during the execution of the installation - scripts. - - - - Creating Package Archives - - In this scheme, the package installation is faked into a separate - tree as described in the Symlink style package management. After the - installation, a package archive is created using the installed files. - This archive is then used to install the package either on the local - machine or can even be used to install the package on other machines. - - This approach is used by most of the package managers found in the - commercial distributions. Examples of package managers that follow this - approach are RPM (which, incidentally, is required by the Linux - Standard Base Specification), pkg-utils, Debian's apt, and - Gentoo's Portage system. A hint describing how to adopt this style of - package management for LFS systems is located at . - - Creation of package files that include dependency information is - complex and is beyond the scope of LFS. - - Slackware uses a tar based system for package - archives. This system purposely does not handle package dependencies - as more complex package managers do. For details of Slackware package - management, see . - - - - User Based Management - - This scheme, unique to LFS, was devised by Matthias Benkmann, and is - available from the Hints Project. In - this scheme, each package is installed as a separate user into the - standard locations. Files belonging to a package are easily identified by - checking the user ID. The features and shortcomings of this approach are - too complex to describe in this section. For the details please see the - hint at . - - - - - - - Deploying LFS on Multiple Systems - - One of the advantages of an LFS system is that there are no files that - depend on the position of files on a disk system. Cloning an LFS build to - another computer with the same architecture as the base system is as - simple as using tar on the LFS partition that contains - the root directory (about 250MB uncompressed for a base LFS build), copying - that file via network transfer or CD-ROM to the new system and expanding - it. From that point, a few configuration files will have to be changed. - Configuration files that may need to be updated include: - /etc/hosts, - /etc/fstab, - /etc/passwd, - /etc/group, - - /etc/shadow, and - /etc/ld.so.conf. - - - /etc/shadow, - /etc/ld.so.conf, - /etc/sysconfig/rc.site, - /etc/sysconfig/network, and - /etc/sysconfig/ifconfig.eth0. - - - - A custom kernel may need to be built for the new system depending on - differences in system hardware and the original kernel - configuration. - - There have been some reports of issues when copying between - similar but not identical architectures. For instance, the instruction set - for an Intel system is not identical with an AMD processor and later - versions of some processors may have instructions that are unavailable in - earlier versions. - - Finally the new system has to be made bootable via . - - - - diff --git a/chapter06/procps.xml b/chapter06/procps.xml deleted file mode 100644 index 59bf0864c..000000000 --- a/chapter06/procps.xml +++ /dev/null @@ -1,292 +0,0 @@ - - - %general-entities; -]> - - - - - - procps-ng - &procps-ng-version; -
&procps-ng-url;
-
- - Procps-ng-&procps-ng-version; - - - Procps-ng - - - - - - <para>The Procps-ng package contains programs for monitoring processes.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&procps-ng-ch6-sbu;</seg> - <seg>&procps-ng-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Procps-ng - - Prepare procps-ng for compilation: - -./configure --prefix=/usr \ - --exec-prefix= \ - --libdir=/usr/lib \ - --docdir=/usr/share/doc/procps-ng-&procps-ng-version; \ - --disable-static \ - --disable-kill - -./configure --prefix=/usr \ - --exec-prefix= \ - --libdir=/usr/lib \ - --docdir=/usr/share/doc/procps-ng-&procps-ng-version; \ - --disable-static \ - --disable-kill \ - --with-systemd - - - The meaning of the configure options: - - - --disable-kill - - This switch disables building the kill - command that will be installed by the Util-linux package. - - - - - Compile the package: - -make - - The test suite needs some custom modifications for LFS. - Remove a test that fails when scripting does not use a tty device and - fix two others. - To run the test suite, run the following commands: - -sed -i -r 's|(pmap_initname)\\\$|\1|' testsuite/pmap.test/pmap.exp -sed -i '/set tty/d' testsuite/pkill.test/pkill.exp -rm testsuite/pgrep.test/pgrep.exp -make check - - Install the package: - -make install - -Finally, move essential libraries to a location that can be found if -/usr is not mounted. - -mv -v /usr/lib/libprocps.so.* /lib -ln -sfv ../../lib/$(readlink /usr/lib/libprocps.so) /usr/lib/libprocps.so - - - - - Contents of Procps-ng - - - Installed programs - Installed library - Installed directories - - - free, pgrep, pidof, pkill, pmap, ps, pwdx, slabtop, - sysctl, tload, top, uptime, vmstat, w, and watch - libprocps.so - /usr/include/proc and /usr/share/doc/procps-ng-&procps-ng-version; - - - - - Short Descriptions - - - - - free - - Reports the amount of free and used memory (both physical and - swap memory) in the system - - free - - - - - - pgrep - - Looks up processes based on their name and other attributes - - pgrep - - - - - - pidof - - Reports the PIDs of the given programs - - pidof - - - - - - 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 - - - - - - pwdx - - Reports the current working directory of a process - - pwdx - - - - - - slabtop - - Displays detailed kernel slab cache information in real time - - slabtop - - - - - - sysctl - - Modifies kernel parameters at run time - - sysctl - - - - - - tload - - Prints a graph of the current system load average - - tload - - - - - - top - - Displays a list of the most CPU intensive 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 - - - - - - libprocps - - Contains the functions used by most programs in this - package - - libprocps - - - - - - - - -
diff --git a/chapter06/psmisc.xml b/chapter06/psmisc.xml deleted file mode 100644 index b01303131..000000000 --- a/chapter06/psmisc.xml +++ /dev/null @@ -1,160 +0,0 @@ - - - %general-entities; -]> - - - - - - psmisc - &psmisc-version; -
&psmisc-url;
-
- - Psmisc-&psmisc-version; - - - Psmisc - - - - - - <para>The Psmisc package contains programs for displaying information about - running processes.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&psmisc-ch6-sbu;</seg> - <seg>&psmisc-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Psmisc - - Prepare Psmisc for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make install - - Finally, move the killall and fuser - programs to the location specified by the FHS: - -mv -v /usr/bin/fuser /bin -mv -v /usr/bin/killall /bin - - - - - Contents of Psmisc - - - Installed programs - - - fuser, killall, peekfd, prtstat, pslog, 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 - - - - - - peekfd - - Peek at file descriptors of a running process, given its - PID - - peekfd - - - - - - prtstat - - Prints information about a process - - prtstat - - - - - - pslog - - Reports current logs path of a process - - pslog - - - - - - 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/python.xml b/chapter06/python.xml index cc440903d..52c070ab3 100644 --- a/chapter06/python.xml +++ b/chapter06/python.xml @@ -5,8 +5,8 @@ %general-entities; ]> - - + + Python @@ -16,66 +16,54 @@ Python-&python-version; - - python + + Python + temporary - <para>The Python 3 package contains the Python development environment. It - is useful for object-oriented programming, writing scripts, prototyping - large programs or developing entire applications.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/python.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> - <segtitle>&buildtime;</segtitle> + <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&python-ch6-sbu;</seg> - <seg>&python-ch6-du;</seg> + <seg>&python-ch5-sbu;</seg> + <seg>&python-ch5-du;</seg> </seglistitem> </segmentedlist> </sect2> <sect2 role="installation"> - <title>Installation of Python 3 + Installation of Python + + + There are two package files whose name starts with + python. The one to extract from is + Python-&python-version;.tar.xz (notice the + uppercase first letter). + Prepare Python for compilation: -./configure --prefix=/usr \ - --enable-shared \ - --with-system-expat \ - --with-system-ffi \ - --with-ensurepip=yes +./configure --prefix=/usr --without-ensurepip - The meaning of the configure options: - - - --with-system-expat - - This switch enables linking against system version of - Expat. - - - - - --with-system-ffi - - This switch enables linking against system version of - libffi. - - - - - --with-ensurepip=yes - - This switch enables building pip and - setuptools packaging programs. - - + The meaning of the configure option: + + + --without-ensurepip + + This switch disables the Python package installer, which is not + needed at this stage. + + @@ -83,171 +71,18 @@ make - To test the results, issue make test. - Some tests requiring network connection or additional packages are - skipped. The test named test_normalization fails because network - configuration is not completed yet. For more comprehensive results, - the test can be rerun when Python 3 is reinstalled in BLFS. - Install the package: -make install -chmod -v 755 /usr/lib/libpython&python-minor;.so -chmod -v 755 /usr/lib/libpython3.so -ln -sfv pip&python-minor; /usr/bin/pip3 - - - The meaning of the install commands: - - - chmod -v 755 /usr/lib/libpython3.{8.,}so - - Fix permissions for libraries to be consistent with other - libraries. - - - - - - If desired, install the preformatted documentation: - -install -v -dm755 /usr/share/doc/python-&python-version;/html - -tar --strip-components=1 \ - --no-same-owner \ - --no-same-permissions \ - -C /usr/share/doc/python-&python-version;/html \ - -xvf ../python-&python-version;-docs-html.tar.bz2 - - - The meaning of the documentation install commands: - - - and - - Ensure the installed files have the correct ownership and - permissions. Without these options, using tar - will install the package files with the upstream creator's values. - - - - - +make install - - Contents of Python 3 - - - Installed Programs - Installed Library - Installed Directories - - - - 2to3, idle3, pip3, pydoc3, python3, and python3-config - - - libpython&python-minor;.so and libpython3.so - - - /usr/include/python&python-minor;, - /usr/lib/python3, and - /usr/share/doc/python-&python-version; - - - - - - Short Descriptions - - - - - 2to3 - - - is a Python program that reads - Python 2.x source code and applies a - series of fixes to transform it into valid - Python 3.x code. - - - 2to3 - - - - - - idle3 - - - is a wrapper script that opens a Python - aware GUI editor. For this script to run, you must have installed - Tk before Python so that the Tkinter - Python module is built. - - - idle3 - - - - - - pip3 - - - The package installer for Python. You can use pip to install - packages from Python Package Index and other indexes. - - - pip3 - - - - - - pydoc3 - - - is the Python documentation tool. - - - pydoc3 - - - + + - <varlistentry id="python3"> - <term><command>python3</command></term> - <listitem> - <para> - is an interpreted, interactive, object-oriented programming - language. - </para> - <indexterm zone="ch-system-Python"> - <primary sortas="b-python3">python3</primary> - </indexterm> - </listitem> - </varlistentry> -<!-- - <varlistentry id="pyvenv"> - <term><command>pyvenv</command></term> - <listitem> - <para> - creates virtual <application>Python</application> environments in - one or more target directories. - </para> - <indexterm zone="ch-system-Python"> - <primary sortas="b-pyvenv">pyvenv</primary> - </indexterm> - </listitem> - </varlistentry> ---> - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-python" role="."/></para> </sect2> </sect1> - diff --git a/chapter06/readline.xml b/chapter06/readline.xml deleted file mode 100644 index 87571ea9d..000000000 --- a/chapter06/readline.xml +++ /dev/null @@ -1,156 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-readline" role="wrap"> - <?dbhtml filename="readline.html"?> - - <sect1info condition="script"> - <productname>readline</productname> - <productnumber>&readline-version;</productnumber> - <address>&readline-url;</address> - </sect1info> - - <title>Readline-&readline-version; - - - Readline - - - - - - <para>The Readline package is a set of libraries that offers command-line - editing and history capabilities.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&readline-ch6-sbu;</seg> - <seg>&readline-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Readline - - Reinstalling Readline will cause the old libraries to be moved to - <libraryname>.old. While this is normally not a problem, in some cases - it can trigger a linking bug in ldconfig. This can be - avoided by issuing the following two seds: - -sed -i '/MV.*old/d' Makefile.in -sed -i '/{OLDSUFF}/c:' support/shlib-install - - Prepare Readline for compilation: - -./configure --prefix=/usr \ - --disable-static \ - --with-curses \ - --docdir=/usr/share/doc/readline-&readline-version; - - - The meaning of the configure option: - - - --with-curses" - - This option tells Readline that it can find the termcap - library functions in the curses library, rather than a separate - termcap library. It allows generating a correct - readline.pc file. - - - - - - Compile the package: - -make SHLIB_LIBS="-lncursesw" - - - The meaning of the make option: - - - SHLIB_LIBS="-lncursesw" - - This option forces Readline to link against the - libncursesw library. - - - - - - This package does not come with a test suite. - - Install the package: - -make SHLIB_LIBS="-lncursesw" install - - Now move the dynamic libraries to a more appropriate location - and fix up some permissions and symbolic links: - -mv -v /usr/lib/lib{readline,history}.so.* /lib -chmod -v u+w /lib/lib{readline,history}.so.* -ln -sfv ../../lib/$(readlink /usr/lib/libreadline.so) /usr/lib/libreadline.so -ln -sfv ../../lib/$(readlink /usr/lib/libhistory.so ) /usr/lib/libhistory.so - - If desired, install the documentation: - -install -v -m644 doc/*.{ps,pdf,html,dvi} /usr/share/doc/readline-&readline-version; - - - - - Contents of Readline - - - Installed libraries - Installed directories - - - libhistory.so and libreadline.so - /usr/include/readline and - /usr/share/doc/readline-&readline-version; - - - - - Short Descriptions - - - - - libhistory - - Provides a consistent user interface for recalling lines - of history - - libhistory - - - - - - libreadline - - Provides a set of commands for manipulating text entered in an - interactive session of a program. - - libreadline - - - - - - - - - diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml deleted file mode 100644 index 0e836d661..000000000 --- a/chapter06/revisedchroot.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - %general-entities; -]> - - - - - Cleaning Up - - Finally, clean up some extra files left around from running tests: - -rm -rf /tmp/* - - Now log out and reenter the chroot environment with an updated - chroot command. From now on, use this updated chroot command any time - you need to reenter the chroot environment after exiting: - -logout - -chroot "$LFS" /usr/bin/env -i \ - HOME=/root TERM="$TERM" \ - PS1='(lfs chroot) \u:\w\$ ' \ - PATH=/bin:/usr/bin:/sbin:/usr/sbin \ - /bin/bash --login - - Here the +h option is not used anymore, since - all the previous programs have been replaced: hashing is therefore - possible. - - If the virtual kernel file systems have been unmounted, either manually - or through a reboot, ensure that the virtual kernel file systems are mounted - when reentering the chroot. This process was explained in and . - - There were several static libraries that were not suppressed earlier - in the chapter in order to satisfy the regression tests in several packages. These - libraries are from binutils, bzip2, e2fsprogs, flex, libtool, and zlib. If desired, - remove them now: - -rm -f /usr/lib/lib{bfd,opcodes}.a -rm -f /usr/lib/libctf{,-nobfd}.a -rm -f /usr/lib/libbz2.a -rm -f /usr/lib/lib{com_err,e2p,ext2fs,ss}.a -rm -f /usr/lib/libltdl.a -rm -f /usr/lib/libfl.a -rm -f /usr/lib/libz.a - - There are also several files installed in the /usr/lib and /usr/libexec - directories with a file name extention of .la. These are "libtool archive" - files. As already said, they are only useful when linking with static - libraries. They are unneeded, and potentially harmful, when using dynamic - shared libraries, specially when using also non-autotools build systems. - To remove them, run: - -find /usr/lib /usr/libexec -name \*.la -delete - - For more information about libtool archive files, see the BLFS section "About Libtool - Archive (.la) files". - - Finally, remove the temporary 'tester' usr account created at the - beginning of this chapter. - -sed -i '/tester/d' /etc/passwd /etc/group -rm -rf /home/tester - diff --git a/chapter06/sed.xml b/chapter06/sed.xml index 030e77a0b..f146b5102 100644 --- a/chapter06/sed.xml +++ b/chapter06/sed.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,22 +16,25 @@ Sed-&sed-version; - + Sed + tools - <para>The Sed package contains a stream editor.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/sed.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> - <segtitle>&buildtime;</segtitle> + <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&sed-ch6-sbu;</seg> - <seg>&sed-ch6-du;</seg> + <seg>&sed-ch5-sbu;</seg> + <seg>&sed-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -42,55 +45,25 @@ <para>Prepare Sed for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr --bindir=/bin</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr \ + --host=$LFS_TGT \ + --bindir=/bin</userinput></screen> - <para>Compile the package and generate the HTML documentation:</para> + <para>Compile the package:</para> -<screen><userinput remap="make">make -make html</userinput></screen> +<screen><userinput remap="make">make</userinput></screen> - <para>To test the results, issue:</para> + <para>Install the package:</para> -<screen><userinput remap="test">chown -Rv tester . -su tester -c "PATH=$PATH make check"</userinput></screen> - - <para>Install the package and its documentation:</para> - -<screen><userinput remap="install">make install -install -d -m755 /usr/share/doc/sed-&sed-version; -install -m644 doc/sed.html /usr/share/doc/sed-&sed-version;</userinput></screen> +<screen><userinput remap="install">make DESTDIR=$LFS install</userinput></screen> </sect2> - <sect2 id="contents-sed" role="content"> - <title>Contents of Sed - - - Installed program - Installed directory - - - sed - /usr/share/doc/sed-&sed-version; - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="sed"> - <term><command>sed</command></term> - <listitem> - <para>Filters and transforms text files in a single pass</para> - <indexterm zone="ch-system-sed sed"> - <primary sortas="b-sed">sed</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-sed" role="."/></para> </sect2> diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml deleted file mode 100644 index 425112cbd..000000000 --- a/chapter06/shadow.xml +++ /dev/null @@ -1,608 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-shadow" role="wrap"> - <?dbhtml filename="shadow.html"?> - - <sect1info condition="script"> - <productname>shadow</productname> - <productnumber>&shadow-version;</productnumber> - <address>&shadow-url;</address> - </sect1info> - - <title>Shadow-&shadow-version; - - - Shadow - - - - - - <para>The Shadow package contains programs for handling passwords in a secure - way.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&shadow-ch6-sbu;</seg> - <seg>&shadow-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Shadow - - - If you would like to enforce the use of strong passwords, refer to - for installing - CrackLib prior to building Shadow. Then add - --with-libcrack to the configure - command below. - - - Disable the installation of the groups program - and its man pages, as Coreutils provides a better version. Also, - prevent the installation of manual pages that were already installed in - : - -sed -i 's/groups$(EXEEXT) //' src/Makefile.in -find man -name Makefile.in -exec sed -i 's/groups\.1 / /' {} \; -find man -name Makefile.in -exec sed -i 's/getspnam\.3 / /' {} \; -find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \; - - Instead of using the default - crypt method, use the more secure - SHA-512 method of password encryption, which also - allows passwords longer than 8 characters. It is also necessary to change - the obsolete /var/spool/mail location - for user mailboxes that Shadow uses by default to the /var/mail location used currently: - -sed -i -e 's@#ENCRYPT_METHOD DES@ENCRYPT_METHOD SHA512@' \ - -e 's@/var/spool/mail@/var/mail@' etc/login.defs - - - If you chose to build Shadow with Cracklib support, run the following: - -sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' etc/login.defs - - - Make a minor change to make the first group number generated - by useradd 1000: - -sed -i 's/1000/999/' etc/useradd - - Prepare Shadow for compilation: - -touch /usr/bin/passwd -./configure --sysconfdir=/etc \ - --with-group-name-max-length=32 - - - The meaning of the configure option: - - - touch /usr/bin/passwd - - The file /usr/bin/passwd needs - to exist because its location is harcoded in some programs, and - the default location if it does not exist is not right. - - - - --with-group-name-max-length=32 - - The maximum user name is 32 characters. Make the maximum - group name the same. - - - - - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make install - - - - - - - - Configuring Shadow - - - 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 - - To enable shadowed group passwords, run: - -grpconv - - Shadow's stock configuration for the useradd - utility has a few caveats that need some explanation. First, the default - action for the useradd utility is to create the user and - a group of the same name as the user. By default the user ID (UID) and - group ID (GID) numbers will begin with 1000. This means if you don't pass - parameters to useradd, each user will be a member of a - unique group on the system. If this behavior is undesirable, you'll need - to pass the -g parameter to - useradd. The default parameters are stored in the - /etc/default/useradd file. You may need to modify two - parameters in this file to suit your particular needs. - - - <filename>/etc/default/useradd</filename> Parameter Explanations - - - GROUP=1000 - - This parameter sets the beginning of the group numbers used in - the /etc/group file. You can modify it to anything you desire. Note - that useradd will never reuse a UID or GID. If the - number identified in this parameter is used, it will use the next - available number after this. Note also that if you don't have a group - 1000 on your system the first time you use useradd - without the -g parameter, you'll get a message - displayed on the terminal that says: - useradd: unknown GID 1000. You may - disregard this message and group number 1000 will be used. - - - - CREATE_MAIL_SPOOL=yes - - This parameter causes useradd to create a - mailbox file for the newly created user. useradd - will make the group ownership of this file to the - mail group with 0660 - permissions. If you would prefer that these mailbox files are not - created by useradd, issue the following - command: - -sed -i 's/yes/no/' /etc/default/useradd - - - - - - - - - - Setting the root password - - Choose a password for user root and set it - by running: - -passwd root - - - - - Contents of Shadow - - - Installed programs - Installed directory - - - chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd, - groupadd, groupdel, groupmems, groupmod, grpck, grpconv, grpunconv, - lastlog, login, logoutd, newgidmap, newgrp, newuidmap, newusers, - nologin, passwd, pwck, pwconv, pwunconv, sg (link to newgrp), su, - useradd, userdel, usermod, vigr (link to vipw), and vipw - /etc/default - - - - - 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 information - - chfn - - - - - - chgpasswd - - Used to update group passwords in batch mode - - chgpasswd - - - - - - chpasswd - - Used to update user passwords in batch mode - - 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 - - - - - - groupmems - - Allows a user to administer his/her own group membership list - without the requirement of super user privileges. - - groupmems - - - - - - groupmod - - Is used to modify the given group's name or GID - - groupmod - - - - - - 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 - - - - - - newgidmap - - Is used to set the gid mapping of a user namespace - - newgidmap - - - - - - newgrp - - Is used to change the current GID during a login session - - newgrp - - - - - - newuidmap - - Is used to set the uid mapping of a user namespace - - newuidmap - - - - - - newusers - - Is used to create or update an entire series of user - accounts - - newusers - - - - - - nologin - - Displays a message that an account is not available; it is designed - to be used as the default shell for accounts that have been - disabled - - nologin - - - - - - 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 - - Runs a shell with substitute user and group IDs - - su - - - - - - 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 - - - - - - - - - diff --git a/chapter06/stripping.xml b/chapter06/stripping.xml new file mode 100644 index 000000000..7c054b6b2 --- /dev/null +++ b/chapter06/stripping.xml @@ -0,0 +1,53 @@ + + + %general-entities; +]> + + + + + Stripping + + The steps in this section are optional, but if the LFS partition is + rather small, it is beneficial to learn that unnecessary items can be removed. + The executables and libraries built so far contain about 70 MB of unneeded + debugging symbols. Remove those symbols with: + +$LFS_TGT-strip --strip-debug $LFS/usr/lib/* +$LFS_TGT-strip --strip-unneeded $LFS/usr/{,s}bin/* + + These commands will skip a number of files, reporting that it does not + recognize their file format. Most of these are scripts instead of binaries. + Note that we use the strip program built in + Binutils pass 1, since it is the one that knows how to strip + our cross-compiled programs. + + + Take care not to use + --strip-unneeded on the libraries. The static + ones would be destroyed and the toolchain packages would need to be + built all over again. + + To save more, remove the documentation: + +rm -rf $LFS/usr/{,share}/{info,man,doc} + + The libtool .la files are only useful when linking with static + libraries. They are unneeded, and potentially harmful, when using dynamic + shared libraries, specially when using also non-autotools build systems. + Remove those files now: + +find $LFS/usr/{lib,libexec} -name \*.la -delete + + At this point, you should have at least 3 GB of free space in + $LFS that can be used to build and install Glibc and Gcc in + the next phase. If you can build and install Glibc, you can build and install + the rest too. + + diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml deleted file mode 100644 index fb2a1b55f..000000000 --- a/chapter06/strippingagain.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - %general-entities; -]> - - - - - Stripping Again - - This section is optional. If the intended user is not a - programmer and does not plan to do - any debugging on the system software, the system size can be decreased - by about 90 MB by removing the debugging symbols from binaries and - libraries. This causes no inconvenience other than not being able to - debug the software fully anymore. - - Most people who use the commands 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 commands, it is a good idea to make a - backup of the LFS system in its current state. - - First place the debugging symbols for selected libraries - in separate files. This debugging information is needed if running - regression tests that use valgrind or gdb later in BLFS. - - - - - -save_lib="ld-&glibc-version;.so libc-&glibc-version;.so libpthread-&glibc-version;.so libthread_db-&libthread_db-version;.so" - -cd /lib - -for LIB in $save_lib; do - objcopy --only-keep-debug $LIB $LIB.dbg - strip --strip-unneeded $LIB - objcopy --add-gnu-debuglink=$LIB.dbg $LIB -done - -save_usrlib="libquadmath.so.&libquadmath-version; libstdc++.so.&libstdcpp-version; - libitm.so.&libitm-version; libatomic.so.&libatomic-version;" - -cd /usr/lib - -for LIB in $save_usrlib; do - objcopy --only-keep-debug $LIB $LIB.dbg - strip --strip-unneeded $LIB - objcopy --add-gnu-debuglink=$LIB.dbg $LIB -done - -unset LIB save_lib save_usrlib - - - Now the binaries and libraries can be stripped: -find /usr/lib -type f -name \*.a \ - -exec strip --strip-debug {} ';' - -find /lib /usr/lib -type f -name \*.so* ! -name \*dbg \ - -exec strip --strip-unneeded {} ';' - -find /{bin,sbin} /usr/{bin,sbin,libexec} -type f \ - -exec strip --strip-all {} ';' - - 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. - - diff --git a/chapter06/sysklogd.xml b/chapter06/sysklogd.xml deleted file mode 100644 index e96980cb4..000000000 --- a/chapter06/sysklogd.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - %general-entities; -]> - - - - - - sysklogd - &sysklogd-version; -
&sysklogd-url;
-
- - Sysklogd-&sysklogd-version; - - - Sysklogd - - - - - - <para>The Sysklogd package contains programs for logging system messages, - such as those given by the kernel when unusual things happen.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&sysklogd-ch6-sbu;</seg> - <seg>&sysklogd-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Sysklogd - - First, fix problems that causes a segmentation fault under - some conditions in klogd and fix an obsolete program construct: - -sed -i '/Error loading kernel symbols/{n;n;d}' ksym_mod.c -sed -i 's/union wait/int/' syslogd.c - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make BINDIR=/sbin install - - - - - Configuring Sysklogd - - - Sysklogd - configuring - - - - /etc/syslog.conf - - - Create a new /etc/syslog.conf file by running the - following: - -cat > /etc/syslog.conf << "EOF" -# Begin /etc/syslog.conf - -auth,authpriv.* -/var/log/auth.log -*.*;auth,authpriv.none -/var/log/sys.log -daemon.* -/var/log/daemon.log -kern.* -/var/log/kern.log -mail.* -/var/log/mail.log -user.* -/var/log/user.log -*.emerg * - -# End /etc/syslog.conf -EOF - - - - - Contents of Sysklogd - - - Installed programs - - - klogd and syslogd - - - - - Short Descriptions - - - - - klogd - - A system daemon for intercepting and logging kernel messages - - klogd - - - - - - syslogd - - 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.] - - syslogd - - - - - - - - -
diff --git a/chapter06/systemd.xml b/chapter06/systemd.xml deleted file mode 100644 index 2cf2d1d1b..000000000 --- a/chapter06/systemd.xml +++ /dev/null @@ -1,830 +0,0 @@ - - - %general-entities; -]> - - - - - - systemd - &systemd-version; -
&systemd-url;
-
- - Systemd-&systemd-version; - - - systemd - - - - - - <para>The systemd package contains programs for controlling the startup, - running, and shutdown of the system.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&systemd-ch6-sbu;</seg> - <seg>&systemd-ch6-du;</seg> - </seglistitem> - </segmentedlist> - </sect2> - - <sect2 role="installation"> - <title>Installation of systemd - - First, apply a patch to fix the build with GCC-10: - -patch -Np1 -i ../systemd-&systemd-version;-gcc_10-fixes-1.patch - - - Create a symlink to work around missing xsltproc: - -ln -sf /bin/true /usr/bin/xsltproc - - Set up the man pages: - -tar -xf ../systemd-man-pages-&systemd-version;.tar.xz - - Remove tests that cannot be built in chroot: - -sed '179,$ d' -i src/resolve/meson.build - - Remove an unneeded group, - render, from the default udev - rules: - -sed -i 's/GROUP="render", //' rules.d/50-udev-default.rules.in - - Prepare systemd for compilation: - -mkdir -p build -cd build - -LANG=en_US.UTF-8 \ -meson --prefix=/usr \ - --sysconfdir=/etc \ - --localstatedir=/var \ - -Dblkid=true \ - -Dbuildtype=release \ - -Ddefault-dnssec=no \ - -Dfirstboot=false \ - -Dinstall-tests=false \ - -Dkmod-path=/bin/kmod \ - -Dldconfig=false \ - -Dmount-path=/bin/mount \ - -Drootprefix= \ - -Drootlibdir=/lib \ - -Dsplit-usr=true \ - -Dsulogin-path=/sbin/sulogin \ - -Dsysusers=false \ - -Dumount-path=/bin/umount \ - -Db_lto=false \ - -Drpmmacrosdir=no \ - -Dhomed=false \ - -Duserdb=false \ - -Dman=true \ - .. - - - The meaning of the meson options: - - - - - -D*-path=* - - These switches provide location of binaries needed by - systemd at runtime that have not yet been installed. - - - - - -Ddefault-dnssec=no - - This switch turns off the experimental DNSSEC support. - - - - - -Dfirstboot=false - - This switch prevents installation of systemd - services responsible for setting up the system for - the first time. They are not useful for LFS because - everything is done manually. - - - - - -Dinstall-tests=false - - This switch prevents installation of the compiled tests. - - - - - -Dldconfig=false - - This switch prevents installation of a systemd unit that runs - ldconfig at boot, which is not useful for source - distributions such as LFS and makes the boot time longer. Remove it - if the described feature is desired. - - - - - -Droot* - - These switches ensure that core programs and - shared libraries are installed in the subdirectories - of the root partition. - - - - - -Dsplit-usr=true - - This switch ensures that systemd will work on - systems where /bin, /lib and /sbin directories are not - symlinks to their /usr counterparts. - - - - - -Dsysusers=false - - This switch prevents installation of systemd - services responsible for setting up the - /etc/group and - /etc/passwd files. Both files - were created earlier in this chapter. - - - - - -Drpmmacrosdir=no - - This switch disables installation of RPM Macros - for use with systemd because LFS does not support RPM. - - - - - -D{userdb,homed}=false - - Remove two daemons that have dependencies that do not fit - the scope of LFS. - - - - - - Compile the package: - -LANG=en_US.UTF-8 ninja - - Install the package: - -LANG=en_US.UTF-8 ninja install - - Remove an unnecessary symbolic link: - -rm -f /usr/bin/xsltproc - - Create the /etc/machine-id file needed by - systemd-journald: - -systemd-machine-id-setup - - Setup the basic target structure: - -systemctl preset-all - - Disable a service that is known to cause problems with systems that - use a network configuration other than what is provided by - systemd-networkd: - - -systemctl disable systemd-time-wait-sync.service - - Prevent systemd from resetting the maximum PID value which causes - some problems with packages and units in BLFS: - - -rm -f /usr/lib/sysctl.d/50-pid-max.conf - - - - - - Contents of systemd - - - Installed programs - Installed libraries - Installed directories - - - bootctl, busctl, coredumpctl, halt (symlink to systemctl), - hostnamectl, init, journalctl, kernel-install, localectl, loginctl, - machinectl, networkctl, portablectl, poweroff (symlink to - systemctl), reboot (symlink to systemctl), resolvconf (symlink to - resolvectl), resolvectl, runlevel (symlink to systemctl), shutdown - (symlink to systemctl), systemctl, systemd-analyze, - systemd-ask-password, systemd-cat, systemd-cgls, systemd-cgtop, - systemd-delta, systemd-detect-virt, systemd-escape, systemd-hwdb, - systemd-id128, systemd-inhibit, systemd-machine-id-setup, - systemd-mount, systemd-notify, systemd-nspawn, systemd-path, - systemd-repart, systemd-resolve (symlink to resolvectl), systemd-run, - systemd-socket-activate, systemd-stdio-bridge, systemd-tmpfiles, - systemd-tty-ask-password-agent, systemd-umount (symlink to - systemd-mount), telinit (symlink to systemctl), timedatectl, and - udevadm - libnss_myhostname.so.2, libnss_mymachines.so.2, - libnss_resolve.so.2, libnss_systemd.so.2, - libsystemd.so, libsystemd-shared-&systemd-version;.so (in /lib/systemd), - and libudev.so - /etc/binfmt.d, /etc/init.d, /etc/kernel, /etc/modules-load.d, - /etc/sysctl.d, /etc/systemd, /etc/tmpfiles.d, /etc/udev, - /etc/xdg/systemd, /lib/systemd, /lib/udev, /usr/include/systemd, - /usr/lib/binfmt.d, /usr/lib/kernel, /usr/lib/modules-load.d, - /usr/lib/sysctl.d, /usr/lib/systemd, /usr/lib/tmpfiles.d, - /usr/share/doc/systemd-&systemd-version;, /usr/share/factory, - /usr/share/systemd, /var/lib/systemd, and /var/log/journal - - - - - Short Descriptions - - - - - bootctl - - Used to query the firmware and boot manager settings - - bootctl - - - - - - busctl - - Used to introspect and monitor the D-Bus bus - - busctl - - - - - - coredumpctl - - Used to retrieve coredumps from the systemd journal - - coredumpctl - - - - - - halt - - Normally invokes shutdown with the - -h option, except when already in run-level 0, - then it tells the kernel to halt the system; it notes in the - file /var/log/wtmp that the system is being - brought down - - halt - - - - - - hostnamectl - - Used to query and change the system hostname and related - settings - - hostnamectl - - - - - - init - - The first process to be started when the kernel has initialized - the hardware which takes over the boot process and starts all - processes according to its configuration files - - init - - - - - - journalctl - - Used to query the contents of the systemd journal - - journalctl - - - - - - kernel-install - - Used to add and remove kernel and initramfs images to and - from /boot - - kernel-install - - - - - - localectl - - Used to query and change the system locale and keyboard layout - settings - - localectl - - - - - - loginctl - - Used to introspect and control the state of the systemd Login - Manager - - loginctl - - - - - - machinectl - - Used to introspect and control the state of the systemd Virtual - Machine and Container Registration Manager - - machinectl - - - - - - networkctl - - Used to introspect the state of the network links as seen by - systemd-networkd - - networkctl - - - - - - portablectl - - Used to attach or detach portable services from the local - system - - portablectl - - - - - - 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 - - - - - - resolvconf - - Register DNS server and domain configuration with - systemd-resolved - - resolvconf - - - - - - resolvectl - - Send control commands to the network name resolution - manager, or resolve domain names, IPv4 and IPv6 addresses, - DNS records, and services. - - resolvectl - - - - - - 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 - - - - - - systemctl - - Used to introspect and control the state of the systemd system - and service manager - - systemctl - - - - - - systemd-analyze - - Used to determine system boot-up performance of the current - boot - - systemd-analyze - - - - - - systemd-ask-password - - Used to query a system password or passphrase from the user, - using a question message specified on the command line - - systemd-ask-password - - - - - - systemd-cat - - Used to connect STDOUT and STDERR of a process with the Journal - - - systemd-cat - - - - - - systemd-cgls - - Recursively shows the contents of the selected Linux control - group hierarchy in a tree - - systemd-cgls - - - - - - systemd-cgtop - - Shows the top control groups of the local Linux control group - hierarchy, ordered by their CPU, memory and disk I/O load - - systemd-cgtop - - - - - - systemd-delta - - Used to identify and compare configuration files in - /etc that override default - counterparts in /usr - - systemd-delta - - - - - - systemd-detect-virt - - Detects execution in a virtualized environment - - systemd-detect-virt - - - - - - systemd-escape - - Used to escape strings for inclusion in systemd unit - names - - systemd-escape - - - - - - systemd-hwdb - - Used to manage hardware database (hwdb) - - systemd-hwdb - - - - - - systemd-id128 - - Generate and print id128 strings - - systemd-id128 - - - - - - systemd-inhibit - - Used to execute a program with a shutdown, sleep or idle - inhibitor lock taken - - systemd-inhibit - - - - - - systemd-machine-id-setup - - Used by system installer tools to initialize the machine ID - stored in /etc/machine-id at install time with a - randomly generated ID - - systemd-machine-id-setup - - - - - - systemd-mount - - A tool to temporarily mount or auto-mount a drive. - - systemd-mount - - - - - - systemd-notify - - Used by daemon scripts to notify the init system about status - changes - - systemd-notify - - - - - - systemd-nspawn - - Used to run a command or OS in a light-weight namespace - container - - systemd-nspawn - - - - - - systemd-path - - Used to query system and user paths - - systemd-path - - - - - - systemd-repart - - Used go grow and add partitions to a partition table when - systemd is used in an OS image (e.g. a container). - - systemd-repart - - - - - - systemd-resolve - - Used to resolve domain names, IPV4 and IPv6 addresses, DNS - resource records, and services - - systemd-resolve - - - - - - systemd-run - - Used to create and start a transient .service or a .scope unit - and run the specified command in it - - systemd-run - - - - - - - - systemd-socket-activate - - A tool to listen on socket devices and launch a process upon - connection. - - systemd-socket-activate - - - - - - systemd-tmpfiles - - Creates, deletes and cleans up volatile and temporary files and - directories, based on the configuration file format and location - specified in - tmpfiles.d directories - - systemd-tmpfiles - - - - - - systemd-umount - - Unmount mount points - - systemd-umount - - - - - - systemd-tty-ask-password-agent - - Used to list or process pending systemd password requests - - systemd-tty-ask-password-agent - - - - - - telinit - - Tells init which run-level to change - to - - telinit - - - - - - timedatectl - - Used to query and change the system clock and its settings - - - timedatectl - - - - - - udevadm - - Generic udev administration tool: controls the udevd daemon, - provides info from the Udev database, monitors uevents, waits for - uevents to finish, tests udev configuration, and triggers uevents - for a given device - - udevadm - - - - - - libsystemd - - The main systemd utility library - - libsystemd - - - - - - libudev - - A library to access Udev device information - - libudev - - - - - - - - -
diff --git a/chapter06/sysvinit.xml b/chapter06/sysvinit.xml deleted file mode 100644 index 0c171acf5..000000000 --- a/chapter06/sysvinit.xml +++ /dev/null @@ -1,220 +0,0 @@ - - - %general-entities; -]> - - - - - - sysvinit - &sysvinit-version; -
&sysvinit-url;
-
- - 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> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&sysvinit-ch6-sbu;</seg> - <seg>&sysvinit-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Sysvinit - - - First, apply a patch that removes several programs installed by other - packages, clarifies a message, and fixes a compiler warning: - -patch -Np1 -i ../&sysvinit-consolidated-patch; - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make install - - - - - Contents of Sysvinit - - - Installed programs - - - bootlogd, fstab-decode, halt, init, killall5, - poweroff (link to halt), reboot (link to halt), runlevel, - shutdown, and telinit (link to init) - - - - - Short Descriptions - - - - - bootlogd - - Logs boot messages to a log file - - bootlogd - - - - - - fstab-decode - - Run a command with fstab-encoded arguments - - fstab-decode - - - - - - halt - - Normally invokes shutdown with the - -h option, except when already in run-level 0, - then it tells the kernel to halt the system; it notes in the - file /var/log/wtmp that the system is being - brought down - - halt - - - - - - init - - The first process to be started when the kernel has initialized - the hardware which takes over the boot process and starts all the - proceses specified in its configuration file - - init - - - - - - killall5 - - Sends a signal to all processes, except the processes in its own - session so it will not kill its parent shell - - killall5 - - - - - - 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 - - - - - - telinit - - Tells init which run-level to change to - - telinit - - - - - - - - -
diff --git a/chapter06/tar.xml b/chapter06/tar.xml index d148c4695..ff2008e28 100644 --- a/chapter06/tar.xml +++ b/chapter06/tar.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,22 +16,25 @@ Tar-&tar-version; - + Tar + tools - <para>The Tar package contains an archiving program.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/tar.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&tar-ch6-sbu;</seg> - <seg>&tar-ch6-du;</seg> + <seg>&tar-ch5-sbu;</seg> + <seg>&tar-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -42,74 +45,26 @@ <para>Prepare Tar for compilation:</para> -<screen><userinput remap="configure">FORCE_UNSAFE_CONFIGURE=1 \ -./configure --prefix=/usr \ +<screen><userinput remap="configure">./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) \ --bindir=/bin</userinput></screen> - <variablelist> - <title>The meaning of the configure options: - - - FORCE_UNSAFE_CONFIGURE=1 - - This forces the test for mknod to be run - as root. It is generally considered dangerous to run this test as - the root user, but as it is being run on a system that has only been - partially built, overriding it is OK. - - - - Compile the package: make - To test the results (about 3 SBU), issue: - -make check - - - Install the package: -make install -make -C doc install-html docdir=/usr/share/doc/tar-&tar-version; +make DESTDIR=$LFS install + + - <sect2 id="contents-tar" role="content"> - <title>Contents of Tar - - - Installed programs - Installed directory - - - tar - /usr/share/doc/tar-&tar-version; - - - - - Short Descriptions - - - - - tar - - Creates, extracts files from, and lists the contents of archives, - also known as tarballs - - tar - - - - - + Details on this package are located in + diff --git a/chapter06/tcl.xml b/chapter06/tcl.xml new file mode 100644 index 000000000..bd17a91a8 --- /dev/null +++ b/chapter06/tcl.xml @@ -0,0 +1,191 @@ + + + %general-entities; + + +]> + + + + + + tcl + &tcl-version; +
&tcl-url;
+
+ + Tcl-&tcl-version; + + + Tcl + + + + + + <para>The <application>Tcl</application> package contains the Tool Command Language, + a robust general-purpose scripting language. The <application>Expect</application> package + is written in the <application>Tcl</application> language.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&tcl-ch5-sbu;</seg> + <seg>&tcl-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Tcl + + This package and the next two (Expect and DejaGNU) are + installed to support running the test suites for GCC and Binutils and other + packages. Installing three packages for testing purposes may seem + excessive, but it is very reassuring, if not essential, to know that the + most important tools are working properly. These packages are required + to run the test suites in . + + Note that the Tcl package used here is a minimal version needed + to run the LFS tests. For the full package, see the + BLFS Tcl procedures. + + Prepare Tcl for compilation: + +SRCDIR=$(pwd) +cd unix +./configure --prefix=/usr \ + --mandir=/usr/share/man \ + $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) + + + The meaning of the configure options: + + + $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit) + + The construct $(<shell command>) + is replaced by the output of the chell command. Here this output is + empty if running on a 32 bit machine, and is + --enable-64bit if running on a 64 bit machine. + + + + + + + Build the package: + +make + +sed -e "s|$SRCDIR/unix|/usr/lib|" \ + -e "s|$SRCDIR|/usr/include|" \ + -i tclConfig.sh + +sed -e "s|$SRCDIR/unix/pkgs/tdbc&tdbc-ver;|/usr/lib/tdbc&tdbc-ver;|" \ + -e "s|$SRCDIR/pkgs/tdbc&tdbc-ver;/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/tdbc&tdbc-ver;/library|/usr/lib/tcl8.6|" \ + -e "s|$SRCDIR/pkgs/tdbc&tdbc-ver;|/usr/include|" \ + -i pkgs/tdbc&tdbc-ver;/tdbcConfig.sh + +sed -e "s|$SRCDIR/unix/pkgs/itcl&itcl-ver;|/usr/lib/itcl&itcl-ver;|" \ + -e "s|$SRCDIR/pkgs/itcl&itcl-ver;/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/itcl&itcl-ver;|/usr/include|" \ + -i pkgs/itcl&itcl-ver;/itclConfig.sh + +unset SRCDIR + + The various sed after the make command + remove references to the build directory from various configuration files, + and replaces them with the install directory. This is not mandatory + for the remaining of LFS, but may be needed in case a package built later + uses Tcl. + + Install the package: + +make install + + Make the installed library writable so debugging symbols can + be removed later: + +chmod -v u+w /usr/lib/libtcl&tcl-major-version;.so + + Install Tcl's headers. The next package, Expect, requires them + to build. + +make install-private-headers + + Now make a necessary symbolic link: + +ln -sfv tclsh&tcl-major-version; /usr/bin/tclsh + + + + + Contents of Tcl + + + Installed programs + Installed library + + + tclsh (link to tclsh&tcl-major-version;) and tclsh&tcl-major-version; + libtcl&tcl-major-version;.so, libtclstub&tcl-major-version;.a + + + + + Short Descriptions + + + + + tclsh&tcl-major-version; + + The Tcl command shell + + tclsh&tcl-major-version; + + + + + + tclsh + + A link to tclsh&tcl-major-version; + + tclsh + + + + + + libtcl&tcl-major-version;.so + + The Tcl library + + libtcl&tcl-major-version;.so + + + + + + libtclstub&tcl-major-version;.a + + The Tcl Stub library + + libtclstub&tcl-major-version;.a + + + + + + + + +
diff --git a/chapter06/texinfo.xml b/chapter06/texinfo.xml index d61df477b..8434c7112 100644 --- a/chapter06/texinfo.xml +++ b/chapter06/texinfo.xml @@ -5,8 +5,8 @@ %general-entities; ]> - - + + texinfo @@ -16,23 +16,25 @@ Texinfo-&texinfo-version; - + Texinfo + temporary - <para>The Texinfo package contains programs for reading, writing, and - converting info pages.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/texinfo.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&texinfo-ch6-sbu;</seg> - <seg>&texinfo-ch6-du;</seg> + <seg>&texinfo-ch5-sbu;</seg> + <seg>&texinfo-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -43,194 +45,29 @@ <para>Prepare Texinfo for compilation:</para> -<screen><userinput remap="configure">./configure --prefix=/usr --disable-static</userinput></screen> +<screen><userinput remap="configure">./configure --prefix=/usr</userinput></screen> - <variablelist> - <title>The meaning of the configure options: - - - --disable-static - - In this case, the top-level configure script will complain that - this is an unrecognized option, but the configure script for - XSParagraph recognizes it and uses it to disable installing a static - XSParagraph.a to /usr/lib/texinfo. - - - - + + As part of the configure process, a test is made that indicates an + error for TestXS_la-TestXS.lo. This is not relevant for LFS and should be + ignored. + Compile the package: make - To test the results, issue: - -make check - Install the package: make install - Optionally, install the components belonging in a TeX - installation: - - -make TEXMF=/usr/share/texmf install-tex - - - The meaning of the make parameter: - - - TEXMF=/usr/share/texmf - - The TEXMF makefile variable holds the location - of the root of the TeX tree if, for example, a TeX package will be - installed later. - - - - - - The Info documentation system uses a plain text file to hold its list of - menu entries. The file is located at /usr/share/info/dir. - Unfortunately, due to occasional problems in the Makefiles of various packages, - it can sometimes get out of sync with the info pages installed on the system. - If the /usr/share/info/dir file ever needs to be - recreated, the following optional commands will accomplish the task: - -pushd /usr/share/info -rm -v dir -for f in * - do install-info $f dir 2>/dev/null -done -popd - - - Contents of Texinfo - - - Installed programs - Installed library - Installed directories - - - info, install-info, makeinfo (link to texi2any), - pdftexi2dvi, pod2texi, texi2any, texi2dvi, texi2pdf, and texindex - MiscXS.so, Parsetexi.so, and XSParagraph.so - (all in /usr/lib/texinfo) - /usr/share/texinfo and /usr/lib/texinfo - - + + - <variablelist> - <bridgehead renderas="sect3">Short Descriptions</bridgehead> - <?dbfo list-presentation="list"?> - <?dbhtml list-presentation="table"?> - - <varlistentry id="info"> - <term><command>info</command></term> - <listitem> - <para>Used to read info pages which are similar to man pages, but - often go much deeper than just explaining all the available command - line options [For example, compare <command>man bison</command> and - <command>info bison</command>.]</para> - <indexterm zone="ch-system-texinfo info"> - <primary sortas="b-info">info</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="install-info"> - <term><command>install-info</command></term> - <listitem> - <para>Used to install info pages; it updates entries in the - <command>info</command> index file</para> - <indexterm zone="ch-system-texinfo install-info"> - <primary sortas="b-install-info">install-info</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="makeinfo"> - <term><command>makeinfo</command></term> - <listitem> - <para>Translates the given Texinfo source documents into - info pages, plain text, or HTML</para> - <indexterm zone="ch-system-texinfo makeinfo"> - <primary sortas="b-makeinfo">makeinfo</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="pdftexi2dvi"> - <term><command>pdftexi2dvi</command></term> - <listitem> - <para>Used to format the given Texinfo document into a - Portable Document Format (PDF) file</para> - <indexterm zone="ch-system-texinfo pdftexi2dvi"> - <primary sortas="b-pdftexi2dvi">pdftexi2dvi</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="pod2texi"> - <term><command>pod2texi</command></term> - <listitem> - <para>Converts Pod to Texinfo format</para> - <indexterm zone="ch-system-texinfo pod2texi"> - <primary sortas="b-pod2texi">pod2texi</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="texi2any"> - <term><command>texi2any</command></term> - <listitem> - <para>Translate Texinfo source documentation to - various other formats</para> - <indexterm zone="ch-system-texinfo texi2any"> - <primary sortas="b-texiany">texi2any</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="texi2dvi"> - <term><command>texi2dvi</command></term> - <listitem> - <para>Used to format the given Texinfo document into a - device-independent file that can be printed</para> - <indexterm zone="ch-system-texinfo texi2dvi"> - <primary sortas="b-texi2dvi">texi2dvi</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="texi2pdf"> - <term><command>texi2pdf</command></term> - <listitem> - <para>Used to format the given Texinfo document into a - Portable Document Format (PDF) file</para> - <indexterm zone="ch-system-texinfo texi2pdf"> - <primary sortas="b-texi2pdf">texi2pdf</primary> - </indexterm> - </listitem> - </varlistentry> - - <varlistentry id="texindex"> - <term><command>texindex</command></term> - <listitem> - <para>Used to sort Texinfo index files</para> - <indexterm zone="ch-system-texinfo texindex"> - <primary sortas="b-texindex">texindex</primary> - </indexterm> - </listitem> - </varlistentry> - - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-texinfo" role="."/></para> </sect2> diff --git a/chapter06/toolchaintechnotes.xml b/chapter06/toolchaintechnotes.xml new file mode 100644 index 000000000..63c9210e5 --- /dev/null +++ b/chapter06/toolchaintechnotes.xml @@ -0,0 +1,335 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" + "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-toolchaintechnotes"> + <?dbhtml filename="toolchaintechnotes.html"?> + + <title>Toolchain Technical Notes + + This section explains some of the rationale and technical details + behind the overall build method. It is not essential to immediately + understand everything in this section. Most of this information will be + clearer after performing an actual build. This section can be referred + to at any time during the process. + + The overall goal of is to + produce a temporary area that contains a known-good set of tools that can be + isolated from the host system. By using chroot, the + commands in the remaining chapters will be contained within that environment, + ensuring a clean, trouble-free build of the target LFS system. The build + process has been designed to minimize the risks for new readers and to provide + the most educational value at the same time. + + The build process is based on the process of + cross-compilation. Cross-compilation is normally used + for building a compiler and its toolchain for a machine different from + the one that is used for the build. This is not strictly needed for LFS, + since the machine where the new system will run is the same as the one + used for the build. But cross-compilation has the great advantage that + anything that is cross-compiled cannot depend on the host environment. + + + + About Cross-Compilation + + Cross-compilation involves some concepts that deserve a section on + their own. Although this section may be omitted in a first reading, it + is strongly suggested to come back to it later in order to get a full + grasp of the build process. + + Let us first define some terms used in this context: + + + build + is the machine where we build programs. Note that this machine + is referred to as the host in other + sections. + + + host + is the machine/system where the built programs will run. Note + that this use of host is not the same as in other + sections. + + + target + is only used for compilers. It is the machine the compiler + produces code for. It may be different from both build and + host. + + + + + As an example, let us imagine the following scenario: we may have a + compiler on a slow machine only, let's call the machine A, and the compiler + ccA. We may have also a fast machine (B), but with no compiler, and we may + want to produce code for a another slow machine (C). Then, to build a + compiler for machine C, we would have three stages: + + + + + + + + + + StageBuildHost + TargetAction + + + + 1AAB + build cross-compiler cc1 using ccA on machine A + + + 2ABB + build cross-compiler cc2 using cc1 on machine A + + + 3BCC + build compiler ccC using cc2 on machine B + + + + + + Then, all the other programs needed by machine C can be compiled + using cc2 on the fast machine B. Note that unless B can run programs + produced for C, there is no way to test the built programs until machine + C itself is running. For example, for testing ccC, we may want to add a + fourth stage: + + + + + + + + + + StageBuildHost + TargetAction + + + + 4CCC + rebuild and test ccC using itself on machine C + + + + + + In the example above, only cc1 and cc2 are cross-compilers, that is, + they produce code for a machine different from the one they are run on. + The other compilers ccA and ccC produce code for the machine they are run + on. Such compilers are called native compilers. + + + + + Implementation of Cross-Compilation for LFS + + + Almost all the build systems use names of the form + cpu-vendor-kernel-os referred to as the machine triplet. An astute + reader may wonder why a triplet refers to a four component + name. The reason is history: initially, three component names were enough + to designate unambiguously a machine, but with new machines and systems + appearing, that proved insufficient. The word triplet + remained. A simple way to determine your machine triplet is to run + the config.guess + script that comes with the source for many packages. Unpack the Binutils + sources and run the script: ./config.guess and note + the output. For example, for a 32-bit Intel processor the + output will be i686-pc-linux-gnu. On a 64-bit + system it will be x86_64-pc-linux-gnu. + + Also be aware of the name of the platform's dynamic linker, often + referred to as the dynamic loader (not to be confused with the standard + linker ld that is part of Binutils). The dynamic linker + provided by Glibc finds and loads the shared libraries needed by a + program, prepares the program to run, and then runs it. The name of the + dynamic linker for a 32-bit Intel machine will be ld-linux.so.2 (ld-linux-x86-64.so.2 for 64-bit systems). A + sure-fire way to determine the name of the dynamic linker is to inspect a + random binary from the host system by running: readelf -l + <name of binary> | grep interpreter and noting the + output. The authoritative reference covering all platforms is in the + shlib-versions file in the root of the Glibc source + tree. + + + In order to fake a cross compilation, the name of the host triplet + is slightly adjusted by changing the "vendor" field in the + LFS_TGT variable. We also use the + --with-sysroot when building the cross linker and + cross compiler, to tell them where to find the needed host files. This + ensures none of the other programs built in can link to libraries on the build + machine. Only two stages are mandatory, and one more for tests: + + + + + + + + + + StageBuildHost + TargetAction + + + + 1pcpclfs + build cross-compiler cc1 using cc-pc on pc + + + 2pclfslfs + build compiler cc-lfs using cc1 on pc + + + 3lfslfslfs + rebuild and test cc-lfs using itself on lfs + + + + + + In the above table, on pc means the commands are run + on a machine using the already installed distribution. On + lfs means the commands are run in a chrooted environment. + + Now, there is more about cross-compiling: the C language is not + just a compiler, but also defines a standard library. In this book, the + GNU C library, named glibc, is used. This library must + be compiled for the lfs machine, that is, using the cross compiler cc1. + But the compiler itself uses an internal library implementing complex + instructions not available in the assembler instruction set. This + internal library is named libgcc, and must be linked to the glibc + library to be fully functional! Furthermore, the standard library for + C++ (libstdc++) also needs being linked to glibc. The solution + to this chicken and egg problem is to first build a degraded cc1+libgcc, + lacking some fuctionalities such as threads and exception handling, then + build glibc using this degraded compiler (glibc itself is not + degraded), then build libstdc++. But this last library will lack the + same functionalities as libgcc. + + This is not the end of the story: the conclusion of the preceding + paragraph is that cc1 is unable to build a fully functional libstdc++, but + this is the only compiler available for building the C/C++ libraries + during stage 2! Of course, the compiler built during stage 2, cc-lfs, + would be able to build those libraries, but (i) the build system of + gcc does not know that it is usable on pc, and (ii) using it on pc + would be at risk of linking to the pc libraries, since cc-lfs is a native + compiler. So we have to build libstdc++ later, in chroot. + + + + + + Other procedural details + + The cross-compiler will be installed in a separate $LFS/tools directory, since it will not + be part of the final system. + + Binutils is installed first because the configure + runs of both GCC and Glibc perform various feature tests on the assembler + and linker to determine which software features to enable or disable. This + is more important than one might first realize. An incorrectly configured + GCC or Glibc can result in a subtly broken toolchain, where the impact of + such breakage might not show up until near the end of the build of an + entire distribution. A test suite failure will usually highlight this error + before too much additional work is performed. + + Binutils installs its assembler and linker in two locations, + $LFS/tools/bin and $LFS/tools/$LFS_TGT/bin. The tools in one + location are hard linked to the other. An important facet of the linker is + its library search order. Detailed information can be obtained from + ld by passing it the --verbose + flag. For example, $LFS_TGT-ld --verbose | grep SEARCH + will illustrate the current search paths and their order. It shows which + files are linked by ld by compiling a dummy program and + passing the --verbose switch to the linker. For + example, + $LFS_TGT-gcc dummy.c -Wl,--verbose 2>&1 | grep succeeded + will show all the files successfully opened during the linking. + + The next package installed is GCC. An example of what can be + seen during its run of configure is: + +checking what assembler to use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/as +checking what linker to use... /mnt/lfs/tools/i686-lfs-linux-gnu/bin/ld + + This is important for the reasons mentioned above. It also + demonstrates that GCC's configure script does not search the PATH + directories to find which tools to use. However, during the actual + operation of gcc itself, the same search paths are not + necessarily used. To find out which standard linker gcc + will use, run: $LFS_TGT-gcc -print-prog-name=ld. + + Detailed information can be obtained from gcc by + passing it the -v command line option while compiling + a dummy program. For example, gcc -v dummy.c will show + detailed information about the preprocessor, compilation, and assembly + stages, including gcc's included search paths and their + order. + + Next installed are sanitized Linux API headers. These allow the + standard C library (Glibc) to interface with features that the Linux + kernel will provide. + + The next package installed is Glibc. The most important + considerations for building Glibc are the compiler, binary tools, and + kernel headers. The compiler is generally not an issue since Glibc will + always use the compiler relating to the --host + parameter passed to its configure script; e.g. in our case, the compiler + will be $LFS_TGT-gcc. The binary tools and kernel + headers can be a bit more complicated. Therefore, take no risks and use + the available configure switches to enforce the correct selections. After + the run of configure, check the contents of the + config.make file in the build directory for all important details. + Note the use of CC="$LFS_TGT-gcc" (with + $LFS_TGT expanded) to control which binary tools are used + and the use of the -nostdinc and + -isystem flags to control the compiler's include + search path. These items highlight an important aspect of the Glibc + package—it is very self-sufficient in terms of its build machinery + and generally does not rely on toolchain defaults. + + As said above, the standard C++ library is compiled next, followed + by all the programs that need themselves to be built. The install step + uses the DESTDIR variable to have the programs land into + the LFS filesystem. + + Then the native lfs compiler is built. First Binutils Pass 2, with + the same DESTDIR install as the other programs, then the + second pass of GCC, omitting libstdc++ and other non-important libraries. + Due to some weird logic in GCC's configure script, + CC_FOR_TARGET ends up as cc when host + is the same as target, but is different from build. This is why + CC_FOR_TARGET=$LFS_TGT-gcc is put explicitely into + the configure options. + + Upon entering the chroot environment in , the first task is to install + libstdc++. Then temporary installations of programs needed for the proper + operation of the toolchain are performed. Programs needed for testing + other programs are also built. From this point onwards, the + core toolchain is self-contained and self-hosted. In the remainder of + the , final versions of all the + packages needed for a fully functional system are built, tested and + installed. + + + + diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml index 519c3b171..6aebad7a1 100644 --- a/chapter06/util-linux.xml +++ b/chapter06/util-linux.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,24 +16,23 @@ Util-linux-&util-linux-version; - + Util-linux + tools - <para>The Util-linux package contains miscellaneous utility programs. - Among them are utilities for handling file systems, consoles, partitions, - and messages.</para> + <para>The Util-linux package contains miscellaneous utility programs.</para> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&util-linux-ch6-sbu;</seg> - <seg>&util-linux-ch6-du;</seg> + <seg>&util-linux-ch5-sbu;</seg> + <seg>&util-linux-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -42,31 +41,14 @@ <sect2 role="installation"> <title>Installation of Util-linux - The FHS recommends using the /var/lib/hwclock directory instead of the - usual /etc directory as the - location for the adjtime file. Create this directory - with: + First create a directory + to enable storage for the hwclock program: mkdir -pv /var/lib/hwclock Prepare Util-linux for compilation: -./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ - --docdir=/usr/share/doc/util-linux-&util-linux-version; \ - --disable-chfn-chsh \ - --disable-login \ - --disable-nologin \ - --disable-su \ - --disable-setpriv \ - --disable-runuser \ - --disable-pylibmount \ - --disable-static \ - --without-python \ - --without-systemd \ - --without-systemdsystemunitdir - -./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ +./configure ADJTIME_PATH=/var/lib/hwclock/adjtime \ --docdir=/usr/share/doc/util-linux-&util-linux-version; \ --disable-chfn-chsh \ --disable-login \ @@ -78,1241 +60,53 @@ --disable-static \ --without-python - The --disable and --without options prevent warnings about - building components that require packages not in LFS or are - inconsistent with programs installed by other packages. - - Compile the package: - -make - - If desired, run the test suite as a non-root user: - - Running the test suite as the root user can be harmful to - your system. To run it, the CONFIG_SCSI_DEBUG option for the kernel must - be available in the currently running system, and must be built as a - module. Building it into the kernel will prevent booting. For complete - coverage, other BLFS packages must be installed. If desired, this test can - be run after rebooting into the completed LFS system and running: - -bash tests/run.sh --srcdir=$PWD --builddir=$PWD - - -chown -Rv tester . -su tester -c "make -k check" - - Install the package: - -make install - - - - - Contents of Util-linux - - - Installed programs - Installed libraries - Installed directories - - - addpart, agetty, blkdiscard, blkid, blkzone, blockdev, cal, cfdisk, chcpu, - chmem, choom, chrt, col, colcrt, colrm, column, ctrlaltdel, delpart, dmesg, - eject, fallocate, fdformat, fdisk, fincore, findfs, findmnt, flock, fsck, - fsck.cramfs, fsck.minix, fsfreeze, fstrim, getopt, hexdump, hwclock, - i386, ionice, ipcmk, ipcrm, ipcs, isosize, kill, last, lastb (link to - last), ldattach, linux32, linux64, logger, look, losetup, lsblk, lscpu, - lsipc, lslocks, lslogins, lsmem, lsns, mcookie, mesg, mkfs, mkfs.bfs, mkfs.cramfs, mkfs.minix, mkswap, - more, mount, mountpoint, namei, nsenter, partx, pivot_root, prlimit, raw, - readprofile, rename, renice, resizepart, rev, rfkill, rtcwake, script, - scriptreplay, setarch, setsid, setterm, sfdisk, sulogin, swaplabel, - swapoff (link to swapon), swapon, switch_root, taskset, ul, - umount, uname26, unshare, utmpdump, uuidd, uuidgen, uuidparse, wall, wdctl, whereis, - wipefs, x86_64, and zramctl - libblkid.so, libfdisk.so, libmount.so, - libsmartcols.so, and libuuid.so - /usr/include/blkid, - /usr/include/libfdisk, - /usr/include/libmount, - /usr/include/libsmartcols, - /usr/include/uuid, - /usr/share/doc/util-linux-&util-linux-version;, - and /var/lib/hwclock - - - - Short Descriptions - - - - - addpart - - Informs the Linux kernel of new partitions - - addpart - - - - - - agetty - - Opens a tty port, prompts for a login name, - and then invokes the login program - - agetty - - - - - - blkdiscard - - Discards sectors on a device - - blkdiscard - - - - - - blkid - - A command line utility to locate and print block device - attributes - - blkid - - - - - - blkzone - - Runs zone command on the given block device - - blkzone - - - - - - 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 - - - - - - chcpu - - Modifies the state of CPUs - - chcpu - - - - - - chmem - - Configures memory - - chmem - - - - - - choom - - Displays and adjusts OOM-killer score - - choom - - - - - - chrt - - Manipulates real-time attributes of a process - - chrt - - - - - - 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 - - - - - - delpart - - Asks the Linux kernel to remove a partition - - delpart - - - - - - dmesg - - Dumps the kernel boot messages - - dmesg - - - - - - eject - - Ejects removable media - - eject - - - - - - fallocate - - Preallocates space to a file - - fallocate - - - - - - fdformat - - Low-level formats a floppy disk - - fdformat - - - - - - fdisk - - Manipulates the partition table of the given device - - fdisk - - - - - - fincore - - Counts pages of file contents in core - - fincore - - - - - - findfs - - Finds a file system by label or Universally Unique Identifier - (UUID) - - findfs - - - - - - findmnt - - Is a command line interface to the libmount library - for work with mountinfo, fstab and mtab files - - findmnt - - - - - - flock - - Acquires a file lock and then executes a command with the lock - held - - flock - - - - - - fsck - - Is used to check, and optionally repair, file systems - - fsck - - - - - - 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 - - - - - - fsfreeze - - Is a very simple wrapper around FIFREEZE/FITHAW ioctl - kernel driver operations - - fsfreeze - - - - - - fstrim - - Discards unused blocks on a mounted filesystem - - fstrim - - - - - - 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 - - - - - - i386 - - A symbolic link to setarch - - i386 - - - - - - ionice - - Gets or sets the io scheduling class and priority for a program - - ionice - - - - - - ipcmk - - Creates various IPC resources - - ipcmk - - - - - - 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 - - - - - - kill - - Sends signals to processes - - kill - - - - - - last - - Shows which users last logged in (and out), searching back - through the /var/log/wtmp file; it also shows - system boots, shutdowns, and run-level changes - - last - - - - - - lastb - - Shows the failed login attempts, as logged in - /var/log/btmp - - lastb - - - - - - ldattach - - Attaches a line discipline to a serial line - - ldattach - - - - - - linux32 - - A symbolic link to setarch - - linux32 - - - - - - linux64 - - A symbolic link to setarch - - linux64 - - - - - - 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 - - - - - - lsblk - - Lists information about all or selected block devices in - a tree-like format - - lsblk - - - - - - lscpu - - Prints CPU architecture information - - lscpu - - - - - - lsipc - - Prints information on IPC facilities currently employed - in the system - - lsipc - - - - - - lslocks - - Lists local system locks - - lslocks - - - - - - lslogins - - Lists information about users, groups and system accounts - - lslogins - - - - - - lsmem - - Lists the ranges of available memory with their online - status - - lsmem - - - - - - lsns - - Lists namespaces - - lsns - - - - - - mcookie - - Generates magic cookies (128-bit random hexadecimal numbers) for - xauth - - mcookie - - - - - - mesg - - Controls whether other users can send messages to the current - user's terminal - - mesg - - - - - - mkfs - - Builds a file system on a device (usually a hard disk - partition) - - mkfs - - - - - - mkfs.bfs - - Creates a 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 - - - - - - mountpoint - - Checks if the directory is a mountpoint - - mountpoint - - - - - - namei - - Shows the symbolic links in the given pathnames - - namei - - - - - - nsenter - - Runs a program with namespaces of other processes - - nsenter - - - - - - partx - - Tells the kernel about the presence and numbering of on-disk - partitions - - partx - - - - - - pivot_root - - Makes the given file system the new root file system of the - current process - - pivot_root - - - - - - prlimit - - Get and set a process' resource limits - - prlimit - - - - - - raw - - Bind a Linux raw character device to a block device - - raw - - - - - - 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 - - - - - - resizepart - - Asks the Linux kernel to resize a partition - - resizepart - - - - - - rev - - Reverses the lines of a given file - - rev - - - - - - rkfill - - Tool for enabling and disabling wireless devices - - rkfill - - - - - - rtcwake - - Used to enter a system sleep state until specified wakeup - time - - rtcwake - - - - - - script - - Makes a typescript of a terminal session - - script - - - - - - scriptreplay - - Plays back typescripts using timing information - - scriptreplay - - - - - - setarch - - Changes reported architecture in a new program environment and - sets personality flags - - setarch - - - - - - setsid - - Runs the given program in a new session - - setsid - - - - - - setterm + The meaning of the configure options: + + + ADJTIME_PATH=/var/lib/hwclock/adjtime - Sets terminal attributes - - setterm - + This sets the location of the file recording information about + the hardware clock, in accordance to the FHS. This is not stricly + needed fot his temporary tool, but it prevent creating a file + at another location, which would not be overwritten or removed + when building the final util-linux. - - sfdisk + + --disable-* - A disk partition table manipulator - - sfdisk - + Those switches prevent warnings about building components + that require packages not in LFS or not installed yet. - - sulogin + + --without-python - Allows root to log in; - it is normally invoked by init when the system goes - into single user mode - - sulogin - + This switch disables using Python. + It avoids trying to build unneeded bindings. - - swaplabel - - Allows to change swaparea UUID and label - - swaplabel - - - + - - swapoff - - Disables devices and files for paging and swapping - - swapoff - - - - - - swapon - - Enables devices and files for paging and swapping and - lists the devices and files currently in use - - swapon - - - - - - switch_root - - Switches to another filesystem as the root of the mount tree - - switch_root - - - - - - tailf - - Tracks the growth of a log file; displays the last 10 lines - of a log file, then continues displaying any new entries in the - log file as they are created - - tailf - - - - - - taskset - - Retrieves or sets a process' CPU affinity - - taskset - - - - - - 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 - - - - - - uname26 - - A symbolic link to setarch - - uname26 - - - - - - unshare - - Runs a program with some namespaces unshared from parent - - unshare - - - - - - utmpdump - - Displays the content of the given login file in a more - user-friendly format - - utmpdump - - - - - - uuidd - - A daemon used by the UUID library to generate time-based - UUIDs in a secure and guaranteed-unique fashion - - uuidd - - - - - - 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 - - - - - - uuidparse - - An utility to parse unique identifiers - - uuidparse - - - - - - wall - - Displays the contents of a file or, by default, its standard - input, on the terminals of all currently logged in users - - wall - - - - - - wdctl - - Shows hardware watchdog status - - wdctl - - - - - - whereis - - Reports the location of the binary, source, and man page - for the given command - - whereis - - - - - - wipefs - - Wipes a filesystem signature from a device - - wipefs - - - - - - x86_64 - - A symbolic link to setarch - - x86_64 - - - - - - zramctl - - A program to set up and control zram (compressed ram disk) - devices - - zramctl - - - + Compile the package: - - libblkid - - Contains routines for device identification and token - extraction - - libblkid - - - +make - - libfdisk - - Contains routines for manipulating partition tables - - libfdisk - - - + Install the package: - - libmount - - Contains routines for block device mounting and - unmounting - - libmount - - - +make install - - libsmartcols - - Contains routines for aiding screen output in tabular form - - libsmartcols - - - + - - libuuid - - Contains routines for generating unique identifiers for objects - that may be accessible beyond the local system - - libuuid - - - + + - </variablelist> + <para>Details on this package are located in + <xref linkend="contents-utillinux" role="."/></para> </sect2> diff --git a/chapter06/vim.xml b/chapter06/vim.xml deleted file mode 100644 index 263122bd7..000000000 --- a/chapter06/vim.xml +++ /dev/null @@ -1,319 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-vim" role="wrap"> - <?dbhtml filename="vim.html"?> - - <sect1info condition="script"> - <productname>vim</productname> - <productnumber>&vim-version;</productnumber> - <address>&vim-url;</address> - </sect1info> - - <title>Vim-&vim-version; - - - Vim - - - - - - <para>The Vim package contains a powerful text editor.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&vim-ch6-sbu;</seg> - <seg>&vim-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - <tip> - <title>Alternatives to Vim - - If you prefer another editor—such as Emacs, Joe, or - Nano—please refer to for suggested - installation instructions. - - - - - - Installation of Vim - - First, change the default location of the vimrc - configuration file to /etc: - -echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h - - - Prepare Vim for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - - To prepare the tests, ensure that the - tester user can write - to the sources tree: - -chown -Rv tester . - - Now run the tests as the tester user: - -su tester -c "LANG=en_US.UTF-8 make -j1 test" &> vim-test.log - - - - The test suite outputs a lot of binary data to the screen. This can - cause issues with the settings of the current terminal. The problem can be - avoided by redirecting the output to a log file as shown above. A - successful test will result in the words "ALL DONE" in the log file - at completion. - - Install the package: - -make install - - Many users are used to using vi instead of - vim. To allow execution of vim - when users habitually enter vi, create a - symlink for both the binary and the man page in the provided - languages: - -ln -sv vim /usr/bin/vi -for L in /usr/share/man/{,*/}man1/vim.1; do - ln -sv vim.1 $(dirname $L)/vi.1 -done - - By default, Vim's documentation is installed in /usr/share/vim. The following symlink - allows the documentation to be accessed via /usr/share/doc/vim-&vim-version;, making - it consistent with the location of documentation for other packages: - -ln -sv ../&vim-docdir;/doc /usr/share/doc/vim-&vim-version; - - If an X Window System is going to be installed on the LFS - system, it may be necessary to recompile Vim after installing X. Vim - comes with a GUI version of the editor that requires X and some - additional libraries to be installed. For more information on this - process, refer to the Vim documentation and the Vim installation page - in the BLFS book at . - - - - - Configuring Vim - - - /etc/vimrc - - - 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 be the first - setting in the configuration file. This is necessary because it changes - other settings, and overrides must come after this setting. Create a default - vim configuration file by running the following: - -cat > /etc/vimrc << "EOF" -" Begin /etc/vimrc - -" Ensure defaults are set before customizing settings, not after -source $VIMRUNTIME/defaults.vim -let skip_defaults_vim=1 - -set nocompatible -set backspace=2 -set mouse= -syntax on -if (&term == "xterm") || (&term == "putty") - set background=dark -endif - -" End /etc/vimrc -EOF - - The set nocompatible setting 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 - setting allows backspacing over line breaks, autoindents, and the start of - insert. The syntax on parameter enables vim's syntax - highlighting. The set mouse= setting enables - proper pasting of text with the mouse when working in chroot or over a - remote connection. Finally, the if statement with the - set background=dark setting 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' - - - By default, Vim only installs spell files for the English language. - To install spell files for your preferred language, download the - *.spl and optionally, the *.sug - files for your language and character encoding from and save them to - /usr/share/&vim-docdir;/spell/. - - To use these spell files, some configuration in - /etc/vimrc is needed, e.g.: - -set spelllang=en,ru -set spell - - For more information, see the appropriate README file located - at the URL above. - - - - - - Contents of Vim - - - Installed programs - Installed directory - - - ex (link to vim), rview (link to vim), rvim (link to vim), vi - (link to vim), view (link to vim), vim, vimdiff (link to vim), vimtutor, - and xxd - /usr/share/vim - - - - - Short Descriptions - - - - - ex - - Starts vim in ex mode - - ex - - - - - - 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 - - - - - - vi - - Link to vim - - vi - - - - - - view - - Starts vim in read-only mode - - view - - - - - - vim - - Is the editor - - vim - - - - - - vimdiff - - Edits two or three versions of a file with vim - and shows differences - - vimdiff - - - - - - 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/xml-parser.xml b/chapter06/xml-parser.xml deleted file mode 100644 index 54d5bcb35..000000000 --- a/chapter06/xml-parser.xml +++ /dev/null @@ -1,92 +0,0 @@ - - - %general-entities; -]> - - - - - - xml-parser - &xml-parser-version; -
&xml-parser-url;
-
- - XML::Parser-&xml-parser-version; - - - XML::Parser - - - - - - <para>The XML::Parser module is a Perl interface to James Clark's - XML parser, Expat.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&xml-parser-ch6-sbu;</seg> - <seg>&xml-parser-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of XML::Parser - - Prepare XML::Parser for compilation: - -perl Makefile.PL - - Compile the package: - -make - - To test the results, issue: - -make test - - Install the package: - -make install - - - - - Contents of XML::Parser - - - Installed module - - - Expat.so - - - - - Short Descriptions - - - - - Expat - - provides the Perl Expat interface - - Expat - - - - - - - - -
diff --git a/chapter06/xz.xml b/chapter06/xz.xml index 5a342b2ff..9e2d0da4b 100644 --- a/chapter06/xz.xml +++ b/chapter06/xz.xml @@ -5,7 +5,7 @@ %general-entities; ]> - + @@ -16,26 +16,25 @@ Xz-&xz-version; - + Xz + tools - <para>The Xz package contains programs for compressing and decompressing - files. It provides capabilities for the lzma and the newer xz compression - formats. Compressing text files with <command>xz</command> yields a better - compression percentage than with the traditional <command>gzip</command> or - <command>bzip2</command> commands.</para> + <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" + href="../chapter08/xz.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> <segmentedlist> <segtitle>&buildtime;</segtitle> <segtitle>&diskspace;</segtitle> <seglistitem> - <seg>&xz-ch6-sbu;</seg> - <seg>&xz-ch6-du;</seg> + <seg>&xz-ch5-sbu;</seg> + <seg>&xz-ch5-du;</seg> </seglistitem> </segmentedlist> @@ -44,320 +43,34 @@ <sect2 role="installation"> <title>Installation of Xz - Prepare Xz for compilation with: + Prepare Xz for compilation: -./configure --prefix=/usr \ - --disable-static \ +./configure --prefix=/usr \ + --host=$LFS_TGT \ + --build=$(build-aux/config.guess) \ + --disable-static \ --docdir=/usr/share/doc/xz-&xz-version; - Compile the package: + Compile the package: make - To test the results, issue: + Install the package: -make check +make DESTDIR=$LFS install - Install the package and make sure that all essential files are in the - correct directory: + Make sure that all essential files are in the correct directory: -make install -mv -v /usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} /bin -mv -v /usr/lib/liblzma.so.* /lib -ln -svf ../../lib/$(readlink /usr/lib/liblzma.so) /usr/lib/liblzma.so +mv -v $LFS/usr/bin/{lzma,unlzma,lzcat,xz,unxz,xzcat} $LFS/bin +mv -v $LFS/usr/lib/liblzma.so.* $LFS/lib +ln -svf ../../lib/$(readlink $LFS/usr/lib/liblzma.so) $LFS/usr/lib/liblzma.so - - Contents of Xz - - - Installed programs - Installed libraries - Installed directories - - - - lzcat (link to xz), - lzcmp (link to xzdiff), - lzdiff (link to xzdiff), - lzegrep (link to xzgrep), - lzfgrep (link to xzgrep), - lzgrep (link to xzgrep), - lzless (link to xzless), - lzma (link to xz), - lzmadec, - lzmainfo, - lzmore (link to xzmore), - unlzma (link to xz), - unxz (link to xz), - xz, - xzcat (link to xz), - xzcmp (link to xzdiff), - xzdec, - xzdiff, - xzegrep (link to xzgrep), - xzfgrep (link to xzgrep), - xzgrep, - xzless, and - xzmore - - liblzma.so - - - /usr/include/lzma and - /usr/share/doc/xz-&xz-version; - - - - - - Short Descriptions - - - - - lzcat - - Decompresses to standard output - - lzcat - - - - - - lzcmp - - Runs cmp on LZMA compressed files - - lzcmp - - - - - - lzdiff - - Runs diff on LZMA compressed files - - lzdiff - - - - - - lzegrep - - Runs egrep on LZMA compressed files - - lzegrep - - - - - - lzfgrep - - Runs fgrep on LZMA compressed files - - lzfgrep - - - - - - lzgrep - - Runs grep on LZMA compressed files - - lzgrep - - - - - - lzless - - Runs less on LZMA compressed files - - lzless - - - - - - lzma - - Compresses or decompresses files using the LZMA format - - lzma - - - - - - lzmadec - - A small and fast decoder for LZMA compressed files - - lzmadec - - - - - - lzmainfo - - Shows information stored in the LZMA compressed file header - - lzmainfo - - - - - - lzmore - - Runs more on LZMA compressed files - - lzmore - - - - - - unlzma - - Decompresses files using the LZMA format - - unlzma - - - - - - unxz - - Decompresses files using the XZ format - - unxz - - - - - - xz - - Compresses or decompresses files using the XZ format - - xz - - - - - - xzcat - - Decompresses to standard output - - xzcat - - - - - - xzcmp - - Runs cmp on XZ compressed files - - xzcmp - - - - - - xzdec - - A small and fast decoder for XZ compressed files - - xzdec - - - - - - xzdiff - - Runs diff on XZ compressed files - - xzdiff - - - - - - xzegrep - - Runs egrep on XZ compressed files - - xzegrep - - - - - - xzfgrep - - Runs fgrep on XZ compressed files - - xzfgrep - - - - - - xzgrep - - Runs grep on XZ compressed files - - xzgrep - - - - - - xzless - - Runs less on XZ compressed files - - xzless - - - - - - xzmore - - Runs more on XZ compressed files - - xzmore - - - - - - liblzma - - The library implementing lossless, block-sorting data - compression, using the Lempel-Ziv-Markov chain algorithm - - liblzma - - - - - + + + <para>Details on this package are located in<!-- TODO + <xref linkend="contents-xz" role="."/> --></para> </sect2> diff --git a/chapter06/zlib.xml b/chapter06/zlib.xml deleted file mode 100644 index 2dcc49413..000000000 --- a/chapter06/zlib.xml +++ /dev/null @@ -1,101 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1"?> -<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" - "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [ - <!ENTITY % general-entities SYSTEM "../general.ent"> - %general-entities; -]> - -<sect1 id="ch-system-zlib" role="wrap"> - <?dbhtml filename="zlib.html"?> - - <sect1info condition="script"> - <productname>zlib</productname> - <productnumber>&zlib-version;</productnumber> - <address>&zlib-url;</address> - </sect1info> - - <title>Zlib-&zlib-version; - - - Zlib - - - - - - <para>The Zlib package contains compression and decompression routines used by - some programs.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&zlib-ch6-sbu;</seg> - <seg>&zlib-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Zlib - - Prepare Zlib for compilation: - -./configure --prefix=/usr - - Compile the package: - -make - - To test the results, issue: - -make check - - Install the package: - -make install - - The shared library needs to be moved to - /lib, and as a result the - .so file in - /usr/lib will need to be recreated: - -mv -v /usr/lib/libz.so.* /lib -ln -sfv ../../lib/$(readlink /usr/lib/libz.so) /usr/lib/libz.so - - - - - Contents of Zlib - - - Installed libraries - - - libz.{a,so} - - - - - Short Descriptions - - - - - libz - - Contains compression and decompression functions used by - some programs - - libz - - - - - - - - - diff --git a/chapter06/zstd.xml b/chapter06/zstd.xml deleted file mode 100644 index 71e7794b6..000000000 --- a/chapter06/zstd.xml +++ /dev/null @@ -1,136 +0,0 @@ - - - %general-entities; -]> - - - - - - zstd - &zstd-version; -
&zstd-url;
-
- - Zstd-&zstd-version; - - - zstd - - - - - - <para>Zstandard is a real-time compression algorithm, providing high - compression ratios. It offers a very wide range of compression / speed - trade-offs, while being backed by a very fast decoder.</para> - - <segmentedlist> - <segtitle>&buildtime;</segtitle> - <segtitle>&diskspace;</segtitle> - - <seglistitem> - <seg>&zstd-ch6-sbu;</seg> - <seg>&zstd-ch6-du;</seg> - </seglistitem> - </segmentedlist> - - </sect2> - - <sect2 role="installation"> - <title>Installation of Zstd - - Compile the package: - -make - - This package does not come with a test suite. - - Install the package: - -make prefix=/usr install - - Remove the static library and move the shared library to - /lib. Also, the - .so file in - /usr/lib will need to be recreated: - -rm -v /usr/lib/libzstd.a -mv -v /usr/lib/libzstd.so.* /lib -ln -sfv ../../lib/$(readlink /usr/lib/libzstd.so) /usr/lib/libzstd.so - - - - - Contents of Zstd - - - Installed programs - Installed library - - - zstd, - zstdcat (link to zstd), - zstdgrep, - zstdless, - zstdmt (link to zstd), and - unzstd (link to zstd) - - - libzstd.so - - - - - Short Descriptions - - - - - zstd - - Compresses or decompresses files using the ZSTD format - - zstd - - - - - - zstdgrep - - Runs grep on ZSTD compressed files - - zstdgrep - - - - - - zstdless - - Runs less on ZSTD compressed files - - zstdless - - - - - - libzstd - - The library implementing lossless data - compression, using the ZSTD algorithm - - libzstd - - - - - - - - -
-- cgit v1.2.3-54-g00ecf