commit 519ee452362f9166fdbaa75d3041ff44b56db30e Author: Bruce Dubbs Date: Sun Jul 16 01:56:42 2006 +0000 Changing branch name git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/6.2/BOOK@7678 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689 diff --git a/INSTALL b/INSTALL new file mode 100644 index 000000000..4e744b671 --- /dev/null +++ b/INSTALL @@ -0,0 +1,47 @@ +LFS Book Conversion Tools Installation Instructions + +After downloading the SVN source, there are some things that need to be set up +on your computer if you want to convert the XML source into something easier to +read (e.g. HTML, TXT, or PDF). If you are interested in this, then keep +reading. If you are only interested in editing the XML source for re- +submission to the lfs-book or lfs-dev mailing lists, then you do not need this +document. Instead, you need to read the LFS Editor's Manual. See the LFS +website at http://www.linuxfromscratch.org for more information. + +------------------------------------------------------------------------------- + +If you want to convert the XML to HTML, install the following: + +* libxml2 + - http://www.linuxfromscratch.org/blfs/view/svn/general/libxml2.html + +* libxslt + - http://www.linuxfromscratch.org/blfs/view/svn/general/libxslt.html + +* DocBook DTD + - http://www.linuxfromscratch.org/blfs/view/svn/pst/xml.html + +* DocBook XSL Stylesheets + - http://www.linuxfromscratch.org/blfs/view/svn/pst/docbook-xsl.html + +* HTMLTidy + - http://www.linuxfromscratch.org/blfs/view/svn/general/tidy.html + +------------------------------------------------------------------------------- + +If you want to convert the XML to TXT, install the above items, and then install +the following: + +* lynx + - http://www.linuxfromscratch.org/blfs/view/svn/basicnet/lynx.html + +------------------------------------------------------------------------------- + +If you want to convert the XML to PDF, install the items listed above (except +lynx) and then install the following: + +* JDK + - http://www.linuxfromscratch.org/blfs/view/svn/general/jdk.html + +* FOP and JAI + - http://www.linuxfromscratch.org/blfs/view/svn/pst/fop.html diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..e61f05d5e --- /dev/null +++ b/Makefile @@ -0,0 +1,71 @@ +BASEDIR=~/lfs-book +DUMPDIR=~/lfs-commands +CHUNK_QUIET=0 +PDF_OUTPUT=LFS-BOOK.pdf +NOCHUNKS_OUTPUT=LFS-BOOK.html +XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-1.69.1 + +lfs: + xsltproc --xinclude --nonet -stringparam profile.condition html \ + -stringparam chunk.quietly $(CHUNK_QUIET) -stringparam base.dir $(BASEDIR)/ \ + stylesheets/lfs-chunked.xsl index.xml + + if [ ! -e $(BASEDIR)/stylesheets ]; then \ + mkdir -p $(BASEDIR)/stylesheets; \ + fi; + cp stylesheets/*.css $(BASEDIR)/stylesheets + + if [ ! -e $(BASEDIR)/images ]; then \ + mkdir -p $(BASEDIR)/images; \ + fi; + cp $(XSLROOTDIR)/images/*.png \ + $(BASEDIR)/images + cd $(BASEDIR)/; sed -i -e "s@../stylesheets@stylesheets@g" \ + *.html + cd $(BASEDIR)/; sed -i -e "s@../images@images@g" \ + *.html + + for filename in `find $(BASEDIR) -name "*.html"`; do \ + tidy -config tidy.conf $$filename; \ + true; \ + sh obfuscate.sh $$filename; \ + sed -i -e "s@text/html@application/xhtml+xml@g" $$filename; \ + done; + +# Uncomment this for testing and stable versions +#pdf: +# xsltproc --xinclude --nonet --stringparam profile.condition pdf \ +# --output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index.xml +# xsltproc --nonet --output $(BASEDIR)/lfs-pdf.fo stylesheets/lfs-pdf.xsl \ +# $(BASEDIR)/lfs-pdf.xml +# sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo +# fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT) +# rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo + +# Remove this for testing and stable versions +pdf: + xsltproc --xinclude --nonet --output $(BASEDIR)/lfs-pdf.fo \ + stylesheets/lfs-pdf.xsl index.xml + sed -i -e "s/inherit/all/" $(BASEDIR)/lfs-pdf.fo + fop.sh $(BASEDIR)/lfs-pdf.fo $(BASEDIR)/$(PDF_OUTPUT) + rm $(BASEDIR)/lfs-pdf.fo + +nochunks: + xsltproc --xinclude --nonet -stringparam profile.condition html \ + --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \ + stylesheets/lfs-nochunks.xsl index.xml + + tidy -config tidy.conf $(BASEDIR)/$(NOCHUNKS_OUTPUT) || true + + sh obfuscate.sh $(BASEDIR)/$(NOCHUNKS_OUTPUT) + + sed -i -e "s@text/html@application/xhtml+xml@g" \ + $(BASEDIR)/$(NOCHUNKS_OUTPUT) + +dump-commands: + xsltproc --xinclude --nonet --output $(DUMPDIR)/ \ + stylesheets/dump-commands.xsl index.xml + +validate: + xmllint --noout --nonet --xinclude --postvalid index.xml + diff --git a/README b/README new file mode 100644 index 000000000..bcdb34182 --- /dev/null +++ b/README @@ -0,0 +1,28 @@ +LFS Book README + +This document is meant to instruct the user on how to convert the book's XML +source to other formats (e.g. HTML, PDF, PS and TXT). First, if you have not +already done so, please read the INSTALL file for instructions on how to install +the required software. If you have already completed the steps outlined in the +INSTALL file, then continue reading for examples how to convert these files into +various other formats. + +XML to XHTML: +------------- +make BASEDIR=/path/to/output/location + + +XML to single file XHTML (nochunks): +------------------------------------ +make BASEDIR=/path/to/output/location nochunks + + +XML to TXT +---------- +Follow the instructions for nochunks and then run: +lynx -dump /path/to/nochunks >/path/to/output + + +XML to PDF: +----------- +make BASEDIR=/path/to/output/location pdf diff --git a/appendices/acknowledgments.xml b/appendices/acknowledgments.xml new file mode 100644 index 000000000..4be9b8a68 --- /dev/null +++ b/appendices/acknowledgments.xml @@ -0,0 +1,426 @@ + + + %general-entities; +]> + + + + + + Acknowledgments + + We would like to thank the following people and organizations + for their contributions to the Linux From Scratch Project. + + + + + Gerard + Beekmans <gerard@linuxfromscratch.org> – + LFS Creator, LFS Project Leader + + + + Matthew + Burgess <matthew@linuxfromscratch.org> – + LFS Project Leader, LFS Technical Writer/Editor, LFS Release + Manager + + + + Archaic + <archaic@linuxfromscratch.org> – LFS Technical Writer/Editor, + HLFS Project Leader, BLFS Editor, Hints and Patches Project + Maintainer + + + + Nathan + Coulson <nathan@linuxfromscratch.org> – + LFS-Bootscripts Maintainer + + + + Bruce + Dubbs <bdubbs@linuxfromscratch.org> – BLFS Project + Leader + + + + Manuel + Canales Esparcia <manuel@linuxfromscratch.org> – + LFS/BLFS/HLFS XML and XSL Maintainer + + + + Jim + Gifford <jim@linuxfromscratch.org> – LFS Technical + Writer, Patches Project Leader + + + + Jeremy + Huntwork <jhuntwork@linuxfromscratch.org> – LFS + Technical Writer, LFS LiveCD Maintainer, ALFS Project Leader + + + + Anderson + Lizardo <lizardo@linuxfromscratch.org> – Website + Backend-Scripts Maintainer + + + + Ryan + Oliver <ryan@linuxfromscratch.org> – LFS Toolchain + Maintainer + + + + James + Robertson <jwrober@linuxfromscratch.org> – Bugzilla + Maintainer + + + + Tushar + Teredesai <tushar@linuxfromscratch.org> – BLFS Book + Editor, Hints and Patches Project Leader + + + + Countless other people on the various LFS and BLFS mailing lists + who helped make this book possible by giving their suggestions, testing + the book, and submitting bug reports, instructions, and their + experiences with installing various packages. + + + + + Translators + + + + + Manuel Canales + Esparcia <macana@macana-es.com> – Spanish + LFS translation project + + + + Johan + Lenglet <johan@linuxfromscratch.org> – French LFS + translation project + + + + Anderson + Lizardo <lizardo@linuxfromscratch.org> – + Portuguese LFS translation project + + + + Thomas + Reitelbach <tr@erdfunkstelle.de> – German LFS + translation project + + + + + Mirror Maintainers + + North American Mirrors + + + + + Scott Kveton + <scott@osuosl.org> – lfs.oregonstate.edu mirror + + + + Mikhail Pastukhov + <miha@xuy.biz> – lfs.130th.net mirror + + + + William Astle + <lost@l-w.net> – ca.linuxfromscratch.org mirror + + + + Jeremy Polen + <jpolen@rackspace.com> – us2.linuxfromscratch.org mirror + + + + Tim Jackson + <tim@idge.net> – linuxfromscratch.idge.net mirror + + + + Jeremy Utley + <jeremy@linux-phreak.net> – lfs.linux-phreak.net mirror + + + + + South American Mirrors + + + + + Andres Meggiotto + <sysop@mesi.com.ar> – lfs.mesi.com.ar mirror + + + + Manuel + Canales Esparcia <manuel@linuxfromscratch.org> – + lfsmirror.lfs-es.info mirror + + + + Eduardo B. + Fonseca <ebf@aedsolucoes.com.br> – + br.linuxfromscratch.org mirror + + + + + European Mirrors + + + + + Barna Koczka + <barna@siker.hu> – hu.linuxfromscratch.org mirror + + + + UK Mirror Service + – linuxfromscratch.mirror.ac.uk mirror + + + + Martin Voss + <Martin.Voss@ada.de> – lfs.linux-matrix.net mirror + + + + Guido Passet + <guido@primerelay.net> – nl.linuxfromscratch.org mirror + + + + Bastiaan Jacques + <baafie@planet.nl> – lfs.pagefault.net mirror + + + + Roel + Neefs <lfs-mirror@linuxfromscratch.rave.org> – + linuxfromscratch.rave.org mirror + + + + Justin Knierim + <justin@jrknierim.de> – www.lfs-matrix.de mirror + + + + Stephan Brendel + <stevie@stevie20.de> – lfs.netservice-neuss.de mirror + + + + Antonin + Sprinzl <Antonin.Sprinzl@tuwien.ac.at> – + at.linuxfromscratch.org mirror + + + + Fredrik + Danerklint <fredan-lfs@fredan.org> – + se.linuxfromscratch.org mirror + + + + Parisian + sysadmins <archive@doc.cs.univ-paris8.fr> – + www2.fr.linuxfromscratch.org mirror + + + + Alexander Velin + <velin@zadnik.org> – bg.linuxfromscratch.org mirror + + + + Dirk + Webster <dirk@securewebservices.co.uk> – + lfs.securewebservices.co.uk mirror + + + + Thomas Skyt + <thomas@sofagang.dk> – dk.linuxfromscratch.org mirror + + + + Simon Nicoll + <sime@dot-sime.com> – uk.linuxfromscratch.org mirror + + + + + Asian Mirrors + + + + + Pui Yong + <pyng@spam.averse.net> – sg.linuxfromscratch.org mirror + + + + Stuart + Harris <stuart@althalus.me.uk> – + lfs.mirror.intermedia.com.sg mirror + + + + + Australian Mirrors + + + + + Jason Andrade + <jason@dstc.edu.au> – au.linuxfromscratch.org mirror + + + + + Former Project Team Members + + + + + Christine + Barczak <theladyskye@linuxfromscratch.org> – LFS + Book Editor + + + + Timothy Bauscher + + + + Robert Briggs + + + + Ian Chilton + + + + Jeroen + Coumans <jeroen@linuxfromscratch.org> – Website + Developer, FAQ Maintainer + + + + Alex Groenewoud – LFS Technical Writer + + + + Marc Heerdink + + + + Mark Hymers + + + Seth W. Klein – FAQ maintainer + + + Nicholas + Leippe <nicholas@linuxfromscratch.org> – Wiki + Maintainer + + + + Simon Perreault + + + + Scot Mc + Pherson <scot@linuxfromscratch.org> – LFS NNTP + Gateway Maintainer + + + + Alexander Patrakov + <semzx@newmail.ru> – LFS Technical Writer + + + + Greg Schafer + <gschafer@zip.com.au> – LFS Technical Writer + + + + Jesse Tie-Ten-Quee – LFS Technical Writer + + + + Jeremy + Utley <jeremy@linuxfromscratch.org> – LFS Technical + Writer, Bugzilla Maintainer, LFS-Bootscripts Maintainer + + + + Zack Winkles + <zwinkles@gmail.com> – LFS Technical Writer + + + + + A very special thank you to our + donators + + + + + Dean Benson + <dean@vipersoft.co.uk> for several monetary contributions + + + + Hagen Herrschaft + <hrx@hrxnet.de> for donating a 2.2 GHz P4 system, now running + under the name of Lorien + + + + SEO Company Canada + supports Open Source projects and different Linux distributions + + + + VA Software who, + on behalf of Linux.com, + donated a VA Linux 420 (former StartX SP2) workstation + + + + Mark Stone for donating Belgarath, the linuxfromscratch.org + server + + + + + diff --git a/appendices/acronymlist.xml b/appendices/acronymlist.xml new file mode 100644 index 000000000..4b5eb808d --- /dev/null +++ b/appendices/acronymlist.xml @@ -0,0 +1,580 @@ + + + %general-entities; +]> + + + + + + Acronyms and Terms + + + + + + + ABI + + Application Binary Interface + + + + + ALFS + + Automated Linux From Scratch + + + + + ALSA + + Advanced Linux Sound Architecture + + + + + API + + Application Programming Interface + + + + + ASCII + + American Standard Code for Information Interchange + + + + + BIOS + + Basic Input/Output System + + + + + BLFS + + Beyond Linux From Scratch + + + + + BSD + + Berkeley Software Distribution + + + + + chroot + + change root + + + + + CMOS + + Complementary Metal Oxide Semiconductor + + + + + COS + + Class Of Service + + + + + CPU + + Central Processing Unit + + + + + CRC + + Cyclic Redundancy Check + + + + + CVS + + Concurrent Versions System + + + + + DHCP + + Dynamic Host Configuration Protocol + + + + + DNS + + Domain Name Service + + + + + EGA + + Enhanced Graphics Adapter + + + + + ELF + + Executable and Linkable Format + + + + + EOF + + End of File + + + + + EQN + + equation + + + + + EVMS + + Enterprise Volume Management System + + + + + ext2 + + second extended file system + + + + + ext3 + + third extended file system + + + + + FAQ + + Frequently Asked Questions + + + + + FHS + + Filesystem Hierarchy Standard + + + + + FIFO + + First-In, First Out + + + + + FQDN + + Fully Qualified Domain Name + + + + + FTP + + File Transfer Protocol + + + + + GB + + Gibabytes + + + + + GCC + + GNU Compiler Collection + + + + + GID + + Group Identifier + + + + + GMT + + Greenwich Mean Time + + + + + GPG + + GNU Privacy Guard + + + + + HTML + + Hypertext Markup Language + + + + + IDE + + Integrated Drive Electronics + + + + + IEEE + + Institute of Electrical and Electronic Engineers + + + + + IO + + Input/Output + + + + + IP + + Internet Protocol + + + + + IPC + + Inter-Process Communication + + + + + IRC + + Internet Relay Chat + + + + + ISO + + International Organization for Standardization + + + + + ISP + + Internet Service Provider + + + + + KB + + Kilobytes + + + + + LED + + Light Emitting Diode + + + + + LFS + + Linux From Scratch + + + + + LSB + + Linux Standard Base + + + + + MB + + Megabytes + + + + + MBR + + Master Boot Record + + + + + MD5 + + Message Digest 5 + + + + + NIC + + Network Interface Card + + + + + NLS + + Native Language Support + + + + + NNTP + + Network News Transport Protocol + + + + + NPTL + + Native POSIX Threading Library + + + + + OSS + + Open Sound System + + + + + PCH + + Pre-Compiled Headers + + + + + PCRE + + Perl Compatible Regular Expression + + + + + PID + + Process Identifier + + + + + PLFS + + Pure Linux From Scratch + + + + + PTY + + pseudo terminal + + + + + QA + + Quality Assurance + + + + + QOS + + Quality Of Service + + + + + RAM + + Random Access Memory + + + + + RPC + + Remote Procedure Call + + + + + RTC + + Real Time Clock + + + + + SBU + + Standard Build Unit + + + + + SCO + + The Santa Cruz Operation + + + + + SGR + + Select Graphic Rendition + + + + + SHA1 + + Secure-Hash Algorithm 1 + + + + + SMP + + Symmetric Multi-Processor + + + + + TLDP + + The Linux Documentation Project + + + + + TFTP + + Trivial File Transfer Protocol + + + + + TLS + + Thread-Local Storage + + + + + UID + + User Identifier + + + + + umask + + user file-creation mask + + + + + USB + + Universal Serial Bus + + + + + UTC + + Coordinated Universal Time + + + + + UUID + + Universally Unique Identifier + + + + + VC + + Virtual Console + + + + + VGA + + Video Graphics Array + + + + + VT + + Virtual Terminal + + + + + + diff --git a/appendices/dependencies.xml b/appendices/dependencies.xml new file mode 100644 index 000000000..cf5a1ac84 --- /dev/null +++ b/appendices/dependencies.xml @@ -0,0 +1,1481 @@ + + + %general-entities; +]> + + + + + + Dependencies + + Every package built in LFS relies on one or more other packages + in order to build and install properly. Some packages even participate + in circular dependencies, that is, the first package depends on the second + which in turn depends on the first. Because of these dependencies, the + order in which packages are built in LFS is very important. The purpose + of this page is to document the dependencies of each package built in LFS. + + For each package we build, we have listed three types of dependencies. + The first lists what other packages need to be available in order to compile + and install the package in question. The second lists what packages, in + addition to those on the first list, need to be available in order to run the + testsuites. The last list of dependencies are packages that require this + package to be built and installed in its final location before they are built + and installed. In most cases, this is because these packages will hardcode + paths to binaries within their scripts. If not built in a certain order, + this could result in paths of /tools/bin/[binary] being placed inside + scripts installed to the final system. This is obviously not desirable. + + + + Autoconf + + + &dependencies; + + + Bash, Coreutils, Grep, M4, Make, Perl, Sed, and Texinfo + + + + + &testsuites; + + + Automake, Diffutils, Findutils, GCC, and Libtool + + + + + &before; + + + Automake + + + + + Automake + + + &dependencies; + + + Autoconf, Bash, Coreutils, Gettext, Grep, M4, Make, Perl, + Sed, and Texinfo + + + + + &testsuites; + + + Binutils, Bison, Bzip2, DejaGNU, Diffutils, Expect, Findutils, + Flex, GCC, Gettext, Gzip, Libtool, and Tar. Can also use several + other packages that are not installed in LFS. + + + + + &before; + + + None + + + + + Bash + + + &dependencies; + + + Bash, Bison, Coreutils, Diffutils, GCC, Glibc, Grep, Make, + Ncurses, Patch, Readline, Sed, and Texinfo + + + + + &testsuites; + + + Diffutils and Gawk + + + + + &before; + + + None + + + + + Berkeley DB + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep, + Make, and Sed + + + + + &testsuites; + + + Not run. Requires TCL installed on the final system + + + + + &before; + + + None + + + + + Binutils + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, + Make, Perl, Sed, and Texinfo + + + + + &testsuites; + + + DejaGNU and Expect + + + + + &before; + + + None + + + + + Bison + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, + Grep, M4, Make, and Sed + + + + + &testsuites; + + + Diffutils and Findutils + + + + + &before; + + + Flex, Kbd, and Tar + + + + + Bzip2 + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Make, + and Patch + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + Coreutils + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, Grep, Make, + Patch, Perl, Sed, and Texinfo + + + + + &testsuites; + + + Diffutils + + + + + &before; + + + Bash, Diffutils, Findutils, Man-DB, and Udev + + + + + DejaGNU + + + &dependencies; + + + Bash, Coreutils, Diffutils, GCC, Grep, Make, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Diffutils + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, + Make, Patch, Sed, and Texinfo + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Expect + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, Make, + Patch, Sed, and Tcl + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + E2fsprogs + + + &dependencies; + + + Bash, Binutils, Coreutils, Gawk, GCC, Gettext, Glibc, Grep, Gzip, + Make, Sed, and Texinfo + + + + + &testsuites; + + + Diffutils + + + + + &before; + + + Util-Linux + + + + + File + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep, + Make, Sed, and Zlib + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Findutils + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, Grep, Make, + Sed, and Texinfo + + + + + &testsuites; + + + DejaGNU, Diffutils, and Expect + + + + + &before; + + + None + + + + + Flex + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, Grep, M4, Make, + Patch, Sed, and Texinfo + + + + + &testsuites; + + + Bison and Gawk + + + + + &before; + + + IPRoute2, Kbd, and Man-DB + + + + + Gawk + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, Grep, Make, + Patch, Sed and, Texinfo + + + + + &testsuites; + + + Diffutils + + + + + &before; + + + None + + + + + Gcc + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Findutils, Gawk, GCC, + Gettext, Glibc, Grep, Make, Patch, Perl, Sed, Tar, and Texinfo + + + + + &testsuites; + + + DejaGNU and Expect + + + + + &before; + + + None + + + + + Gettext + + + &dependencies; + + + Bash, Binutils, Coreutils, Gawk, GCC, Glibc, Grep, Make, + Sed, and Texinfo + + + + + &testsuites; + + + Diffutils, Perl, and Tcl + + + + + &before; + + + Automake + + + + + Glibc + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Gettext, + Grep, Gzip, Make, Perl, Sed, and Texinfo + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + Grep + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Make, + Patch, Sed, and Texinfo + + + + + &testsuites; + + + Diffutils and Gawk + + + + + &before; + + + Man-DB + + + + + Groff + + + &dependencies; + + + Bash, Binutils, Bison, Coreutils, Gawk, GCC, Glibc, Grep, Make, + Patch, Sed, and Texinfo + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + Man-DB and Perl + + + + + GRUB + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, Make, + Ncurses, Sed, and Texinfo + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + Gzip + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, Make, + Patch, Sed, and Texinfo + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + Man-DB + + + + + Iana-Etc + + + &dependencies; + + + Coreutils, Gawk, and Make + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + Perl + + + + + Inetutils + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Make, Ncurses, + Patch, Sed, and Texinfo + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + Tar + + + + + IProute2 + + + &dependencies; + + + Bash, Berkeley DB, Bison, Coreutils, Flex, GCC, Glibc, Make, + and Linux-Libc-Headers + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Kbd + + + &dependencies; + + + Bash, Binutils, Bison, Coreutils, Flex, GCC, Gettext, Glibc, + Gzip, Make, Patch, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Less + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, Make, + Ncurses, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Libtool + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep, + Make, Sed, and Texinfo + + + + + &testsuites; + + + Findutils + + + + + &before; + + + None + + + + + Linux Kernel + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Findutils, GCC, Glibc, Grep, + Gzip, Make, Module-Init-Tools, Ncurses, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + M4 + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Make, and Sed + + + + + &testsuites; + + + Diffutils + + + + + &before; + + + Autoconf and Bison + + + + + Man-DB + + + &dependencies; + + + Bash, Berkeley DB, Binutils, Bzip2, Coreutils, Flex, GCC, Gettext, + Glibc, Grep, Groff, Gzip, Less, Make, and Sed + + + + + &testsuites; + + + Not run. Requires Man-DB testsuite package + + + + + &before; + + + None + + + + + Make + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Gettext, Glibc, Grep, + Make, Sed, and Texinfo + + + + + &testsuites; + + + Perl + + + + + &before; + + + None + + + + + Mktemp + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Patch, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Module-Init-Tools + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Make, Sed, + and Zlib + + + + + &testsuites; + + + File, Findutils, and Gawk + + + + + &before; + + + None + + + + + Ncurses + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Gawk, GCC, Glibc, Grep, + Make, Patch, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + Bash, GRUB, Inetutils, Less, Procps, Psmisc, Readline, Texinfo, + Util-Linux, and Vim + + + + + Patch + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Make, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Perl + + + &dependencies; + + + Bash, Berkeley DB, Binutils, Coreutils, Gawk, GCC, Glibc, Grep, + Groff, Make, and Sed + + + + + &testsuites; + + + Iana-Etc and Procps + + + + + &before; + + + Autoconf + + + + + Procps + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Make, and Ncurses + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Psmisc + + + &dependencies; + + + Bash, Coreutils, GCC, Gettext, Glibc, Grep, Make, Ncurses, + and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Readline + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Make, Ncurses, + Patch, Sed, and Texinfo + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + Bash + + + + + Sed + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, Grep, Make, + Sed, and Texinfo + + + + + &testsuites; + + + Diffutils and Gawk + + + + + &before; + + + E2fsprogs, File, Libtool, and Shadow + + + + + Shadow + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, Findutils, Gawk, GCC, + Gettext, Glibc, Grep, Make, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Sysklogd + + + &dependencies; + + + Binutils, Coreutils, GCC, Glibc, Make, and Patch + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Sysvinit + + + &dependencies; + + + Binutils, Coreutils, GCC, Glibc, Make, and Sed + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Tar + + + &dependencies; + + + Bash, Binutils, Bison, Coreutils, GCC, Gettext, Glibc, + Grep, Inetutils, Make, Patch, Sed, and Texinfo + + + + + &testsuites; + + + Diffutils, Findutils, and Gawk + + + + + &before; + + + None + + + + + Tcl + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, + Make, and Sed + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + Texinfo + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Gettext, Glibc, Grep, Make, + Ncurses, Patch, and Sed + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + Udev + + + &dependencies; + + + Binutils, Coreutils, GCC, Glibc, and Make + + + + + &testsuites; + + + Findutils, Perl, and Sed + + + + + &before; + + + None + + + + + Util-Linux + + + &dependencies; + + + Bash, Binutils, Coreutils, E2fprogs, GCC, Gettext, Glibc, Grep, + Make, Ncurses, Patch, Sed, and Zlib + + + + + &testsuites; + + + No testsuite available + + + + + &before; + + + None + + + + + Vim + + + &dependencies; + + + Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, Grep, Make, + Ncurses, and Sed + + + + + &testsuites; + + + None + + + + + &before; + + + None + + + + + Zlib + + + &dependencies; + + + Bash, Binutils, Coreutils, GCC, Glibc, Grep, Make, and Sed + + + + + &testsuites; + + + None + + + + + &before; + + + File, Module-Init-Tools, and Util-Linux + + + + diff --git a/chapter01/askforhelp.xml b/chapter01/askforhelp.xml new file mode 100644 index 000000000..6b662cc6b --- /dev/null +++ b/chapter01/askforhelp.xml @@ -0,0 +1,126 @@ + + + %general-entities; +]> + + + + + Help + + If an issue or a question is encountered while working through + this book, check the FAQ page at . + Questions are often already answered there. If your question is not + answered on this page, try to find the source of the problem. The + following hint will give you some guidance for troubleshooting: + . + + If you cannot find your problem listed in the FAQ, search the mailing + lists at . + + We also have a wonderful LFS community that is willing to offer + assistance through the mailing lists and IRC (see the section of this book). However, + we get several support questions every day and many of them can be easily + answered by going to the FAQ and by searching the mailing lists first. + So, for us to offer the best assistance possible, you need to do some + research on your own first. That allows us to focus on the more unusual + support needs. If your searches do not produce a solution, please include + all relevant information (mentioned below) in your request for help. + + + Things to Mention + + Apart from a brief explanation of the problem being experienced, + the essential things to include in any request for help are: + + + + The version of the book being used (in this case &version;) + + + The host distribution and version being used to create LFS + + + The package or section the problem was encountered in + + + The exact error message or symptom being received + + + Note whether you have deviated from the book at all + + + + + Deviating from this book does not mean that + we will not help you. After all, LFS is about personal preference. + Being upfront about any changes to the established procedure helps us + evaluate and determine possible causes of your problem. + + + + + + Configure Script Problems + + If something goes wrong while running the configure + script, review the config.log file. This file may + contain errors encountered during configure which were + not printed to the screen. Include the relevant lines + if you need to ask for help. + + + + + Compilation Problems + + Both the screen output and the contents of various files are useful + in determining the cause of compilation problems. The screen output from + the configure script and the make + run can be helpful. It is not necessary to include the entire output, but + do include enough of the relevant information. Below is an example of the + type of information to include from the screen output from + make: + +gcc -DALIASPATH=\"/mnt/lfs/usr/share/locale:.\" +-DLOCALEDIR=\"/mnt/lfs/usr/share/locale\" +-DLIBDIR=\"/mnt/lfs/usr/lib\" +-DINCLUDEDIR=\"/mnt/lfs/usr/include\" -DHAVE_CONFIG_H -I. -I. +-g -O2 -c getopt1.c +gcc -g -O2 -static -o make ar.o arscan.o commands.o dir.o +expand.o file.o function.o getopt.o implicit.o job.o main.o +misc.o read.o remake.o rule.o signame.o variable.o vpath.o +default.o remote-stub.o version.o opt1.o +-lutil job.o: In function `load_too_high': +/lfs/tmp/make-3.79.1/job.c:1565: undefined reference +to `getloadavg' +collect2: ld returned 1 exit status +make[2]: *** [make] Error 1 +make[2]: Leaving directory `/lfs/tmp/make-3.79.1' +make[1]: *** [all-recursive] Error 1 +make[1]: Leaving directory `/lfs/tmp/make-3.79.1' +make: *** [all-recursive-am] Error 2 + + In this case, many people would just include the bottom + section: + +make [2]: *** [make] Error 1 + + This is not enough information to properly diagnose the problem + because it only notes that something went wrong, not + what went wrong. The entire section, as in the + example above, is what should be saved because it includes the command + that was executed and the associated error message(s). + + An excellent article about asking for help on the Internet is + available online at . Read and + follow the hints in this document to increase the likelihood of getting + the help you need. + + + + diff --git a/chapter01/changelog.xml b/chapter01/changelog.xml new file mode 100644 index 000000000..86d23f696 --- /dev/null +++ b/chapter01/changelog.xml @@ -0,0 +1,2330 @@ + + + %general-entities; +]> + + + + + Changelog + + This is version &version; of the Linux From Scratch book, dated + &releasedate;. If this book is more than six months old, a newer and better + version is probably already available. To find out, please check one of the + mirrors via . + + Below is a list of changes made since the previous release of the + book. + + + Changelog Entries: + + + + July 15, 2006 + + + [bdubbs] - Added a patch to module-init-tools to + correct a possible problem when aliesa are specified with + regular expressions. + + + [bdubbs] - Updated the kernel to version 2.6.16.26. + + + + [bdubbs] - Added sed to correct path to the find + program in updatedb after moving find to /bin. + + + [bdubbs] - Updated text concerning test failures in + glibc to describe the most recent results. + + + + + + July 13, 2006 + + + [bdubbs] - Moved the executables: nice, find, kbd_mode, + openvt, and setfont to /bin to support boot scripts. + Added --datadir=/lib/kbd to kbd's configure so that keyboard + data will always be on the root partition. + + + + [bdubbs] - Updated text in section 7.9 (The Bash + Shell Startup Files) to better explain the Xlib example. + + + + + + + July 12, 20006 + + + [bdubbs] - Updated to man-pages-2.34. + + + [bdubbs] - Updated to e2fsprogs-1.39. + + + [dnicholson] - Changed text explaining the installation + of the udev-config rules. Thanks to Matthew Burgess. + + + [dnicholson] - Various fixes and additions for examples + of custom rules in Udev courtesy of Alexander Patrakov. Added + the "Creating custom symlinks" page which includes examples + of creating persistent device symlinks, including CD-ROMs. Added + a second set of guidelines for creating persistent symlinks for + network cards. Other text touch ups on the configuration pages + involving Udev. Closes ticket #1818. + + + [bdubbs] - Updated udev-config and bootscripts download + location. + + + [dnicholson] - Added commands to create the vi to vim + man page symlink in all available languages. Closes ticket + #1811. Thanks to Alexander Patrakov. + + + [dnicholson] - Updated to udev-096 and udev-config-20060712. + Removed the bug.c program and the cd symlinks script. The cd + symlinks will be covered in Chapter 7. Closes ticket #1804. Thanks + to Alexander Patrakov for making the appropriate changes in the + Udev rules. + + + + + + July 11, 2006 + + + [bdubbs] - Changed url for the SBU pages to a generic + location. + + + [bdubbs] - Added clarifying text to section 7.9 concerning + charmap specifications. Thanks to Dan Nicholson. + Closes ticket #1813. + + + [bdubbs] - Moved text in section 5.7 "Adjusting the Toolchain" + referencing TCL out of the caution and into its own note so it does not + get included later in gcc-pass2. + Closes ticket #1822. + + + [bdubbs] - Updated the kernel to version 2.6.16.24. + Closes ticket #1808. + + + + + + July 10, 2006 + + + [dnicholson] - Specified the full path to + modprobe in the example modprobe rule. + Closes ticket #1812. + + + [dnicholson] - Remove the + locale country command from the heuristic to + determine the locale in the Bash Shell Startup Files since it + doesn't produce results in all locales. + + + + + + July 7, 2006 + + + [matt] - Updated module-init-tools download information as it + has a new maintainer. + + + + + + June 10, 2006 + + + [ken] - Added gettext.sh to list of programs + installed by gettext, similarly nologin for shadow, + grub-set-default for grub, enc2xs + and instmodsh for perl, slabtop + for procps, flock and tailf for + util-linux, bootlogd for sysvinit, manpath + for man-db, filefrag for e2fsprogs. + Thanks to Chris Staub for the patch. + + + + + + May 31, 2006 + + + [matthew] - Upgrade to Linux-2.6.16.19. + + + [matthew] - Upgrade to Man-pages-2.33. + + + [matthew] - Upgrade to Bison-2.2. + + + [matthew] - Upgrade to Coreutils-5.96. + + + [gerard] - Added tee to chapter 6's Glibc + make check so the output can be seen on screen + as well as captured in the log file. + + + + + + May 30, 2006 + + + [matthew] - Removed an out of date comment regarding having to + run pwconv to reset passwords after enabling + password shadowing. Thanks to Chris Staub for the report. + + + [matthew] - Removed getunimap, + setlogons, and setvesablank from + the list of programs installed by kbd. Thanks to Chris Staub for the + patch. + + + + + + May 30, 2006 + + + [matthew] - Removed swapdev from the list of + files installed by util-linux. Thanks to Chris Staub for the patch. + + + + + + + May 27, 2006 + + + [jhuntwork] - Remove the 'refer back's in the gcc-pass2 and + chapter06/gcc pages. Better organizes the commands and data so that + the flow of the book is not lost. + + + [jhuntwork] - Add a note about installing spell files for + Vim in a language other than English. + + + [jhuntwork] - Correct Vim's installation of man pages to work + well with Man-DB. Patch from Alexander Patrakov and Ag Hatzim. + + + + + + May 26, 2006 + + + [jhuntwork] - Some version corrections in the vim page. + + + + + + May 25, 2006 + + + [jhuntwork] - Updated to Vim-7.0. Fixes #1793. + + + [jhuntwork] - Fixed generation of diff's man page. + Thanks Randy McMurchy for the report and Ken Moffat for the fix. + Fixes #1800. + + + + + + May 22, 2006 + + + [jim] - Fixed a constant support question asked in #IRC and + the mailing lists about shadow's additional sed command + for cracklib. Using a complete sed command instead. + + + + + + May 15, 2006 + + + [archaic] - Updated to udev-config-20060515. This adds the rule + to create /dev/usb nodes as well as making the rules files slightly + more modular by reorganizing which rules go to which files. This is a + very minor update. + + + [archaic] - Updated to man-pages-2.32. + + + [archaic] - Updated to udev-092. + + + + + + May 14, 2006 + + + [manuel] - Updated SBU and disk usage values. + + + [manuel] - Created packages.ent. Moved data about packages + to packages.ent as entities. + + + + + + May 12, 2006 + + + [archaic] - Updated to linux-2.6.16.16. + + + + + + May 9, 2006 + + + [manuel] - Updated packages and patches sizes. + + + + + + May 8, 2006 + + + [archaic] - Made the directory tree creation more concise and + removed the extraneous /opt/* hierarchy (it is not required by + FHS). Closes ticket #1656. + + + + + + May 7, 2006 + + + [archaic] - Updated to linux-2.6.16.14. + + + [ken] - Use ext3 filesystem instead of ext2. + Resolves ticket #1792. + + + + + + May 6, 2006 + + + [jhuntwork] - Added MD5 sums for packages and patches. + Resolves ticket #1788. + + + + + + May 3, 2006 + + + [archaic] - Upgraded to linux-2.6.16.13. + + + [jhuntwork] - Updated stripping notes to reflect current + findings. Resolves ticket #1657. + + + [archaic] - Updated the bug.c code to avoid USB-related uevent + leakage reports. + + + + + + May 2, 2006 + + + [jhuntwork] - Fixed sanity checks to work after final GCC + and changed their format. Resolves ticket #1768. + + + [archaic] - Removed mention of usbfs from the fstab page since + it is already covered in BLFS. + + + [archaic] - Updated to man-pages-2.31. + + + [archaic] - Updated to iana-etc-2.10. + + + [archaic] - Updated to tcl8.4.13. + + + + + + May 1, 2006 + + + [archaic] - Added two seds to avoid symlink problems with + Readline during reinstallation. Thanks to Dan and Manuel for the fix + and for testing. Fixes ticket #1770. + + + [archaic] - Fixed issue where module-init-tools would not + re-install its binaries. + + + [archaic] - Updated to linux-2.6.16.11. + + + [archaic] - Updated to udev-091. Moved to a tarball-based set of + udev rules. Updated the bootscripts to support the new udevsettle + program. + + + + + + April 27, 2006 + + + [manuel] - Added SEO Company Canada to donators + acknowledgements. + + + + + + April 23, 2006 + + + [manuel] - Fixed command to change $LFS/tools + ownership. Resolves ticket #1780. + + + + + + April 22, 2006 + + + [manuel] - Revised again the Host System Requirements page + wording and look. Thanks to Bruce Dubbs for the patch. Resolves + ticket #1779. + + + + + + April 21, 2006 + + + [manuel] - Added commands to determine the version of the + required packages installed on the host. Thanks to Bruce Dubbs + for the commands list and Randy McMurchy for reviewing the + wording. + + + [manuel] - Alphabetized patches list. Thanks to Justin + R. Knierim for the patch. + + + + + + April 20, 2006 + + + [jhuntwork] - Updated bash to 3.1.17 via an updated patch. + Resolves Ticket 1775. + + + [manuel] - Reworded why a 2.6 kernel compiled with GCC-3 + is required on the host system. + + + [manuel] - Revised dependencies info. Thanks to Chris Staub + for the patch. + + + + + + April 19, 2006 + + + [jhuntwork] - Added a more detailed list of minimum + software requirements. Thanks to Chris Staub for researching these + and Alexander Patrakov for suggesting the enhancement. + Resolves Ticket 1598. + + + + + + April 18, 2006 + + + [jhuntwork] - Moved all dependency information to a new page, + Appendix C. Appendix C also contains information concerning the + build order. While there might need to be a few tweaks yet, this + information is complete enough at this point to close out the + long-standing ticket #684. Many thanks to Chris Staub, Dan Nicholson + and Manuel Canales Esparcia for helping get this finished. + + + + + + April 15, 2006 + + + [archaic] - Updated to lfs-bootscripts-20060415. + + + [archaic] - Added patch to glibc to fix build errors in packages + that include linux/types.h after sys/kd.h. + + + + + + April 14, 2006 + + + [ken] - Add security patch for tar to address CVE-2006-0300. + + + [archaic] - Upgraded to man-pages-2.29 and linux-2.6.16.5. No + command changes. + + + [manuel] - Changed typography conventions. From now, + replaceable text is encapsulated inside < >, optional text + inside [ ], and library extensions inside { }. Thanks to + Bruce Dubbs for the patch. + + + + + + April 13, 2006 + + + [archaic] - Removed boot logging rule from /etc/syslog.conf and + removed the command to move logger to /bin. + + + [archaic] - Added symlink from vim.1 to vi.1. + + + [archaic] - Added chgpasswd to the list of installed files for + Shadow. + + + [archaic] - Merged the udev_update branch to trunk. + + + + + + April 12, 2006 + + + [jhuntwork] - Rewrote section explaining IP Addresses. + Thanks Bryan Kadzban and Bruce Dubbs. Resolves Ticket 1663. + + + [jhuntwork] - Added a pointer to GDBM in Berkeley DB page. + Also added explanatory text concerning why LFS chose Debian's + convention for storing man pages. Thanks to Tushar Teredesai and + Alexander Patrakov. Resolves Ticket 1694. + + + [jhuntwork] - Remove symlink of zsoelim to groff's soelim + in chapter 6. Man-DB produces a sufficient zsoelim which overwrites + the symlink we used to create. + + + + + + April 11, 2006 + + + [jhuntwork] - Updated bash-3.1 patch. (Ticket 1758) + + + + + + April 8, 2006 + + + [jhuntwork] - Added a command to create an empty /etc/mtab file early + in chapter 6. This avoids testsuite failures in e2fsprogs and possibly other + programs that expect /etc/mtab to be present. Explanation from Dan Nicholson, + slightly modified. Also merged the 'Creating Essential Symlinks' section with + 'Creating passwd, group and log Files'. + + + + + + April 6, 2006 + + + [manuel] - Placed home page (when available) and full download + links for all packages in chapter03/packages.xml. + + + [jhuntwork] - Merged alphabetical branch to trunk. + + + + + + April 2, 2006 + + + [archaic] - Moved the chowning of /tools to the end of chapter 5 + and rewrote note about backing up or re-using /tools. Moved the + mounting of kernel filesystems before the package management page and + rewrote the page to mount --bind /dev and mount all other kernel + filesystems while outside chroot. Rewrote note about re-entering + chroot and remounting kernel filesystems. Removed /dev from the list + of dirs created in chroot and added it before chroot. + + + + + + March 30, 2006 + + + [ken] - Correct my erroneous comment about UTF-8 locales in + Man-DB. Thanks to Alexander for explaining it. + + + [ken] - upgraded to Linux-2.6.16.1, Iproute2-2.6.16-060323, + and Udev-088. + + + + + + March 29, 2006 + + + [ken] - Upgrade to shadow-4.0.15 and add convert-mans script + to convert its UTF-8 man pages. Thanks to Alexander and Archaic for + the script and commands. Fixes tickets #1748 and #1750. + + + + + + March 22, 2006 + + + [archaic] - Updated to + lfs-bootscripts-udev_update-20060321. + + + + + + March 21, 2006 + + + [archaic] - Updated the bootscripts. Removed references to + hotplug and the bootscripts udev patch. Removed reference to + udevstart. Added text and commands for generating Udev bug reports. + + + + + + + March 18, 2006 + + + [matthew] - Do not run configure manually for iproute2 as it + is run automatically by the Makefile. Thanks to Chris Staub for the + patch. Fixes ticket #1734. + + + [matthew] - Make bzdiff use mktemp instead of the deprecated + tempfile command. Thanks to Chris Staub for the patch. Fixes ticket + #1713. + + + [matthew] - Upgrade to flex-2.5.33. + + + [matthew] - Upgrade to readline-5.1.004. + + + [matthew] - Upgrade to bash-3.1.014. + + + [matthew] - Upgrade to psmisc-22.2. + + + [matthew] - Upgrade to file-4.17. + + + [matthew] - Use updated version of the coreutils suppression + patch to prevent coreutils version of the su man page from being + installed. Fixes #1690. + + + + + + March 11, 2006 + + + [matthew] - Upgrade to GCC 4.0.3. + + + + + + March 8, 2006 + + + [matthew] - Upgrade to Man-pages 2.25. + + + [matthew] - Remove an example of poor Udev support as it + does not apply to the kernel used in the book. Thanks to Alexander + Patrakov. + + + [matthew] - Upgrade to Linux 2.6.15.6. + + + [matthew] - Upgrade to udev-087. + + + [matthew] - Udev's run_program rules require a null device to be + present at an early stage, so create one in /lib/udev/devices. + + + + + + March 7, 2006 + + + [matthew] - Update Udev rules file to load SCSI modules and + upload firmware to devices that need it. Improve explanations of + device and module handling. Thanks to Alexander Patrakov. + + + [archaic] - Replaced the debian-specific groff patch with an + LFS-style patch. + + + + + + March 3, 2006 + + + [gerard] - Remove -D_GNU_SOURCE from chapter 5 - Patch. Thanks + to Dan Nicholson for the patch. + + + + + + March 1, 2006 + + + [archaic] - Create the Udev directories before creating the + symlinks. + + + [jhuntwork] - Added a description of perl configure flags that + help perl deal with a lack of groff. Thanks Dan Nicholson. + + + + + + February 27, 2006 + + + [archaic] - New bash fixes patch adds patch 011 from Bash + upstream. Bash patch 010 broke quoting in certain situations. + + + + + + February 20, 2006 + + + [matthew] - Use non-deprecated format for accessing MODALIAS + keys in the Udev rules file, and prevent the "$" from being + expanded by the shell. + + + [matthew] - Add patches 009 and 010 from Bash upstream. + + + [matthew] - Upgrade to Man-pages 2.24. + + + + + + February 19, 2006 + + + [matthew] - Upgrade Perl libc patch to prevent Perl from trying + to find headers on the host system. Fixes bug 1695. + + + [matthew] - Expand the Udev module handling rule to run for + every subsystem, not just USB. + + + [matthew] - Upgrade to Linux 2.6.15.4. + + + [matthew] - Upgrade to Udev 085. + + + [matthew] - Install Sed's HTML documentation by using + --enable-html instead of editing the Makefile. Thanks to Greg Schafer + for the report and the fix. + + + [matthew] - Add upstream fixes 001-002 for Readline. + + + [matthew] - Add upstream fixes 001-008 for Bash. + + + [matthew] - Upgrade to Sed 4.1.5. + + + [matthew] - Upgrade to Man-pages 2.23. + + + [matthew] - Upgrade to Coreutils-5.94. + + + [matthew] - Upgrade to DB-4.4.20. + + + [matthew] - Upgrade to Perl-5.8.8, removing the now unneeded + vulnerability and DB module patches. + + + [matthew] - Add the verbose parameter to a couple of commands in + Linux-Libc-Headers and DB. + + + [matthew] - Create udev specific directories in udev's + instructions instead of the more generic creatingdirs.xml. Add + "pts" and "shm" directories to + /lib/udev/devices so that they + can be mounted successfully at boot time. + + + + + + February 10, 2006 + + + [manuel] - Finished the XML indentation plus few tags + changes. + + + + + + February 8, 2006 + + + [matthew] - Rewrite the majority of chapter07/udev.xml to + reflect the new configuration for handling dynamic device naming and + module loading. + + + + + + February 3, 2006 + + + [matthew] - Create the + /lib/firmware directory that + can be used by Udev's firmware_helper utility. + + + + [matthew] - Add descriptions of Udev's helper binaries. + + + [manuel] - Add udev bootscript patch to whatsnew. Removed + hotplug from list of packages to download. + + + [ken] - Add udev bootscript patch to list of patches to + download. + + + [ken] - Correct the size of the udev tarball. + + + + + + February 2, 2006 + + + [matthew] - Upgrade to Udev-084 and build all its extras to + enable custom rules to be written more easily. Also, change the + rules file to handle kernel module loading and patch the udev + bootscript to work with this version of udev. + + + [matthew] - Remove the hotplug package and related bootscript. + Udev will now handle device creation and module loading. + + + [matthew] - Upgrade to Linux-2.6.15.2. + + + + + + January 30, 2006 + + + [jhuntwork] - Adjust binutils-pass1 so we don't need to hang + on to its source directories. Also use 'gcc -dumpmachine' instead + of the MACHTYPE var. + + + [jhuntwork] - Various textual corrections. Thanks Chris + Staub. + + + [jhuntwork] - Remove unnecessary LDFLAGS variables in binutils + pass 1 and 2. Thanks Dan Nicholson. + + + + + + January 29, 2006 + + + [jhuntwork] - Restore the use of *startfile_prefix_spec. + + + [jhuntwork] - Remove a spurious -i from the perl command when + readjusting the toolchain. Thanks Dan Nicholson. + + + + + + January 26, 2006 + + + [jhuntwork] - Modify chapter 6 Glibc's make install command to + allow test-installation.pl to run. + + + [jhuntwork] - Adjust chapter 5 binutils to build a static ld-new + for use in the chapter 6 readjusting section. Also add some extended + sanity checks. These fixes are adapted from DIY-Linux and Greg Schafer. + Thanks to Dan Nicholson for the report, as well. + + + [jhuntwork] - Added 'nodump' to commands in the Package Management + section. + + + + + + January 25, 2006 + + + [jhuntwork] - Remove ppc specific instructions from chapter 6 + patch. Cross-LFS can handle non-x86 arch specifics at this point. + + + [jhuntwork] - Fix chapter 6 Glibc's test-installation.pl to test + the correct Glibc. Fixes bug 1675. Thanks to Dan Nicholson for the report + and Greg Schafer for the fix. + + + [jhuntwork] - Fixed the re-adjusting of the toolchain in chapter + 6 so that chapter 6 GCC and Binutils links against the proper Glibc and + so that we don't have to keep the binutils directories from chapter 5. + Also moved a note about saving the /tools directory to the beginning of + chapter 6. Fixes bug 1677. Thanks to Chris Staub, Alexander Patrakov, + Greg Schafer and Tushar Teredesai for reporting and resolving this + issue. + + + [matthew] - Upgrade coreutils i18n patch to version 2 to fix + sort -n and add the en_US.UTF-8 locale to improve + coreutils' test coverage. Fixes bugs 1688 and 1689. Thanks to + Alexander Patrakov. + + + [matthew] - Add information about package management. Thanks to + the BLFS project for the text. + + + + + + January 24, 2006 + + + [matthew] - Upgrade to Groff-1.18.1.1-11. + + + + + + January 23, 2006 + + + [matthew] - Upgrade to Man-pages 2.21. + + + [matthew] - Upgrade to Psmisc 22.1. + + + [matthew] - Upgrade to Shadow 4.0.14. + + + [matthew] - Install documentation for the Linux kernel. Thanks + to Tushar for the report. Fixes bug 1683. + + + [matthew] - Added a patch to enable Perl's DB_File module to + compile with the latest version of Berkeley DB. Thanks to Alexander + Patrakov for the patch. + + + + + + January 20, 2006 + + + [jhuntwork] - Added a patch to fix the sprintf security + vulnerability in Perl. Thanks to Tim van der Molen for pointing + it out. + + + + + + January 17, 2006 + + + [jhuntwork] - Fixed locale generation for French UTF-8. Thanks + to Dan McGhee for the report and Alexander Patrakov for the fix. + + + + + + January 10, 2006 + + + [ken]: Define YYENABLE_NLS in bison, to resolve a code + difference shown up by Iterative Comparison Analysis. Thanks + to Greg Schafer. + + + [ken]: Revert my move of mktemp and add a sed to correct + gccbug. + + + + + + January 7, 2006 + + + [ken]: Alter the Perl instructions to always create an + /etc/hosts file. This fixes a potential difference in the + 'hostcat' recorded in Config_heavy.pl. Thanks to Bryan Kadzban + for explaining this. + + + [ken]: Move grep ahead of libtool, so that the latter + will correctly reference /bin/grep in references to EGREP. + + + [ken]: Move mktemp ahead of gcc so that gccbug will + use mktemp. + + + [ken]: Give Berkeley DB its full name, and remove the + '-lpthread' overrides. Also add pointer to BLFS, thanks to + Randy McMurchy. + + + + + + January 5, 2006 + + + [jhuntwork]: Remove mention of news server until we actually + have one. Thanks Randy. + + + [jhuntwork]: Initial addition of UTF-8 support. Thanks to + Alexander Patrakov. + + + + + + January 3, 2006 + + + [matt]: Clarify the description of mktemp's --with-libc + configure parameter (fixes bug 1667). + + + [matt]: Upgrade to libtool 1.5.22. + + + [matt]: Upgrade to man-pages 2.18. + + + [matt]: Remove the -v flag from the example mkswap command in + chapter 2 as it does not affect verbosity (fixes bug 1674). + + + + + + December 31, 2005 + + + [ken]: Alter installation of Linux Libc asm Headers in chroot, + to be repeatable. + + + + + + December 23, 2005 + + + [jim]: Corrected version on Vim symlink + + + + + + December 21, 2005 + + + [matt]: Correctly symlink Vim's documentation to /usr/share/doc. + Thanks to Jeremy for the report and the fix. + + + + + + December 17, 2005 + + + [matt]: Pass a valid path to module-init-tools' --prefix + configure switch and remove the now unnecessary --mandir switch + + + [matt]: Symlink Vim's documentation to /usr/share/doc. Fixes + bug 1610. Thanks to Randy McMurchy for the original report and to + Ken and Jeremy for their investigations into the fix. + + + [matt]: Upgrade to psmisc-21.9 + + + [matt]: Upgrade to man-pages-2.17 + + + + + + December 16, 2005 + + + [jhuntwork]: Move Procps to before Perl in chapter 6. Perl's + testsuite uses 'ps'. + + + + + + December 13, 2005 + + + [jhuntwork]: Install Tcl's internal headers to /tools/include, + allowing us to drop its source directory right away. Origin is + Greg Schafer, and thanks to Dan Nicholson for the report (fixes + bug 1670). + + + + + + December 12, 2005 + + + [jhuntwork]: Updated texinfo patch. Fixes segfault issues + with texindex. Thanks to Randy McMurchy for the report and Bruce + Dubbs and Joe Ciccone for the fix. + + + + + + December 11, 2005 + + + [jhuntwork]: Upgrade to tcl-8.4.12 + + + [jhuntwork]: Upgrade to less-394. + + + [jhuntwork]: Upgrade to readline-5.1. Also removed bash-3.0 + and readline-5.0 specific patches. + + + [jhuntwork]: Upgrade to bash-3.1. Also fixed Tcl to work with + the new bash version. Thanks to Alexander Patrakov and ultimately, + Greg Schafer for the fix. + + + [jhuntwork]: Changed variable used in readline for linking + in ncurses. Thanks to Alexander Patrakov for the fix. + + + + + + December 9, 2005 + + + [matt]: Upgrade to man-pages-2.16 + + + [matt]: Upgrade to module-init-tools-3.2.2 + + + + [matt]: Upgrade to findutils-4.2.27 + + + + + + December 7, 2005 + + + [matt]: Mention the testsuites (or lack of them) for all + packages (fixes bug 1664). Thanks to Chris Staub for the report + and analysis of affected packages. + + + + + + November 26, 2005 + + + [matt]: Don't install the Linuxthreads man pages, the POSIX + threading API is documented in the man3p section provided by the + man-pages package (fixes bug 1660). + + + [matt]: Remove the incorrect note about not having to dump/check + a journalled filesystem (fixes bug 1662). + + + [matt]: Upgrade to module-init-tools 3.2.1. + + + [matt]: Prevent installing the internationalized man pages + for Shadow's groups binary (thanks to Randy + McMurchy for the report). + + + [matt]: Upgrade to man-pages 2.14. + + + [matt]: Upgrade to findutils-4.2.26 + + + [manuel]: Changed --strip-path to --strip-components in the + unpack of module-init-tools-testsuite package. + + + + + + November 23, 2005 + + + [gerard]: Corrected reference to 'man page' to 'HTML + documentation' in chapter 6/sec + + + + + + November 18, 2005 + + + [manuel]: Fixed the unpack of the module-init-tools-testsuite + package. + + + + + + November 16, 2005 + + + [jhuntwork]: Textual correction concerning gettext in + chapter 5 and the use of --disable-shared + + + + + + November 15, 2005 + + + [archaic]: Changed the chapter 6 Perl Dpager configure option + to reflect the new location of the less binary. + + + + + + November 14, 2005 + + + [jhuntwork]: Only install msgfmt from + gettext in chapter 5. This is all that is necessary and prevents + gettext from trying to pull in unnecessary elements from the host. + Thanks to Greg Schafer for pointing this out. + + + + + + November 12, 2005 + + + [matt]: Improve the heuristic for determining a locale that + is supported by both Glibc and packages outside LFS (bug 1642). + Many thanks to Alexander Patrakov for highlighting the numerous + issues and for reviewing the various suggested fixes. + + + [jhuntwork]: Move sed to earlier in the build. + + + [jhuntwork]: Move m4 to earlier in the build. Thanks + Chris Staub. + + + + + + November 11, 2005 + + + [matt]: Omit running Bzip2's testsuite as a separate step, + as make runs it automatically (bug 1652). + + + + + + November 10, 2005 + + + [jhuntwork]: Initial re-ordering of packages. Thanks to + Chris Staub (bug 684). + + + + + + November 7, 2005 + + + [matt]: Install the binaries from Less to /usr/bin instead + of /bin (fixes bug 1643). + + + [matt]: Remove the --libexecdir option from both passes of + GCC in chapter 5 (fixes bug 1646). Also change the --libexecdir + option for Findutils to conform with the /usr/lib/packagename + convention already prevalent in the book (fixes bug 1644). + + + + + + November 6, 2005 + + + [matt]: Remove the optimization related warnings from the + toolchain packages (bug 1650). + + + [matt]: Install Vim's documentation to + /usr/share/doc/vim-&vim-version; instead of /usr/share/vim/vim64/doc + (bug 1610). Thanks to Randy McMurchy for the report, and Jeremy + Huntwork for the fix. + + + [matt]: Stop Udev from killing udevd processes on the host + system (fixes bug 1651). Thanks to Alexander Patrakov for the + report and the fix. + + + [matt]: Upgrade to Coreutils 5.93. + + + [matt]: Upgrade to Psmisc 21.8. + + + [matt]: Upgrade to Glibc 2.3.6. + + + + + + November 5, 2005 + + + [matt]: Add a note to the toolchain sanity check in chapter 5 + to explain that if TCL fails to build, it's an indication of a broken + toolchain (bug 1581). + + + + + + November 3, 2005 + + + [matt]: Upgrade to man-pages 2.13. + + + [matt]: Correct the instructions for running Module-Init-Tools' + testsuite (fixes bug 1597). Thanks to Greg Schafer, Tushar Teredesai + and to Randy McMurchy for providing the patch. + + + + + + October 31, 2005 + + + [matt]: Upgrade to shadow-4.0.13. + + + [matt]: Upgrade to vim-6.4. + + + [matt]: Upgrade to procps-3.2.6. + + + [matt]: Build udev_run_devd and udev_run_hotplugd and alter + the udev rules file so that udev once again executes programs in + the /etc/dev.d and /etc/hotplug.d directories (fixes bug 1635). + Also change the udev rules to prevent udev from handling the "card" + and "dm" devices as these are managed entirely by programs outside + of LFS. + + + + + + October 29, 2005 + + + [matt]: Upgrade to udev-071 + + + [matt]: Upgrade to man-pages 2.11. + + + [matt]: Upgrade to coreutils-5.92. This involved removing + the DEFAULT_POSIX2_VERSION environment variable as it is no longer + required. The testsuite also requires the Data::Dumper module from + Perl, so it is now built in chapter05/perl.xml. + + + + + + October 22, 2005 + + + [archaic]: Upgrade to m4-1.4.4. + + + + + + October 21, 2005 + + + [matt]: Upgrade to file-4.16. + + + [matt]: Upgrade to man-pages 2.10. + + + [matt]: Upgrade to ncurses 5.5. + + + + + + October 15, 2005 + + + [matt]: Upgrade to man-pages 2.09. + + + [matt]: Use an updated version of the Udev rules file + (fixes bug 1639). + + + [matt]: Add a cdrom group as required by the Udev rules. + file + + + + + + October 9, 2005 + + + [matt]: Emphasise the fact that one must delete the source + directory after each package has been installed. Fixes bug 1638. + Thanks to Chris Staub. + + + + + + October 8, 2005 + + + [archaic]: Added patch to fix poor tempfile creation in + Texinfo-4.8 that can lead to a symlink attack. + + + [matt]: Upgrade to iproute2-051007. + + + + + + October 7, 2005 + + + [matt]: Upgrade to gcc-4.0.2. + + + + + + October 4, 2005 + + + [matt]: Prevent GCC from running the fixincludes + script in chapter5 pass2 and chapter 6 (fixes bug 1636). Thanks to Tushar + and Greg for their contributions on this issue. + + + + + + September 29, 2005 + + + [matt]: Add more explicit reader prerequisites (fixes + bug 1629). + + + [matt]: Add to commands that accept it + (fixes bug 1612). + + + + + + September 26, 2005 + + + [matt]: Upgrade to man-pages-2.08. + + + + + + September 24, 2005 + + + [matt]: Upgrade to gawk-3.1.5. + + + [matt]: Upgrade to man-1.6b. + + + [matt]: Upgrade to util-linux-2.12r. + + + + + + September 20, 2005 + + + [matt]: Upgrade to bison-2.1. + + + + + + September 17, 2005 + + + [matt]: Upgrade to udev-070 and remove the unnecessary + "udevdir=/dev" parameter. + + + [matt]: Added patch for coreutils to improve echo's POSIX + and bash compatibility and to recognise "\xhh" syntax + as required by the test suite in udev-069 and later. + + + + + + September 15, 2005 + + + [archaic]: Added patch for util-linux to prevent a umount + vulnerability. + + + + + + September 8, 2005 + + + [jhuntwork]: Upgrade to groff-1.19.2 + + + + + + September 6, 2005 + + + [ken]: Reworded the glibc text to expect test failures. + + + + + + September 5, 2005 + + + [ken]: Add patch to fix some of the math tests in glibc. + + + + + September 4, 2005 + + + [matt]: Add patch to stop cfdisk segfaulting + when invoked on devices with partitions that don't contain an ext2, + ext3, xfs or jfs filesystem (see bug 1604). + + + [matt]: Upgrade to libtool-1.5.20. + + + [matt]: Upgrade to findutils-4.2.25. + + + + + + September 2, 2005 + + + [matt]: The optimization flag for util-linux comes from + configure rather than MCONFIG, + so adjust the sed in order for the segfault fix + to actually work. + + + [matt]: Avoid the potential race condition when invoking + find to remove GCC's fixed headers. + + + + + + August 30th, 2005 + + + [matt]: Work around a segfault in cfdisk by compiling with -O + instead of the default -O2 optimization setting (fixes bug 1604). + + + [matt]: Update the inetutils patch to use the upstream fix + for GCC-4.x compilation problems (fixes bug 1602). + + + [matt]: Upgrade to shadow-2.0.12 + + + [ken]: Remove sed -i commands from + gcc-pass2. + + + + + + August 28th, 2005 + + + [jhuntwork]: Adjusted tar commands in Bash and Glibc chapter 6 + builds for consistency + + + + + + August 23rd, 2005 + + + [matt]: find may fail due to a race + condition when deleting files. Remove the && construct in + chapter05/adjusting.xml so that the rest of the commands for removing + fixed headers will be executed (fixes bug 1621). + + + [matt]: Install Udev's documentation relating to configuring + rules (fixes bug 1622). + + + [matt]: Upgrade to Man-1.6a. + + + + + + August 20th, 2005 + + + [matt]: Stop moving some of coreutils' binaries to /bin as + they aren't required to be there (fixes bug 1620). + + + + + + August 19th, 2005 + + + [matt]: Upgrade to Udev-068. + + + [matt]: Upgrade to IANA-etc-2.00. + + + [matt]: Upgrade to file-4.15. + + + + + + August 18th, 2005 + + + [matt]: Simplify the method for finding where GCC's default + specs file and private include directory live. Additionally, don't + assume the host's sed supports the -i switch. + + + [ken]: Add a patch to sanitise bzgrep's handling of + filenames. + + + + + + August 16th, 2005 + + + [matt]: Install sed's man page to /usr/share/doc/sed-4.1.4 + instead of /usr/share/doc (fixes bug 1600). + + + [matt]: Upgraded to linux-2.6.12.5. + + + + + + August 15th, 2005 + + + [matt]: Alter the GCC -fomit-frame-pointer sed to protect + from multiple invocations (Greg Schafer). + + + + + + August 14th, 2005 + + + [ken]: Upgrade shadow to 4.0.11.1 with --enable-shadowgrp as + advised by Greg Schafer. + + + [matt]: Mention the common libmudflap test failures in GCC + (fixes bug 1615). + + + [matt]: Added patch to install documentation for bzip2 (fixes + bug 1603). + + + [matt]: Upgrade to linux-2.6.12.4. + + + [matt]: Add sed to chapter05/gcc-pass2 and chapter06/gcc to + ensure they get built with -fomit-frame-pointer so it matches the + bootstrap build in chapter05/gcc-pass1 (fixes bug 1609). + + + [matt]: Upgrade to udev-067 including a fix for the failing + test (bug 1611). + + + + + + August 12th, 2005 + + + [matt]: Explain that libiconv isn't required on an LFS + system (fixes bug 1614). + + + [matt]: Fix ownership of libtool's libltdl data files + (fixes bug 1601). + + + [matt]: Change findutils and vim's configure switch explanations + to the convention used in the rest of the book (Bug 1613). + + + [matt]: Expand explanation of device node creation at the start + of chapter 6. + + + [matt]: Fix incorrect version number for expect's installed + library (Bug 1608). + + + + + + August 7th, 2005 + + + [archaic]: Added note in Shadow regarding building Cracklib + from BLFS first. + + + + + + August 6th, 2005 + + + [matt]: Add texi2pdf to list of Texinfo's installed files. + + + [matt]: Updated Vim's security patch to address the latest + modeline vulnerability. + + + + + + July 30th, 2005 + + + [matt]: Added instructions for installing Bash documentation + (Randy McMurchy). + + + [matt]: Remove GCC linkonce patch from chapter03/patches.xml + as it's no longer used in the book + + + + + + July 29th, 2005 + + + [manuel]: Removed the text about defining gvimrc. + + + + + + July 28th, 2005 + + + [matt]: Add GCC-4 related patch for kbd. + + + [matt]: Add GCC-4 related patch for inetutils. + + + [matt]: Remove the note regarding a known test failure in GRUB. + The test no longer fails under GCC-4. + + + [matt]: Add GCC-4 related patch to chapter06 tar. + + + + + + July 27th, 2005 + + + [matt]: Don't define gvim's configuration file as we don't + compile gvim in LFS (Bruce Dubbs). + + + + + + July 26th, 2005 + + + [matt]: Remove groups from the list of programs + installed by shadow, as we use the version provided by coreutils + instead (Randy McMurchy). + + + [matt]: Updated to mktemp-1.5-add_tempfile-3.patch, which adds + license and copyright information to the previous version. + + + + + + July 23rd, 2005 + + + [matt]: Moved FORMER_CONTRIBUTORS information into the book, + so as people can actually see it. The space constraint argument in + that file was weak - it only added another 10 lines to a 255 page + document (PDF). Now at least we publically + acknowledge the efforts of previous contributors. + + + [matt]: Updated to man-pages-2.07. + + + [matt]: Updated to zlib-1.2.3. + + + + + + July 22nd, 2005 + + + [manuel]: Added obfuscate.sh and modified the Makefile to + obfuscate e-mail addresses in XHTML output. + + + + + + July 21st, 2005 + + + [matt]: Add GCC-4 related patches to chapter06 glibc. + + + [matt]: Unset the GCC_INCLUDEDIR variable once it's no longer + needed. + + + + + + July 19th, 2005 + + + [matt]: Removed flex++ from the list of installed files, as + it is no longer present (Randy McMurchy) + + + + + + July 18th, 2005 + + + [matt]: Re-added the explanation of the fixincludes process + and rewording where necessary (Chris Staub), and reworded description + of the specs patch. + + + [matt]: Remove all host headers brought in via the fixincludes + process, not just pthread.h and sigaction.h + + + + + + July 17th, 2005 + + + [matt]: Slightly adjusted the specs file seds, to prevent + multiple seds from adversely affecting them. + + + [matt]: Removed the fixincludes sed from gcc-pass1 as we may + need to fix up host's headers. Also reinstate the associated removal + of pthread.h and sigthread.h. + + + + + + July 16th, 2005 + + + [jhuntwork]: Added sed to chapter 5 gcc builds to force the + fixincludes to use the headers in /tools and not the host. + + + [jhuntwork]: Removed no_fixincludes and linkonce patches for + gcc4. Also removed the command to remove the fixed pthread.h. + + + [jhuntwork]: Fixed adjusting toolchain sed for both chapters + 5 and 6. + + + + + + July 15th, 2005 + + + [matt]: Updated to Linux-2.6.12.3. + + + [matt]: Added a patch to enable tar to build with gcc-4.0.1 + + + [matt]: GCC-4.x no longer installs its specs file by default. + Alter the toolchain adjustment stage to first dump the specs file + where GCC will find it, then alter it. + + + [matt]: Added patches for chapter 5's Glibc to build with + gcc-4.0.1 + + + [matt]: Updated to gcc-4.0.1. + + + [matt]: Updated to udev-063. + + + + + + July 13th, 2005 + + + [matt]: Updated to automake-1.9.6. + + + + + + July 8th, 2005 + + + [matt]: Updated to udev-062. + + + [matt]: Updated to linux-libc-headers-2.6.12.0. + + + [matt]: Updated to linux-2.6.12.2. + + + [matt]: Updated to shadow-4.0.10. + + + [matt]: Updated to iana-etc-1.10. + + + + + + July 6th, 2005 + + + [archaic]: Pulled the inetutils kernel header patch out again + as it is not needed. + + + [matt]: Updated to e2fsprogs-1.38. + + + [matt]: Updated to binutils-2.16.1. + + + + + + July 5th, 2005 + + + [matt]: Updated to tcl-8.4.11. + + + [matt]: Updated to man-1.6. + + + [matt]: Updated to file 4.14. + + [matt]: Updated to man-pages 2.05. + + + + + + June 12th, 2005 + + + [matt]: Upgraded to gettext-0.14.5. + + + [matt]: Upgraded to perl-5.8.7. + + + [matt]: Upgraded to tcl-8.4.10. + + + [matt]: Upgraded to man-pages-2.03. + + + + + + May 24th, 2005 + + + [jim]: Changed gcc-specs patch to -2. + + + + + + May 23nd, 2005 + + + [jim]: Changed changelog to use version entities. + + + + + + May 22nd, 2005 + + + [matt]: Updated to Udev-058. + + + [matt]: Updated to Libtool-1.5.18. + + + [matt]: Updated to Gcc-3.4.4. + + + [matt]: Updated to Binutils-2.16. + + + + + + May 15th, 2005 + + + [matt]: Updated to Grub 0.97. + + + [matt]: Updated to Libtool 1.5.16. + + + [jim]: Updated to udev 057. + + + + + + April 14, 2005 + + + [jim]: Updated to man-pages 2.02. + + + + + + April 13, 2005 + + + [jim]: Updated to glibc 2.3.5. + + + [jim]: Updated to gettext 0.14.4. + + + + + + April 12, 2005 + + + [manuel]: Small redaction changes. + + + + + + April 11, 2005 + + + [manuel]: Several tags and text corrections. + + + + + + April 6, 2005 + + + [jim]: Removed IPRoute2 patch for a sed (Ryan Oliver). + + + + + + + Branch frozen for LFS 6.1 as of April 5, 2005. Some packages + and patches updates related with security up to July 9, 2005. + + diff --git a/chapter01/chapter01.xml b/chapter01/chapter01.xml new file mode 100644 index 000000000..2975cc8d8 --- /dev/null +++ b/chapter01/chapter01.xml @@ -0,0 +1,21 @@ + + + %general-entities; +]> + + + + + + Introduction + + + + + + + + + diff --git a/chapter01/how.xml b/chapter01/how.xml new file mode 100644 index 000000000..16d565c4e --- /dev/null +++ b/chapter01/how.xml @@ -0,0 +1,89 @@ + + + %general-entities; +]> + + + + + How to Build an LFS System + + The LFS system will be built by using a previously installed + Linux distribution (such as Debian, Mandrake, Red Hat, or SuSE). This + existing Linux system (the host) will be used as a starting point to + provide necessary programs, including a compiler, linker, and shell, + to build the new system. Select the development option + during the distribution installation to be able to access these + tools. + + As an alternative to installing a separate distribution + onto your machine, you may wish to use the Linux From Scratch LiveCD. + The CD works well as a host system, providing all the tools you need + to successfully follow the instructions in this book. Additionally, + it contains all the source packages, patches and a copy of this book. + So once you have the CD, no network connection or additional downloads + are necessary. For more information about the LFS LiveCD or to download + a copy, visit . + + of this book describes how + to create a new Linux native partition and file system, the place + where the new LFS system will be compiled and installed. explains which packages and + patches need to be downloaded to build an LFS system and how to store + them on the new file system. + discusses the setup of an appropriate working environment. Please read + carefully as it explains several + important issues the reader should be aware of before beginning to + work through and beyond. + + explains the + installation of a number of packages that will form the basic + development suite (or toolchain) which is used to build the actual + system in . Some of these + packages are needed to resolve circular dependencies—for example, + to compile a compiler, you need a compiler. + + also shows the user how to + build a first pass of the toolchain, including Binutils and GCC (first pass + basically means these two core packages will be reinstalled). + The next step is to build Glibc, the C library. Glibc will be compiled by + the toolchain programs built in the first pass. Then, a second pass of the + toolchain will be built. This time, the toolchain will be dynamically linked + against the newly built Glibc. The remaining packages are built using this second + pass toolchain. When this is done, the LFS installation process will no + longer depend on the host distribution, with the exception of the running + kernel. + + This effort to isolate the new system from the host distribution may + seem excessive, but a full technical explanation is provided in + . + + In , the full LFS system is + built. The chroot (change root) program is used to enter + a virtual environment and start a new shell whose root directory will be + set to the LFS partition. This is very similar to rebooting and instructing + the kernel to mount the LFS partition as the root partition. The system + does not actually reboot, but instead chroot's because + creating a bootable system requires additional work which is not necessary + just yet. The major advantage is that chrooting allows the + builder to continue using the host while LFS is being built. While waiting + for package compilation to complete, a user can switch to a different + virtual console (VC) or X desktop and continue using the computer as + normal. + + To finish the installation, the LFS-Bootscripts are set up in + , and the kernel and boot loader are set + up in . + contains information on furthering the LFS experience beyond this book. + After the steps in this book have been implemented, the computer will be + ready to reboot into the new LFS system. + + This is the process in a nutshell. Detailed information on each + step is discussed in the following chapters and package descriptions. + Items that may seem complicated will be clarified, and everything will + fall into place as the reader embarks on the LFS adventure. + + diff --git a/chapter01/livecd.xml b/chapter01/livecd.xml new file mode 100644 index 000000000..68c408c55 --- /dev/null +++ b/chapter01/livecd.xml @@ -0,0 +1,106 @@ + + + %general-entities; +]> + + + + + About the Included CD + + For your convenience, we have included a CD with this book that + contains the source packages needed for creating a Linux From Scratch + system. The CD is bootable and provides a stable working environment + for building LFS. This book refers to this system as the + host system. The CD images are actively maintained and + updated versions can be found at + + + In addition to the tools required to build LFS, the host system + on the CD has a number of other helpful tools installed: + + + + + An HTML version of this book + + + + The X Window System Environment + + + + Web Tools + + + Wget (command line file retriever) + + + Lynx (text web browser) + + + Irssi (console IRC client) + + + Firefox (graphical web browser) + + + Xchat (X-based IRC client) + + + + + + Text Editors + + + Vim + + + Nano + + + + + + Network Tools + + + SSH Server and Client + + + NFS Server and Client + + + Smbmount (mount.cifs) for Windows shares + + + Subversion + + + Dhcpcd (DHCP client) + + + + + + Filesystem Programs + + + Reiserfsprogs + + + Xfsprogs + + + + + + nALFS - A tool for automating LFS builds + + + + + diff --git a/chapter01/resources.xml b/chapter01/resources.xml new file mode 100644 index 000000000..6588b937d --- /dev/null +++ b/chapter01/resources.xml @@ -0,0 +1,92 @@ + + + %general-entities; +]> + + + + + Resources + + + FAQ + + If during the building of the LFS system you encounter any + errors, have any questions, or think there is a typo in the book, + please start by consulting the Frequently Asked Questions (FAQ) + that is located at . + + + + + Mailing Lists + + The linuxfromscratch.org server hosts a number of mailing + lists used for the development of the LFS project. These lists include the + main development and support lists, among others. If the FAQ does not solve + the problem you are having, the next step would be to search the mailing + lists at . + + For information on the different lists, how to subscribe, archive + locations, and additional information, visit + . + + + + + + + IRC + + Several members of the LFS community offer assistance on our + community Internet Relay Chat (IRC) network. Before using this support, + please make sure that your question is not already answered in the LFS + FAQ or the mailing list archives. You can find the IRC network at + irc.linuxfromscratch.org. The support channel is named + #LFS-support. + + + + + References + + For additional information on the packages, useful tips are + available in the LFS Package Reference page located at . + + + + + Mirror Sites + + The LFS project has a number of world-wide mirrors to make accessing + the website and downloading the required packages more convenient. Please + visit the LFS website at for a list + of current mirrors. + + + + + Contact Information + + Please direct all your questions and comments to one of the LFS + mailing lists (see above). + + + + diff --git a/chapter01/whatsnew.xml b/chapter01/whatsnew.xml new file mode 100644 index 000000000..0b48a6cec --- /dev/null +++ b/chapter01/whatsnew.xml @@ -0,0 +1,311 @@ + + + %general-entities; +]> + + + + + What's new since the last release + + Below is a list of package updates made since the previous + release of the book. + + + + + Upgraded to: + + + + Automake &automake-version; + + + Bash &bash-version; + + + + Binutils &binutils-version; + + + Bison &bison-version; + + + + Coreutils &coreutils-version; + + + + + E2fsprogs &e2fsprogs-version; + + + + File &file-version; + + + Findutils &findutils-version; + + + Flex &flex-version; + + + Gawk &gawk-version; + + + GCC &gcc-version; + + + Gettext &gettext-version; + + + Glibc &glibc-version; + + + + + GRUB &grub-version; + + + + IANA-Etc &iana-etc-version; + + + + IPRoute2 &iproute2-version; + + + + Less &less-version; + + + LFS-Bootscripts &lfs-bootscripts-version; + + + Libtool &libtool-version; + + + Linux &linux-version; + + + Linux-Libc-Headers &linux-libc-headers-version; + + + M4 &m4-version; + + + + + Man-pages &man-pages-version; + + + + + Ncurses &ncurses-version; + + + + Perl &perl-version; + + + Procps &procps-version; + + + Psmisc &psmisc-version; + + + Readline &readline-version; + + + Sed &sed-version; + + + Shadow &shadow-version; + + + + + + TCL &tcl-version; + + + + Udev &udev-version; + + + + Vim &vim-version; + + + Zlib &zlib-version; + + + + + Downgraded to: + + + Groff &groff-version; + + + + + + Added: + + + &bash-fixes-patch; + + + &bzip2-bzgrep-patch; + + + &bzip2-docs-patch; + + + &gawk-segfault-patch; + + + &gcc-specs-patch; + + + &glibc-linux_types-patch; + + + &groff-debian-patch; + + + Berkeley DB-&db-version; + + + &inetutils-gcc4_fixes-patch; + + + &kbd-gcc4_fixes-patch; + + + MAN-DB-&man-db-version; + + + &mktemp-tempfile-patch; + + + &perl-libc-patch; + + + &readline-fixes-patch; + + + &tar-gcc4_fix-patch; + + + &texinfo-tempfile_fix-patch; + + + &udev-config; + + + &vim-fixes-patch; + + + &vim-mandir-patch; + + + + + Removed: + + + flex-2.5.31-debian_fixes-3.patch + + + gcc-3.4.3-linkonce-1.patch + + + gcc-3.4.3-no_fixincludes-1.patch + + + gcc-3.4.3-specs-2.patch + + + glibc-2.3.4-fix_test-1.patch + + + hotplug-2004-09-23 + + + inetutils-1.4.2-kernel_headers-1.patch + + + iproute2-2.6.11-050330-remove_db-1.patch + + + Man-1.6b + + + mktemp-1.5-add_tempfile-2.patch + + + perl-5.8.6-libc-1.patch + + + udev-config-4.rules + + + vim-6.3-security_fix-1.patch + + + zlib-1.2.2-security_fix-1.patch + + + + + diff --git a/chapter02/chapter02.xml b/chapter02/chapter02.xml new file mode 100644 index 000000000..8200994ed --- /dev/null +++ b/chapter02/chapter02.xml @@ -0,0 +1,19 @@ + + + %general-entities; +]> + + + + + + Preparing a New Partition + + + + + + + diff --git a/chapter02/creatingfilesystem.xml b/chapter02/creatingfilesystem.xml new file mode 100644 index 000000000..b960019f6 --- /dev/null +++ b/chapter02/creatingfilesystem.xml @@ -0,0 +1,73 @@ + + + %general-entities; +]> + + + + + Creating a File System on the Partition + + Now that a blank partition has been set up, the file system can be created. + The most widely-used system in the Linux world is the second extended file + system (ext2), but with newer + high-capacity hard disks, journaling file systems are becoming increasingly + popular. The third extended filesystem (ext3) is a widely used enhancement to + ext2, which adds journalling + capabilities and is compatible with the E2fsprogs utilities. + We will create an ext3 + file system. Instructions for creating other file systems can be found at + . + + To create an ext3 file + system on the LFS partition, run the following: + +mke2fs -jv /dev/<xxx> + + Replace <xxx> with the name of the LFS + partition (hda5 in our previous + example). + + + Some host distributions use custom features in their filesystem + creation tools (E2fsprogs). This can cause problems when booting into your new + LFS in Chapter 9, as those features will not be supported by the LFS-installed + E2fsprogs; you will get an error similar to unsupported filesystem + features, upgrade your e2fsprogs. To check if your host system + uses custom enhancements, run the following command: + +debugfs -R feature /dev/<xxx> + + If the output contains features other than: ; + ; ; + or then your host + system may have custom enhancements. In that case, to avoid later problems, + you should compile the stock E2fsprogs package and use the resulting binaries + to re-create the filesystem on your LFS partition: + +cd /tmp +tar -xjvf /path/to/sources/e2fsprogs-&e2fsprogs-version;.tar.bz2 +cd e2fsprogs-&e2fsprogs-version; +mkdir -v build +cd build +../configure +make #note that we intentionally don't 'make install' here! +./misc/mke2fs -jv /dev/<xxx> +cd /tmp +rm -rfv e2fsprogs-&e2fsprogs-version; + + + If a swap partition was + created, it will need to be initialized for use by issuing the command below. + If you are using an existing swap + partition, there is no need to format it. + +mkswap /dev/<yyy> + + Replace <yyy> with the name of the + swap partition. + + diff --git a/chapter02/creatingpartition.xml b/chapter02/creatingpartition.xml new file mode 100644 index 000000000..612d1c3cf --- /dev/null +++ b/chapter02/creatingpartition.xml @@ -0,0 +1,55 @@ + + + %general-entities; +]> + + + + + Creating a New Partition + + Like most other operating systems, LFS is usually installed on a + dedicated partition. The recommended approach to building an LFS system + is to use an available empty partition or, if you have enough unpartitioned + space, to create one. However, an LFS system (in fact even multiple LFS + systems) may also be installed on a partition already occupied by another + operating system and the different systems will co-exist peacefully. The + document + explains how to implement this, whereas this book discusses the method of + using a fresh partition for the installation. + + A minimal system requires a partition of around 1.3 gigabytes (GB). + This is enough to store all the source tarballs and compile the packages. + However, if the LFS system is intended to be the primary Linux system, + additional software will probably be installed which will require additional + space (2-3 GB). The LFS system itself will not take up this much room. + A large portion of this requirement is to provide sufficient free temporary + storage. Compiling packages can require a lot of disk space which will be + reclaimed after the package is installed. + + Because there is not always enough Random Access Memory (RAM) available + for compilation processes, it is a good idea to use a small disk partition as + swap space. This is used by the + kernel to store seldom-used data and leave more memory available for active + processes. The swap partition for + an LFS system can be the same as the one used by the host system, in which + case it is not necessary to create another one. + + Start a disk partitioning program such as cfdisk + or fdisk with a command line option naming the hard + disk on which the new partition will be created—for example + /dev/hda for the primary Integrated + Drive Electronics (IDE) disk. Create a Linux native partition and a + swap partition, if needed. Please + refer to cfdisk(8) or fdisk(8) if + you do not yet know how to use the programs. + + Remember the designation of the new partition (e.g., hda5). This book will refer to this as + the LFS partition. Also remember the designation of the swap partition. These names will be + needed later for the /etc/fstab file. + + diff --git a/chapter02/introduction.xml b/chapter02/introduction.xml new file mode 100644 index 000000000..812764536 --- /dev/null +++ b/chapter02/introduction.xml @@ -0,0 +1,17 @@ + + + %general-entities; +]> + + + + + Introduction + + In this chapter, the partition which will host the LFS system is + prepared. We will create the partition itself, create a file system + on it, and mount it. + + diff --git a/chapter02/mounting.xml b/chapter02/mounting.xml new file mode 100644 index 000000000..3572e1861 --- /dev/null +++ b/chapter02/mounting.xml @@ -0,0 +1,59 @@ + + + %general-entities; +]> + + + + + Mounting the New Partition + + Now that a file system has been created, the partition needs to + be made accessible. In order to do this, the partition needs to be + mounted at a chosen mount point. For the purposes of this book, it is + assumed that the file system is mounted under /mnt/lfs, but the directory choice is up + to you. + + Choose a mount point and assign it to the LFS + environment variable by running: + +export LFS=/mnt/lfs + + Next, create the mount point and mount the LFS file system by + running: + +mkdir -pv $LFS +mount -v -t ext3 /dev/<xxx> $LFS + + Replace <xxx> with the designation of the LFS + partition. + + If using multiple partitions for LFS (e.g., one for / and another for /usr), mount them using: + +mkdir -pv $LFS +mount -v -t ext3 /dev/<xxx> $LFS +mkdir -v $LFS/usr +mount -v -t ext3 /dev/<yyy> $LFS/usr + + Replace <xxx> and + <yyy> with the appropriate partition + names. + + Ensure that this new partition is not mounted with permissions that + are too restrictive (such as the , , + or options). Run the mount command + without any parameters to see what options are set for the mounted LFS + partition. If , , and/or + are set, the partition will need to be + remounted. + + Now that there is an established place to work, it is time to + download the packages. + + + diff --git a/chapter03/chapter03.xml b/chapter03/chapter03.xml new file mode 100644 index 000000000..b244cc460 --- /dev/null +++ b/chapter03/chapter03.xml @@ -0,0 +1,18 @@ + + + %general-entities; +]> + + + + + + Packages and Patches + + + + + + diff --git a/chapter03/introduction.xml b/chapter03/introduction.xml new file mode 100644 index 000000000..6bdb5c776 --- /dev/null +++ b/chapter03/introduction.xml @@ -0,0 +1,52 @@ + + + %general-entities; +]> + + + + + Introduction + + This chapter includes a list of packages that need to be downloaded in + order to build a basic Linux system. The listed version numbers correspond to + versions of the software that are known to work, and this book is based on + their use. We highly recommend against using newer versions because the build + commands for one version may not work with a newer version. The newest package + versions may also have problems that require work-arounds. These work-arounds + will be developed and stabilized in the development version of the + book. + + Download locations may not always be accessible. If a download + location has changed since this book was published, Google () provides a useful search engine for + most packages. If this search is unsuccessful, try one of the + alternative means of downloading discussed at . + + Downloaded packages and patches will need to be stored somewhere + that is conveniently available throughout the entire build. A working + directory is also required to unpack the sources and build them. + $LFS/sources can be used both + as the place to store the tarballs and patches and as a working + directory. By using this directory, the required elements will be + located on the LFS partition and will be available during all stages + of the building process. + + To create this directory, execute the following command, as user + root, before starting the download + session: + +mkdir -v $LFS/sources + + Make this directory writable and sticky. Sticky + means that even if multiple users have write permission on a + directory, only the owner of a file can delete the file within a + sticky directory. The following command will enable the write and + sticky modes: + +chmod -v a+wt $LFS/sources + + diff --git a/chapter03/packages.xml b/chapter03/packages.xml new file mode 100644 index 000000000..e5cc7bf2d --- /dev/null +++ b/chapter03/packages.xml @@ -0,0 +1,586 @@ + + + %general-entities; +]> + + + + + All Packages + + Download or otherwise obtain the following packages: + + + + + Autoconf (&autoconf-version;) - &autoconf-size;: + + Home page: + Download: + MD5 sum: &autoconf-md5; + + + + + Automake (&automake-version;) - &automake-size;: + + Home page: + Download: + MD5 sum: &automake-md5; + + + + + Bash (&bash-version;) - &bash-size;: + + Home page: + Download: + MD5 sum: &bash-md5; + + + + + Bash Documentation (&bash-doc-version;) - &bash-doc-size;: + + Home page: + Download: + MD5 sum: &bash-doc-md5; + + + + + Berkeley DB (&db-version;) - &db-size;: + + Home page: + Download: + MD5 sum: &db-md5; + + + + + Binutils (&binutils-version;) - &binutils-size;: + + Home page: + Download: + MD5 sum: &binutils-md5; + + + + + Bison (&bison-version;) - &bison-size;: + + Home page: + Download: + MD5 sum: &bison-md5; + + + + + Bzip2 (&bzip2-version;) - &bzip2-size;: + + Home page: + Download: + MD5 sum: &bzip2-md5; + + + + + Coreutils (&coreutils-version;) - &coreutils-size;: + + Home page: + Download: + MD5 sum: &coreutils-md5; + + + + + DejaGNU (&dejagnu-version;) - &dejagnu-size;: + + Home page: + Download: + MD5 sum: &dejagnu-md5; + + + + + Diffutils (&diffutils-version;) - &diffutils-size;: + + Home page: + Download: + MD5 sum: &diffutils-md5; + + + + + E2fsprogs (&e2fsprogs-version;) - &e2fsprogs-size;: + + Home page: + Download: + MD5 sum: &e2fsprogs-md5; + + + + + Expect (&expect-version;) - &expect-size;: + + Home page: + Download: + MD5 sum: &expect-md5; + + + + + File (&file-version;) - &file-size;: + + Home page: + Download: + MD5 sum: &file-md5; + + + File (&file-version;) may no longer be available at the + listed location. The site administrators of the master download + location occasionally remove older versions when new ones are + released. An alternative download location that may have the correct + version available can also be found at: . + + + + + + Findutils (&findutils-version;) - &findutils-size;: + + Home page: + Download: + MD5 sum: &findutils-md5; + + + + + Flex (&flex-version;) - &flex-size;: + + Home page: + Download: + MD5 sum: &flex-md5; + + + + + Gawk (&gawk-version;) - &gawk-size;: + + Home page: + Download: + MD5 sum: &gawk-md5; + + + + + GCC (&gcc-version;) - &gcc-size;: + + Home page: + Download: + MD5 sum: &gcc-md5; + + + + + Gettext (&gettext-version;) - &gettext-size;: + + Home page: + Download: + MD5 sum: &gettext-md5; + + + + + Glibc (&glibc-version;) - &glibc-size;: + + Home page: + Download: + MD5 sum: &glibc-md5; + + + + + Glibc LibIDN add-on (&glibc-libidn-version;) - &glibc-libidn-size;: + + Home page: + Download: + MD5 sum: &glibc-libidn-md5; + + + + + Grep (&grep-version;) - &grep-size;: + + Home page: + Download: + MD5 sum: &grep-md5; + + + + + Groff (&groff-version;) - &groff-size;: + + Home page: + Download: + MD5 sum: &groff-md5; + + + + + GRUB (&grub-version;) - &grub-size;: + + Home page: + Download: + MD5 sum: &grub-md5; + + + + + Gzip (&gzip-version;) - &gzip-size;: + + Home page: + Download: + MD5 sum: &gzip-md5; + + + + + Iana-Etc (&iana-etc-version;) - &iana-etc-size;: + + Home page: + Download: + MD5 sum: &iana-etc-md5; + + + + + Inetutils (&inetutils-version;) - &inetutils-size;: + + Home page: + Download: + MD5 sum: &inetutils-md5; + + + + + IPRoute2 (&iproute2-version;) - &iproute2-size;: + + Home page: + Download: + MD5 sum: &iproute2-md5; + + + + + Kbd (&kbd-version;) - &kbd-size;: + + Home page: + Download: + MD5 sum: &kbd-md5; + + + + + Less (&less-version;) - &less-size;: + + Home page: + Download: + MD5 sum: &less-md5; + + + + + LFS-Bootscripts (&lfs-bootscripts-version;) - &lfs-bootscripts-size;: + + Home page: + Download: + MD5 sum: &lfs-bootscripts-md5; + + + + + Libtool (&libtool-version;) - &libtool-size;: + + Home page: + Download: + MD5 sum: &libtool-md5; + + + + + Linux (&linux-version;) - &linux-size;: + + Home page: + Download: + MD5 sum: &linux-md5; + + + + + Linux-Libc-Headers (&linux-libc-headers-version;) - &linux-libc-headers-size;: + + Home page: + Download: + MD5 sum: &linux-libc-headers-md5; + + + + + M4 (&m4-version;) - &m4-size;: + + Home page: + Download: + MD5 sum: &m4-md5; + + + + + Make (&make-version;) - &make-size;: + + Home page: + Download: + MD5 sum: &make-md5; + + + + + Man-DB (&man-db-version;) - &man-db-size;: + + Home page: + Download: + MD5 sum: &man-db-md5; + + + + + Man-pages (&man-pages-version;) - &man-pages-size;: + + Home page: + Download: + MD5 sum: &man-pages-md5; + + + + + Mktemp (&mktemp-version;) - &mktemp-size;: + + Home page: + Download: + MD5 sum: &mktemp-md5; + + + + + Module-Init-Tools (&module-init-tools-version;) - &module-init-tools-size;: + + Home page: + Download: + MD5 sum: &module-init-tools-md5; + + + + + Ncurses (&ncurses-version;) - &ncurses-size;: + + Home page: + Download: + MD5 sum: &ncurses-md5; + + + + + + + Patch (&patch-version;) - &patch-size;: + + Home page: + Download: + MD5 sum: &patch-md5; + + + + + Perl (&perl-version;) - &perl-size;: + + Home page: + Download: + MD5 sum: &perl-md5; + + + + + Procps (&procps-version;) - &procps-size;: + + Home page: + Download: + MD5 sum: &procps-md5; + + + + + Psmisc (&psmisc-version;) - &psmisc-size;: + + Home page: + Download: + MD5 sum: &psmisc-md5; + + + + + Readline (&readline-version;) - &readline-size;: + + Home page: + Download: + MD5 sum: &readline-md5; + + + + + Sed (&sed-version;) - &sed-size;: + + Home page: + Download: + MD5 sum: &sed-md5; + + + + + Shadow (&shadow-version;) - &shadow-size;: + + Home page: + Download: + MD5 sum: &shadow-md5; + + + Shadow (&shadow-version;) may no longer be available at the + listed location. The site administrators of the master download + location occasionally remove older versions when new ones are released. + An alternative download location that may have the correct version + available can also be found at: . + + + + + + Sysklogd (&sysklogd-version;) - &sysklogd-size;: + + Home page: + Download: + MD5 sum: &sysklogd-md5; + + + + + Sysvinit (&sysvinit-version;) - &sysvinit-size;: + + Home page: + Download: + MD5 sum: &sysvinit-md5; + + + + + Tar (&tar-version;) - &tar-size;: + + Home page: + Download: + MD5 sum: &tar-md5; + + + + + Tcl (&tcl-version;) - &tcl-size;: + + Home page: + Download: + MD5 sum: &tcl-md5; + + + + + Texinfo (&texinfo-version;) - &texinfo-size;: + + Home page: + Download: + MD5 sum: &texinfo-md5; + + + + + Udev (&udev-version;) - &udev-size;: + + Home page: + Download: + MD5 sum: &udev-md5; + + + + + Udev Configuration Tarball - &udev-config-size;: + + Home page: + Download: + MD5 sum: &udev-config-md5; + + + + + Util-linux (&util-linux-version;) - &util-linux-size;: + + Home page: + Download: + MD5 sum: &util-linux-md5; + + + + + Vim (&vim-version;) - &vim-size;: + + Home page: + Download: + MD5 sum: &vim-md5; + + + + + Vim (&vim-lang-version;) language files (optional) - &vim-lang-size;: + + Home page: + Download: + MD5 sum: &vim-lang-md5; + + + + + Zlib (&zlib-version;) - &zlib-size;: + + Home page: + Download: + MD5 sum: &zlib-md5; + + + + + + Total size of these packages: about + + diff --git a/chapter03/patches.xml b/chapter03/patches.xml new file mode 100644 index 000000000..040bb8962 --- /dev/null +++ b/chapter03/patches.xml @@ -0,0 +1,305 @@ + + + %general-entities; +]> + + + + + Needed Patches + + In addition to the packages, several patches are also required. + These patches correct any mistakes in the packages that should be + fixed by the maintainer. The patches also make small modifications to + make the packages easier to work with. The following patches will be + needed to build an LFS system: + + + + + Bash Upstream Fixes Patch - &bash-fixes-patch-size;: + + Download: + MD5 sum: &bash-fixes-patch-md5; + + + + + Bzip2 Bzgrep Security Fixes Patch - &bzip2-bzgrep-patch-size;: + + Download: + MD5 sum: &bzip2-bzgrep-patch-md5; + + + + + Bzip2 Documentation Patch - &bzip2-docs-patch-size;: + + Download: + MD5 sum: &bzip2-docs-patch-md5; + + + + + Coreutils Internationalization Fixes Patch - &coreutils-i18n-patch-size;: + + Download: + MD5 sum: &coreutils-i18n-patch-md5; + + + + + Coreutils Suppress Uptime, Kill, Su Patch - &coreutils-suppress-patch-size;: + + Download: + MD5 sum: &coreutils-suppress-patch-md5; + + + + + Coreutils Uname Patch - &coreutils-uname-patch-size;: + + Download: + MD5 sum: &coreutils-uname-patch-md5; + + + + + Diffutils Internationalization Fixes Patch - &diffutils-i18n-patch-size;: + + Download: + MD5 sum: &diffutils-i18n-patch-md5; + + + + + Expect Spawn Patch - &expect-spawn-patch-size;: + + Download: + MD5 sum: &expect-spawn-patch-md5; + + + + + Gawk Segfault Patch - &gawk-segfault-patch-size;: + + Download: + MD5 sum: &gawk-segfault-patch-md5; + + + + + GCC Specs Patch - &gcc-specs-patch-size;: + + Download: + MD5 sum: &gcc-specs-patch-md5; + + + + + Glibc Linux Types Patch - &glibc-linux_types-patch-size;: + + Download: + MD5 sum: &glibc-linux_types-patch-md5; + + + + + Grep RedHat Fixes Patch - &grep-fixes-patch-size;: + + Download: + MD5 sum: &grep-fixes-patch-md5; + + + + + Groff Debian Patch - &groff-debian-patch-size;: + + Download: + MD5 sum: &groff-debian-patch-md5; + + + + + Gzip Security Patch - &gzip-security_fix-patch-size;: + + Download: + MD5 sum: &gzip-security_fix-patch-md5; + + + + + Inetutils GCC-4.x Fix Patch - &inetutils-gcc4_fixes-patch-size;: + + Download: + MD5 sum: &inetutils-gcc4_fixes-patch-md5; + + + + + Inetutils No-Server-Man-Pages Patch - &inetutils-man_pages-patch-size;: + + Download: + MD5 sum: &inetutils-man_pages-patch-md5; + + + + + Kbd Backspace/Delete Fix Patch - &kbd-backspace-patch-size;: + + Download: + MD5 sum: &kbd-backspace-patch-md5; + + + + + Kbd GCC-4.x Fix Patch - &kbd-gcc4_fixes-patch-size;: + + Download: + MD5 sum: &kbd-gcc4_fixes-patch-md5; + + + + + Linux kernel UTF-8 Composing Patch - &linux-utf8-patch-size;: + + Download: + MD5 sum: &linux-utf8-patch-md5; + + + + + Mktemp Tempfile Patch - &mktemp-tempfile-patch-size;: + + Download: + MD5 sum: &mktemp-tempfile-patch-md5; + + + + + Module-init-tools Patch - &module-init-modprobe-patch-size;: + + Download: + MD5 sum: &module-init-modprobe-patch-md5; + + + + + Ncurses Fixes Patch - &ncurses-fixes-patch-size;: + + Download: + MD5 sum: &ncurses-fixes-patch-md5; + + + + + Perl Libc Patch - &perl-libc-patch-size;: + + Download: + MD5 sum: &perl-libc-patch-md5; + + + + + Readline Upstream Fixes Patch - &readline-fixes-patch-size;: + + Download: + MD5 sum: &readline-fixes-patch-md5; + + + + + Sysklogd 8-Bit Cleanness Patch - &sysklogd-8bit-patch-size;: + + Download: + MD5 sum: &sysklogd-8bit-patch-md5; + + + + + Sysklogd Fixes Patch - &sysklogd-fixes-patch-size;: + + Download: + MD5 sum: &sysklogd-fixes-patch-md5; + + + + + Tar GCC-4.x Fix Patch - &tar-gcc4_fix-patch-size;: + + Download: + MD5 sum: &tar-gcc4_fix-patch-md5; + + + + + Tar Security Fixes Patch - &tar-security_fixes-patch-size;: + + Download: + MD5 sum: &tar-security_fixes-patch-md5; + + + + + Tar Sparse Fix Patch - &tar-sparse_fix-patch-size;: + + Download: + MD5 sum: &tar-sparse_fix-patch-md5; + + + + + Texinfo Multibyte Fixes Patch - &texinfo-multibyte-patch-size;: + + Download: + MD5 sum: &texinfo-multibyte-patch-md5; + + + + + + Texinfo Tempfile Fix Patch - &texinfo-tempfile_fix-patch-size;: + + Download: + MD5 sum: &texinfo-tempfile_fix-patch-md5; + + + + + Util-linux Cramfs Patch - &util-linux-cramfs-patch-size;: + + Download: + MD5 sum: &util-linux-cramfs-patch-md5; + + + + + Vim Upstream Fixes Patch - &vim-fixes-patch-size;: + + Download: + MD5 sum: &vim-fixes-patch-md5; + + + + + Vim Man Directories Patch - &vim-mandir-patch-size;: + + Download: + MD5 sum: &vim-mandir-patch-md5; + + + + + + Total size of these patches: about + + In addition to the above required patches, there exist a number of + optional patches created by the LFS community. These optional patches + solve minor problems or enable functionality that is not enabled by + default. Feel free to peruse the patches database located at + and acquire any additional + patches to suit the system needs. + + diff --git a/chapter04/aboutlfs.xml b/chapter04/aboutlfs.xml new file mode 100644 index 000000000..14aec3126 --- /dev/null +++ b/chapter04/aboutlfs.xml @@ -0,0 +1,39 @@ + + + %general-entities; +]> + + + + + About $LFS + + Throughout this book, the environment variable LFS will + be used several times. It is paramount that this variable is always defined. + It should be set to the mount point chosen for the LFS partition. + Check that the LFS variable is set up properly with: + +echo $LFS + + Make sure the output shows the path to the LFS partition's mount + point, which is /mnt/lfs if the + provided example was followed. If the output is incorrect, the + variable can be set with: + +export LFS=/mnt/lfs + + Having this variable set is beneficial in that commands such as + mkdir $LFS/tools can be typed literally. The shell + will automatically replace $LFS with + /mnt/lfs (or whatever the variable was set to) when it + processes the command line. + + Do not forget to check that $LFS is set whenever + you leave and reenter the current working environment (as when doing a + su to root + or another user). + + + diff --git a/chapter04/aboutsbus.xml b/chapter04/aboutsbus.xml new file mode 100644 index 000000000..e56f90143 --- /dev/null +++ b/chapter04/aboutsbus.xml @@ -0,0 +1,45 @@ + + + %general-entities; +]> + + + + + About SBUs + + Many people would like to know beforehand approximately how long + it takes to compile and install each package. Because Linux From + Scratch can be built on many different systems, it is impossible to + provide accurate time estimates. The biggest package (Glibc) will + take approximately 20 minutes on the fastest systems, but could take + up to three days on slower systems! Instead of providing actual times, + the Standard Build Unit (SBU) measure will be + used instead. + + The SBU measure works as follows. The first package to be compiled + from this book is Binutils in . The + time it takes to compile this package is what will be referred to as the + Standard Build Unit or SBU. All other compile times will be expressed relative + to this time. + + For example, consider a package whose compilation time is 4.5 + SBUs. This means that if a system took 10 minutes to compile and + install the first pass of Binutils, it will take + approximately 45 minutes to build this example package. + Fortunately, most build times are shorter than the one for Binutils. + + In general, SBUs are not entirely accurate because they depend on many + factors, including the host system's version of GCC. Note that on Symmetric + Multi-Processor (SMP)-based machines, SBUs are even less accurate. They are + provided here to give an estimate of how long it might take to install a + package, but the numbers can vary by as much as dozens of minutes in some + cases. + + To view actual timings for a number of specific machines, we recommend + The LinuxFromScratch SBU Home Page at . + + + diff --git a/chapter04/abouttestsuites.xml b/chapter04/abouttestsuites.xml new file mode 100644 index 000000000..1a08bedea --- /dev/null +++ b/chapter04/abouttestsuites.xml @@ -0,0 +1,52 @@ + + + %general-entities; +]> + + + + + About the Test Suites + + Most packages provide a test suite. Running the test suite for a + newly built package is a good idea because it can provide a sanity + check indicating that everything compiled correctly. A test suite + that passes its set of checks usually proves that the package is + functioning as the developer intended. It does not, however, guarantee + that the package is totally bug free. + + Some test suites are more important than others. For example, + the test suites for the core toolchain packages—GCC, Binutils, and + Glibc—are of the utmost importance due to their central role in a + properly functioning system. The test suites for GCC and Glibc can + take a very long time to complete, especially on slower hardware, but + are strongly recommended. + + + Experience has shown that there is little to be gained from running + the test suites in . There can be + no escaping the fact that the host system always exerts some influence on + the tests in that chapter, often causing inexplicable failures. Because + the tools built in are temporary + and eventually discarded, we do not recommend running the test suites in + for the average reader. The + instructions for running those test suites are provided for the benefit of + testers and developers, but they are strictly optional. + + + A common issue with running the test suites for Binutils and GCC + is running out of pseudo terminals (PTYs). This can result in a high + number of failing tests. This may happen for several reasons, but the + most likely cause is that the host system does not have the + devpts file system set up + correctly. This issue is discussed in greater detail in . + + Sometimes package test suites will fail, but for reasons which the + developers are aware of and have deemed non-critical. Consult the logs located + at to verify whether or not these failures are + expected. This site is valid for all tests throughout this book. + + diff --git a/chapter04/addinguser.xml b/chapter04/addinguser.xml new file mode 100644 index 000000000..5a1a2d3fa --- /dev/null +++ b/chapter04/addinguser.xml @@ -0,0 +1,102 @@ + + + %general-entities; +]> + + + + + Adding the LFS User + + When logged in as user root, + making a single mistake can damage or destroy a system. Therefore, we + recommend building the packages in this chapter as an unprivileged user. + You could use your own user name, but to make it easier to set up a clean + working environment, create a new user called lfs as a member of a new group (also named + lfs) and use this user during + the installation process. As root, + issue the following commands to add the new user: + +groupadd lfs +useradd -s /bin/bash -g lfs -m -k /dev/null lfs + + + The meaning of the command line options: + + + -s /bin/bash + + This makes bash the default shell for user + lfs. + + + + + -g lfs + + This option adds user lfs + to group lfs. + + + + + -m + + This creates a home directory for lfs. + + + + + -k /dev/null + + This parameter prevents possible copying of files from a skeleton + directory (default is /etc/skel) + by changing the input location to the special null device. + + + + + lfs + + This is the actual name for the created group and user. + + + + + + To log in as lfs (as opposed + to switching to user lfs when logged + in as root, which does not require + the lfs user to have a password), + give lfs a password: + +passwd lfs + + Grant lfs full access to + $LFS/tools by making + lfs the directory owner: + +chown -v lfs $LFS/tools + + If a separate working directory was created as suggested, give + user lfs ownership of this + directory: + +chown -v lfs $LFS/sources + + Next, login as user lfs. + This can be done via a virtual console, through a display manager, or with + the following substitute user command: + +su - lfs + + The - instructs + su to start a login shell as opposed to a non-login shell. + The difference between these two types of shells can be found in detail in + bash(1) and info bash. + + diff --git a/chapter04/chapter04.xml b/chapter04/chapter04.xml new file mode 100644 index 000000000..b5ef385c6 --- /dev/null +++ b/chapter04/chapter04.xml @@ -0,0 +1,21 @@ + + + %general-entities; +]> + + + + + + Final Preparations + + + + + + + + + diff --git a/chapter04/creatingtoolsdir.xml b/chapter04/creatingtoolsdir.xml new file mode 100644 index 000000000..50fa9aa25 --- /dev/null +++ b/chapter04/creatingtoolsdir.xml @@ -0,0 +1,48 @@ + + + %general-entities; +]> + + + + + Creating the $LFS/tools Directory + + All programs compiled in + will be installed under $LFS/tools + to keep them separate from the programs compiled in . The programs compiled here are + temporary tools and will not be a part of the final LFS system. By keeping + these programs in a separate directory, they can easily be discarded later + after their use. This also prevents these programs from ending up in the + host production directories (easy to do by accident in ). + + Create the required directory by running the following as + root: + +mkdir -v $LFS/tools + + The next step is to create a /tools + symlink on the host system. This will point to the newly-created directory on + the LFS partition. Run this command as root as well: + +ln -sv $LFS/tools / + + + The above command is correct. The ln command + has a few syntactic variations, so be sure to check + info coreutils ln and ln(1) + before reporting what you may think is an error. + + + The created symlink enables the toolchain to be compiled so that it + always refers to /tools, meaning + that the compiler, assembler, and linker will work both in this chapter + (when we are still using some tools from the host) and in the next (when + we are chrooted to the LFS partition). + + diff --git a/chapter04/settingenviron.xml b/chapter04/settingenviron.xml new file mode 100644 index 000000000..561e30381 --- /dev/null +++ b/chapter04/settingenviron.xml @@ -0,0 +1,91 @@ + + + %general-entities; +]> + + + + + Setting Up the Environment + + Set up a good working environment by creating two new startup files + for the bash shell. While logged in as user + lfs, issue the following command + to create a new .bash_profile: + +cat > ~/.bash_profile << "EOF" +exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash +EOF + + When logged on as user lfs, + the initial shell is usually a login shell which reads + the /etc/profile of the host (probably containing some + settings and environment variables) and then .bash_profile. + The exec env -i.../bin/bash command in the + .bash_profile file replaces the running shell with a new + one with a completely empty environment, except for the HOME, + TERM, and PS1 variables. This ensures that no + unwanted and potentially hazardous environment variables from the host system + leak into the build environment. The technique used here achieves the goal of + ensuring a clean environment. + + The new instance of the shell is a non-login + shell, which does not read the /etc/profile or + .bash_profile files, but rather reads the + .bashrc file instead. Create the + .bashrc file now: + +cat > ~/.bashrc << "EOF" +set +h +umask 022 +LFS=/mnt/lfs +LC_ALL=POSIX +PATH=/tools/bin:/bin:/usr/bin +export LFS LC_ALL PATH +EOF + + The set +h command turns off + bash's hash function. Hashing is ordinarily a useful + feature—bash uses a hash table to remember the + full path of executable files to avoid searching the PATH + time and again to find the same executable. However, the new tools should + be used as soon as they are installed. By switching off the hash function, + the shell will always search the PATH when a program is to + be run. As such, the shell will find the newly compiled tools in + $LFS/tools as soon as they are + available without remembering a previous version of the same program in a + different location. + + Setting the user file-creation mask (umask) to 022 ensures that newly + created files and directories are only writable by their owner, but are + readable and executable by anyone (assuming default modes are used by the + open(2) system call, new files will end up with permission + mode 644 and directories with mode 755). + + The LFS variable should be set to the chosen mount + point. + + The LC_ALL variable controls the localization of certain + programs, making their messages follow the conventions of a specified country. + If the host system uses a version of Glibc older than 2.2.4, having + LC_ALL set to something other than POSIX or + C (during this chapter) may cause issues if you exit the chroot + environment and wish to return later. Setting LC_ALL to + POSIX or C (the two are equivalent) ensures that + everything will work as expected in the chroot environment. + + By putting /tools/bin ahead of the + standard PATH, all the programs installed in are picked up by the shell immediately after + their installation. This, combined with turning off hashing, limits the risk + that old programs are used from the host when the same programs are available in + the chapter 5 environment. + + Finally, to have the environment fully prepared for building the + temporary tools, source the just-created user profile: + +source ~/.bash_profile + + diff --git a/chapter05/adjusting.xml b/chapter05/adjusting.xml new file mode 100644 index 000000000..a3d1e9d14 --- /dev/null +++ b/chapter05/adjusting.xml @@ -0,0 +1,126 @@ + + + %general-entities; +]> + + + + + Adjusting the Toolchain + + Now that the temporary C libraries have been installed, all + tools compiled in the rest of this chapter should be linked against + these libraries. In order to accomplish this, the linker and the + compiler's specs file need to be adjusted. + + The linker, adjusted at the end of the first pass of Binutils, needs + to be renamed so that it can be properly found and used. First, backup the + original linker, then replace it with the adjusted linker. We'll also + create a link to its counterpart in + /tools/$(gcc -dumpmachine)/bin + +mv -v /tools/bin/{ld,ld-old} +mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} +mv -v /tools/bin/{ld-new,ld} +ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld + + From this point onwards, everything will link only against the + libraries in /tools/lib. + + The next task is to point GCC to the new dynamic linker. This is done by + dumping GCC's specs file to a location where GCC will look for it + by default. A simple sed substitution then alters the + dynamic linker that GCC will use: + + +SPECFILE=`dirname $(gcc -print-libgcc-file-name)`/specs && +gcc -dumpspecs > $SPECFILE && +sed 's@^/lib/ld-linux.so.2@/tools&@g' $SPECFILE > tempspecfile && +mv -vf tempspecfile $SPECFILE && +unset SPECFILE + + It is recommended that the above command be copy-and-pasted in order to + ensure accuracy. Alternatively, the specs file can be edited by hand. This is + done by replacing every occurrence of /lib/ld-linux.so.2 with + /tools/lib/ld-linux.so.2 + + Be sure to visually inspect the specs file in order to verify the + intended changes have been made. + + + If working on a platform where the name of the dynamic linker is + something other than ld-linux.so.2, + replace ld-linux.so.2 with the name of the platform's + dynamic linker in the above commands. Refer back to if necessary. + + + During the build process, GCC runs a script + (fixincludes) that scans the system for header files + that may need to be fixed (they might contain syntax errors, for example), + and installs the fixed versions in a private include directory. There is a + possibility that, as a result of this process, some header files from the + host system have found their way into GCC's private include directory. As + the rest of this chapter only requires the headers from GCC and Glibc, + which have both been installed at this point, any fixed + headers can safely be removed. This helps to avoid any host headers + polluting the build environment. Run the following commands to remove the + header files in GCC's private include directory (you may find it easier to + copy and paste these commands, rather than typing them by hand, due to + their length): + + +GCC_INCLUDEDIR=`dirname $(gcc -print-libgcc-file-name)`/include && +find ${GCC_INCLUDEDIR}/* -maxdepth 0 -xtype d -exec rm -rvf '{}' \; && +rm -vf `grep -l "DO NOT EDIT THIS FILE" ${GCC_INCLUDEDIR}/*` && +unset GCC_INCLUDEDIR + + + 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: + +echo 'main(){}' > dummy.c +cc dummy.c +readelf -l a.out | grep ': /tools' + + If everything is working correctly, there should be no errors, + and the output of the last command will be of the form: + +[Requesting program interpreter: + /tools/lib/ld-linux.so.2] + + Note that /tools/lib + appears as the prefix of the dynamic linker. + + 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. First, perform the sanity check again, using + gcc instead of cc. If this works, + then the /tools/bin/cc symlink is + missing. Revisit and install + the symlink. Next, ensure that the PATH is correct. This + can be checked by running echo $PATH and verifying that + /tools/bin is at the head of the + list. If the PATH is wrong it could mean that you are not + logged in as user lfs or that + something went wrong back in Another option is that something may have gone wrong with the + specs file amendment above. In this case, redo the specs file amendment, + being careful to copy-and-paste the commands. + + Once all is well, clean up the test files: + +rm -v dummy.c a.out + + + + Building TCL in the next section will serve as an additional check that + the toolchain has been built properly. If TCL fails to build, it is an + indication that something has gone wrong with the Binutils, GCC, or Glibc + installation, but not with TCL itself. + + diff --git a/chapter05/bash.xml b/chapter05/bash.xml new file mode 100644 index 000000000..b4c29a99c --- /dev/null +++ b/chapter05/bash.xml @@ -0,0 +1,86 @@ + + + %general-entities; +]> + + + + + Bash-&bash-version; + + + Bash + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/bash.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bash-ch5-sbu;</seg> + <seg>&bash-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bash + + Prepare Bash for compilation: + +./configure --prefix=/tools --without-bash-malloc + + + The meaning of the configure option: + + + --without-bash-malloc + + 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. + + + + + + Compile the package: + +make + + To test the results, issue: + make tests. + + Install the package: + +make install + + Make a link for the programs that use sh for + a shell: + +ln -vs bash /tools/bin/sh + + + + + + + <para>Details on this package are located in + <xref linkend="contents-bash" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/binutils-pass1.xml b/chapter05/binutils-pass1.xml new file mode 100644 index 000000000..3541aa055 --- /dev/null +++ b/chapter05/binutils-pass1.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-binutils-pass1" role="wrap"> + <?dbhtml filename="binutils-pass1.html"?> + + <title>Binutils-&binutils-version; - Pass 1 + + + Binutils + tools, pass 1 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/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 Binutils + + 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 outside of the + source directory in a dedicated build directory: + +mkdir -v ../binutils-build +cd ../binutils-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 three commands in a time + command like this: time { ./configure ... && make + && make install; }. + + + Now prepare Binutils for compilation: + +../binutils-&binutils-version;/configure --prefix=/tools --disable-nls + + + The meaning of the configure options: + + + --prefix=/tools + + This tells the configure script to prepare to install the + Binutils programs in the /tools + directory. + + + + + --disable-nls + + This disables internationalization as i18n is not needed for the + temporary tools. + + + + + + Continue with compiling the package: + +make + + Compilation is now complete. Ordinarily we would now run the + test suite, but at this early stage the test suite framework (Tcl, + Expect, and DejaGNU) is not yet in place. The benefits of running the + tests at this point are minimal since the programs from this + first pass will soon be replaced by those from the second. + + Install the package: + +make install + + Next, prepare the linker for the Adjusting phase + later on: + +make -C ld clean +make -C ld LIB_PATH=/tools/lib +cp -v ld/ld-new /tools/bin + + + The meaning of the make parameters: + + + -C ld clean + + This tells the make program to remove all compiled + files in the ld + subdirectory. + + + + + -C ld LIB_PATH=/tools/lib + + This option rebuilds everything in the ld subdirectory. Specifying the + LIB_PATH Makefile variable on the command line + allows us to override the default value and point it to the + temporary tools location. The value of this variable specifies + the linker's default library search path. This preparation is + used later in the chapter. + + + + + + + + + + + <para>Details on this package are located in + <xref linkend="contents-binutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/binutils-pass2.xml b/chapter05/binutils-pass2.xml new file mode 100644 index 000000000..8d5397243 --- /dev/null +++ b/chapter05/binutils-pass2.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-binutils-pass2" role="wrap"> + <?dbhtml filename="binutils-pass2.html"?> + + <title>Binutils-&binutils-version; - Pass 2 + + + Binutils + tools, pass 2 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/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>Re-installation of Binutils + + Create a separate build directory again: + +mkdir -v ../binutils-build +cd ../binutils-build + + Prepare Binutils for compilation: + +../binutils-&binutils-version;/configure --prefix=/tools \ + --disable-nls --with-lib-path=/tools/lib + + + The meaning of the new configure options: + + + --with-lib-path=/tools/lib + + This tells the configure script to specify the library + search path during the compilation of Binutils, resulting in + /tools/lib being passed + to the linker. This prevents the linker from searching through + library directories on the host. + + + + + + Compile the package: + +make + + Compilation is now complete. As discussed earlier, running the + test suite is not mandatory for the temporary tools here in this + chapter. To run the Binutils test suite anyway, issue the following + command: + +make check + + Install the package: + +make install + + Now prepare the linker for the Re-adjusting phase in + the next chapter: + +make -C ld clean +make -C ld LIB_PATH=/usr/lib:/lib +cp -v ld/ld-new /tools/bin + + + + + + + + <para>Details on this package are located in + <xref linkend="contents-binutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/bison.xml b/chapter05/bison.xml new file mode 100644 index 000000000..9e84df2b3 --- /dev/null +++ b/chapter05/bison.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-bison" role="wrap"> + <?dbhtml filename="bison.html"?> + + <title>Bison-&bison-version; + + + Bison + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/bison.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bison-ch5-sbu;</seg> + <seg>&bison-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bison + + Prepare Bison for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-bison" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/bzip2.xml b/chapter05/bzip2.xml new file mode 100644 index 000000000..f08b900cf --- /dev/null +++ b/chapter05/bzip2.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-bzip2" role="wrap"> + <?dbhtml filename="bzip2.html"?> + + <title>Bzip2-&bzip2-version; + + + Bzip2 + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/bzip2.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bzip2-ch5-sbu;</seg> + <seg>&bzip2-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bzip2 + + The Bzip2 package does not contain a configure + script. Compile and test it with: + +make + + Install the package: + +make PREFIX=/tools install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-bzip2" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/changingowner.xml b/chapter05/changingowner.xml new file mode 100644 index 000000000..c3d6306cc --- /dev/null +++ b/chapter05/changingowner.xml @@ -0,0 +1,46 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-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 $LFS/tools directory + is owned by the user lfs, a user + that exists only on the host system. If the $LFS/tools directory is kept as is, the files are + owned by a user ID without a corresponding account. This is dangerous because + a user account created later could get this same user ID and would own the + $LFS/tools directory and all the files + therein, 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/tools directory to + user root by running the following + command: + +chown -R root:root $LFS/tools + + Although the $LFS/tools directory + can be deleted once the LFS system has been finished, it can be retained to build + additional LFS systems of the same book version. How best + to backup $LFS/tools is a matter of + personal preference and is left as an exercise for the reader. + + diff --git a/chapter05/chapter05.xml b/chapter05/chapter05.xml new file mode 100644 index 000000000..df3d854bb --- /dev/null +++ b/chapter05/chapter05.xml @@ -0,0 +1,47 @@ + + + %general-entities; +]> + + + + + + Constructing a Temporary System + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chapter05/coreutils.xml b/chapter05/coreutils.xml new file mode 100644 index 000000000..dff10525a --- /dev/null +++ b/chapter05/coreutils.xml @@ -0,0 +1,69 @@ + + + %general-entities; +]> + + + + + Coreutils-&coreutils-version; + + + Coreutils + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/coreutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&coreutils-ch5-sbu;</seg> + <seg>&coreutils-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Coreutils + + Prepare Coreutils for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make RUN_EXPENSIVE_TESTS=yes check. The + RUN_EXPENSIVE_TESTS=yes parameter tells the + test suite to run several additional tests that are considered + relatively expensive (in terms of CPU power and memory usage) on some + platforms, but generally are not a problem on Linux. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-coreutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/dejagnu.xml b/chapter05/dejagnu.xml new file mode 100644 index 000000000..9cbbf7d49 --- /dev/null +++ b/chapter05/dejagnu.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-dejagnu" role="wrap"> + <?dbhtml filename="dejagnu.html"?> + + <title>DejaGNU-&dejagnu-version; + + + DejaGNU + + + + + + <para>The DejaGNU package contains a framework for testing other + programs.</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=/tools + + Build and install the package: + +make install + + 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/chapter05/diffutils.xml b/chapter05/diffutils.xml new file mode 100644 index 000000000..1d1fb9806 --- /dev/null +++ b/chapter05/diffutils.xml @@ -0,0 +1,64 @@ + + + %general-entities; +]> + + + + + Diffutils-&diffutils-version; + + + Diffutils + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/diffutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&diffutils-ch5-sbu;</seg> + <seg>&diffutils-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Diffutils + + Prepare Diffutils for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-diffutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/expect.xml b/chapter05/expect.xml new file mode 100644 index 000000000..237996ba7 --- /dev/null +++ b/chapter05/expect.xml @@ -0,0 +1,155 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-expect" role="wrap"> + <?dbhtml filename="expect.html"?> + + <title>Expect-&expect-version; + + + Expect + + + + + + <para>The Expect package contains a program for carrying out scripted + dialogues with other interactive programs.</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 + + First, fix a bug that can result in false failures during the GCC test + suite run: + +patch -Np1 -i ../&expect-spawn-patch; + + Now prepare Expect for compilation: + +./configure --prefix=/tools --with-tcl=/tools/lib \ + --with-tclinclude=/tools/include --with-x=no + + + The meaning of the configure options: + + + --with-tcl=/tools/lib + + This ensures that the configure script finds the Tcl + installation in the temporary tools location instead of possibly + locating an existing one on the host system. + + + + + --with-tclinclude=/tools/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. + + + + + --with-x=no + + This tells the configure script not to search for Tk (the + Tcl GUI component) or the X Window System libraries, both of which + may reside on the host system but will not exist in the temporary + environment. + + + + + + Build the package: + +make + + To test the results, issue: make test. + Note that the Expect test suite is known to experience failures under + certain host conditions that are not within our control. Therefore, + test suite failures here are not surprising and are not considered + critical. + + Install the package: + +make SCRIPTS="" install + + + The meaning of the make parameter: + + + SCRIPTS="" + + This prevents installation of the supplementary Expect + scripts, which are not needed. + + + + + + + + + Contents of Expect + + + Installed program + Installed library + + + expect + libexpect-&expect-lib-version;.a + + + + + Short Descriptions + + + + + expect + + Communicates with other interactive programs according + to a script + + expect + + + + + + libexpect-&expect-lib-version;.a + + 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/chapter05/findutils.xml b/chapter05/findutils.xml new file mode 100644 index 000000000..db160ffc8 --- /dev/null +++ b/chapter05/findutils.xml @@ -0,0 +1,65 @@ + + + %general-entities; +]> + + + + + Findutils-&findutils-version; + + + Findutils + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/findutils.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&findutils-ch5-sbu;</seg> + <seg>&findutils-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Findutils + + Prepare Findutils for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-findutils" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/flex.xml b/chapter05/flex.xml new file mode 100644 index 000000000..02c4d6ab3 --- /dev/null +++ b/chapter05/flex.xml @@ -0,0 +1,77 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-flex" role="wrap"> + <?dbhtml filename="flex.html"?> + + <title>Flex-&flex-version; + + + Flex + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/flex.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&flex-ch5-sbu;</seg> + <seg>&flex-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Flex + + Flex contains several known bugs. These can be fixed with the + following patch: + +patch -Np1 -i ../&flex-fixes-patch; + + The GNU autotools will detect that the Flex source code has been + modified by the previous patch and tries to update the man page + accordingly. This does not work on many systems, and the default page is + fine, so make sure it does not get regenerated: + +touch doc/flex.1 + + Now prepare Flex for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-flex" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/gawk.xml b/chapter05/gawk.xml new file mode 100644 index 000000000..8a3ba4d92 --- /dev/null +++ b/chapter05/gawk.xml @@ -0,0 +1,75 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gawk" role="wrap"> + <?dbhtml filename="gawk.html"?> + + <title>Gawk-&gawk-version; + + + Gawk + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/gawk.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gawk-ch5-sbu;</seg> + <seg>&gawk-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gawk + + Prepare Gawk for compilation: + +./configure --prefix=/tools + + Due to a bug in the configure script, Gawk fails + to detect certain aspects of locale support in Glibc. This bug leads to, + e.g., Gettext testsuite failures. Work around this issue by appending the + missing macro definitions to config.h: + +cat >>config.h <<"EOF" +#define HAVE_LANGINFO_CODESET 1 +#define HAVE_LC_MESSAGES 1 +EOF + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gawk" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/gcc-pass1.xml b/chapter05/gcc-pass1.xml new file mode 100644 index 000000000..1e35da182 --- /dev/null +++ b/chapter05/gcc-pass1.xml @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gcc-pass1" role="wrap"> + <?dbhtml filename="gcc-pass1.html"?> + + <title>GCC-&gcc-version; - Pass 1 + + + GCC + tools, pass 1 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/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 GCC + + The GCC documentation recommends building GCC outside of the + source directory in a dedicated build directory: + +mkdir -v ../gcc-build +cd ../gcc-build + + Prepare GCC for compilation: + +../gcc-&gcc-version;/configure --prefix=/tools \ + --with-local-prefix=/tools --disable-nls --enable-shared \ + --enable-languages=c + + + The meaning of the configure options: + + + --with-local-prefix=/tools + + The purpose of this switch is to remove /usr/local/include from + gcc's include search path. This is not + absolutely essential, however, it helps to minimize the + influence of the host system. + + + + + --enable-shared + + This switch allows the building of libgcc_s.so.1 and + libgcc_eh.a. + Having libgcc_eh.a + available ensures that the configure script for Glibc (the + next package we compile) produces the proper results. + + + + + --enable-languages=c + + This option ensures that only the C compiler is built. + + + + + + Continue with compiling the package: + +make bootstrap + + + The meaning of the make parameter: + + + bootstrap + + This target does not just compile GCC, but compiles it + several times. It uses the programs compiled in a first round + to compile itself a second time, and then again a third time. + It then compares these second and third compiles to make sure + it can reproduce itself flawlessly. This also implies that it + was compiled correctly. + + + + + + Compilation is now complete. At this point, the test suite would + normally be run, but, as mentioned before, the test suite framework is + not in place yet. The benefits of running the tests at this point + are minimal since the programs from this first pass will soon be + replaced. + + Install the package: + +make 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 -vs gcc /tools/bin/cc + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/gcc-pass2.xml b/chapter05/gcc-pass2.xml new file mode 100644 index 000000000..451cd5424 --- /dev/null +++ b/chapter05/gcc-pass2.xml @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gcc-pass2" role="wrap"> + <?dbhtml filename="gcc-pass2.html"?> + + <title>GCC-&gcc-version; - Pass 2 + + + GCC + tools, pass 2 + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/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>Re-installation of GCC + + The tools required to test GCC and Binutils—Tcl, Expect + and DejaGNU—are installed now. GCC and Binutils can now be + rebuilt, linking them against the new Glibc and testing them properly + (if running the test suites in this chapter). Please note that these + test suites are highly dependent on properly functioning PTYs which + are provided by the host. PTYs are most commonly implemented via the + devpts file system. Check + to see if the host system is set up correctly in this regard by + performing a quick test: + +expect -c "spawn ls" + + The response might be: + +The system has no more ptys. +Ask your system administrator to create more. + + If the above message is received, the host does not have its PTYs + set up properly. In this case, there is no point in running the test + suites for GCC and Binutils until this issue is resolved. Please consult + the LFS FAQ at for more + information on how to get PTYs working. + + As previously explained in , + under normal circumstances the GCC fixincludes script + is run in order to fix potentially broken header files. As GCC-&gcc-version; + and Glibc-&glibc-version; have already been installed at this point, and + their respective header files are known to not require fixing, the + fixincludes script is not required. As mentioned + previously, the script may in fact pollute the build environment by + installing fixed headers from the host system into GCC's private include + directory. The running of the fixincludes script can + be suppressed by issuing the following commands: + +cp -v gcc/Makefile.in{,.orig} && +sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig > gcc/Makefile.in + + The bootstrap build performed in + built GCC with the compiler flag. + Non-bootstrap builds omit this flag by default, so apply the following + sed to use it in order to ensure consistent compiler + builds. + +cp -v gcc/Makefile.in{,.tmp} && +sed 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in.tmp \ + > gcc/Makefile.in + + Apply the following patch to change the location of GCC's default + dynamiclinker (typically ld-linux.so.2): + +patch -Np1 -i ../&gcc-specs-patch; + + The above patch also removes /usr/include from GCC's include search path. + Patching now rather than adjusting the specs file after installation + ensures that the new dynamic linker is used during the actual build of + GCC. That is, all of the binaries created during the build will link + against the new Glibc. + + + The above patch is critical in ensuring a successful overall + build. Do not forget to apply it. + + + Create a separate build directory again: + +mkdir -v ../gcc-build +cd ../gcc-build + + Before starting to build GCC, remember to unset any environment + variables that override the default optimization flags. + + Now prepare GCC for compilation: + +../gcc-&gcc-version;/configure --prefix=/tools \ + --with-local-prefix=/tools --enable-clocale=gnu \ + --enable-shared --enable-threads=posix \ + --enable-__cxa_atexit --enable-languages=c,c++ \ + --disable-libstdcxx-pch + + + The meaning of the new configure options: + + + --enable-clocale=gnu + + This option ensures the correct locale model is selected + for the C++ libraries under all circumstances. If the configure + script finds the de_DE locale installed, + it will select the correct gnu locale model. However, if the + de_DE locale is not installed, there is the + risk of building Application Binary Interface (ABI)-incompatible + C++ libraries because the incorrect generic locale model may be + selected. + + + + + --enable-threads=posix + + This enables C++ exception handling for multi-threaded code. + + + + + --enable-__cxa_atexit + + This option allows use of __cxa_atexit, + rather than atexit, to register C++ destructors + for local statics and global objects. This option is essential for + fully standards-compliant handling of destructors. It also affects + the C++ ABI, and therefore results in C++ shared libraries and C++ + programs that are interoperable with other Linux distributions. + + + + + --enable-languages=c,c++ + + This option ensures that both the C and C++ compilers are + built. + + + + + --disable-libstdcxx-pch + + Do not build the pre-compiled header (PCH) for + libstdc++. It takes up a + lot of space, and we have no use for it. + + + + + + Compile the package: + +make + + There is no need to use the bootstrap target + now because the compiler being used to compile this GCC was built from + the exact same version of the GCC sources used earlier. + + Compilation is now complete. As previously mentioned, running the test + suites for the temporary tools compiled in this chapter is not mandatory. + To run the GCC test suite anyway, use the following command: + +make -k check + + The -k flag is used to make the test suite run + through to completion and not stop at the first failure. The GCC test + suite is very comprehensive and is almost guaranteed to generate a few + failures. + + For a discussion of test failures that are of particular + importance, please see + + Install the package: + +make install + + + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gcc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/gettext.xml b/chapter05/gettext.xml new file mode 100644 index 000000000..6d5d89823 --- /dev/null +++ b/chapter05/gettext.xml @@ -0,0 +1,85 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gettext" role="wrap"> + <?dbhtml filename="gettext.html"?> + + <title>Gettext-&gettext-version; + + + Gettext + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/gettext.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gettext-ch5-sbu;</seg> + <seg>&gettext-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gettext + + For our temporary set of tools, we only need to build and install + one binary from Gettext. + + Prepare Gettext for compilation: + +cd gettext-tools +./configure --prefix=/tools --disable-shared + + + The meaning of the configure option: + + + --disable-shared + + We do not need to install any of the shared Gettext libraries at + this time, therefore there is no need to build them. + + + + + + Compile the package: + +make -C lib +make -C src msgfmt + + As only one binary has been compiled, it is not possible to run the + testsuite without compiling additional support libraries from the Gettext + package. It is therefore not recommended to attempt to run the testsuite at + this stage. + + Install the msgfmt binary: + +cp -v src/msgfmt /tools/bin + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gettext" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/glibc.xml b/chapter05/glibc.xml new file mode 100644 index 000000000..a251b0e86 --- /dev/null +++ b/chapter05/glibc.xml @@ -0,0 +1,202 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-glibc" role="wrap"> + <?dbhtml filename="glibc.html"?> + + <title>Glibc-&glibc-version; + + + Glibc + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/glibc.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&glibc-ch5-sbu;</seg> + <seg>&glibc-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Glibc + + The Glibc documentation recommends building Glibc outside of the source + directory in a dedicated build directory: + +mkdir -v ../glibc-build +cd ../glibc-build + + Next, prepare Glibc for compilation: + +../glibc-&glibc-version;/configure --prefix=/tools \ + --disable-profile --enable-add-ons \ + --enable-kernel=2.6.0 --with-binutils=/tools/bin \ + --without-gd --with-headers=/tools/include \ + --without-selinux + + + The meaning of the configure options: + + + --disable-profile + + This builds the libraries without profiling information. Omit + this option if profiling on the temporary tools is necessary. + + + + + --enable-add-ons + + This tells Glibc to use the NPTL add-on as its threading + library. + + + + + --enable-kernel=2.6.0 + + This tells Glibc to compile the library with support + for 2.6.x Linux kernels. + + + + + --with-binutils=/tools/bin + + While not required, this switch ensures that there are + no errors pertaining to which Binutils programs get used during the + Glibc build. + + + + + --without-gd + + This prevents the build of the memusagestat + program, which insists on linking against the host's libraries + (libgd, libpng, libz, etc.). + + + + + --with-headers=/tools/include + + This tells Glibc to compile itself against the headers recently + installed to the tools directory, so that it knows exactly what + features the kernel has and can optimize itself accordingly. + + + + + --without-selinux + + When building from hosts that include SELinux functionality + (e.g., Fedora Core 3), Glibc will build with support for SELinux. + As the LFS tools environment does not contain support for SELinux, a + Glibc compiled with such support will fail to operate correctly. + + + + + + During this stage the following warning might appear: + +
+configure: WARNING: +*** These auxiliary programs are missing or +*** incompatible versions: msgfmt +*** some features will be disabled. +*** Check the INSTALL file for required versions. +
+ + The missing or incompatible msgfmt program is + generally harmless, but it can sometimes cause issues when running the + test suite. This msgfmt program is part of the + Gettext package which the host distribution should provide. If + msgfmt is present but deemed incompatible, upgrade + the host system's Gettext package or continue without it and see if + the test suite runs without problems regardless. + + Compile the package: + +make + + Compilation is now complete. As mentioned earlier, running the + test suites for the temporary tools installed in this chapter is not + mandatory. To run the Glibc test suite (if desired), the following + command will do so: + +make check + + For a discussion of test failures that are of particular + importance, please see + + In this chapter, some tests can be adversely affected by + existing tools or environmental issues on the host system. Glibc test + suite failures in this chapter are typically not worrisome. The Glibc + installed in is the one that + will ultimately end up being used, so that is the one that needs to pass + most tests (even in , some + failures could still occur, for example, with the math tests). + + When experiencing a failure, make a note of it, then continue by + reissuing the make check command. The test suite + should pick up where it left off and continue. This stop-start sequence + can be circumvented by issuing a make -k check command. + If using this option, be sure to log the output so that the log file can + be examined for failures later. + + The install stage of Glibc will issue a harmless warning at the + end about the absence of /tools/etc/ld.so.conf. + Prevent this warning with: + +mkdir -v /tools/etc +touch /tools/etc/ld.so.conf + + Install the package: + +make install + + Different countries and cultures have varying conventions for + how to communicate. These conventions range from the format for + representing dates and times to more complex issues, such as the + language spoken. The internationalization of GNU + programs works by locale. + + + If the test suites are not being run in this chapter (as per + the recommendation), there is no need to install the locales now. + The appropriate locales will be installed in the next chapter. + To install the Glibc locales anyway, use instructions from + + + +
+ + + + + <para>Details on this package are located in + <xref linkend="contents-glibc" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/grep.xml b/chapter05/grep.xml new file mode 100644 index 000000000..9683bd464 --- /dev/null +++ b/chapter05/grep.xml @@ -0,0 +1,81 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-grep" role="wrap"> + <?dbhtml filename="grep.html"?> + + <title>Grep-&grep-version; + + + Grep + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/grep.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&grep-ch5-sbu;</seg> + <seg>&grep-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Grep + + Prepare Grep for compilation: + +./configure --prefix=/tools \ + --disable-perl-regexp + + + The meaning of the configure option: + + + --disable-perl-regexp + + This ensures that the grep program does + not get linked against a Perl Compatible Regular Expression (PCRE) + library that may be present on the host but will not be available + once we enter the chroot environment. + + + + + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-grep" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/gzip.xml b/chapter05/gzip.xml new file mode 100644 index 000000000..7cb715ddd --- /dev/null +++ b/chapter05/gzip.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-gzip" role="wrap"> + <?dbhtml filename="gzip.html"?> + + <title>Gzip-&gzip-version; + + + Gzip + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/gzip.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gzip-ch5-sbu;</seg> + <seg>&gzip-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gzip + + Prepare Gzip for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-gzip" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/introduction.xml b/chapter05/introduction.xml new file mode 100644 index 000000000..1704086ef --- /dev/null +++ b/chapter05/introduction.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-introduction"> + <?dbhtml filename="introduction.html"?> + + <title>Introduction + + This chapter shows how to compile and install 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. + + The files compiled in this chapter will be installed under the + $LFS/tools directory to keep them + separate from the files installed in the next chapter and the host + production directories. Since the packages compiled here are temporary, + we do not want them to pollute the soon-to-be LFS system. + + + Before issuing the build instructions for a package, the package + should be unpacked as user lfs, + and a cd into the created directory should be performed. + The build instructions assume that the bash shell is + in use. + + + 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. + + + After installing each package, delete its source and build directories, + unless specifically instructed otherwise. Deleting the sources prevents + mis-configuration when the same package is reinstalled later. + + + 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. + +
diff --git a/chapter05/linux-libc-headers.xml b/chapter05/linux-libc-headers.xml new file mode 100644 index 000000000..89b3962ea --- /dev/null +++ b/chapter05/linux-libc-headers.xml @@ -0,0 +1,66 @@ + + + %general-entities; +]> + + + + + Linux-Libc-Headers-&linux-libc-headers-version; + + + Linux-Libc-Headers + tools, headers + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/linux-libc-headers.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&linux-libc-headers-ch5-sbu;</seg> + <seg>&linux-libc-headers-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Linux-Libc-Headers + + For years it has been common practice to use raw + kernel headers (straight from a kernel tarball) in /usr/include, but over the last few years, + the kernel developers have taken a strong stance that this should not + be done. This gave birth to the Linux-Libc-Headers Project, which was + designed to maintain an Application Programming Interface (API) stable + version of the Linux headers. + + Install the header files: + +cp -Rv include/asm-i386 /tools/include/asm +cp -Rv include/linux /tools/include + + If your architecture is not i386 (compatible), adjust the first command + accordingly. + + + + + + + <para>Details on this package are located in + <xref linkend="contents-linux-libc-headers" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/m4.xml b/chapter05/m4.xml new file mode 100644 index 000000000..5d4a3942d --- /dev/null +++ b/chapter05/m4.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-m4" role="wrap"> + <?dbhtml filename="m4.html"?> + + <title>M4-&m4-version; + + + M4 + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/m4.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&m4-ch5-sbu;</seg> + <seg>&m4-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of M4 + + Prepare M4 for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-m4" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/make.xml b/chapter05/make.xml new file mode 100644 index 000000000..0f700933f --- /dev/null +++ b/chapter05/make.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> +<sect1 id="ch-tools-make" role="wrap"> + <?dbhtml filename="make.html"?> + + <title>Make-&make-version; + + + Make + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/make.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&make-ch5-sbu;</seg> + <seg>&make-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Make + + Prepare Make for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-make" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/ncurses.xml b/chapter05/ncurses.xml new file mode 100644 index 000000000..b70f1e006 --- /dev/null +++ b/chapter05/ncurses.xml @@ -0,0 +1,90 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-ncurses" role="wrap"> + <?dbhtml filename="ncurses.html"?> + + <title>Ncurses-&ncurses-version; + + + Ncurses + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/ncurses.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&ncurses-ch5-sbu;</seg> + <seg>&ncurses-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Ncurses + + Prepare Ncurses for compilation: + +./configure --prefix=/tools --with-shared \ + --without-debug --without-ada --enable-overwrite + + + The meaning of the 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-overwrite + + This tells Ncurses to install its header files into + /tools/include, instead of + /tools/include/ncurses, to + ensure that other packages can find the Ncurses headers + successfully. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-ncurses" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/patch.xml b/chapter05/patch.xml new file mode 100644 index 000000000..6fd786d38 --- /dev/null +++ b/chapter05/patch.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-patch" role="wrap"> + <?dbhtml filename="patch.html"?> + + <title>Patch-&patch-version; + + + Patch + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/patch.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&patch-ch5-sbu;</seg> + <seg>&patch-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Patch + + Prepare Patch for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-patch" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/perl.xml b/chapter05/perl.xml new file mode 100644 index 000000000..13b7ac6a6 --- /dev/null +++ b/chapter05/perl.xml @@ -0,0 +1,92 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-perl" role="wrap"> + <?dbhtml filename="perl.html"?> + + <title>Perl-&perl-version; + + + Perl + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/perl.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&perl-ch5-sbu;</seg> + <seg>&perl-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Perl + + First adapt some hard-wired paths to the C library by applying + the following patch: + +patch -Np1 -i ../&perl-libc-patch; + + Prepare Perl for compilation (make sure to get the + 'Data/Dumper Fcntl IO POSIX' part of the command correct—they are all + letters): + +./configure.gnu --prefix=/tools -Dstatic_ext='Data/Dumper Fcntl IO POSIX' + + + The meaning of the configure options: + + + -Dstatic_ext='Data/Dumper Fcntl IO POSIX' + + This tells Perl to build the minimum set of static extensions + needed for installing and testing the Coreutils and Glibc packages in the + next chapter. + + + + + + Only a few of the utilities contained in this package need to be + built: + +make perl utilities + + Although Perl comes with a test suite, it is not recommended to + run it at this point. Only part of Perl was built and running + make test now will cause the rest of Perl to be + built as well, which is unnecessary at this point. The test suite can + be run in the next chapter if desired. + + Install these tools and their libraries: + +cp -v perl pod/pod2man /tools/bin +mkdir -pv /tools/lib/perl5/&perl-version; +cp -Rv lib/* /tools/lib/perl5/&perl-version; + + + + + + + <para>Details on this package are located in + <xref linkend="contents-perl" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/sed.xml b/chapter05/sed.xml new file mode 100644 index 000000000..f2a5b9a96 --- /dev/null +++ b/chapter05/sed.xml @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-sed" role="wrap"> + <?dbhtml filename="sed.html"?> + + <title>Sed-&sed-version; + + + Sed + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/sed.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&sed-ch5-sbu;</seg> + <seg>&sed-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Sed + + Prepare Sed for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-sed" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/stripping.xml b/chapter05/stripping.xml new file mode 100644 index 000000000..6a8139033 --- /dev/null +++ b/chapter05/stripping.xml @@ -0,0 +1,39 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-stripping"> + <?dbhtml filename="stripping.html"?> + + <title>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: + +strip --strip-debug /tools/lib/* +strip --strip-unneeded /tools/{,s}bin/* + + The last of the above commands will skip some twenty files, + reporting that it does not recognize their file format. Most of these + are scripts instead of binaries. + + 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 nearly 20 MB more, remove the documentation: + +rm -rf /tools/{info,man} + + At this point, you should have at least 850 MB of free space in + $LFS that can be used to build and install Glibc in the + next phase. If you can build and install Glibc, you can build and install + the rest too. + + diff --git a/chapter05/tar.xml b/chapter05/tar.xml new file mode 100644 index 000000000..09f8d84a5 --- /dev/null +++ b/chapter05/tar.xml @@ -0,0 +1,70 @@ + + + %general-entities; +]> + + + + + Tar-&tar-version; + + + Tar + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/tar.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&tar-ch5-sbu;</seg> + <seg>&tar-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Tar + + If you wish to run the test suite, apply the following patch to fix + some issues with GCC-&gcc-version;: + +patch -Np1 -i ../&tar-gcc4_fix-patch; + + Prepare Tar for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-tar" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/tcl.xml b/chapter05/tcl.xml new file mode 100644 index 000000000..aa56ceff4 --- /dev/null +++ b/chapter05/tcl.xml @@ -0,0 +1,131 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-tools-tcl" role="wrap"> + <?dbhtml filename="tcl.html"?> + + <title>Tcl-&tcl-version; + + + Tcl + + + + + + <para>The Tcl package contains the Tool Command 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. 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. Even if the test suites are not run in this chapter + (they are not mandatory), these packages are required to run the test + suites in . + + Prepare Tcl for compilation: + +cd unix +./configure --prefix=/tools + + Build the package: + +make + + To test the results, issue: TZ=UTC make test. + The Tcl test suite is known to experience failures under certain host + conditions that are not fully understood. Therefore, test suite failures + here are not surprising, and are not considered critical. The + TZ=UTC parameter sets the time zone to Coordinated + Universal Time (UTC), also known as Greenwich Mean Time (GMT), but only + for the duration of the test suite run. This ensures that the clock tests + are exercised correctly. Details on the TZ environment + variable are provided in . + + Install the package: + +make install + + Install Tcl's headers. The next package, Expect, requires them + to build. + +make install-private-headers + + Now make a necessary symbolic link: + +ln -sv tclsh8.4 /tools/bin/tclsh + + + + + Contents of Tcl + + + Installed programs + Installed library + + + tclsh (link to tclsh8.4) and tclsh8.4 + libtcl8.4.so + + + + + Short Descriptions + + + + + tclsh8.4 + + The Tcl command shell + + tclsh8.4 + + + + + + tclsh + + A link to tclsh8.4 + + tclsh + + + + + + libtcl8.4.so + + The Tcl library + + libtcl8.4.so + + + + + + + + + diff --git a/chapter05/texinfo.xml b/chapter05/texinfo.xml new file mode 100644 index 000000000..5b5538f3b --- /dev/null +++ b/chapter05/texinfo.xml @@ -0,0 +1,65 @@ + + + %general-entities; +]> + + + + + Texinfo-&texinfo-version; + + + Texinfo + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/texinfo.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&texinfo-ch5-sbu;</seg> + <seg>&texinfo-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Texinfo + + Prepare Texinfo for compilation: + +./configure --prefix=/tools + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + + <para>Details on this package are located in + <xref linkend="contents-texinfo" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter05/toolchaintechnotes.xml b/chapter05/toolchaintechnotes.xml new file mode 100644 index 000000000..394a4f4a5 --- /dev/null +++ b/chapter05/toolchaintechnotes.xml @@ -0,0 +1,218 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-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 + back to at any time during the process. + + The overall goal of is to + provide a temporary environment that can be chrooted into and from which can be + produced a clean, trouble-free build of the target LFS system in . Along the way, we separate the new system + from the host system as much as possible, and in doing so, build a + self-contained and self-hosted toolchain. It should be noted that the build + process has been designed to minimize the risks for new readers and provide + maximum educational value at the same time. + + + Before continuing, be aware of the name of the working platform, + often referred to as the target triplet. Many times, the target + triplet will probably be i686-pc-linux-gnu. A + simple way to determine the name of the target 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. + + 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 will usually be ld-linux.so.2. + On platforms that are less prevalent, the name might be ld.so.1, and newer 64 bit platforms might + be named something else entirely. The name of the platform's dynamic linker + can be determined by looking in the /lib + directory on the host system. A sure-fire way to determine the name 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. + + + Some key technical points of how the build method works: + + + + The process is similar in principle to cross-compiling, whereby + tools installed in the same prefix work in cooperation, and thus utilize + a little GNU magic + + + Careful manipulation of the standard linker's library search path + ensures programs are linked only against chosen libraries + + + Careful manipulation of gcc's + specs file tells the compiler which target dynamic + linker will be used + + + + 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, + /tools/bin and /tools/$TARGET_TRIPLET/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, an 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, + 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... + /tools/i686-pc-linux-gnu/bin/as +checking what linker to use... /tools/i686-pc-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: + 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. + + 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 + gcc found in a PATH directory. 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 glibc-build directory for all important details. + Note the use of CC="gcc -B/tools/bin/" 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. + + After the Glibc installation, make some adjustments to ensure that + searching and linking take place only within the /tools prefix. Install an adjusted + ld, which has a hard-wired search path limited to + /tools/lib. Then amend + gcc's specs file to point to the new dynamic linker in + /tools/lib. This last step is vital + to the whole process. As mentioned above, a hard-wired path to a dynamic + linker is embedded into every Executable and Link Format (ELF)-shared + executable. This can be inspected by running: + readelf -l <name of binary> | grep interpreter. + Amending gcc's specs file ensures that every program compiled from here + through the end of this chapter will use the new dynamic linker in + /tools/lib. + + The need to use the new dynamic linker is also the reason why + the Specs patch is applied for the second pass of GCC. Failure to do + so will result in the GCC programs themselves having the name of the + dynamic linker from the host system's /lib directory embedded into them, which + would defeat the goal of getting away from the host. + + During the second pass of Binutils, we are able to utilize the + --with-lib-path configure switch to control + ld's library search path. From this point onwards, + the core toolchain is self-contained and self-hosted. The remainder of + the packages all build against + the new Glibc in /tools. + + Upon entering the chroot environment in , the first major package to be + installed is Glibc, due to its self-sufficient nature mentioned above. + Once this Glibc is installed into /usr, perform a quick changeover of the + toolchain defaults, then proceed in building the rest of the target + LFS system. + + + + diff --git a/chapter05/util-linux.xml b/chapter05/util-linux.xml new file mode 100644 index 000000000..56350c648 --- /dev/null +++ b/chapter05/util-linux.xml @@ -0,0 +1,76 @@ + + + %general-entities; +]> + + + + + Util-linux-&util-linux-version; + + + Util-linux + tools + + + + + + <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" + href="../chapter06/util-linux.xml" + xpointer="xpointer(/sect1/sect2[1]/para[1])"/> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&util-linux-ch5-sbu;</seg> + <seg>&util-linux-ch5-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Util-linux + + Util-linux does not use the freshly installed headers and libraries + from the /tools directory by default. + This is fixed by altering the configure script: + +sed -i 's@/usr/include@/tools/include@g' configure + + Prepare Util-linux for compilation: + +./configure + + Compile some support routines: + +make -C lib + + Only a few of the utilities contained in this package need to be + built: + +make -C mount mount umount +make -C text-utils more + + This package does not come with a test suite. + + Copy these programs to the temporary tools directory: + +cp mount/{,u}mount text-utils/more /tools/bin + + + + + + + <para>Details on this package are located in + <xref linkend="contents-utillinux" role="."/></para> + + </sect2> + +</sect1> diff --git a/chapter06/aboutdebug.xml b/chapter06/aboutdebug.xml new file mode 100644 index 000000000..5cecada9c --- /dev/null +++ b/chapter06/aboutdebug.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" + "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [ + <!ENTITY % general-entities SYSTEM "../general.ent"> + %general-entities; +]> + +<sect1 id="ch-system-aboutdebug"> + <?dbhtml filename="aboutdebug.html"?> + + <title>About Debugging Symbols + + Most programs and libraries are, by default, compiled with + debugging symbols included (with gcc's + -g option). This means that when debugging a + program or library that was compiled with debugging information + included, the debugger can provide not only memory addresses, but also + the names of the routines and variables. + + However, the inclusion of these debugging symbols enlarges a + program or library significantly. The following is an example of the + amount of space these symbols occupy: + + + + A bash binary with debugging symbols: + 1200 KB + + + A bash binary without debugging symbols: + 480 KB + + + Glibc and GCC files (/lib + and /usr/lib) with debugging + symbols: 87 MB + + + Glibc and GCC files without debugging symbols: 16 MB + + + + Sizes may vary depending on which compiler and C library were used, + but when comparing programs with and without debugging symbols, the + difference will usually be a factor between two and five. + + Because most users will never use a debugger on their system software, + a lot of disk space can be regained by removing these symbols. The next + section shows how to strip all debugging symbols from the programs and + libraries. Additional information on system optimization can be found at + . + + diff --git a/chapter06/autoconf.xml b/chapter06/autoconf.xml new file mode 100644 index 000000000..4ffb8e9ee --- /dev/null +++ b/chapter06/autoconf.xml @@ -0,0 +1,171 @@ + + + %general-entities; +]> + + + + + Autoconf-&autoconf-version; + + + Autoconf + + + + + + <para>The Autoconf package contains programs for producing shell scripts that + can automatically configure source code.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&autoconf-ch6-sbu;</seg> + <seg>&autoconf-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Autoconf + + Prepare Autoconf for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + This takes a long time, about 3 SBUs. In addition, 2 test are skipped + that use Automake. For full test coverage, Autoconf can be re-tested + after Automake has been installed. + + Install the package: + +make install + + + + + Contents of Autoconf + + + Installed programs + + + autoconf, autoheader, autom4te, autoreconf, autoscan, autoupdate, + and ifnames + + + + + Short Descriptions + + + + + autoconf + + Produces shell scripts that automatically configure software + source code packages to adapt to many kinds of Unix-like systems. + The configuration scripts it produces are independent—running + them does not require the autoconf program. + + autoconf + + + + + + autoheader + + A tool for creating template files of C + #define statements for configure to use + + autoheader + + + + + + autom4te + + A wrapper for the M4 macro processor + + autom4te + + + + + + autoreconf + + Automatically runs autoconf, + autoheader, aclocal, + automake, gettextize, and + libtoolize in the correct order to save time + when changes are made to autoconf and + automake template files + + autoreconf + + + + + + autoscan + + Helps to create a configure.in file for a + software package; it examines the source files in a directory tree, + searching them for common portability issues, and creates a + configure.scan file that serves as as a + preliminary configure.in file for the + package + + autoscan + + + + + + autoupdate + + Modifies a configure.in file that still + calls autoconf macros by their old names to use the + current macro names + + autoupdate + + + + + + ifnames + + Helps when writing configure.in files + for a software package; it prints the identifiers that the package + uses in C preprocessor conditionals. If a package has already been set + up to have some portability, this program can help determine what + configure needs to check for. It can also fill in + gaps in a configure.in file generated by + autoscan + + ifnames + + + + + + + + + diff --git a/chapter06/automake.xml b/chapter06/automake.xml new file mode 100644 index 000000000..65da0b897 --- /dev/null +++ b/chapter06/automake.xml @@ -0,0 +1,263 @@ + + + %general-entities; +]> + + + + + 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 + + Prepare Automake for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + This takes a long time, about 10 SBUs. + + Install the package: + +make install + + + + + + Contents of Automake + + + Installed programs + + + acinstall, aclocal, aclocal-&automake-version;, automake, + automake-&automake-version;, compile, config.guess, config.sub, + depcomp, elisp-comp, install-sh, mdate-sh, missing, mkinstalldirs, + py-compile, symlink-tree, and ylwrap + + + + + Short Descriptions + + + + + acinstall + + A script that installs aclocal-style M4 files + + acinstall + + + + + + aclocal + + Generates aclocal.m4 files based on the + contents of configure.in files + + aclocal + + + + + + aclocal-&automake-version; + + A hard link to aclocal + + aclocal-&automake-version; + + + + + + automake + + A tool for automatically generating + Makefile.in files from + Makefile.am files. To create all the + Makefile.in files for a package, run this program + in the top-level directory. By scanning the + configure.in file, it automatically finds each + appropriate Makefile.am file and generates the + corresponding Makefile.in file + + automake + + + + + + automake-&automake-version; + + A hard link to automake + + automake-&automake-version; + + + + + + compile + + A wrapper for compilers + + compile + + + + + + config.guess + + A script that attempts to guess the canonical triplet for + the given build, host, or target architecture + + config.guess + + + + + + config.sub + + A configuration validation subroutine script + + config.sub + + + + + + depcomp + + A script for compiling a program so that dependency information + is generated in addition to the desired output + + depcomp + + + + + + elisp-comp + + Byte-compiles Emacs Lisp code + + elisp-comp + + + + + + install-sh + + A script that installs a program, script, or data file + + install-sh + + + + + + mdate-sh + + A script that prints the modification time of a file or + directory + + mdate-sh + + + + + + missing + + A script acting as a common stub for missing GNU programs during + an installation + + missing + + + + + + mkinstalldirs + + A script that creates a directory tree + + mkinstalldirs + + + + + + py-compile + + Compiles a Python program + + py-compile + + + + + + symlink-tree + + A script to create a symlink tree of a directory tree + + symlink-tree + + + + + + ylwrap + + A wrapper for lex and + yacc + + ylwrap + + + + + + + + + diff --git a/chapter06/bash.xml b/chapter06/bash.xml new file mode 100644 index 000000000..53ea0a66b --- /dev/null +++ b/chapter06/bash.xml @@ -0,0 +1,150 @@ + + + %general-entities; +]> + + + + + Bash-&bash-version; + + + Bash + + + + + + <para>The Bash package contains the Bourne-Again SHell.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bash-ch6-sbu;</seg> + <seg>&bash-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bash + + If you downloaded the Bash documentation tarball and wish to install + HTML documentation, issue the following commands: + +tar -xvf ../bash-doc-&bash-doc-version;.tar.gz && +sed -i "s|htmldir = @htmldir@|htmldir = /usr/share/doc/bash-&bash-version;|" \ + Makefile.in + + Upstream developers have fixed several issues since the initial + release of Bash-&bash-version;. Apply those fixes: + +patch -Np1 -i ../&bash-fixes-patch; + + Prepare Bash for compilation: + +./configure --prefix=/usr --bindir=/bin \ + --without-bash-malloc --with-installed-readline + + + The meaning of the configure options: + + + --with-installed-readline + + This option tells Bash to use the readline library that is already + installed on the system rather than using its own readline + version. + + + + + + Compile the package: + +make + + To test the results, issue: + make tests. + + Install the package: + +make install + + Run the newly compiled bash program (replacing the one that is + currently being executed): + +exec /bin/bash --login +h + + + The parameters used make the bash + process an interactive login shell and continue to disable hashing so + that new programs are found as they become available. + + + + + + Contents of Bash + + + Installed programs + + + bash, bashbug, and sh (link to bash) + + + + + Short Descriptions + + + + + bash + + A widely-used command interpreter; it performs many types of + expansions and substitutions on a given command line before executing + it, thus making this interpreter a powerful tool + + bash + + + + + + bashbug + + A shell script to help the user compose and mail 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 + + + + + + + + + diff --git a/chapter06/binutils.xml b/chapter06/binutils.xml new file mode 100644 index 000000000..5c9514bf2 --- /dev/null +++ b/chapter06/binutils.xml @@ -0,0 +1,327 @@ + + + %general-entities; +]> + + + + + Binutils-&binutils-version; + + + Binutils + + + + + + <para>The Binutils package contains a linker, an assembler, and other + tools for handling object files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <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. Check that everything is set up correctly by performing a + simple test: + +expect -c "spawn ls" + + If the following message shows up, the chroot environment is not + set up for proper PTY operation: + +The system has no more ptys. +Ask your system administrator to create more. + + This issue needs to be resolved before running the test suites + for Binutils and GCC. + + The Binutils documentation recommends building Binutils outside of the + source directory in a dedicated build directory: + +mkdir -v ../binutils-build +cd ../binutils-build + + Prepare Binutils for compilation: + +../binutils-&binutils-version;/configure --prefix=/usr \ + --enable-shared + + 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, i686 machines would expand that to /usr/i686-pc-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 check + + Install the package: + +make tooldir=/usr install + + Install the libiberty header + file that is needed by some packages: + +cp -v ../binutils-&binutils-version;/include/libiberty.h /usr/include + + + + + + Contents of Binutils + + + Installed programs + Installed libraries + + + addr2line, ar, as, c++filt, gprof, ld, nm, objcopy, objdump, + ranlib, readelf, size, strings, and strip + libiberty.a, libbfd.{a,so}, and libopcodes.{a,so} + + + + + Short Descriptions + + + + + addr2line + + Translates program addresses to file names and line numbers; + given an address and the name of an executable, it uses the debugging + information in the executable to determine which source file and line + number are associated with the address + + addr2line + + + + + + ar + + Creates, modifies, and extracts from archives + + ar + + + + + + as + + An assembler that assembles the output of gcc + into object files + + as + + + + + + c++filt + + Used by the linker to de-mangle C++ and Java symbols and to keep + overloaded functions from clashing + + c++filt + + + + + + gprof + + Displays call graph profile data + + gprof + + + + + + ld + + A linker that combines a number of object and archive files + into a single file, relocating their data and tying up symbol + references + + ld + + + + + + nm + + Lists the symbols occurring in a given object file + + nm + + + + + + objcopy + + Translates one type of object file into another + + objcopy + + + + + + objdump + + Displays information about the given object file, with options + controlling the particular information to display; the information + shown is useful to programmers who are working on the compilation + tools + + objdump + + + + + + ranlib + + Generates an index of the contents of an archive and stores it + in the archive; the index lists all of the symbols defined by archive + members that are relocatable object files + + ranlib + + + + + + readelf + + Displays information about ELF type binaries + + readelf + + + + + + size + + Lists the section sizes and the total size for the given + object files + + size + + + + + + strings + + Outputs, for each given file, the sequences of printable + characters that are of at least the specified length (defaulting to + four); for object files, it prints, by default, only the strings from + the initializing and loading sections while for other types of files, it + scans the entire file + + strings + + + + + + strip + + Discards symbols from object files + + strip + + + + + + libiberty + + Contains routines used by various GNU programs, including + getopt, obstack, + strerror, strtol, and + strtoul + + libiberty + + + + + + libbfd + + The Binary File Descriptor library + + libbfd + + + + + + libopcodes + + A library for dealing with opcodes—the readable + text versions of instructions for the processor; + it is used for building utilities like + objdump. + + libopcodes + + + + + + + + + diff --git a/chapter06/bison.xml b/chapter06/bison.xml new file mode 100644 index 000000000..9079bf723 --- /dev/null +++ b/chapter06/bison.xml @@ -0,0 +1,120 @@ + + + %general-entities; +]> + + + + + Bison-&bison-version; + + + Bison + + + + + + <para>The Bison package contains a parser generator.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bison-ch6-sbu;</seg> + <seg>&bison-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bison + + Prepare Bison for compilation: + +./configure --prefix=/usr + + The configure system causes bison to be built without support for + internationalization of error messages if a bison + program is not already in $PATH. The following addition will correct + this. + +echo '#define YYENABLE_NLS 1' >> config.h + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + Contents of Bison + + + Installed programs + Installed library + + + bison and yacc + liby.a + + + + + Short Descriptions + + + + + bison + + Generates, from a series of rules, a program for analyzing the + structure of text files; Bison is a replacement for Yacc (Yet Another + Compiler Compiler) + + bison + + + + + + yacc + + A wrapper for bison, meant for programs that + still call yacc instead of bison; + it calls bison with the -y + option + + yacc + + + + + + liby.a + + The Yacc library containing implementations of Yacc-compatible + yyerror and main functions; + this library is normally not very useful, but POSIX requires it + + liby.a + + + + + + + + + diff --git a/chapter06/bzip2.xml b/chapter06/bzip2.xml new file mode 100644 index 000000000..69d4d9b12 --- /dev/null +++ b/chapter06/bzip2.xml @@ -0,0 +1,250 @@ + + + %general-entities; +]> + + + + + Bzip2-&bzip2-version; + + + Bzip2 + + + + + + <para>The Bzip2 package contains programs for compressing and decompressing + files. Compressing text files with <command>bzip2</command> yields a much + better compression percentage than with the traditional + <command>gzip</command>.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&bzip2-ch6-sbu;</seg> + <seg>&bzip2-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Bzip2 + + Apply a patch to install the documentation for this package: + +patch -Np1 -i ../&bzip2-docs-patch; + + The bzgrep command does not escape '|' and '&' + in filenames passed to it. This allows arbitrary commands to be executed + with the privileges of the user running bzgrep. Apply + the following to address this: + +patch -Np1 -i ../&bzip2-bzgrep-patch; + + The bzdiff script still uses the deprecated + tempfile program. Update it to use + mktemp instead: + +sed -i 's@tempfile -d /tmp -p bz@mktemp -p /tmp@' bzdiff + + Prepare Bzip2 for compilation with: + +make -f Makefile-libbz2_so +make clean + + + The meaning of the make parameter: + + + -f Makefile-libbz2_so + + This will cause Bzip2 to be built using a different + Makefile file, in this case the + Makefile-libbz2_so file, which creates a dynamic + libbz2.so library and links + the Bzip2 utilities against it. + + + + + + Compile and test the package: + +make + + If reinstalling Bzip2, perform + rm -vf /usr/bin/bz* first, otherwise the following + make install will fail. + + Install the programs: + +make install + + Install the shared bzip2 binary into the + /bin directory, make + some necessary symbolic links, and clean up: + +cp -v bzip2-shared /bin/bzip2 +cp -av libbz2.so* /lib +ln -sv ../../lib/libbz2.so.1.0 /usr/lib/libbz2.so +rm -v /usr/bin/{bunzip2,bzcat,bzip2} +ln -sv bzip2 /bin/bunzip2 +ln -sv bzip2 /bin/bzcat + + + + + Contents of Bzip2 + + + Installed programs + Installed libraries + + + bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff, + bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore + libbz2.{a,so} + + + + + Short Descriptions + + + + + bunzip2 + + Decompresses bzipped files + + bunzip2 + + + + + + bzcat + + Decompresses to standard output + + bzcat + + + + + + bzcmp + + Runs cmp on bzipped files + + bzcmp + + + + + + bzdiff + + Runs diff on bzipped files + + bzdiff + + + + + + bzgrep + + Runs grep on bzipped files + + bzgrep + + + + + + bzegrep + + Runs egrep on bzipped files + + bzegrep + + + + + + bzfgrep + + Runs fgrep on bzipped files + + bzfgrep + + + + + + bzip2 + + Compresses files using the Burrows-Wheeler block sorting text + compression algorithm with Huffman coding; the compression rate is + better than that achieved by more conventional compressors using + Lempel-Ziv algorithms, like gzip + + bzip2 + + + + + + bzip2recover + + Tries to recover data from damaged bzipped files + + bzip2recover + + + + + + bzless + + Runs less on bzipped files + + bzless + + + + + + bzmore + + Runs more on bzipped files + + bzmore + + + + + + libbz2* + + The library implementing lossless, block-sorting data + compression, using the Burrows-Wheeler algorithm + + libbz2* + + + + + + + + + diff --git a/chapter06/chapter06.xml b/chapter06/chapter06.xml new file mode 100644 index 000000000..5715d6be9 --- /dev/null +++ b/chapter06/chapter06.xml @@ -0,0 +1,75 @@ + + + %general-entities; +]> + + + + + + Installing Basic System Software + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml new file mode 100644 index 000000000..ea213033e --- /dev/null +++ b/chapter06/chroot.xml @@ -0,0 +1,61 @@ + + + %general-entities; +]> + + + + + Entering the Chroot Environment + + It is time to enter the chroot environment to begin building and + installing the final LFS system. As user root, run the following command to enter the + realm that is, at the moment, populated with only the temporary tools: + +chroot "$LFS" /tools/bin/env -i \ + HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ + /tools/bin/bash --login +h + + The -i option given to the env + command will clear all variables of the chroot environment. After that, only + the HOME, TERM, PS1, and + PATH variables are set again. The + TERM=$TERM construct will set the TERM + variable inside chroot to the same value as outside chroot. This variable is + needed for programs like vim and less + to operate properly. If other variables are needed, such as + CFLAGS or CXXFLAGS, this is a good place to set + them again. + + From this point on, there is no need to use the + LFS variable anymore, because all work will be restricted + to the LFS file system. This is because the Bash shell is told that + $LFS is now the root + (/) directory. + + Notice that /tools/bin comes last + in the PATH. This means that a temporary tool will 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 new file mode 100644 index 000000000..bc614c205 --- /dev/null +++ b/chapter06/coreutils.xml @@ -0,0 +1,1062 @@ + + + %general-entities; +]> + + + + + Coreutils-&coreutils-version; + + + Coreutils + + + + + + <para>The Coreutils package contains utilities for showing and setting the + basic system characteristics.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&coreutils-ch6-sbu;</seg> + <seg>&coreutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Coreutils + + A known issue with the uname program from + this package is that the -p switch always + returns unknown. The following patch + fixes this behavior for Intel architectures: + +patch -Np1 -i ../&coreutils-uname-patch; + + Prevent Coreutils from installing binaries that will be installed by + other packages later: + +patch -Np1 -i ../&coreutils-suppress-patch; + + 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: + +patch -Np1 -i ../&coreutils-i18n-patch; + + In order for the tests added by this patch to pass, the permissions for + the test file have to be changed: + +chmod +x tests/sort/sort-mb-tests + + + 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. + + + It has been found that translated messages sometimes overflow a buffer + in the who -Hu command. Increase the buffer size: + +sed -i 's/_LEN 6/_LEN 20/' src/who.c + + Now prepare Coreutils for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + The test suite of Coreutils makes several assumptions about the + presence of system users and groups that are not valid within the minimal + environment that exists at the moment. Therefore, additional items need + to be set up before running the tests. Skip down to Install the + package if not running the test suite. + + Create two dummy groups and a dummy user: + +echo "dummy1:x:1000:" >> /etc/group +echo "dummy2:x:1001:dummy" >> /etc/group +echo "dummy:x:1000:1000::/root:/bin/bash" >> /etc/passwd + + Now the test suite is ready to be run. First, run the tests that are + meant to be run as user root: + +make NON_ROOT_USERNAME=dummy check-root + + Then run the remainder of the tests as the + dummy user: + +src/su dummy -c "make RUN_EXPENSIVE_TESTS=yes check" + + When testing is complete, remove the dummy user and groups: + +sed -i '/dummy/d' /etc/passwd /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,hostname,ln,ls,mkdir,mknod,mv,pwd,rm} /bin +mv -v /usr/bin/{rmdir,stty,sync,true,uname} /bin +mv -v /usr/bin/chroot /usr/sbin + + Some of the scripts in the LFS-Bootscripts package depend on + head, sleep, and + nice. As /usr + may not be available during the early stages of booting, those binaries + need to be on the root partition: + +mv -v /usr/bin/{head,sleep,nice} /bin + + + + + + Contents of Coreutils + + + Installed programs + + + basename, cat, chgrp, chmod, chown, chroot, cksum, comm, cp, + csplit, cut, date, dd, df, dir, dircolors, dirname, du, echo, env, + expand, expr, factor, false, fmt, fold, groups, head, hostid, + hostname, id, install, join, link, ln, logname, ls, md5sum, mkdir, + mkfifo, mknod, mv, nice, nl, nohup, od, paste, pathchk, pinky, pr, + printenv, printf, ptx, pwd, readlink, rm, rmdir, seq, sha1sum, shred, + sleep, sort, split, stat, stty, sum, sync, tac, tail, tee, test, + touch, tr, true, tsort, tty, uname, unexpand, uniq, unlink, users, + vdir, wc, who, whoami, and yes + + + + + Short Descriptions + + + + + basename + + Strips any path and a given suffix from a file name + + basename + + + + + + cat + + Concatenates files to standard output + + cat + + + + + + chgrp + + Changes the group ownership of 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 + + + + + + hostname + + Reports or sets the name of the host + + hostname + + + + + + id + + Reports the effective user ID, group ID, and group memberships + of the current user or specified user + + id + + + + + + install + + Copies files while setting their permission modes and, if + possible, their owner and group + + install + + + + + + join + + Joins the lines that have identical join fields from two + separate files + + join + + + + + + link + + Creates a hard link with the given name to a file + + link + + + + + + ln + + Makes hard links or soft (symbolic) links between files + + ln + + + + + + logname + + Reports the current user's login name + + logname + + + + + + ls + + Lists the contents of each given directory + + ls + + + + + + md5sum + + Reports or checks Message Digest 5 (MD5) checksums + + md5sum + + + + + + mkdir + + Creates directories with the given names + + mkdir + + + + + + mkfifo + + Creates First-In, First-Outs (FIFOs), a named + pipe in UNIX parlance, with the given names + + mkfifo + + + + + + mknod + + Creates device nodes with the given names; a device node is a + character special file, a block special file, or a FIFO + + mknod + + + + + + mv + + Moves or renames files or directories + + mv + + + + + + nice + + Runs a program with modified scheduling priority + + nice + + + + + + nl + + Numbers the lines from the given files + + nl + + + + + + nohup + + Runs a command immune to hangups, with its output redirected to + a log file + + nohup + + + + + + od + + Dumps files in octal and other formats + + od + + + + + + paste + + Merges the given files, joining sequentially corresponding lines + side by side, separated by tab characters + + paste + + + + + + pathchk + + Checks if file names are valid or portable + + pathchk + + + + + + pinky + + Is a lightweight finger client; it reports some information + about the given users + + pinky + + + + + + pr + + Paginates and columnates files for printing + + pr + + + + + + printenv + + Prints the environment + + printenv + + + + + + printf + + Prints the given arguments according to the given format, much + like the C printf function + + printf + + + + + + ptx + + Produces a permuted index from the contents of the given files, + with each keyword in its context + + ptx + + + + + + pwd + + Reports the name of the current working directory + + pwd + + + + + + readlink + + Reports the value of the given symbolic link + + readlink + + + + + + rm + + Removes files or directories + + rm + + + + + + rmdir + + Removes directories if they are empty + + rmdir + + + + + + seq + + Prints a sequence of numbers within a given range and with a + given increment + + seq + + + + + + sha1sum + + Prints or checks 160-bit Secure Hash Algorithm 1 (SHA1) + checksums + + sha1sum + + + + + + shred + + Overwrites the given files repeatedly with complex patterns, + making it difficult to recover the data + + shred + + + + + + sleep + + Pauses for the given amount of time + + sleep + + + + + + sort + + Sorts the lines from the given files + + sort + + + + + + split + + Splits the given file into pieces, by size or by number of + lines + + split + + + + + + stat + + Displays file or filesystem status + + stat + + + + + + stty + + Sets or reports terminal line settings + + stty + + + + + + sum + + Prints checksum and block counts for each given file + + sum + + + + + + sync + + Flushes file system buffers; it forces changed blocks to disk + and updates the super block + + sync + + + + + + tac + + Concatenates the given files in reverse + + tac + + + + + + tail + + Prints the last ten lines (or the given number of lines) of each + given file + + tail + + + + + + tee + + Reads from standard input while writing both to standard output + and to the given files + + tee + + + + + + test + + Compares values and checks file types + + test + + + + + + touch + + Changes file timestamps, setting the access and modification + times of the given files to the current time; files that do not exist + are created with zero length + + touch + + + + + + tr + + Translates, squeezes, and deletes the given characters from + standard input + + tr + + + + + + true + + Does nothing, successfully; it always exits with a status code + indicating success + + true + + + + + + tsort + + Performs a topological sort; it writes a completely ordered list + according to the partial ordering in a given file + + tsort + + + + + + tty + + Reports the file name of the terminal connected to standard + input + + tty + + + + + + uname + + Reports system information + + uname + + + + + + unexpand + + Converts spaces to tabs + + unexpand + + + + + + uniq + + Discards all but one of successive identical lines + + 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 + + + + + + + + + diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml new file mode 100644 index 000000000..0cfc7596f --- /dev/null +++ b/chapter06/createfiles.xml @@ -0,0 +1,137 @@ + + + %general-entities; +]> + + + + + Creating Essential Files and Symlinks + + + /etc/passwd + + + + /etc/group + + + + /var/run/utmp + + + + /var/log/btmp + + + + /var/log/lastlog + + + + /var/log/wtmp + + + Some programs use hard-wired paths to programs which do not exist yet. In + order to satisfy these programs, create a number of symbolic links which will be + replaced by real files throughout the course of this chapter after the software + has been installed. + +ln -sv /tools/bin/{bash,cat,grep,pwd,stty} /bin +ln -sv /tools/bin/perl /usr/bin +ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib +ln -sv bash /bin/sh + + A proper Linux system maintains a list of the mounted file systems in + the file /etc/mtab. Normally, this file would be + created when we mount a new file system. Since we will not be mounting any + file systems inside our chroot environment, create an empty file for + utilities that expect the presence of /etc/mtab: + +touch /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 +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: +sys:x:2: +kmem:x:3: +tty:x:4: +tape:x:5: +daemon:x:6: +floppy:x:7: +disk:x:8: +lp:x:9: +dialout:x:10: +audio:x:11: +video:x:12: +utmp:x:13: +usb:x:14: +cdrom:x:15: +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 this + chapter, and in part by common convention employed by a number of existing + Linux distributions. 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. + + To remove the I have no name! prompt, start a new + shell. Since a full Glibc was installed in and the + /etc/passwd and /etc/group + files have been created, user name and group name resolution will now + work. + +exec /tools/bin/bash --login +h + + 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/run/utmp /var/log/{btmp,lastlog,wtmp} +chgrp -v utmp /var/run/utmp /var/log/lastlog +chmod -v 664 /var/run/utmp /var/log/lastlog + + The /var/run/utmp file records the users + that are currently logged in. The /var/log/wtmp + file records all logins and logouts. The + /var/log/lastlog file records when + each user last logged in. The /var/log/btmp file + records the bad login attempts. + + diff --git a/chapter06/creatingdirs.xml b/chapter06/creatingdirs.xml new file mode 100644 index 000000000..20e0e6f1d --- /dev/null +++ b/chapter06/creatingdirs.xml @@ -0,0 +1,69 @@ + + + %general-entities; +]> + + + + + Creating Directories + + It is time to create some structure in the LFS file system. Create a + standard directory tree by issuing the following commands: + +mkdir -pv /{bin,boot,etc/opt,home,lib,mnt,opt} +mkdir -pv /{media/{floppy,cdrom},sbin,srv,var} +install -dv -m 0750 /root +install -dv -m 1777 /tmp /var/tmp +mkdir -pv /usr/{,local/}{bin,include,lib,sbin,src} +mkdir -pv /usr/{,local/}share/{doc,info,locale,man} +mkdir -v /usr/{,local/}share/{misc,terminfo,zoneinfo} +mkdir -pv /usr/{,local/}share/man/man{1..8} +for dir in /usr /usr/local; do + ln -sv share/{man,doc,info} $dir +done +mkdir -v /var/{lock,log,mail,run,spool} +mkdir -pv /var/{opt,cache,lib/{misc,locate},local} + + 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 ). In addition to + the FHS, we create compatibility symlinks for the man, doc, and info directories since many packages still try + to install their documentation into /usr/<directory> or /usr/local/<directory> as opposed to + /usr/share/<directory> or + /usr/local/share/<directory>. + The FHS also stipulates the existence of /usr/local/games and /usr/share/games. The FHS is not precise as to + the structure of the /usr/local/share + subdirectory, so we create only the directories that are needed. However, + feel free to create these directories if you prefer to conform more strictly + to the FHS. + + + + diff --git a/chapter06/db.xml b/chapter06/db.xml new file mode 100644 index 000000000..367f85e65 --- /dev/null +++ b/chapter06/db.xml @@ -0,0 +1,279 @@ + + + %general-entities; +]> + + + + + Berkeley DB-&db-version; + + + Berkeley DB + + + + + + <para>The Berkeley DB package contains programs and utilities used by many + other applications for database related functions.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&db-ch6-sbu;</seg> + <seg>&db-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + <tip> + <title>Other Installation Possibilities + + There are instructions to build this package in the BLFS book if you + need to build the RPC server or additional language bindings. The + additional language bindings will require additional packages to be + installed. See + for suggested installation instructions. + + Also, GDBM could be used in place of Berkeley + DB to satisfy Man-DB. However, since Berkeley DB is considered a core part + of the LFS build, it will not be listed as a dependency for any package in + the BLFS book. Likewise, many hours go into testing LFS with Berkeley DB + installed, not with GDBM. If you fully understand the risks versus + benefits of using GDBM and wish to use it anyway, see the BLFS + instructions located at + + + + + + + Installation of Berkeley DB + + Prepare Berkeley DB for compilation: + +cd build_unix && +../dist/configure --prefix=/usr --enable-compat185 --enable-cxx + + + The meaning of the configure options: + + + --enable-compat185 + + This option enables building Berkeley DB 1.85 compatibility + API. + + + + + --enable-cxx + + This option enables building C++ API libraries. + + + + + + Compile the package: + +make + + It is not possible to test the package meaningfully, because + that would involve building TCL bindings. TCL bindings cannot be + built properly now because TCL is linked against Glibc in + /tools, not against Glibc in + /usr. + + Install the package: + +make docdir=/usr/share/doc/db-&db-version; install + + + The meaning of the make parameter: + + + docdir=... + + This variable specifies the correct place for the + documentation. + + + + + + Fix the ownerships of the installed files: + +chown -v root:root /usr/bin/db_* \ + /usr/lib/libdb* /usr/include/db* && +chown -Rv root:root /usr/share/doc/db-&db-version; + + + + + Contents of Berkeley DB + + + Installed programs + Installed libraries + + + db_archive, db_checkpoint, db_deadlock, db_dump, db_hotbackup, + db_load, db_printlog, db_recover, db_stat, db_upgrade, and db_verify + libdb.{so,ar}and libdb_cxx.r{o,ar} + + + + + Short Descriptions + + + + + db_archive + + Prints the pathnames of log files that are no longer in use + + db_archive + + + + + + db_checkpoint + + A daemon used to monitor and checkpoint database logs + + db_checkpoint + + + + + + db_deadlock + + A daemon used to abort lock requests when deadlocks are + detected + + db_deadlock + + + + + + db_dump + + Converts database files to a plain-text file format readable + by db_load + + db_dump + + + + + + db_hotbackup + + Creates hot backup or hot failover + snapshots of Berkeley DB databases + + db_hotbackup + + + + + + db_load + + Is used to create database files from plain-text files + + db_load + + + + + + db_printlog + + Converts database log files to human readable text + + db_printlog + + + + + + db_recover + + Is used to restore a database to a consistent state after a + failure + + db_recover + + + + + + db_stat + + Displays statistics for Berkeley databases + + db_stat + + + + + + db_upgrade + + Is used to upgrade database files to a newer version of + Berkeley DB + + db_upgrade + + + + + + db_verify + + Is used to run consistency checks on database files + + db_verify + + + + + + + libdb.{so,a} + + Contains functions to manipulate database files from C + programs + + libdb + + + + + + libdb_cxx.{so,a} + + Contains functions to manipulate database files from C++ + programs + + libdb_cxx + + + + + + + + + diff --git a/chapter06/diffutils.xml b/chapter06/diffutils.xml new file mode 100644 index 000000000..855c7d418 --- /dev/null +++ b/chapter06/diffutils.xml @@ -0,0 +1,131 @@ + + + %general-entities; +]> + + + + + Diffutils-&diffutils-version; + + + Diffutils + + + + + + <para>The Diffutils package contains programs that show the differences + between files or directories.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&diffutils-ch6-sbu;</seg> + <seg>&diffutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Diffutils + + POSIX requires the diff command to treat whitespace + characters according to the current locale. The following patch fixes the + non-compliance issue: + +patch -Np1 -i ../&diffutils-i18n-patch; + + The above patch will cause the Diffutils build system to attempt to + rebuild the diff.1 man page using the unavailable + program help2man. The result is an unreadable man page for + diff. We can avoid this by updating the timestamp on + the file man/diff.1: + +touch man/diff.1 + + Prepare Diffutils for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + + 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 + + + + + + + + + diff --git a/chapter06/e2fsprogs.xml b/chapter06/e2fsprogs.xml new file mode 100644 index 000000000..7d27eefb5 --- /dev/null +++ b/chapter06/e2fsprogs.xml @@ -0,0 +1,470 @@ + + + %general-entities; +]> + + + + + E2fsprogs-&e2fsprogs-version; + + + E2fsprogs + + + + + + <para>The E2fsprogs package contains the utilities for handling the + <systemitem class="filesystem">ext2</systemitem> file system. It also + supports the <systemitem class="filesystem">ext3</systemitem> journaling + file system.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&e2fsprogs-ch6-sbu;</seg> + <seg>&e2fsprogs-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of E2fsprogs + + It is recommended that E2fsprogs be built in a subdirectory of + the source tree: + +mkdir -v build +cd build + + Prepare E2fsprogs for compilation: + +../configure --prefix=/usr --with-root-prefix="" \ + --enable-elf-shlibs --disable-evms + + + The meaning of the configure options: + + + --with-root-prefix="" + + Certain programs (such as the e2fsck + program) are considered essential programs. When, for example, + /usr is not mounted, these + 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-evms + + This disables the building of the Enterprise Volume + Management System (EVMS) plugin. This plugin is not up-to-date with + the latest EVMS internal interfaces and EVMS is not installed as part + of a base LFS system, so the plugin is not required. See the EVMS + website at for more + information regarding EVMS. + + + + + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the binaries and documentation: + +make install + + Install the shared libraries: + +make install-libs + + + + + Contents of E2fsprogs + + + Installed programs + Installed libraries + + + badblocks, blkid, chattr, compile_et, debugfs, dumpe2fs, e2fsck, + e2image, e2label, filefrag, findfs, fsck, fsck.ext2, fsck.ext3, logsave, lsattr, + mk_cmds, mke2fs, mkfs.ext2, mkfs.ext3, mklost+found, resize2fs, + tune2fs, and uuidgen. + libblkid.{a,so}, libcom_err.{a,so}, libe2p.{a,so}, + libext2fs.{a,so}, libss.{a,so}, and libuuid.{a,so} + + + + + Short Descriptions + + + + + badblocks + + Searches a device (usually a disk partition) for bad + blocks + + badblocks + + + + + + blkid + + A command line utility to locate and print block device + attributes + + blkid + + + + + + chattr + + Changes the attributes of files on an ext2 file system; it also + changes ext3 + file systems, the journaling version of ext2 file systems + + chattr + + + + + + compile_et + + An error table compiler; it converts a table of error-code + names and messages into a C source file suitable for use with the + com_err library + + compile_et + + + + + + debugfs + + A file system debugger; it can be used to examine and change + the state of an ext2 + file system + + debugfs + + + + + + dumpe2fs + + Prints the super block and blocks group information for the + file system present on a given device + + dumpe2fs + + + + + + e2fsck + + Is used to check, and optionally repair ext2 file systems and ext3 file systems + + e2fsck + + + + + + e2image + + Is used to save critical ext2 file system data to a file + + e2image + + + + + + e2label + + Displays or changes the file system label on the ext2 file system present on a given + device + + e2label + + + + + + filefrag + + Reports on how badly fragmented a particular file might be + + filefrag + + + + + + findfs + + Finds a file system by label or Universally Unique Identifier + (UUID) + + findfs + + + + + + fsck + + Is used to check, and optionally repair, file systems + + fsck + + + + + + fsck.ext2 + + By default checks ext2 + file systems + + fsck.ext2 + + + + + + fsck.ext3 + + By default checks ext3 + file systems + + fsck.ext3 + + + + + + logsave + + Saves the output of a command in a log file + + logsave + + + + + + lsattr + + Lists the attributes of files on a second extended file + system + + lsattr + + + + + + mk_cmds + + Converts a table of command names and 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 + + mkfs.ext2 + + + + + + mkfs.ext3 + + By default creates ext3 + file systems + + mkfs.ext3 + + + + + + mklost+found + + Used to create a lost+found + directory on an ext2 file + system; it pre-allocates disk blocks to this directory to lighten the + task of e2fsck + + mklost+found + + + + + + resize2fs + + Can be used to enlarge or shrink an ext2 file system + + resize2fs + + + + + + tune2fs + + Adjusts tunable file system parameters on an ext2 file system + + tune2fs + + + + + + uuidgen + + Creates new UUIDs. Each new UUID can reasonably be considered + unique among all UUIDs created, on the local system and on other + systems, in the past and in the future + + uuidgen + + + + + + libblkid + + Contains routines for device identification and token + extraction + + libblkid + + + + + + libcom_err + + The common error display routine + + libcom_err + + + + + + libe2p + + Used by dumpe2fs, chattr, + and lsattr + + libe2p + + + + + + libext2fs + + Contains routines to enable user-level programs to manipulate an + ext2 file system + + libext2fs + + + + + + libss + + Used by debugfs + + libss + + + + + + libuuid + + Contains routines for generating unique identifiers for objects + that may be accessible beyond the local system + + libuuid + + + + + + + + + diff --git a/chapter06/file.xml b/chapter06/file.xml new file mode 100644 index 000000000..2d7abff5c --- /dev/null +++ b/chapter06/file.xml @@ -0,0 +1,100 @@ + + + %general-entities; +]> + + + + + File-&file-version; + + + File + + + + + + <para>The File package contains a utility for determining the type of a given + file or files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&file-ch6-sbu;</seg> + <seg>&file-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of File + + Prepare File for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + + Contents of File + + + Installed programs + Installed library + + + file + libmagic.{a,so} + + + + + Short Descriptions + + + + + file + + Tries to classify each given file; it does this by performing + several tests—file system tests, magic number tests, and language + tests + + file + + + + + + libmagic + + Contains routines for magic number recognition, used by the + file program + + libmagic + + + + + + + + + diff --git a/chapter06/findutils.xml b/chapter06/findutils.xml new file mode 100644 index 000000000..d2a89174d --- /dev/null +++ b/chapter06/findutils.xml @@ -0,0 +1,180 @@ + + + %general-entities; +]> + + + + + Findutils-&findutils-version; + + + Findutils + + + + + + <para>The Findutils package contains programs to find files. These programs + are provided to recursively search through a directory tree and to + create, maintain, and search a database (often faster than the recursive + find, but unreliable if the database has not been recently updated).</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&findutils-ch6-sbu;</seg> + <seg>&findutils-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Findutils + + Prepare Findutils for compilation: + +./configure --prefix=/usr --libexecdir=/usr/lib/findutils \ + --localstatedir=/var/lib/locate + + + 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. + + + + + + Compile the package: + +make + + To test the results, issue: + 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 correct an explicit path. + +mv -v /usr/bin/find /bin +sed -i -e 's/find:=${BINDIR}/find:=\/bin/' /usr/bin/updatedb + + + + + Contents of Findutils + + + Installed programs + + + bigram, code, find, frcode, locate, updatedb, and xargs + + + + + Short Descriptions + + + + + bigram + + Was formerly used to produce locate + databases + + bigram + + + + + + code + + Was formerly used to produce locate + databases; it is the ancestor of frcode. + + code + + + + + + find + + Searches given directory trees for files matching the specified + criteria + + find + + + + + + frcode + + Is called by updatedb to compress the list + of file names; it uses front-compression, reducing the database size + by a factor of four to five. + + frcode + + + + + + locate + + Searches through a database of file names and reports the names + that contain a given string or match a given pattern + + locate + + + + + + updatedb + + Updates the locate database; it scans the + entire file system (including other file systems that are currently + mounted, unless told not to) and puts every file name it finds into + the database + + updatedb + + + + + + xargs + + Can be used to apply a given command to a list of files + + xargs + + + + + + + + + diff --git a/chapter06/flex.xml b/chapter06/flex.xml new file mode 100644 index 000000000..96b414897 --- /dev/null +++ b/chapter06/flex.xml @@ -0,0 +1,133 @@ + + + %general-entities; +]> + + + + + Flex-&flex-version; + + + Flex + + + + + + <para>The Flex package contains a utility for generating programs that + recognize patterns in text.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&flex-ch6-sbu;</seg> + <seg>&flex-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Flex + + Prepare Flex for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + There are some packages that expect to find the + lex library in /usr/lib. Create a symlink to account for + this: + +ln -sv libfl.a /usr/lib/libl.a + + A few programs do not know about flex yet and + try to run its predecessor, lex. To support those + programs, create a wrapper script named lex that + calls flex in lex emulation + mode: + +cat > /usr/bin/lex << "EOF" +#!/bin/sh +# Begin /usr/bin/lex + +exec /usr/bin/flex -l "$@" + +# End /usr/bin/lex +EOF +chmod -v 755 /usr/bin/lex + + + + + Contents of Flex + + + Installed programs + Installed library + + + flex and lex + libfl.a + + + + + Short Descriptions + + + + + flex + + A tool for generating programs that recognize patterns in text; + it allows for the versatility to specify the rules for pattern-finding, + eradicating the need to develop a specialized program + + flex + + + + + + lex + + A script that runs flex in + lex emulation mode + + lex + + + + + + libfl.a + + The flex library + + libfl.a + + + + + + + + + diff --git a/chapter06/gawk.xml b/chapter06/gawk.xml new file mode 100644 index 000000000..5c157bc03 --- /dev/null +++ b/chapter06/gawk.xml @@ -0,0 +1,172 @@ + + + %general-entities; +]> + + + + + Gawk-&gawk-version; + + + Gawk + + + + + + <para>The Gawk package contains programs for manipulating text files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gawk-ch6-sbu;</seg> + <seg>&gawk-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gawk + + Under some circumstances, Gawk-&gawk-version; attempts to free a + chunk of memory that was not allocated. This bug is fixed by the following + patch: + +patch -Np1 -i ../&gawk-segfault-patch; + + Prepare Gawk for compilation: + +./configure --prefix=/usr --libexecdir=/usr/lib + + Due to a bug in the configure script, Gawk fails + to detect certain aspects of locale support in Glibc. This bug leads to, + e.g., Gettext testsuite failures. Work around this issue by appending the + missing macro definitions to config.h: + +cat >>config.h <<"EOF" +#define HAVE_LANGINFO_CODESET 1 +#define HAVE_LC_MESSAGES 1 +EOF + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + Contents of Gawk + + + Installed programs + + + awk (link to gawk), gawk, gawk-&gawk-version;, grcat, igawk, pgawk, + pgawk-&gawk-version;, and pwcat + + + + + Short Descriptions + + + + + awk + + A link to gawk + + awk + + + + + + gawk + + A program for manipulating text files; it is the GNU + implementation of awk + + gawk + + + + + + gawk-&gawk-version; + + A hard link to gawk + + gawk-&gawk-version; + + + + + + grcat + + Dumps the group database /etc/group + + grcat + + + + + + igawk + + Gives gawk the ability to include files + + igawk + + + + + + pgawk + + The profiling version of gawk + + pgawk + + + + + + pgawk-&gawk-version; + + Hard link to pgawk + + pgawk-&gawk-version; + + + + + + pwcat + + Dumps the password database /etc/passwd + + pwcat + + + + + + + + + diff --git a/chapter06/gcc.xml b/chapter06/gcc.xml new file mode 100644 index 000000000..41754d817 --- /dev/null +++ b/chapter06/gcc.xml @@ -0,0 +1,349 @@ + + + %general-entities; +]> + + + + + GCC-&gcc-version; + + + GCC + + + + + + <para>The GCC package contains the GNU compiler collection, which includes + the C and C++ compilers.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gcc-ch6-sbu;</seg> + <seg>&gcc-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of GCC + + Apply a sed substitution that will suppress the + installation of libiberty.a. The + version of libiberty.a provided by + Binutils will be used instead: + +sed -i 's/install_to_$(INSTALL_DEST) //' libiberty/Makefile.in + + The bootstrap build performed in + built GCC with the compiler flag. + Non-bootstrap builds omit this flag by default, so apply the following + sed to use it in order to ensure consistent compiler + builds. + +sed -i 's/^XCFLAGS =$/& -fomit-frame-pointer/' gcc/Makefile.in + + The fixincludes script is known to occasionally + erroneously attempt to "fix" the system headers installed so far. As + the headers installed by GCC-&gcc-version; and Glibc-&glibc-version; are known + to not require fixing, issue the following command to prevent the + fixincludes script from running: + +sed -i 's@\./fixinc\.sh@-c true@' gcc/Makefile.in + + GCC provides a gccbug script which detects at + compile time whether mktemp is present, and hardcodes the result in a test. + This will cause the script to fall back to using less random names for + temporary files. We will be installing mktemp later, so the following sed + will simulate its presence. + +sed -i 's/@have_mktemp_command@/yes/' gcc/gccbug.in + + The GCC documentation recommends building GCC outside of the source + directory in a dedicated build directory: + +mkdir -v ../gcc-build +cd ../gcc-build + + Prepare GCC for compilation: + +../gcc-&gcc-version;/configure --prefix=/usr \ + --libexecdir=/usr/lib --enable-shared \ + --enable-threads=posix --enable-__cxa_atexit \ + --enable-clocale=gnu --enable-languages=c,c++ + + Compile the package: + +make + + + In this section, the test suite for GCC is considered + critical. Do not skip it under any circumstance. + + + Test the results, but do not stop at errors: + +make -k check + + To receive a summary of the test suite results, run: + +../gcc-&gcc-version;/contrib/test_summary + + For only the summaries, pipe the output through + grep -A7 Summ. + + Results can be compared with those located at . + + A few unexpected failures cannot always be avoided. The GCC developers + are usually aware of these issues, but have not resolved them yet. In + particular, the libmudflap tests + are known be particularly problematic as a result of a bug in GCC + (). + Unless the test results are vastly different from those at the above URL, + it is safe to continue. + + Install the package: + +make install + + Some packages expect the C preprocessor to be installed in the + /lib directory. + To support those packages, create this symlink: + +ln -sv ../usr/bin/cpp /lib + + Many packages use the name cc to call the C + compiler. To satisfy those packages, create a symlink: + +ln -sv gcc /usr/bin/cc + + 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/i686-pc-linux-gnu/&gcc-version;/../../../crt1.o succeeded +/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crti.o succeeded +/usr/lib/gcc/i686-pc-linux-gnu/&gcc-version;/../../../crtn.o succeeded + + + + + + + +SEARCH_DIR("/usr/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/local/lib") +SEARCH_DIR("/lib") +SEARCH_DIR("/usr/lib"); + + + + + + + + + + + + + + + + + + + + + + + + + + + Contents of GCC + + + Installed programs + Installed libraries + + + c++, cc (link to gcc), cpp, g++, gcc, gccbug, and gcov + libgcc.a, libgcc_eh.a, libgcc_s.so, libstdc++.{a,so}, and + libsupc++.a + + + + + Short Descriptions + + + + + cc + + The C compiler + + cc + + + + + + cpp + + The C preprocessor; it is used by the compiler to expand the + #include, #define, and similar statements in the source files + + cpp + + + + + + c++ + + The C++ compiler + + c++ + + + + + + g++ + + The C++ compiler + + g++ + + + + + + gcc + + The C compiler + + gcc + + + + + + gccbug + + A shell script used to help create useful bug reports + + gccbug + + + + + + gcov + + A coverage testing tool; it is used to analyze programs to + determine where optimizations will have the most effect + + gcov + + + + + + libgcc + + Contains run-time support for gcc + + libgcc* + + + + + + libstdc++ + + The standard C++ library + + libstdc++ + + + + + + libsupc++ + + Provides supporting routines for the C++ programming + language + + libsupc++ + + + + + + + + + diff --git a/chapter06/gettext.xml b/chapter06/gettext.xml new file mode 100644 index 000000000..f1e53723e --- /dev/null +++ b/chapter06/gettext.xml @@ -0,0 +1,394 @@ + + + %general-entities; +]> + + + + + Gettext-&gettext-version; + + + Gettext + + + + + + <para>The Gettext package contains utilities for internationalization and + localization. These allow programs to be compiled with NLS (Native Language + Support), enabling them to output messages in the user's native + language.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gettext-ch6-sbu;</seg> + <seg>&gettext-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gettext + + Prepare Gettext for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + This takes a very long time, around 5 SBUs. + + Install the package: + +make install + + + + + Contents of Gettext + + + Installed programs + Installed libraries + + + autopoint, config.charset, config.rpath, envsubst, gettext, gettext.sh, + gettextize, hostname, msgattrib, msgcat, msgcmp, msgcomm, msgconv, msgen, + msgexec, msgfilter, msgfmt, msggrep, msginit, msgmerge, msgunfmt, msguniq, + ngettext, and xgettext + libasprintf.{a,so}, libgettextlib.so, libgettextpo.{a,so}, and + libgettextsrc.so + + + + + Short Descriptions + + + + + autopoint + + Copies standard Gettext infrastructure files into a source + package + + autopoint + + + + + + config.charset + + Outputs a system-dependent table of character encoding + aliases + + config.charset + + + + + + config.rpath + + Outputs a system-dependent set of variables, describing how + to set the runtime search path of shared libraries in an + executable + + config.rpath + + + + + + envsubst + + Substitutes environment variables in shell format strings + + envsubst + + + + + + gettext + + Translates a natural language message into the user's language + by looking up the translation in a message catalog + + gettext + + + + + + 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 + + + + + + hostname + + Displays a network hostname in various forms + + hostname + + + + + + msgattrib + + Filters the messages of a translation catalog according to their + attributes and manipulates the attributes + + msgattrib + + + + + + msgcat + + Concatenates and merges the given + .po files + + msgcat + + + + + + msgcmp + + Compares two .po + files to check that both contain the same set of msgid strings + + msgcmp + + + + + + msgcomm + + Finds the messages that are common to to the given + .po files + + msgcomm + + + + + + msgconv + + Converts a translation catalog to a different character + encoding + + msgconv + + + + + + msgen + + Creates an English translation catalog + + msgen + + + + + + msgexec + + Applies a command to all translations of a translation + catalog + + msgexec + + + + + + msgfilter + + Applies a filter to all translations of a translation + catalog + + msgfilter + + + + + + msgfmt + + Generates a binary message catalog from a translation + catalog + + msgfmt + + + + + + msggrep + + Extracts all messages of a translation catalog that match a + given pattern or belong to some given source files + + msggrep + + + + + + msginit + + Creates a new .po file, + initializing the meta information with values from the user's + environment + + msginit + + + + + + msgmerge + + Combines two raw translations into a single file + + msgmerge + + + + + + msgunfmt + + Decompiles a binary message catalog into raw translation + text + + msgunfmt + + + + + + msguniq + + Unifies duplicate translations in a translation catalog + + msguniq + + + + + + ngettext + + Displays native language translations of a textual message whose + grammatical form depends on a number + + ngettext + + + + + + xgettext + + Extracts the translatable message lines from the given source + files to make the first translation template + + xgettext + + + + + + libasprintf + + defines the autosprintf class, which makes + C formatted output routines usable in C++ programs, for use with the + <string> strings and the + <iostream> streams + + libasprintf + + + + + + libgettextlib + + a private library containing common routines used by the + various Gettext programs; these are not intended for general use + + libgettextlib + + + + + + libgettextpo + + Used to write specialized programs that process + .po files; this library is + used when the standard applications shipped with Gettext (such as + msgcomm, msgcmp, + msgattrib, and msgen) will + not suffice + + libgettextpo + + + + + + libgettextsrc + + A private library containing common routines used by the + various Gettext programs; these are not intended for general use + + libgettextsrc + + + + + + + + + diff --git a/chapter06/glibc.xml b/chapter06/glibc.xml new file mode 100644 index 000000000..eb39a12e9 --- /dev/null +++ b/chapter06/glibc.xml @@ -0,0 +1,854 @@ + + + %general-entities; +]> + + + + + Glibc-&glibc-version; + + + Glibc + + + + + + <para>The Glibc package contains the main C library. This library provides + the basic routines for allocating memory, searching directories, opening and + closing files, reading and writing files, string handling, pattern matching, + arithmetic, and so on.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&glibc-ch6-sbu;</seg> + <seg>&glibc-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Glibc + + + Some packages outside of LFS suggest installing GNU libiconv in + order to translate data from one encoding to another. The project's + home page () says + This library provides an iconv() + implementation, for use on systems which don't have one, or whose + implementation cannot convert from/to Unicode. Glibc provides + an iconv() implementation and can convert from/to + Unicode, therefore libiconv is not required on an LFS system. + + + The Glibc build system is self-contained and will install + perfectly, even though the compiler specs file and linker are still + pointing at /tools. The specs + and linker cannot be adjusted before the Glibc install because the + Glibc autoconf tests would give false results and defeat the goal + of achieving a clean build. + + The glibc-libidn tarball adds support for internationalized domain + names (IDN) to Glibc. Many programs that support IDN require the full + libidn library (see + ), not this add-on. + Unpack the tarball from within the Glibc source directory: + +tar -xf ../glibc-libidn-&glibc-version;.tar.bz2 + + Apply the following patch to fix build errors in packages that include + linux/types.h after sys/kd.h: + +patch -Np1 -i ../&glibc-linux_types-patch; + + In the vi_VN.TCVN locale, bash enters an infinite loop + at startup. It is unknown whether this is a bash bug or a + Glibc problem. Disable installation of this locale in order to avoid the + problem: + +sed -i '/vi_VN.TCVN/d' localedata/SUPPORTED + + When running make install, a script called + test-installation.pl performs a small sanity test on + our newly installed Glibc. However, because our toolchain still points to + the /tools directory, the sanity + test would be carried out against the wrong Glibc. We can force the script + to check the Glibc we have just installed with the following: + +sed -i \ +'s|libs -o|libs -L/usr/lib -Wl,-dynamic-linker=/lib/ld-linux.so.2 -o|' \ + scripts/test-installation.pl + + The Glibc documentation recommends building Glibc outside of the source + directory in a dedicated build directory: + +mkdir -v ../glibc-build +cd ../glibc-build + + Prepare Glibc for compilation: + +../glibc-&glibc-version;/configure --prefix=/usr \ + --disable-profile --enable-add-ons \ + --enable-kernel=2.6.0 --libexecdir=/usr/lib/glibc + + + The meaning of the new configure options: + + + --libexecdir=/usr/lib/glibc + + This changes the location of the pt_chown + program from its default of /usr/libexec to /usr/lib/glibc. + + + + + + Compile the package: + +make + + + In this section, the test suite for Glibc is considered critical. + Do not skip it under any circumstance. + + + Test the results: + +make -k check 2>&1 | tee glibc-check-log +grep Error glibc-check-log + + You will probably see an expected (ignored) failure in the + posix/annexc test. In addition the Glibc test suite + is somewhat dependent on the host system. This is a list of the most + common issues: + + + + The nptl/tst-clock2 and + tst-attr3 tests sometimes + fail. The reason is not completely understood, but indications + are that a heavy system load can trigger these failures. + + + The math tests sometimes fail when running on + systems where the CPU is not a relatively new genuine Intel or + authentic AMD processor. + + + If you have mounted the LFS partition with the + noatime option, the atime + test will fail. As mentioned in , do not + use the noatime option while building LFS. + + + When running on older and slower hardware or on systems under + load, some tests can fail because of test timeouts being exceeded. + + + + Though it is a harmless message, the install stage of Glibc will + complain about the absence of /etc/ld.so.conf. + Prevent this warning with: + +touch /etc/ld.so.conf + + Install the package: + +make install + + The locales that can make the system respond in a different language + were not installed by the above command. None of the locales are required, + but, if some of them are misssing, testuites of the future packages would + skip important testcases. + + Individual locales can be installed using the + localedef program. E.g., the first + localedef command below combines the + /usr/share/i18n/locales/de_DE + charset-independent locale definition with the + /usr/share/i18n/charmaps/ISO-8859-1.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 de_DE -f ISO-8859-1 de_DE +localedef -i de_DE@euro -f ISO-8859-15 de_DE@euro +localedef -i en_HK -f ISO-8859-1 en_HK +localedef -i en_PH -f ISO-8859-1 en_PH +localedef -i en_US -f ISO-8859-1 en_US +localedef -i en_US -f UTF-8 en_US.UTF-8 +localedef -i es_MX -f ISO-8859-1 es_MX +localedef -i fa_IR -f UTF-8 fa_IR +localedef -i fr_FR -f ISO-8859-1 fr_FR +localedef -i fr_FR@euro -f ISO-8859-15 fr_FR@euro +localedef -i fr_FR -f UTF-8 fr_FR.UTF-8 +localedef -i it_IT -f ISO-8859-1 it_IT +localedef -i ja_JP -f EUC-JP ja_JP + + 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 if you need them. + + + + + + Configuring Glibc + + + /etc/nsswitch.conf + + + + /etc/localtime + + + The /etc/nsswitch.conf file needs to be created + because, although Glibc provides defaults when this file is missing or corrupt, + the Glibc defaults do not work well in a networked environment. The time zone + also needs to be configured. + + 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 + + To determine the local time zone, 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., EST5EDT or + Canada/Eastern). Then create the + /etc/localtime file by running: + +cp -v --remove-destination /usr/share/zoneinfo/<xxx> \ + /etc/localtime + + Replace <xxx> with the name of the time zone + that tzselect provided (e.g., Canada/Eastern). + + + The meaning of the cp option: + + + --remove-destination + + This is needed to force removal of the already existing symbolic + link. The reason for copying the file instead of using a symlink is to + cover the situation where /usr + is on a separate partition. This could be important when booted into + single user mode. + + + + + + + + + Configuring 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 + +# End /etc/ld.so.conf +EOF + + + + + Contents of Glibc + + + Installed programs + Installed libraries + + + catchsegv, gencat, getconf, getent, iconv, iconvconfig, ldconfig, + ldd, lddlibc4, locale, localedef, mtrace, nscd, nscd_nischeck, + pcprofiledump, pt_chown, rpcgen, rpcinfo, sln, sprof, tzselect, xtrace, + zdump, and zic + ld.so, libBrokenLocale.{a,so}, libSegFault.so, libanl.{a,so}, + libbsd-compat.a, libc.{a,so}, libcidn.so, libcrypt.{a,so}, libdl.{a,so}, + libg.a, libieee.a, libm.{a,so}, libmcheck.a, libmemusage.so, libnsl.a, + libnss_compat.so, libnss_dns.so, libnss_files.so, libnss_hesiod.so, + libnss_nis.so, libnss_nisplus.so, libpcprofile.so, libpthread.{a,so}, + libresolv.{a,so}, librpcsvc.a, librt.{a,so}, libthread_db.so, and + libutil.{a,so} + + + + + 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 + + Prints various information about the current locale + + locale + + + + + + localedef + + Compiles locale specifications + + localedef + + + + + + 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 + + + + + + nscd_nischeck + + Checks whether or not secure mode is necessary for NIS+ + lookup + + nscd_nischeck + + + + + + pcprofiledump + + Dumps information generated by PC profiling + + pcprofiledump + + + + + + pt_chown + + A helper program for grantpt to set the owner, + group and access permissions of a slave pseudo terminal + + pt_chown + + + + + + rpcgen + + Generates C code to implement the Remote Procecure Call (RPC) + protocol + + rpcgen + + + + + + rpcinfo + + Makes an RPC call to an RPC server + + rpcinfo + + + + + + sln + + A statically linked ln program + + sln + + + + + + sprof + + Reads and displays shared object profiling data + + sprof + + + + + + tzselect + + Asks the user about the location of the system and reports + the corresponding time zone description + + tzselect + + + + + + xtrace + + Traces the execution of a program by printing the currently + executed function + + xtrace + + + + + + zdump + + The time zone dumper + + zdump + + + + + + zic + + The time zone compiler + + zic + + + + + + ld.so + + The helper program for shared library executables + + ld.so + + + + + + libBrokenLocale + + Used 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 + + + + + + libSegFault + + The segmentation fault signal handler, used by + catchsegv + + libSegFault + + + + + + libanl + + An asynchronous name lookup library + + libanl + + + + + + libbsd-compat + + Provides the portability needed in order to run certain Berkey + Software Distribution (BSD) programs under Linux + + libbsd-compat + + + + + + libc + + The main C library + + libc + + + + + + libcidn + + Used internally by Glibc for handling internationalized domain + names in the getaddrinfo() function + + libcrypt + + + + + + libcrypt + + The cryptography library + + libcrypt + + + + + + libdl + + The dynamic linking interface library + + libdl + + + + + + libg + + Dummy library containing no functions. Previously was a runtime + library for g++ + + libg + + + + + + libieee + + Linking in this module forces error handling rules for math + functions as defined by the Institute of Electrical and Electronic + Engineers (IEEE). The default is POSIX.1 error handling + + libieee + + + + + + libm + + The mathematical library + + libm + + + + + + libmcheck + + Turns on memory allocation checking when linked to + + libmcheck + + + + + + libmemusage + + Used by memusage to help collect + information about the memory usage of a program + + libmemusage + + + + + + libnsl + + The network services library + + libnsl + + + + + + libnss + + The Name Service Switch libraries, containing functions for + resolving host names, user names, group names, aliases, services, + protocols, etc. + + libnss + + + + + + libpcprofile + + Contains profiling functions used to track the amount of CPU + time spent in specific source code lines + + libpcprofile + + + + + + libpthread + + The POSIX threads library + + libpthread + + + + + + libresolv + + Contains functions for creating, sending, and interpreting + packets to the Internet domain name servers + + libresolv + + + + + + librpcsvc + + Contains functions providing miscellaneous RPC services + + librpcsvc + + + + + + librt + + Contains functions providing most of the interfaces specified + by the POSIX.1b Realtime Extension + + librt + + + + + + libthread_db + + Contains functions useful for building debuggers for + multi-threaded programs + + libthread_db + + + + + + libutil + + Contains code for standard functions used in + many different Unix utilities + + libutil + + + + + + + + + diff --git a/chapter06/grep.xml b/chapter06/grep.xml new file mode 100644 index 000000000..b92bfcf94 --- /dev/null +++ b/chapter06/grep.xml @@ -0,0 +1,114 @@ + + + %general-entities; +]> + + + + + Grep-&grep-version; + + + Grep + + + + + + <para>The Grep package contains programs for searching through files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&grep-ch6-sbu;</seg> + <seg>&grep-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Grep + + The current Grep package has many bugs, especially in the support of + multibyte locales. RedHat fixed some of them with the following patch: + +patch -Np1 -i ../&grep-fixes-patch; + + In order for the tests added by this patch to pass, the permissions for + the test file have to be changed: + +chmod +x tests/fmbtest.sh + + Prepare Grep for compilation: + +./configure --prefix=/usr --bindir=/bin + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + Contents of Grep + + + Installed programs + + + egrep (link to grep), fgrep (link to grep), and grep + + + + + Short Descriptions + + + + + egrep + + Prints lines matching an extended regular expression + + egrep + + + + + + fgrep + + Prints lines matching a list of fixed strings + + fgrep + + + + + + grep + + Prints lines matching a basic regular expression + + grep + + + + + + + + + diff --git a/chapter06/groff.xml b/chapter06/groff.xml new file mode 100644 index 000000000..3887ca4c0 --- /dev/null +++ b/chapter06/groff.xml @@ -0,0 +1,474 @@ + + + %general-entities; +]> + + + + + 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 + + Apply the patch that adds the ascii8 and + nippon devices to Groff: + +patch -Np1 -i ../&groff-debian-patch; + + + These devices are used by Man-DB when formatting non-English manual + pages that are not in the ISO-8859-1 encoding. Currently, there is no + working patch for Groff-1.19.x that adds this functionality. + + + + Many screen fonts don't have Unicode single quotes and dashes in them. + Tell Groff to use the ASCII equivalents instead: + +sed -i -e 's/2010/002D/' -e 's/2212/002D/' \ + -e 's/2018/0060/' -e 's/2019/0027/' font/devutf8/R.proto + + 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 --enable-multibyte + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + Some documentation programs, such as xman, + will not work properly without the following symlinks: + +ln -sv eqn /usr/bin/geqn +ln -sv tbl /usr/bin/gtbl + + + + + Contents of Groff + + + Installed programs + + + addftinfo, afmtodit, eqn, eqn2graph, geqn (link to eqn), grn, + grodvi, groff, groffer, grog, grolbp, grolj4, grops, grotty, gtbl + (link to tbl), hpftodit, indxbib, lkbib, lookbib, mmroff, neqn, + nroff, pfbtops, pic, pic2graph, post-grohtml, pre-grohtml, refer, + soelim, tbl, tfmtodit, and troff + + + + + Short Descriptions + + + + + addftinfo + + Reads a troff font file and adds some additional font-metric + information that is used by the groff system + + addftinfo + + + + + + afmtodit + + Creates a font file for use with groff and + grops + + afmtodit + + + + + + eqn + + Compiles descriptions of equations embedded within troff + input files into commands that are understood by + troff + + eqn + + + + + + eqn2graph + + Converts a troff EQN (equation) into a cropped image + + eqn2graph + + + + + + geqn + + A link to eqn + + geqn + + + + + + grn + + A groff preprocessor for gremlin files + + grn + + + + + + grodvi + + A driver for groff that produces TeX dvi + format + + grodvi + + + + + + groff + + A front-end to the groff document formatting system; normally, it + runs the troff program and a post-processor + appropriate for the selected device + + groff + + + + + + groffer + + Displays groff files and man pages on X and tty terminals + + groffer + + + + + + grog + + Reads files and guesses which of the groff + options , , , + , , , + , 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 + + + + + + grops + + Translates the output of GNU troff to + PostScript + + grops + + + + + + grotty + + Translates the output of GNU troff into + a form suitable for typewriter-like devices + + grotty + + + + + + gtbl + + A link to tbl + + gtbl + + + + + + hpftodit + + Creates a font file for use with groff -Tlj4 + from an HP-tagged font metric file + + hpftodit + + + + + + indxbib + + Creates an inverted index for the bibliographic databases with a + specified file for use with refer, + lookbib, and lkbib + + indxbib + + + + + + lkbib + + Searches bibliographic databases for references that contain + specified keys and reports any references found + + lkbib + + + + + + lookbib + + Prints a prompt on the standard error (unless the standard input + is not a terminal), reads a line containing a set of keywords from the + standard input, searches the bibliographic databases in a specified file + for references containing those keywords, prints any references found + on the standard output, and repeats this process until the end of + input + + lookbib + + + + + + mmroff + + A simple preprocessor for groff + + mmroff + + + + + + neqn + + Formats equations for American Standard Code for Information + Interchange (ASCII) output + + neqn + + + + + + nroff + + A script that emulates the nroff command + using groff + + nroff + + + + + + pfbtops + + Translates a PostScript font in .pfb format to ASCII + + pfbtops + + + + + + pic + + Compiles descriptions of pictures embedded within troff or + TeX input files into commands understood by TeX or + troff + + pic + + + + + + pic2graph + + Converts a PIC diagram into a cropped image + + pic2graph + + + + + + post-grohtml + + Translates the output of GNU troff to + HTML + + post-grohtml + + + + + + pre-grohtml + + Translates the output of GNU troff to + HTML + + pre-grohtml + + + + + + refer + + Copies the contents of a file to the standard output, except + that lines between .[ and .] + are interpreted as citations, and lines between .R1 + and .R2 are interpreted as commands for how + citations are to be processed + + refer + + + + + + soelim + + Reads files and replaces lines of the form .so + file by the contents of the mentioned + file + + soelim + + + + + + tbl + + Compiles descriptions of tables embedded within troff input + files into commands that are understood by + troff + + tbl + + + + + + tfmtodit + + Creates a font file for use with groff + -Tdvi + + tfmtodit + + + + + + troff + + Is highly compatible with Unix troff; it + should usually be invoked using the groff command, + which will also run preprocessors and post-processors in the + appropriate order and with the appropriate options + + troff + + + + + + + + + diff --git a/chapter06/grub.xml b/chapter06/grub.xml new file mode 100644 index 000000000..8651c95c8 --- /dev/null +++ b/chapter06/grub.xml @@ -0,0 +1,156 @@ + + + %general-entities; +]> + + + + + 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 + + This package is known to have issues when its default + optimization flags (including the -march and + -mcpu options) are changed. If any environment + variables that override default optimizations have been defined, such + as CFLAGS and CXXFLAGS, + unset them when building GRUB. + + Prepare GRUB for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install +mkdir -v /boot/grub +cp -v /usr/lib/grub/i386-pc/stage{1,2} /boot/grub + + Replace i386-pc with whatever + directory is appropriate for the hardware in use. + + The i386-pc directory + contains a number of *stage1_5 files, different + ones for different file systems. Review the files available and copy + the appropriate ones to the /boot/grub directory. Most users will + copy the e2fs_stage1_5 and/or + reiserfs_stage1_5 files. + + + + + Contents of GRUB + + + Installed programs + + + grub, grub-install, grub-md5-crypt, grub-set-default, + grub-terminfo, and mbchk + + + + + Short Descriptions + + + + + grub + + The Grand Unified Bootloader's command shell + + grub + + + + + + grub-install + + Installs GRUB on the given device + + grub-install + + + + + + grub-md5-crypt + + Encrypts a password in MD5 format + + grub-md5-crypt + + + + + + grub-set-default + + Sets the default boot entry for GRUB + + grub-set-default + + + + + + grub-terminfo + + Generates a terminfo command from a terminfo name; it can be + employed if an unknown terminal is being used + + grub-terminfo + + + + + + mbchk + + Checks the format of a multi-boot kernel + + mbchk + + + + + + + + + diff --git a/chapter06/gzip.xml b/chapter06/gzip.xml new file mode 100644 index 000000000..9cb4b8437 --- /dev/null +++ b/chapter06/gzip.xml @@ -0,0 +1,255 @@ + + + %general-entities; +]> + + + + + Gzip-&gzip-version; + + + Gzip + + + + + + <para>The Gzip package contains programs for compressing and decompressing + files.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&gzip-ch6-sbu;</seg> + <seg>&gzip-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Gzip + + Gzip has 2 known security vulnerabilities. The following patch + addresses both of them: + +patch -Np1 -i ../&gzip-security_fix-patch; + + Prepare Gzip for compilation: + +./configure --prefix=/usr + + The gzexe script has the location of the + gzip binary hard-wired into it. Because the + location of the binary is changed later, the following command ensures + that the new location gets placed into the script: + +sed -i 's@"BINDIR"@/bin@g' gzexe.in + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + Move the gzip program to the /bin directory and create some commonly used + symlinks to it: + +mv -v /usr/bin/gzip /bin +rm -v /usr/bin/{gunzip,zcat} +ln -sv gzip /bin/gunzip +ln -sv gzip /bin/zcat +ln -sv gzip /bin/compress +ln -sv gunzip /bin/uncompress + + + + + Contents of Gzip + + + Installed programs + + + compress (link to gzip), gunzip (link to gzip), gzexe, gzip, + uncompress (link to gunzip), zcat (link to gzip), zcmp, zdiff, + zegrep, zfgrep, zforce, zgrep, zless, zmore, and znew + + + + + Short Descriptions + + + + + compress + + Compresses and decompresses files + + compress + + + + + + gunzip + + Decompresses gzipped files + + gunzip + + + + + + gzexe + + Creates self-decompressing executable files + + gzexe + + + + + + gzip + + Compresses the given files using Lempel-Ziv (LZ77) coding + + gzip + + + + + + uncompress + + Decompresses compressed files + + uncompress + + + + + + zcat + + Decompresses the given gzipped files to standard output + + zcat + + + + + + zcmp + + Runs cmp on gzipped files + + zcmp + + + + + + zdiff + + Runs diff on gzipped files + + zdiff + + + + + + zegrep + + Runs egrep on gzipped files + + zegrep + + + + + + zfgrep + + Runs fgrep on gzipped files + + zfgrep + + + + + + zforce + + Forces a .gz extension on + all given files that are gzipped files, so that gzip + will not compress them again; this can be useful when file names were + truncated during a file transfer + + zforce + + + + + + zgrep + + Runs grep on gzipped files + + zgrep + + + + + + zless + + Runs less on gzipped files + + zless + + + + + + zmore + + Runs more on gzipped files + + zmore + + + + + + znew + + Re-compresses files from compress format to + gzip format—.Z to .gz + + znew + + + + + + + + + diff --git a/chapter06/iana-etc.xml b/chapter06/iana-etc.xml new file mode 100644 index 000000000..2e786ce74 --- /dev/null +++ b/chapter06/iana-etc.xml @@ -0,0 +1,95 @@ + + + %general-entities; +]> + + + + + Iana-Etc-&iana-etc-version; + + + Iana-Etc + + + + + + <para>The Iana-Etc package provides data for network services and + protocols.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <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 + + The following command converts the raw data provided by IANA into the + correct formats for the /etc/protocols and + /etc/services data files: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + 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 new file mode 100644 index 000000000..87bd5e35c --- /dev/null +++ b/chapter06/inetutils.xml @@ -0,0 +1,218 @@ + + + %general-entities; +]> + + + + + 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 + + Apply a patch to Inetutils to enable it to compile with + GCC-&gcc-version;: + +patch -Np1 -i ../&inetutils-gcc4_fixes-patch; + + All programs that come with Inetutils will not be installed. + However, the Inetutils build system will insist on installing all the + man pages anyway. The following patch will correct this + situation: + +patch -Np1 -i ../&inetutils-man_pages-patch; + +Prepare Inetutils for compilation: + +./configure --prefix=/usr --libexecdir=/usr/sbin \ + --sysconfdir=/etc --localstatedir=/var \ + --disable-logger --disable-syslogd \ + --disable-whois --disable-servers + + + The meaning of the configure options: + + + --disable-logger + + This option prevents Inetutils from installing the + logger program, which is used by scripts to + pass messages to the System Log Daemon. Do not install it because + Util-linux installs a better version later. + + + + + --disable-syslogd + + This option prevents Inetutils from installing the System Log + Daemon, which is installed with the Sysklogd package. + + + + + --disable-whois + + This option disables the building of the Inetutils + whois client, which is out of date. Instructions for + a better whois client are in the BLFS book. + + + + + --disable-servers + + This disables the installation of the various network servers + included as part of the Inetutils package. These servers are deemed not + appropriate in a basic LFS system. Some are insecure by nature and are + only considered safe on trusted networks. More information can be found + at . Note that + better replacements are available for many of these servers. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + Move the ping program to its FHS-compliant + place: + +mv -v /usr/bin/ping /bin + + + + + Contents of Inetutils + + + Installed programs + + + ftp, ping, rcp, rlogin, rsh, talk, telnet, and tftp + + + + + Short Descriptions + + + + + ftp + + Is the file transfer protocol program + + ftp + + + + + + ping + + Sends echo-request packets and reports how long the replies + take + + ping + + + + + + rcp + + Performs remote file copy + + rcp + + + + + + rlogin + + Performs remote login + + rlogin + + + + + + rsh + + Runs a remote shell + + rsh + + + + + + talk + + Is used to chat with another user + + talk + + + + + + telnet + + An interface to the TELNET protocol + + telnet + + + + + + tftp + + A trivial file transfer program + + tftp + + + + + + + + + diff --git a/chapter06/introduction.xml b/chapter06/introduction.xml new file mode 100644 index 000000000..1a5e0aae4 --- /dev/null +++ b/chapter06/introduction.xml @@ -0,0 +1,57 @@ + + + %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 the user (or the system) + needs it. For every installed package, a summary of its contents is given, + followed by concise descriptions of each program and library the package + installed. + + If using compiler optimizations, please + review the optimization hint at . + Compiler optimizations can make a program run slightly faster, but they may + also cause compilation difficulties and problems when running the program. + If a package refuses to compile when using optimization, try to compile it + without optimization and see if that fixes the problem. Even if the package + does compile when using optimization, there is the risk it may have been + compiled incorrectly because of the complex interactions between the code + and build tools. Also note that the and + options may cause problems with the toolchain packages + (Binutils, GCC and Glibc). The small potential gains achieved in using + compiler optimizations are often outweighed by the risks. First-time builders + of LFS are encouraged to build without custom optimizations. The subsequent + system will still run very fast and be stable at the same time. + + The order that packages are installed in this chapter needs to be + strictly followed to ensure that no program accidentally acquires a path + referring to /tools hard-wired into + it. For the same reason, do not compile packages in parallel. Compiling in + parallel may save time (especially on dual-CPU machines), but it could result + in a program containing a hard-wired path to /tools, which will cause the program to stop + working when that directory is removed. + + Before the installation instructions, each installation page provides + information about the package, including a concise description of what it + contains, approximately how long it will take to build, 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. + + diff --git a/chapter06/iproute2.xml b/chapter06/iproute2.xml new file mode 100644 index 000000000..eb0438e25 --- /dev/null +++ b/chapter06/iproute2.xml @@ -0,0 +1,299 @@ + + + %general-entities; +]> + + + + + 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 + + Compile the package: + +make SBINDIR=/sbin + + + The meaning of the make option: + + + SBINDIR=/sbin + + This ensures that the IPRoute2 binaries will install into + /sbin. This is the correct + location according to the FHS, because some of the IPRoute2 binaries + are used by the LFS-Bootscripts package. + + + + + + This package does not come with a test suite. + + Install the package: + +make SBINDIR=/sbin install + + The arpd binary links against the Berkeley DB + libraries that reside in /usr and + uses a database in /var/lib/arpd/arpd.db. Thus, + according to the FHS, it must be in /usr/sbin. Move it there: + + mv -v /sbin/arpd /usr/sbin + + + + + Contents of IPRoute2 + + + Installed programs + + + arpd, ctstat (link to lnstat), ifcfg, ifstat, ip, lnstat, nstat, + routef, routel, rtacct, rtmon, rtpr, rtstat (link to lnstat), ss, + and tc. + + + + + Short Descriptions + + + + + arpd + + Userspace ARP daemon, useful in really large networks, where the + kernelspace ARP implementation is insufficient, or when setting up a + honeypot + + arpd + + + + + + ctstat + + Connection status utility + + ctstat + + + + + + ifcfg + + A shell script wrapper for the ip command + + 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 continously 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 new file mode 100644 index 000000000..1ada7b17c --- /dev/null +++ b/chapter06/kbd.xml @@ -0,0 +1,371 @@ + + + %general-entities; +]> + + + + + Kbd-&kbd-version; + + + Kbd + + + + + + <para>The Kbd package contains key-table files and keyboard utilities.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&kbd-ch6-sbu;</seg> + <seg>&kbd-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Kbd + + 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. + + Patch Kbd to fix a bug in setfont that is triggered + when compiling with GCC-&gcc-version;: + +patch -Np1 -i ../&kbd-gcc4_fixes-patch; + + Prepare Kbd for compilation: + +./configure --datadir=/lib/kbd + + + The meaning of the configure options: + + + --datadir=/lib/kbd + + This option puts keyboard layout data in a directory that will + always be on the root partition instead of the default /usr/share/kbd. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + 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. + + + Some of the scripts in the LFS-Bootscripts package depend on + kbd_mode, openvt, and + setfont. As /usr + may not be available during the early stages of booting, those binaries + need to be on the root partition: + +mv -v /usr/bin/{kbd_mode,openvt,setfont} /bin + + + + + + + + Contents of Kbd + + + Installed programs + + + chvt, deallocvt, dumpkeys, fgconsole, getkeycodes, kbd_mode, + kbdrate, loadkeys, loadunimap, + mapscrn, openvt, psfaddtable (link to psfxtable), psfgettable (link to + psfxtable), psfstriptable (link to psfxtable), psfxtable, resizecons, + setfont, setkeycodes, setleds, setmetamode, + showconsolefont, showkey, unicode_start, and unicode_stop + + + + + 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 + + + + + + kbd_mode + + Reports or sets the keyboard mode + + kbd_mode + + + + + + kbdrate + + Sets the keyboard repeat and delay rates + + kbdrate + + + + + + loadkeys + + Loads the keyboard translation tables + + loadkeys + + + + + + loadunimap + + Loads the kernel unicode-to-font mapping table + + loadunimap + + + + + + mapscrn + + An obsolete program that used to load a user-defined output + character mapping table into the console driver; this is now done + by setfont + + mapscrn + + + + + + openvt + + Starts a program on a new virtual terminal (VT) + + openvt + + + + + + psfaddtable + + A link to psfxtable + + psfaddtable + + + + + + psfgettable + + A link to psfxtable + + psfgettable + + + + + + psfstriptable + + A link to psfxtable + + psfstriptable + + + + + + psfxtable + + Handle Unicode character tables for console fonts + + psfxtable + + + + + + resizecons + + Changes the kernel idea of the console size + + resizecons + + + + + + setfont + + Changes the Enhanced Graphic Adapter (EGA) and Video Graphics + Array (VGA) fonts on the console + + setfont + + + + + + setkeycodes + + Loads kernel scancode-to-keycode mapping table entries; this is + useful if there are unusual keys on the keyboard + + setkeycodes + + + + + + setleds + + Sets the keyboard flags and Light Emitting Diodes (LEDs) + + setleds + + + + + + setmetamode + + Defines the keyboard meta-key handling + + setmetamode + + + + + + 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..034d60422 --- /dev/null +++ b/chapter06/kernfs.xml @@ -0,0 +1,78 @@ + + + %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} + + + 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 will 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. This is generally done during the boot process by Udev. Since + this new system does not yet have Udev and has not yet been booted, it is + necessary to mount and populate /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 --bind /dev $LFS/dev + + + + + Mounting Virtual Kernel File Systems + + Now mount the remaining virtual kernel filesystems: + +mount -vt devpts devpts $LFS/dev/pts +mount -vt tmpfs shm $LFS/dev/shm +mount -vt proc proc $LFS/proc +mount -vt sysfs sysfs $LFS/sys + + + + diff --git a/chapter06/less.xml b/chapter06/less.xml new file mode 100644 index 000000000..4dfacdbcc --- /dev/null +++ b/chapter06/less.xml @@ -0,0 +1,119 @@ + + + %general-entities; +]> + + + + + 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/libtool.xml b/chapter06/libtool.xml new file mode 100644 index 000000000..8283627ee --- /dev/null +++ b/chapter06/libtool.xml @@ -0,0 +1,110 @@ + + + %general-entities; +]> + + + + + Libtool-&libtool-version; + + + Libtool + + + + + + <para>The Libtool package contains the GNU generic library support script. + It wraps the complexity of using shared libraries in a consistent, portable + interface.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <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. + + Install the package: + +make install + + + + + + Contents of Libtool + + + Installed programs + Installed libraries + + + libtool and libtoolize + libltdl.{a,so} + + + + + Short Descriptions + + + + + libtool + + Provides generalized library-building support services + + libtool + + + + + + libtoolize + + Provides a standard way to add libtool + support to a package + + libtoolize + + + + + + libltdl + + Hides the various difficulties of dlopening libraries + + libltdl + + + + + + + + + diff --git a/chapter06/linux-libc-headers.xml b/chapter06/linux-libc-headers.xml new file mode 100644 index 000000000..9496c0b99 --- /dev/null +++ b/chapter06/linux-libc-headers.xml @@ -0,0 +1,93 @@ + + + %general-entities; +]> + + + + + Linux-Libc-Headers-&linux-libc-headers-version; + + + Linux-Libc-Headers + + + + + + <para>The Linux-Libc-Headers package contains the + <quote>sanitized</quote> kernel headers.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&linux-libc-headers-ch6-sbu;</seg> + <seg>&linux-libc-headers-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Linux-Libc-Headers + + For years it has been common practice to use raw + kernel headers (straight from a kernel tarball) in /usr/include, but over the last few + years, the kernel developers have taken a strong stance that this + should not be done. This gave birth to the Linux-Libc-Headers Project, + which was designed to maintain an API stable version of the Linux + headers. + + Install the header files: + +install -dv /usr/include/asm +cp -Rv include/asm-i386/* /usr/include/asm +cp -Rv include/linux /usr/include + + Ensure that all the headers are owned by root: + +chown -Rv root:root /usr/include/{asm,linux} + + Make sure the users can read the headers: + +find /usr/include/{asm,linux} -type d -exec chmod -v 755 {} \; +find /usr/include/{asm,linux} -type f -exec chmod -v 644 {} \; + + + + + Contents of Linux-Libc-Headers + + + Installed headers + + + /usr/include/{asm,linux}/*.h + + + + + Short Descriptions + + + + + /usr/include/{asm,linux}/*.h + + The Linux API headers + + /usr/include/{asm,linux}/*.h + + + + + + + + + diff --git a/chapter06/m4.xml b/chapter06/m4.xml new file mode 100644 index 000000000..fe5c5a6a6 --- /dev/null +++ b/chapter06/m4.xml @@ -0,0 +1,92 @@ + + + %general-entities; +]> + + + + + M4-&m4-version; + + + M4 + + + + + + <para>The M4 package contains a macro processor.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&m4-ch6-sbu;</seg> + <seg>&m4-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of M4 + + Prepare M4 for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make 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 + + + + + + + + + diff --git a/chapter06/make.xml b/chapter06/make.xml new file mode 100644 index 000000000..4e131f521 --- /dev/null +++ b/chapter06/make.xml @@ -0,0 +1,86 @@ + + + %general-entities; +]> + + + + + Make-&make-version; + + + Make + + + + + + <para>The Make package contains a program for compiling packages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&make-ch6-sbu;</seg> + <seg>&make-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Make + + Prepare Make for compilation: + +./configure --prefix=/usr + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + 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 + + + + + + + + + diff --git a/chapter06/man-db.xml b/chapter06/man-db.xml new file mode 100644 index 000000000..482ae7a17 --- /dev/null +++ b/chapter06/man-db.xml @@ -0,0 +1,453 @@ + + + %general-entities; +]> + + + + + 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 + + Three adjustments need to be made to the sources of Man-DB. + + The first one changes the location of translated manual pages that come + with Man-DB, in order for them to be accessible in both traditional and + UTF-8 locales: + +mv man/de{_DE.88591,} && +mv man/es{_ES.88591,} && +mv man/it{_IT.88591,} && +mv man/ja{_JP.eucJP,} && +sed -i 's,\*_\*,??,' man/Makefile.in + + The second change is a sed substitution to delete + the /usr/man lines in the man_db.conf + file to prevent redundant results when using programs such as + whatis: + +sed -i '/\t\/usr\/man/d' src/man_db.conf.in + + The third change accounts for programs that Man-DB should be able + to find at runtime, but that haven't been installed yet: + +cat >>include/manconfig.h.in <<"EOF" +#define WEB_BROWSER "exec /usr/bin/lynx" +#define COL "/usr/bin/col" +#define VGRIND "/usr/bin/vgrind" +#define GRAP "/usr/bin/grap" +EOF + + The col program is a part of the Util-linux + package, 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. + + Prepare Man-DB for compilation: + +./configure --prefix=/usr --enable-mb-groff --disable-setuid + + + The meaning of the configure options: + + + --enable-mb-groff + + This tells the man program to use the + ascii8 and nippon Groff devices for + formatting non-ISO-8859-1 manual pages. + + + + + --disable-setuid + + This disables making the man program setuid + to user man. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + Some packages provide UTF-8 man pages which this version of + man is unable to display. The following script will + allow some of these to be converted into the expected encodings shown in + the table below. Man-DB expects the manual pages to be in the encodings + in the table, and will convert them as necessary to the actual locale + encoding when it displays them, so that they will display in both UTF-8 + and traditional locales. Because this script is intended for limited use + during the system build, for public data, we will not bother with error + checking, nor use a non-predictable temporary file name. + +cat >>convert-mans <<"EOF" +#!/bin/sh -e +FROM="$1" +TO="$2" +shift ; shift +while [ $# -gt 0 ] +do + FILE="$1" + shift + iconv -f "$FROM" -t "$TO" "$FILE" >.tmp.iconv + mv .tmp.iconv "$FILE" +done +EOF +install -m755 convert-mans /usr/bin + + Additional information regarding the compression of + man and info pages can be found in the BLFS book at + . + + + + + Non-English Manual Pages in LFS + + Linux distributions have different policies concerning the character + encoding in which manual pages are stored in the filesystem. E.g., RedHat + stores all manual pages in UTF-8, while Debian uses language-specific + (mostly 8-bit) encodings. This leads to incompatibility of packages with + manual pages designed for different distributions. + + LFS uses the same conventions as Debian. This was chosen because + Man-DB does not understand man pages stored in UTF-8. And, for our + purposes, Man-DB is preferable to Man as it works without extra + configuration in any locale. Lastly, as of now, there is no fully-working + implementation of the RedHat convention. RedHat's groff + is known to misformat text. + + The relationship between language codes and the expected encoding + of manual pages is listed below. Man-DB automatically converts them to + the locale encoding while viewing. + + + + Expected character encoding of manual pages + + + + + + Language (code) + Encoding + + + + + + Danish (da) + ISO-8859-1 + + + German (de) + ISO-8859-1 + + + English (en) + ISO-8859-1 + + + Spanish (es) + ISO-8859-1 + + + Finnish (fi) + ISO-8859-1 + + + French (fr) + ISO-8859-1 + + + Irish (ga) + ISO-8859-1 + + + Galician (gl) + ISO-8859-1 + + + Indonesian (id) + ISO-8859-1 + + + Icelandic (is) + ISO-8859-1 + + + Italian (it) + ISO-8859-1 + + + Dutch (nl) + ISO-8859-1 + + + + Norwegian (no) + ISO-8859-1 + + + + Portuguese (pt) + ISO-8859-1 + + + Swedish (sv) + ISO-8859-1 + + + + Czech (cs) + ISO-8859-2 + + + Croatian (hr) + ISO-8859-2 + + + Hungarian (hu) + ISO-8859-2 + + + Japanese (ja) + EUC-JP + + + Korean (ko) + EUC-KR + + + Polish (pl) + ISO-8859-2 + + + Russian (ru) + KOI8-R + + + Slovak (sk) + ISO-8859-2 + + + Turkish (tr) + ISO-8859-9 + + + + + +
+ + + Manual pages in languages not in the list are not supported. + Norwegian doesn't work now because of the transition from no_NO to + nb_NO locale, and Korean is non-functional because of the incomplete + Groff patch. + + + If upstream distributes the manual pages in the same encoding + as Man-DB expects, the manual pages can be copied to + /usr/share/man/<language + code>. E.g., French manual pages + () can be + installed with the following command: + +mkdir -p /usr/share/man/fr && +cp -rv man? /usr/share/man/fr + + If upstream distributes manual pages in UTF-8 (i.e., for + RedHat) instead of the encoding listed in the table above, they + have to be converted from UTF-8 to the encoding listed in the table before + installation. This can be achieved with convert-mans, + e.g., Spanish manual pages () + can be installed with the following commands: + +mv man7/iso_8859-7.7{,X} +convert-mans UTF-8 ISO-8859-1 man?/*.? +mv man7/iso_8859-7.7{X,} +make install + + + The need to exclude the man7/iso_8859-7.7 file + from the conversion process because it is already in ISO-8859-1 is a + packaging bug in man-pages-es-1.55. Future versions should not require + this workaround. + + +
+ + + Contents of Man-DB + + + Installed programs + + + accessdb, apropos, catman, convert-mans,lexgrog, man, mandb, + manpath, whatis, and zsoelim + + + + + 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 + + + + + + convert-mans + + Reformat man pages so that Man-DB can display them + + convert-mans + + + + + + 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 + + + + + + zsoelim + + Reads files and replaces lines of the form .so + file by the contents of the mentioned + file + + zsoelim + + + + + + + + +
diff --git a/chapter06/man-pages.xml b/chapter06/man-pages.xml new file mode 100644 index 000000000..6c289385c --- /dev/null +++ b/chapter06/man-pages.xml @@ -0,0 +1,74 @@ + + + %general-entities; +]> + + + + + Man-pages-&man-pages-version; + + + Man-pages + + + + + + <para>The Man-pages package contains over 1,200 man pages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&man-pages-ch6-sbu;</seg> + <seg>&man-pages-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Man-pages + + Install Man-pages by running: + +make install + + + + + Contents of Man-pages + + + Installed files + + + various man pages + + + + + Short Descriptions + + + + + man pages + + Describe the C and C++ functions, important + device files, and significant configuration files + + man pages + + + + + + + + + diff --git a/chapter06/mktemp.xml b/chapter06/mktemp.xml new file mode 100644 index 000000000..116dbb510 --- /dev/null +++ b/chapter06/mktemp.xml @@ -0,0 +1,120 @@ + + + %general-entities; +]> + + + + + Mktemp-&mktemp-version; + + + Mktemp + + + + + + <para>The Mktemp package contains programs used to create secure temporary + files in shell scripts.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&mktemp-ch6-sbu;</seg> + <seg>&mktemp-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Mktemp + + Many scripts still use the deprecated + tempfile program, which has functionality similar + to mktemp. Patch Mktemp to include a + tempfile wrapper: + +patch -Np1 -i ../&mktemp-tempfile-patch; + + Prepare Mktemp for compilation: + +./configure --prefix=/usr --with-libc + + + The meaning of the configure options: + + + --with-libc + + This causes the mktemp program to use the + mkstemp and mkdtemp + functions from the system C library instead of its own implementation + of them. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install +make install-tempfile + + + + + Contents of Mktemp + + + Installed programs + + + mktemp and tempfile + + + + + Short Descriptions + + + + + mktemp + + Creates temporary files in a secure manner; it is used in + scripts + + mktemp + + + + + + tempfile + + Creates temporary files in a less secure manner than + mktemp; it is installed for + backwards-compatibility + + tempfile + + + + + + + + + diff --git a/chapter06/module-init-tools.xml b/chapter06/module-init-tools.xml new file mode 100644 index 000000000..728317c56 --- /dev/null +++ b/chapter06/module-init-tools.xml @@ -0,0 +1,185 @@ + + + %general-entities; +]> + + + + + Module-Init-Tools-&module-init-tools-version; + + + Module-Init-Tools + + + + + + <para>The Module-Init-Tools package contains programs for handling kernel + modules in Linux kernels greater than or equal to version 2.5.47.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&module-init-tools-ch6-sbu;</seg> + <seg>&module-init-tools-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Module-Init-Tools + + First correct a potential problem when modules are specified + using regular expressions: + +patch -Np1 -i ../module-init-tools-&module-init-tools-version;-modeprobe-1.patch + + Issue the following commands to perform the tests (note that the + make distclean command is required to clean up the source + tree, as the source gets recompiled as part of the testing process): + +./configure && +make check && +make distclean + + Prepare Module-Init-Tools for compilation: + +./configure --prefix=/ --enable-zlib + + Compile the package: + +make + + Install the package: + +make INSTALL=install install + + + The meaning of the make parameter: + + INSTALL=install + + Normally, make install will not install the + binaries if they already exist. This option overrides that behavior by + calling install instead of using the default + wrapper script. + + + + + + + + Contents of Module-Init-Tools + + + Installed programs + + + depmod, generate-modprobe.conf, insmod, insmod.static, lsmod, + modinfo, modprobe, and rmmod + + + + + 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 + + + + + + generate-modprobe.conf + + Creates a modprobe.conf file from an existing 2.2 or 2.4 module + setup + + generate-modprobe.conf + + + + + + insmod + + Installs a loadable module in the running kernel + + insmod + + + + + + insmod.static + + A statically compiled version of insmod + + insmod.static + + + + + + lsmod + + Lists currently loaded modules + + lsmod + + + + + + modinfo + + Examines an object file associated with a kernel module and + displays any information that it can glean + + modinfo + + + + + + modprobe + + Uses a dependency file, created by + depmod, to automatically load relevant modules + + modprobe + + + + + + rmmod + + Unloads modules from the running kernel + + rmmod + + + + + + + + + diff --git a/chapter06/ncurses.xml b/chapter06/ncurses.xml new file mode 100644 index 000000000..b53464fb9 --- /dev/null +++ b/chapter06/ncurses.xml @@ -0,0 +1,337 @@ + + + %general-entities; +]> + + + + + Ncurses-&ncurses-version; + + + Ncurses + + + + + + <para>The Ncurses package contains libraries for terminal-independent + handling of character screens.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&ncurses-ch6-sbu;</seg> + <seg>&ncurses-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Ncurses + + + + Since the release of Ncurses-&ncurses-version;, a memory leak and some + display bugs were found and fixed upstream. Apply those fixes: + +patch -Np1 -i ../&ncurses-fixes-patch; + + Prepare Ncurses for compilation: + +./configure --prefix=/usr --with-shared --without-debug --enable-widec + + + The meaning of the configure option: + + + --enable-widec + + This switch causes wide-character libraries (e.g., libncursesw.so.&ncurses-version;) + to be built instead of normal ones (e.g., libncurses.so.&ncurses-version;). + These wide-character libraries are usable in both multibyte and + traditional 8-bit locales, while normal libraries work properly + only in 8-bit locales. Wide-character and normal libraries are + source-compatible, but not binary-compatible. + + + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + Give the Ncurses libraries execute permissions: + +chmod -v 755 /usr/lib/*.&ncurses-version; + + Fix a library that should not be executable: + +chmod -v 644 /usr/lib/libncurses++w.a + + Move the libraries to the /lib directory, + where they are expected to reside: + +mv -v /usr/lib/libncursesw.so.5* /lib + + Because the libraries have been moved, one symlink points to + a non-existent file. Recreate it: + +ln -sfv ../../lib/libncursesw.so.5 /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 curses ncurses form panel menu ; do \ + rm -vf /usr/lib/lib${lib}.so ; \ + echo "INPUT(-l${lib}w)" >/usr/lib/lib${lib}.so ; \ + ln -sfv lib${lib}w.a /usr/lib/lib${lib}.a ; \ +done && +ln -sfv libncurses++w.a /usr/lib/libncurses++.a + + Finally, make sure that old applications that look for + -lcurses at build time are still + buildable: + +echo "INPUT(-lncursesw)" >/usr/lib/libcursesw.so && +ln -sfv libncurses.so /usr/lib/libcurses.so && +ln -sfv libncursesw.a /usr/lib/libcursesw.a && +ln -sfv libncurses.a /usr/lib/libcurses.a + + + The instructions above don't create non-wide-character Ncurses + libraries since no package installed by compiling from sources would + link against them at runtime. If you must have such libraries because + of some binary-only application, build them with the following + commands: + +make distclean && +./configure --prefix=/usr --with-shared --without-normal \ + --without-debug --without-cxx-binding && +make sources libs && +cp -av lib/lib*.so.5* /usr/lib + + + + + + Contents of Ncurses + + + Installed programs + Installed libraries + + + captoinfo (link to tic), clear, infocmp, infotocap (link to tic), + reset (link to tset), tack, tic, toe, tput, and tset + libcursesw.{a,so} (symlink and linker script to libncursesw.{a,so}), + libformw.{a,so}, libmenuw.{a,so}, libncurses++w.a, libncursesw.{a,so}, + libpanelw.{a,so} and their non-wide-character counterparts without "w" + in the library names. + + + + + Short Descriptions + + + + + captoinfo + + Converts a termcap description into a terminfo description + + captoinfo + + + + + + clear + + Clears the screen, if possible + + clear + + + + + + infocmp + + Compares or prints out terminfo descriptions + + infocmp + + + + + + infotocap + + Converts a terminfo description into a termcap description + + infotocap + + + + + + reset + + Reinitializes a terminal to its default values + + reset + + + + + + tack + + The terminfo action checker; it is mainly used to test the + accuracy of an entry in the terminfo database + + tack + + + + + + tic + + The terminfo entry-description compiler that translates a + terminfo file from source format into the binary format needed for the + ncurses library routines. A terminfo file contains information on the + capabilities of a certain terminal + + tic + + + + + + toe + + Lists all available terminal types, giving the primary name and + description for each + + toe + + + + + + tput + + Makes the values of terminal-dependent capabilities available to + the shell; it can also be used to reset or initialize a terminal or + report its long name + + tput + + + + + + tset + + Can be used to initialize terminals + + tset + + + + + + libcurses + + A link to libncurses + + libcurses + + + + + + libncurses + + Contains functions to display text in many complex ways on a + terminal screen; a good example of the use of these functions is the + menu displayed during the kernel's make + menuconfig + + libncurses + + + + + + libform + + Contains functions to implement forms + + libform + + + + + + libmenu + + Contains functions to implement menus + + libmenu + + + + + + libpanel + + Contains functions to implement panels + + libpanel + + + + + + + + + diff --git a/chapter06/patch.xml b/chapter06/patch.xml new file mode 100644 index 000000000..3f7c97988 --- /dev/null +++ b/chapter06/patch.xml @@ -0,0 +1,88 @@ + + + %general-entities; +]> + + + + + Patch-&patch-version; + + + Patch + + + + + + <para>The Patch package contains a program for modifying or creating files + by applying a <quote>patch</quote> file typically created by the + <command>diff</command> program.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&patch-ch6-sbu;</seg> + <seg>&patch-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Patch + + Prepare Patch for compilation. + +./configure --prefix=/usr + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + Contents of Patch + + + Installed program + + + patch + + + + + Short Descriptions + + + + + patch + + Modifies files according to a patch file. A patch file is + normally a difference listing created with the diff + program. By applying these differences to the original files, + patch creates the patched versions. + + patch + + + + + + + + + diff --git a/chapter06/perl.xml b/chapter06/perl.xml new file mode 100644 index 000000000..50efc833a --- /dev/null +++ b/chapter06/perl.xml @@ -0,0 +1,423 @@ + + + %general-entities; +]> + + + + + Perl-&perl-version; + + + Perl + + + + + + <para>The Perl package contains the Practical Extraction and Report + Language.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&perl-ch6-sbu;</seg> + <seg>&perl-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Perl + + First create a basic /etc/hosts file which will be + referenced in one of Perl's configuration files as well as being used used by + the testsuite if you run that. + +echo "127.0.0.1 localhost $(hostname)" > /etc/hosts + + To have full control over the way Perl is set up, run the + interactive Configure script and hand-pick the way + this package is built. If the defaults it auto-detects are suitable, + prepare Perl for compilation with: + +./configure.gnu --prefix=/usr \ + -Dman1dir=/usr/share/man/man1 \ + -Dman3dir=/usr/share/man/man3 \ + -Dpager="/usr/bin/less -isR" + + + The meaning of the configure options: + + + -Dpager="/usr/bin/less -isR" + + This corrects an error in the way that perldoc + invokes the less program. + + + + + -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. + + + + + + Compile the package: + +make + + To test the results, issue: + make test. + + Install the package: + +make install + + + + + Contents of Perl + + + Installed programs + Installed libraries + + + a2p, c2ph, dprofpp, enc2xs, find2perl, h2ph, h2xs, instmodsh, libnetcfg, perl, + perl&perl-version; (link to perl), perlbug, perlcc, perldoc, perlivp, + piconv, pl2pm, pod2html, pod2latex, pod2man, pod2text, pod2usage, + podchecker, podselect, psed (link to s2p), pstruct (link to c2ph), s2p, + splain, and xsubpp + Several hundred which cannot all be listed here + + + + + Short Descriptions + + + + + a2p + + Translates awk to Perl + + a2p + + + + + + c2ph + + Dumps C structures as generated from + cc -g -S + + c2ph + + + + + + dprofpp + + Displays Perl profile data + + dprofpp + + + + + + enc2xs + + Builds a Perl extension for the Encode module from either + Unicode Character Mappings or Tcl Encoding Files + + enc2xs + + + + + + find2perl + + Translates find commands to Perl + + find2perl + + + + + + h2ph + + Converts .h C header + files to .ph Perl header + files + + h2ph + + + + + + h2xs + + Converts .h C header + files to Perl extensions + + h2xs + + + + + + instmodsh + + Shell script for examining installed Perl modules, + and can even create a tarball from an installed module + + instmodsh + + + + + + libnetcfg + + Can be used to configure the + libnet + + libnetcfg + + + + + + perl + + Combines some of the best features of C, sed, + awk and sh into a single + swiss-army language + + perl + + + + + + perl&perl-version; + + A hard link to perl + + perl&perl-version; + + + + + + perlbug + + Used to generate bug reports about Perl, or the modules that come + with it, and mail them + + perlbug + + + + + + perlcc + + Generates executables from Perl programs + + perlcc + + + + + + perldoc + + Displays a piece of documentation in pod format that is embedded + in the Perl installation tree or in a Perl script + + perldoc + + + + + + perlivp + + The Perl Installation Verification Procedure; it can be used to + verify that Perl and its libraries have been installed + correctly + + perlivp + + + + + + piconv + + A Perl version of the character encoding converter + iconv + + piconv + + + + + + pl2pm + + A rough tool for converting Perl4 + .pl files to Perl5 + .pm modules + + pl2pm + + + + + + pod2html + + Converts files from pod format to HTML format + + pod2html + + + + + + pod2latex + + Converts files from pod format to LaTeX format + + pod2latex + + + + + + pod2man + + Converts pod data to formatted *roff input + + pod2man + + + + + + pod2text + + Converts pod data to formatted ASCII text + + pod2text + + + + + + pod2usage + + Prints usage messages from embedded pod docs in files + + pod2usage + + + + + + podchecker + + Checks the syntax of pod format documentation files + + podchecker + + + + + + podselect + + Displays selected sections of pod documentation + + podselect + + + + + + psed + + A Perl version of the stream editor sed + + psed + + + + + + pstruct + + Dumps C structures as generated from cc -g -S + stabs + + pstruct + + + + + + s2p + + Translates sed scripts to Perl + + s2p + + + + + + splain + + Is used to force verbose warning diagnostics in Perl + + splain + + + + + + xsubpp + + Converts Perl XS code into C code + + xsubpp + + + + + + + + + diff --git a/chapter06/pkgmgt.xml b/chapter06/pkgmgt.xml new file mode 100644 index 000000000..c5c783b92 --- /dev/null +++ b/chapter06/pkgmgt.xml @@ -0,0 +1,235 @@ + + + %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. 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 subproject 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 one of the toolchain packages (Glibc, GCC or Binutils) needs + to be upgraded to a newer minor version, it is safer to rebuild LFS. + Though you may be able to get by rebuilding all + the packages in their dependency order, we do not recommend it. For + example, if glibc-2.2.x needs to be updated to glibc-2.3.x, it is safer + to rebuild. For micro version updates, a simple reinstallation usually + works, but is not guaranteed. For example, upgrading from glibc-2.3.4 + to glibc-2.3.5 will not usually cause any problems. + + + + 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. + + + + + LD_PRELOAD Based + + In this approach, a library is preloaded before installation. During + installation, this library tracks the packages that are being installed by + attaching itself to various executables such as 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. + + + + + 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 . + + + + + 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 . + + + + + + diff --git a/chapter06/procps.xml b/chapter06/procps.xml new file mode 100644 index 000000000..341ab24e5 --- /dev/null +++ b/chapter06/procps.xml @@ -0,0 +1,252 @@ + + + %general-entities; +]> + + + + + Procps-&procps-version; + + + Procps + + + + + + <para>The Procps package contains programs for monitoring processes.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&procps-ch6-sbu;</seg> + <seg>&procps-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Procps + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + + + + Contents of Procps + + + Installed programs + Installed library + + + free, kill, pgrep, pkill, pmap, ps, skill, slabtop, snice, + sysctl, tload, top, uptime, vmstat, w, and watch + libproc.so + + + + + Short Descriptions + + + + + free + + Reports the amount of free and used memory (both physical and + swap memory) in the system + + free + + + + + + kill + + Sends signals to processes + + kill + + + + + + pgrep + + Looks up processes based on their name and other attributes + + pgrep + + + + + + pkill + + Signals processes based on their name and other attributes + + pkill + + + + + + pmap + + Reports the memory map of the given process + + pmap + + + + + + ps + + Lists the current running processes + + ps + + + + + + skill + + Sends signals to processes matching the given criteria + + skill + + + + + + slabtop + + Displays detailed kernel slap cache information in real time + + slabtop + + + + + + snice + + Changes the scheduling priority of processes matching the given + criteria + + snice + + + + + + sysctl + + Modifies kernel parameters at run time + + sysctl + + + + + + tload + + Prints a graph of the current system load average + + tload + + + + + + top + + Displays 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 + + + + + + libproc + + Contains the functions used by most programs in this + package + + libproc + + + + + + + + + diff --git a/chapter06/psmisc.xml b/chapter06/psmisc.xml new file mode 100644 index 000000000..299ef5ff6 --- /dev/null +++ b/chapter06/psmisc.xml @@ -0,0 +1,160 @@ + + + %general-entities; +]> + + + + + 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 --exec-prefix="" + + + The meaning of the configure options: + + + --exec-prefix="" + + This ensures that the Psmisc binaries will install into + /bin instead of /usr/bin. This is the correct location + according to the FHS, because some of the Psmisc binaries are used + by the LFS-Bootscripts package. + + + + + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + There is no reason for the pstree and + pstree.x11 programs to reside in /bin. Therefore, move them to /usr/bin: + +mv -v /bin/pstree* /usr/bin + + By default, Psmisc's pidof program is not + installed. This usually is not a problem because it is installed later + in the Sysvinit package, which provides a better + pidof program. If Sysvinit will not be used for a + particular system, complete the installation of Psmisc by creating the + following symlink: + +ln -sv killall /bin/pidof + + + + + Contents of Psmisc + + + Installed programs + + + fuser, killall, pstree, and pstree.x11 (link to pstree) + + + + + Short Descriptions + + + + + fuser + + Reports the Process IDs (PIDs) of processes that use the given + files or file systems + + fuser + + + + + + killall + + Kills processes by name; it sends a signal to all processes + running any of the given commands + + killall + + + + + + oldfuser + + Reports the Process IDs (PIDs) of processes that use the given + files or file systems + + oldfuser + + + + + + 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/readjusting.xml b/chapter06/readjusting.xml new file mode 100644 index 000000000..3107168fa --- /dev/null +++ b/chapter06/readjusting.xml @@ -0,0 +1,123 @@ + + + %general-entities; +]> + + + + + Re-adjusting the Toolchain + + Now that the final C libraries have been installed, it is time to adjust + the toolchain again. The toolchain will be adjusted so that it will link any + newly compiled program against these new libraries. This is a similar process + used in the Adjusting phase in the beginning of , but with the adjustments reversed. In , the chain was guided from the host's + /{,usr/}lib directories to the new + /tools/lib directory. Now, the chain will + be guided from that same /tools/lib + directory to the LFS /{,usr/}lib + directories. + + 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/$(gcc + -dumpmachine)/bin. + +mv -v /tools/bin/{ld,ld-old} +mv -v /tools/$(gcc -dumpmachine)/bin/{ld,ld-old} +mv -v /tools/bin/{ld-new,ld} +ln -sv /tools/bin/ld /tools/$(gcc -dumpmachine)/bin/ld + + Next, amend the GCC specs file so that it points to the new + dynamic linker, and so that GCC knows where to find its start files. + A perl command accomplishes this: + +gcc -dumpspecs | \ +perl -p -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g;' \ + -e 's@\*startfile_prefix_spec:\n@$_/usr/lib/ @g;' > \ + `dirname $(gcc --print-libgcc-file-name)`/specs + + It is a good idea to visually inspect the specs file to verify the + intended change was actually made. + + + If working on a platform where the name of the dynamic linker is + something other than ld-linux.so.2, + substitute ld-linux.so.2 with the name of the platform's + dynamic linker in the above commands. Refer back to if necessary. + + + It is imperative at this point to 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 'main(){}' > dummy.c +cc dummy.c -Wl,--verbose &> dummy.log +readelf -l a.out | grep ': /lib' + + If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name): + +[Requesting program interpreter: /lib/ld-linux.so.2] + + Note that /lib is now + the prefix of our dynamic linker. + + Now make sure that we're setup to use the correct startfiles: + +grep -o '/usr/lib.*/crt[1in].* .*' dummy.log + + If everything is working correctly, there should be no errors, + and the output of the last command will be: + +/usr/lib/crt1.o succeeded +/usr/lib/crti.o succeeded +/usr/lib/crtn.o succeeded + + Next, verify that the new linker is being used with the correct search paths: + +grep 'SEARCH.*/usr/lib' dummy.log |sed 's|; |\n|g' + + If everything is working correctly, there should be no errors, + and the output of the last command will be: + +SEARCH_DIR("/tools/i686-pc-linux-gnu/lib") +SEARCH_DIR("/usr/lib") +SEARCH_DIR("/lib"); + + Next make sure that we're using the correct libc: + +grep "/lib/libc.so.6 " dummy.log + + If everything is working correctly, there should be no errors, + and the output of the last command will be: + +attempt to open /lib/libc.so.6 succeeded + + Lastly, make sure GCC is using the correct dynamic linker: + +grep found dummy.log + + If everything is working correctly, there should be no errors, + and the output of the last command will be (allowing for + platform-specific differences in dynamic linker name): + +found ld-linux.so.2 at /lib/ld-linux.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 on 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/readline.xml b/chapter06/readline.xml new file mode 100644 index 000000000..9dc0f48e2 --- /dev/null +++ b/chapter06/readline.xml @@ -0,0 +1,139 @@ + + + %general-entities; +]> + + + + + 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 + + Upstream developers have fixed several issues since the initial + release of Readline-&readline-version;. Apply those fixes: + +patch -Np1 -i ../&readline-fixes-patch; + + 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 --libdir=/lib + + Compile the package: + +make SHLIB_LIBS=-lncurses + + + The meaning of the make option: + + + SHLIB_LIBS=-lncurses + + This option forces Readline to link against the + libncurses (really, + libncursesw) library. + + + + + + This package does not come with a test suite. + + Install the package: + +make install + + Give Readline's dynamic libraries more appropriate permissions: + +chmod -v 755 /lib/lib{readline,history}.so* + + Now move the static libraries to a more appropriate location: + +mv -v /lib/lib{readline,history}.a /usr/lib + + Next, remove the .so files in + /lib and relink them into /usr/lib. + +rm -v /lib/lib{readline,history}.so +ln -sfv ../../lib/libreadline.so.5 /usr/lib/libreadline.so +ln -sfv ../../lib/libhistory.so.5 /usr/lib/libhistory.so + + + + + Contents of Readline + + + Installed libraries + + + libhistory.{a,so}, and libreadline.{a,so} + + + + + Short Descriptions + + + + + libhistory + + Provides a consistent user interface for recalling lines + of history + + libhistory + + + + + + libreadline + + Aids in the consistency of user interface across discrete + programs that need to provide a command line interface + + libreadline + + + + + + + + + diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml new file mode 100644 index 000000000..5954b64be --- /dev/null +++ b/chapter06/revisedchroot.xml @@ -0,0 +1,34 @@ + + + %general-entities; +]> + + + + + Cleaning Up + + From now on, when reentering the chroot environment after + exiting, use the following modified chroot command: + +chroot "$LFS" /usr/bin/env -i \ + HOME=/root TERM="$TERM" PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /bin/bash --login + + The reason for this is that the programs in /tools are no longer needed. Since they are no + longer needed you can delete the /tools + directory if so desired. + + + Removing /tools will also + remove the temporary copies of Tcl, Expect, and DejaGNU which were used + for running the toolchain tests. If you need these programs later on, + they will need to be recompiled and re-installed. The BLFS book has + instructions for this (see ). + + + diff --git a/chapter06/sed.xml b/chapter06/sed.xml new file mode 100644 index 000000000..5b4249ef3 --- /dev/null +++ b/chapter06/sed.xml @@ -0,0 +1,95 @@ + + + %general-entities; +]> + + + + + Sed-&sed-version; + + + Sed + + + + + + <para>The Sed package contains a stream editor.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&sed-ch6-sbu;</seg> + <seg>&sed-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Sed + + Prepare Sed for compilation: + +./configure --prefix=/usr --bindir=/bin --enable-html + + + The meaning of the new configure option: + + + --enable-html + + This builds the HTML documentation. + + + + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + Contents of Sed + + + Installed program + + + sed + + + + + Short Descriptions + + + + + sed + + Filters and transforms text files in a single pass + + sed + + + + + + + + + diff --git a/chapter06/shadow.xml b/chapter06/shadow.xml new file mode 100644 index 000000000..83b8cf53c --- /dev/null +++ b/chapter06/shadow.xml @@ -0,0 +1,563 @@ + + + %general-entities; +]> + + + + + 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. + + + Prepare Shadow for compilation: + +./configure --libdir=/lib --enable-shared --without-selinux + + + The meaning of the configure options: + + + --without-selinux + + Support for selinux is enabled by default, but selinux is not + built in a base LFS system. The configure script + will fail if this option is not used. + + + + + + Disable the installation of the groups program + and its man page, as Coreutils provides a better version: + +sed -i 's/groups$(EXEEXT) //' src/Makefile +find man -name Makefile -exec sed -i '/groups/d' {} \; + + Disable the installation of Chinese and Korean manual pages, since + Man-DB cannot format them properly: + +sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile + + Shadow supplies other manual pages in a UTF-8 encoding. Man-DB + can display these in the recommended encodings by using the + convert-mans script which we installed. + + for i in de es fi fr id it pt_BR; do + convert-mans UTF-8 ISO-8859-1 man/${i}/*.? +done + +for i in cs hu pl; do + convert-mans UTF-8 ISO-8859-2 man/${i}/*.? +done + +convert-mans UTF-8 EUC-JP man/ja/*.? +convert-mans UTF-8 KOI8-R man/ru/*.? +convert-mans UTF-8 ISO-8859-9 man/tr/*.? + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make install + + Shadow uses two files to configure + authentication settings for the system. Install these two configuration + files: + + + /etc/limits + + + + /etc/login.access + + +cp -v etc/{limits,login.access} /etc + + Instead of using the default + crypt method, use the more secure + MD5 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. Both of + these can be accomplished by changing the relevant configuration file + while copying it to its destination: + + + /etc/login.defs + + +sed -e's@#MD5_CRYPT_ENAB.no@MD5_CRYPT_ENAB yes@' \ + -e 's@/var/spool/mail@/var/mail@' \ + etc/login.defs > /etc/login.defs + + + If you built Shadow with Cracklib support, run the following: + +sed -i 's@DICTPATH.*@DICTPATH\t/lib/cracklib/pw_dict@' /etc/login.defs + + + Move a misplaced program to its proper location: + +mv -v /usr/bin/passwd /bin + + Move Shadow's libraries to more appropriate locations: + +mv -v /lib/libshadow.*a /usr/lib +rm -v /lib/libshadow.so +ln -sfv ../../lib/libshadow.so.0 /usr/lib/libshadow.so + + The -D option of the + useradd program requires the /etc/default directory for it to work + properly: + +mkdir -v /etc/default + + + + + 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 + + + + + Setting the root password + + Choose a password for user root and set it + by running: + +passwd root + + + + + Contents of Shadow + + + Installed programs + Installed libraries + + + chage, chfn, chgpasswd, chpasswd, chsh, expiry, faillog, gpasswd, + groupadd, groupdel, groupmod, grpck, grpconv, grpunconv, lastlog, login, + logoutd, newgrp, newusers, nologin, passwd, pwck, pwconv, pwunconv, sg (link to + newgrp), su, useradd, userdel, usermod, vigr (link to vipw), and + vipw + libshadow.{a,so} + + + + + Short Descriptions + + + + + chage + + Used to change the maximum number of days between obligatory + password changes + + chage + + + + + + chfn + + Used to change a user's full name and other 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 + + + + + + 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 + + + + + + newgrp + + Is used to change the current GID during a login session + + newgrp + + + + + + newusers + + Is used to create or update an entire series of user + accounts + + newusers + + + + + + nologin + + Displays a message that an account is not available. 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 + + + + + + libshadow + + Contains functions used by most programs in this package + + libshadow + + + + + + + + + diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml new file mode 100644 index 000000000..74e351799 --- /dev/null +++ b/chapter06/strippingagain.xml @@ -0,0 +1,56 @@ + + + %general-entities; +]> + + + + + Stripping Again + + 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 command mentioned below do not + experience any difficulties. However, it is easy to make a typo and + render the new system unusable, so before running the + strip command, it is a good idea to make a + backup of the LFS system in its current state. + + Before performing the stripping, take special care to ensure that + none of the binaries that are about to be stripped are running. If + unsure whether the user entered chroot with the command given in + first exit from + chroot: + +logout + + Then reenter it with: + +chroot $LFS /tools/bin/env -i \ + HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /tools/bin/bash --login + + Now the binaries and libraries can be safely stripped: + +/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \ + -exec /tools/bin/strip --strip-debug '{}' ';' + + A large number of files will be reported as having their file + format not recognized. These warnings can be safely ignored. These + warnings indicate that those files are scripts instead of + binaries. + + If disk space is very tight, the + --strip-all option can be used on the binaries + in /{,usr/}{bin,sbin} to gain + several more megabytes. Do not use this option on libraries—they will + be destroyed. + + diff --git a/chapter06/sysklogd.xml b/chapter06/sysklogd.xml new file mode 100644 index 000000000..095fd087c --- /dev/null +++ b/chapter06/sysklogd.xml @@ -0,0 +1,135 @@ + + + %general-entities; +]> + + + + + 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 + + The following patch fixes various issues, including a problem building + Sysklogd with Linux 2.6 series kernels + +patch -Np1 -i ../&sysklogd-fixes-patch; + + The following patch makes sysklogd treat bytes in the 0x80--0x9f range + literally in the messages being logged, instead of replacing them with octal + codes. Unpatched sysklogd would damage messages in the UTF-8 encoding. + +patch -Np1 -i ../&sysklogd-8bit-patch; + + Compile the package: + +make + + This package does not come with a test suite. + + Install the package: + +make 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/sysvinit.xml b/chapter06/sysvinit.xml new file mode 100644 index 000000000..ab9dad5bd --- /dev/null +++ b/chapter06/sysvinit.xml @@ -0,0 +1,322 @@ + + + %general-entities; +]> + + + + + Sysvinit-&sysvinit-version; + + + Sysvinit + + + + + + <para>The Sysvinit package contains programs for controlling the startup, + running, and shutdown of the system.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&sysvinit-ch6-sbu;</seg> + <seg>&sysvinit-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Sysvinit + + When run-levels are changed (for example, when halting the + system), init sends termination signals to those + processes that init itself started and that should + not be running in the new run-level. While doing this, + init outputs messages like Sending processes + the TERM signal which seem to imply that it is sending these + signals to all currently running processes. To avoid this + misinterpretation, modify the source so that these messages read like + Sending processes started by init the TERM signal + instead: + +sed -i 's@Sending processes@& started by init@g' \ + src/init.c + + Compile the package: + +make -C src + + This package does not come with a test suite. + + Install the package: + +make -C src install + + + + + Configuring Sysvinit + + + Sysvinit + configuring + + + + /etc/inittab + + + Create a new file /etc/inittab by running the + following: + +cat > /etc/inittab << "EOF" +# Begin /etc/inittab + +id:3:initdefault: + +si::sysinit:/etc/rc.d/init.d/rc sysinit + +l0:0:wait:/etc/rc.d/init.d/rc 0 +l1:S1:wait:/etc/rc.d/init.d/rc 1 +l2:2:wait:/etc/rc.d/init.d/rc 2 +l3:3:wait:/etc/rc.d/init.d/rc 3 +l4:4:wait:/etc/rc.d/init.d/rc 4 +l5:5:wait:/etc/rc.d/init.d/rc 5 +l6:6:wait:/etc/rc.d/init.d/rc 6 + +ca:12345:ctrlaltdel:/sbin/shutdown -t1 -a -r now + +su:S016:once:/sbin/sulogin + +1:2345:respawn:/sbin/agetty tty1 9600 +2:2345:respawn:/sbin/agetty tty2 9600 +3:2345:respawn:/sbin/agetty tty3 9600 +4:2345:respawn:/sbin/agetty tty4 9600 +5:2345:respawn:/sbin/agetty tty5 9600 +6:2345:respawn:/sbin/agetty tty6 9600 + +# End /etc/inittab +EOF + + + + + Contents of Sysvinit + + + Installed programs + + + bootlogd, halt, init, killall5, last, lastb (link to last), mesg, + mountpoint, pidof (link to killall5), poweroff (link to halt), + reboot (link to halt), runlevel, shutdown, sulogin, + telinit (link to init), utmpdump, and wall + + + + + Short Descriptions + + + + + bootlogd + + Logs boot messages to a log file + + bootlogd + + + + + + 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 it is instructed to + + init + + + + + + killall5 + + Sends a signal to all processes, except the processes in its own + session so it will not kill the shell running the script that called + it + + killall5 + + + + + + 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 + + + + + + mesg + + Controls whether other users can send messages to the current + user's terminal + + mesg + + + + + + mountpoint + + Checks if the directory is a mountpoint + + mountpoint + + + + + + pidof + + Reports the PIDs of the given programs + + pidof + + + + + + poweroff + + Tells the kernel to halt the system and switch off the computer + (see halt) + + poweroff + + + + + + reboot + + Tells the kernel to reboot the system (see + halt) + + reboot + + + + + + runlevel + + Reports the previous and the current run-level, as noted in the + last run-level record in /var/run/utmp + + runlevel + + + + + + shutdown + + Brings the system down in a secure way, signaling all processes + and notifying all logged-in users + + shutdown + + + + + + sulogin + + Allows root to log in; + it is normally invoked by init when the system goes + into single user mode + + sulogin + + + + + + telinit + + Tells init which run-level to change to + + telinit + + + + + + utmpdump + + Displays the content of the given login file in a more + user-friendly format + + utmpdump + + + + + + wall + + Writes a message to all logged-in users + + wall + + + + + + + + + diff --git a/chapter06/tar.xml b/chapter06/tar.xml new file mode 100644 index 000000000..9850b2d34 --- /dev/null +++ b/chapter06/tar.xml @@ -0,0 +1,113 @@ + + + %general-entities; +]> + + + + + Tar-&tar-version; + + + Tar + + + + + + <para>The Tar package contains an archiving program.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&tar-ch6-sbu;</seg> + <seg>&tar-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Tar + + Apply a patch to fix some issues with the test suite when using + GCC-&gcc-version;: + +patch -Np1 -i ../&tar-gcc4_fix-patch; + + Tar has a bug when the -S option is used + with files larger than 4 GB. The following patch properly fixes this + issue: + +patch -Np1 -i ../&tar-sparse_fix-patch; + + Recent versions of Tar are vulnerable to a buffer overflow from + specially crafted archives. The following patch addresses this: + +patch -Np1 -i ../&tar-security_fixes-patch; + + Prepare Tar for compilation: + +./configure --prefix=/usr --bindir=/bin --libexecdir=/usr/sbin + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the package: + +make install + + + + + + Contents of Tar + + + Installed programs + + + rmt and tar + + + + + Short Descriptions + + + + + rmt + + Remotely manipulates a magnetic + tape drive through an interprocess communication connection + + rmt + + + + + + tar + + Creates, extracts files from, and lists the contents of archives, + also known as tarballs + + tar + + + + + + + + + diff --git a/chapter06/texinfo.xml b/chapter06/texinfo.xml new file mode 100644 index 000000000..761c4c5e7 --- /dev/null +++ b/chapter06/texinfo.xml @@ -0,0 +1,200 @@ + + + %general-entities; +]> + + + + + Texinfo-&texinfo-version; + + + Texinfo + + + + + + <para>The Texinfo package contains programs for reading, writing, and + converting info pages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&texinfo-ch6-sbu;</seg> + <seg>&texinfo-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Texinfo + + The info program makes assumptions such as that + a string occupies the same number of character cells on the screen and + bytes in memory and that one can break the string anywhere, which fail + in UTF-8 based locales. The patch below makes them valid by falling back + to English messages when a multibyte locale is in use: + +patch -Np1 -i ../&texinfo-multibyte-patch; + + Texinfo allows local users to overwrite arbitrary files via a symlink + attack on temporary files. Apply the following patch to fix this: + +patch -Np1 -i ../&texinfo-tempfile_fix-patch; + + Prepare Texinfo for compilation: + +./configure --prefix=/usr + + 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: + +cd /usr/share/info +rm dir +for f in * +do install-info $f dir 2>/dev/null +done + + + + + Contents of Texinfo + + + Installed programs + + + info, infokey, install-info, makeinfo, texi2dvi, texi2pdf, and + texindex + + + + + Short Descriptions + + + + + info + + 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 man bison and + info bison. + + info + + + + + + infokey + + Compiles a source file containing Info customizations into a + binary format + + infokey + + + + + + install-info + + Used to install info pages; it updates entries in the + info index file + + install-info + + + + + + makeinfo + + Translates the given Texinfo source documents into + info pages, plain text, or HTML + + makeinfo + + + + + + texi2dvi + + Used to format the given Texinfo document into a + device-independent file that can be printed + + texi2dvi + + + + + + texi2pdf + + Used to format the given Texinfo document into a + Portable Document Format (PDF) file + + texi2pdf + + + + + + texindex + + Used to sort Texinfo index files + + texindex + + + + + + + + + diff --git a/chapter06/udev.xml b/chapter06/udev.xml new file mode 100644 index 000000000..cdd6302eb --- /dev/null +++ b/chapter06/udev.xml @@ -0,0 +1,323 @@ + + + %general-entities; +]> + + + + + Udev-&udev-version; + + + Udev + + + + + + <para>The Udev package contains programs for dynamic creation of device + nodes.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&udev-ch6-sbu;</seg> + <seg>&udev-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of Udev + + The udev-config tarball contains LFS-specific files used to configure + Udev. + +tar xf ../&udev-config;.tar.bz2 + + Create some devices and directories that Udev cannot handle due to + them being required very early in the boot process: + +install -dv /lib/{firmware,udev/devices/{pts,shm}} +mknod -m0666 /lib/udev/devices/null c 1 3 +ln -sv /proc/self/fd /lib/udev/devices/fd +ln -sv /proc/self/fd/0 /lib/udev/devices/stdin +ln -sv /proc/self/fd/1 /lib/udev/devices/stdout +ln -sv /proc/self/fd/2 /lib/udev/devices/stderr +ln -sv /proc/kcore /lib/udev/devices/core + + Compile the package: + +make EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \ + extras/firmware extras/floppy extras/path_id \ + extras/scsi_id extras/usb_id extras/volume_id" + + + The meaning of the make option: + + + EXTRAS=... + + This builds several helper binaries that can aid in writing custom + Udev rules. + + + + + + To test the results, issue: + make test. + + Install the package: + +make DESTDIR=/ \ + EXTRAS="extras/ata_id extras/cdrom_id extras/edd_id \ + extras/firmware extras/floppy extras/path_id \ + extras/scsi_id extras/usb_id extras/volume_id" install + + + The meaning of the make parameter: + + + DESTDIR=/ + + This prevents the Udev build process from killing any + udevd processes that may be running on the + host system. + + + + + + Udev has to be configured in order to work properly, as it does + not install any configuration files by default. Install the + LFS-specific configuration files: + +cp -v &udev-config;/[0-9]* /etc/udev/rules.d/ + + Install the documentation that explains how to create Udev rules: + +install -m644 -D -v docs/writing_udev_rules/index.html \ + /usr/share/doc/udev-&udev-version;/index.html + + + + + Contents of Udev + + + Installed programs + Installed directory + + + ata_id, cdrom_id, create_floppy_devices, edd_id, firmware_helper, + path_id, scsi_id, udevcontrol, udevd, udevinfo, udevmonitor, udevsettle, + udevtest, udevtrigger, usb_id, vol_id, and write_cd_aliases + /etc/udev + + + + + Short Descriptions + + + + + ata_id + + Provides Udev with a unique string and + additional information (uuid, label) for an ATA drive + + ata_id + + + + + + cdrom_id + + Provides Udev with the capabilities of a + CD-ROM or DVD-ROM drive + + cdrom_id + + + + + + create_floppy_devices + + Creates all possible floppy devices based on the CMOS type + + create_floppy_devices + + + + + + edd_id + + Provides Udev with the EDD ID for a BIOS disk drive + + edd_id + + + + + + firmware_helper + + Uploads firmware to devices + + firmware_helper + + + + + + path_id + + Provide the shortest possible unique hardware path to a + device + + path_id + + + + + + scsi_id + + Provides Udev with a unique SCSI identifier + based on the data returned from sending a SCSI INQUIRY command to + the specified device + + scsi_id + + + + + + udevcontrol + + Configures a number of options for the running + udevd daemon, such as the log level. + + udevcontrol + + + + + + 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 + + + + + + udevinfo + + Allows users to query the Udev database for + information on any device currently present on the system; it also + provides a way to query any device in the sysfs tree to help create udev + rules + + udevinfo + + + + + + udevmonitor + + Prints the event received from the kernel and the environment + which Udev sends out after rule processing + + udevmonitor + + + + + + udevsettle + + Watches the Udev event queue and exits if all current uevents + have been handled + + udevsettle + + + + + + udevtest + + Simulates a uevent for the given device, and prints out the + name of the node the real udevd would have created, + or the name of the renamed network interface + + udevtest + + + + + + udevtrigger + + Triggers kernel device uevents to be replayed + + udevtrigger + + + + + + usb_id + + Provides Udev with information about USB + devices + + usb_id + + + + + + vol_id + + Provides Udev with the label and uuid of a + filesystem + + vol_id + + + + + + /etc/udev + + Contains Udev configuation files, + device permissions, and rules for device naming + + /etc/udev + + + + + + + + + diff --git a/chapter06/util-linux.xml b/chapter06/util-linux.xml new file mode 100644 index 000000000..900c89e40 --- /dev/null +++ b/chapter06/util-linux.xml @@ -0,0 +1,783 @@ + + + %general-entities; +]> + + + + + Util-linux-&util-linux-version; + + + Util-linux + + + + + + <para>The Util-linux package contains miscellaneous utility programs. Among + them are utilities for handling file systems, consoles, partitions, and + messages.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&util-linux-ch6-sbu;</seg> + <seg>&util-linux-ch6-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>FHS compliance notes + + The FHS recommends using the /var/lib/hwclock directory instead of the + usual /etc directory as the + location for the adjtime file. To make the + hwclock program FHS-compliant, run the + following: + +sed -i 's@etc/adjtime@var/lib/hwclock/adjtime@g' \ + hwclock/hwclock.c +mkdir -p /var/lib/hwclock + + + + + Installation of Util-linux + + Util-linux fails to compile against newer versions of Linux-Libc-Headers. + The following patch properly fixes this issue: + +patch -Np1 -i ../&util-linux-cramfs-patch; + + Prepare Util-linux for compilation: + +./configure + + Compile the package: + +make HAVE_KILL=yes HAVE_SLN=yes + + + The meaning of the make parameters: + + + HAVE_KILL=yes + + This prevents the kill program (already + installed by Procps) from being built and installed again. + + + + + HAVE_SLN=yes + + This prevents the sln program (a + statically linked version of ln already installed + by Glibc) from being built and installed again. + + + + + + This package does not come with a test suite. + + Install the package: + +make HAVE_KILL=yes HAVE_SLN=yes install + + + + + Contents of Util-linux + + + Installed programs + + + agetty, arch, blockdev, cal, cfdisk, chkdupexe, col, colcrt, + colrm, column, ctrlaltdel, cytune, ddate, dmesg, elvtune, fdformat, + fdisk, flock, fsck.cramfs, fsck.minix, getopt, hexdump, hwclock, ipcrm, + ipcs, isosize, line, logger, look, losetup, mcookie, mkfs, mkfs.bfs, + mkfs.cramfs, mkfs.minix, mkswap, more, mount, namei, pg, pivot_root, + ramsize (link to rdev), raw, rdev, readprofile, rename, renice, rev, + rootflags (link to rdev), script, setfdprm, setsid, setterm, sfdisk, + swapoff (link to swapon), swapon, tailf, tunelp, ul, umount, + vidmode (link to rdev), whereis, and write + + + + + Short Descriptions + + + + + agetty + + Opens a tty port, prompts for a login name, + and then invokes the login program + + agetty + + + + + + arch + + Reports the machine's architecture + + arch + + + + + + blockdev + + Allows users to call block device ioctls from the command + line + + blockdev + + + + + + cal + + Displays a simple calendar + + cal + + + + + + cfdisk + + Manipulates the partition table of the given device + + cfdisk + + + + + + chkdupexe + + Finds duplicate executables + + chkdupexe + + + + + + col + + Filters out reverse line feeds + + col + + + + + + colcrt + + Filters nroff output for terminals + that lack some capabilities, such as overstriking and half-lines + + colcrt + + + + + + colrm + + Filters out the given columns + + colrm + + + + + + column + + Formats a given file into multiple columns + + column + + + + + + ctrlaltdel + + Sets the function of the Ctrl+Alt+Del key combination to a + hard or a soft reset + + ctrlaltdel + + + + + + cytune + + Tunes the parameters of the serial line drivers for + Cyclades cards + + cytune + + + + + + ddate + + Gives the Discordian date or converts the given Gregorian date + to a Discordian one + + ddate + + + + + + dmesg + + Dumps the kernel boot messages + + dmesg + + + + + + elvtune + + Tunes the performance and interactivity of a block + device + + elvtune + + + + + + fdformat + + Low-level formats a floppy disk + + fdformat + + + + + + flock + + Acquires a file lock and then executes a command with the lock + held + + flock + + + + + + fdisk + + Manipulates the partition table of the given device + + fdisk + + + + + + fsck.cramfs + + Performs a consistency check on the Cramfs file system on the + given device + + fsck.cramfs + + + + + + fsck.minix + + Performs a consistency check on the Minix file system on the + given device + + fsck.minix + + + + + + getopt + + Parses options in the given command line + + getopt + + + + + + hexdump + + Dumps the given file in hexadecimal or in another given + format + + hexdump + + + + + + hwclock + + Reads or sets the system's hardware clock, also called + the Real-Time Clock (RTC) or Basic Input-Output System (BIOS) + clock + + hwclock + + + + + + ipcrm + + Removes the given Inter-Process Communication (IPC) resource + + ipcrm + + + + + + ipcs + + Provides IPC status information + + ipcs + + + + + + isosize + + Reports the size of an iso9660 file system + + isosize + + + + + + line + + Copies a single line + + line + + + + + + logger + + Enters the given message into the system log + + logger + + + + + + look + + Displays lines that begin with the given string + + look + + + + + + losetup + + Sets up and controls loop devices + + losetup + + + + + + mcookie + + Generates magic cookies (128-bit random hexadecimal numbers) for + xauth + + mcookie + + + + + + mkfs + + Builds a file system on a device (usually a hard disk + partition) + + mkfs + + + + + + mkfs.bfs + + Creates 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 + + + + + + namei + + Shows the symbolic links in the given pathnames + + namei + + + + + + pg + + Displays a text file one screen full at a time + + pg + + + + + + pivot_root + + Makes the given file system the new root file system of the + current process + + pivot_root + + + + + + ramsize + + Sets the size of the RAM disk in a bootable image + + ramsize + + + + + + raw + + Used to bind a Linux raw character device to a block + device + + raw + + + + + + rdev + + Queries and sets the root device, among other things, in a + bootable image + + rdev + + + + + + readprofile + + Reads kernel profiling information + + readprofile + + + + + + rename + + Renames the given files, replacing a given string with + another + + rename + + + + + + renice + + Alters the priority of running processes + + renice + + + + + + rev + + Reverses the lines of a given file + + rev + + + + + + rootflags + + Sets the rootflags in a bootable image + + rootflags + + + + + + script + + Makes a typescript of a terminal session + + script + + + + + + setfdprm + + Sets user-provided floppy disk parameters + + setfdprm + + + + + + setsid + + Runs the given program in a new session + + setsid + + + + + + setterm + + Sets terminal attributes + + setterm + + + + + + sfdisk + + A disk partition table manipulator + + sfdisk + + + + + + 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 + + + + + + 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 + + + + + + tunelp + + Tunes the parameters of the line printer + + tunelp + + + + + + ul + + A filter for translating underscores into escape sequences + indicating underlining for the terminal in use + + ul + + + + + + umount + + Disconnects a file system from the system's file tree + + umount + + + + + + vidmode + + Sets the video mode in a bootable image + + vidmode + + + + + + whereis + + Reports the location of the binary, source, and man page + for the given command + + whereis + + + + + + write + + Sends a message to the given user if that + user has not disabled receipt of such messages + + write + + + + + + + + + diff --git a/chapter06/vim.xml b/chapter06/vim.xml new file mode 100644 index 000000000..4d67ad037 --- /dev/null +++ b/chapter06/vim.xml @@ -0,0 +1,445 @@ + + + %general-entities; +]> + + + + + 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, unpack both + vim-&vim-version;.tar.bz2 and (optionally) + vim-&vim-version;-lang.tar.gz archives into the + same directory. Then, patch Vim with several fixes from upstream + developers since the initial release of Vim-&vim-version;: + +patch -Np1 -i ../&vim-fixes-patch; + + This version of Vim installs translated man pages and places + them into directories that will not be searched by Man-DB. Patch Vim + so that it installs its man pages into searchable directories and + ultimately allows Man-DB to transcode the page into the desired format + at run-time: + +patch -Np1 -i ../&vim-mandir-patch; + + Finally, change the default location of the + vimrc configuration file to /etc: + +echo '#define SYS_VIMRC_FILE "/etc/vimrc"' >> src/feature.h + + Now prepare Vim for compilation: + +./configure --prefix=/usr --enable-multibyte + + + The meaning of the configure options: + + + --enable-multibyte + + This switch enables support for editing files in multibyte + character encodings. This is needed if using a locale with a + multibyte character set. This switch is also helpful to be able + to edit text files initially created in Linux distributions like + Fedora Core that use UTF-8 as a default character set. + + + + + + Compile the package: + +make + + To test the results, issue: make test. However, + this test suite outputs a lot of binary data to the screen, which can cause + issues with the settings of the current terminal. This can be resolved by + redirecting the output to a log file. + + Install the package: + +make install + + In UTF-8 locales, the vimtutor program tries to + convert the tutorials from ISO-8859-1 to UTF-8. Since some tutorials are + not in ISO-8859-1, the text in them is thus made unreadable. If you + unpacked the vim-&vim-version;-lang.tar.gz archive + and are going to use a UTF-8 based locale, remove non-ISO-8859-1 tutorials. + An English tutorial will be used instead. + + +rm -f /usr/share/vim/vim70/tutor/tutor.{gr,pl,ru,sk} +rm -f /usr/share/vim/vim70/tutor/tutor.??.* + + 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 "" fr it pl ru; do + ln -sv vim.1 /usr/share/man/$L/man1/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/vim70/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 + +set nocompatible +set backspace=2 +syntax on +if (&term == "iterm") || (&term == "putty") + set background=dark +endif + +" End /etc/vimrc +EOF + + The set nocompatible makes + vim behave in a more useful way (the default) than + the vi-compatible manner. Remove the no to keep the + old vi behavior. The set + backspace=2 allows backspacing over line breaks, + autoindents, and the start of insert. The syntax + on enables vim's syntax highlighting. Finally, the + if statement with the set + background=dark corrects vim's guess + about the background color of some terminal emulators. This gives the + highlighting a better color scheme for use on the black background of + these programs. + + Documentation for other available options can be obtained by + running the following command: + +vim -c ':options' + + + By default, Vim only installs spell files for the English language. + To install spell files for your preferred language, please read the README + file located here: + + + + + + Contents of Vim + + + Installed programs + + + efm_filter.pl, efm_perl.pl, ex (link to vim), less.sh, mve.awk, + pltags.pl, ref, rview (link to vim), rvim (link to vim), shtags.pl, + tcltags, vi (link to vim), view (link to vim), vim, vim132, vim2html.pl, + vimdiff (link to vim), vimm, vimspell.sh, vimtutor, and xxd + + + + + Short Descriptions + + + + + efm_filter.pl + + A filter for creating an error file that can be read + by vim + + efm_filter.pl + + + + + + efm_perl.pl + + Reformats the error messages of the Perl interpreter for use + with the quickfix mode of vim + + efm_perl.pl + + + + + + ex + + Starts vim in ex mode + + ex + + + + + + less.sh + + A script that starts vim with less.vim + + less.sh + + + + + + mve.awk + + Processes vim errors + + mve.awk + + + + + + pltags.pl + + Creates a tags file for Perl code for use by + vim + + pltags.pl + + + + + + ref + + Checks the spelling of arguments + + ref + + + + + + rview + + Is a restricted version of view; no shell + commands can be started and view cannot be + suspended + + rview + + + + + + rvim + + Is a restricted version of vim; no shell + commands can be started and vim cannot be + suspended + + rvim + + + + + + shtags.pl + + Generates a tags file for Perl scripts + + shtags.pl + + + + + + tcltags + + Generates a tags file for TCL code + + tcltags + + + + + + view + + Starts vim in read-only mode + + view + + + + + + vi + + Link to vim + + vi + + + + + + vim + + Is the editor + + vim + + + + + + vim132 + + Starts vim with the terminal in 132-column + mode + + vim132 + + + + + + vim2html.pl + + Converts Vim documentation to HypterText Markup Language + (HTML) + + vim2html.pl + + + + + + vimdiff + + Edits two or three versions of a file with vim + and show differences + + vimdiff + + + + + + vimm + + Enables the DEC locator input model on a remote terminal + + vimm + + + + + + vimspell.sh + + Spell checks a file and generates the syntax statements + necessary to highlight in vim. This script + requires the old Unix spell command, which + is provided neither in LFS nor in BLFS + + vimspell.sh + + + + + + vimtutor + + Teaches the basic keys and commands of + vim + + vimtutor + + + + + + xxd + + Creates a hex dump of the given file; it can + also do the reverse, so it can be used for binary patching + + xxd + + + + + + + + + diff --git a/chapter06/zlib.xml b/chapter06/zlib.xml new file mode 100644 index 000000000..b5bca5e1c --- /dev/null +++ b/chapter06/zlib.xml @@ -0,0 +1,120 @@ + + + %general-entities; +]> + + + + + 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 + + + Zlib is known to build its shared library incorrectly if + CFLAGS is specified in the environment. If using + a specified CFLAGS variable, be sure to add the + -fPIC directive to the CFLAGS + variable for the duration of the configure command below, then + remove it afterwards. + + + Prepare Zlib for compilation: + +./configure --prefix=/usr --shared --libdir=/lib + + Compile the package: + +make + + To test the results, issue: + make check. + + Install the shared library: + +make install + + The previous command installed a .so file in /lib. We will remove it and relink it into + /usr/lib: + +rm -v /lib/libz.so +ln -sfv ../../lib/libz.so.&zlib-version; /usr/lib/libz.so + + Build the static library: + +make clean +./configure --prefix=/usr +make + + To test the results again, issue: + make check. + + Install the static library: + +make install + + Fix the permissions on the static library: + +chmod -v 644 /usr/lib/libz.a + + + + + Contents of Zlib + + + Installed libraries + + + libz.{a,so} + + + + + Short Descriptions + + + + + libz + + Contains compression and decompression functions used by + some programs + + libz + + + + + + + + + diff --git a/chapter07/bootscripts.xml b/chapter07/bootscripts.xml new file mode 100644 index 000000000..d367cf320 --- /dev/null +++ b/chapter07/bootscripts.xml @@ -0,0 +1,284 @@ + + + %general-entities; +]> + + + + + LFS-Bootscripts-&lfs-bootscripts-version; + + + Bootscripts + + + + + + <para>The LFS-Bootscripts package contains a set of scripts to start/stop the + LFS system at bootup/shutdown.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&lfs-bootscripts-ch7-sbu;</seg> + <seg>&lfs-bootscripts-ch7-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of LFS-Bootscripts + + Install the package: + +make install + + + + + Contents of LFS-Bootscripts + + + Installed scripts + + + checkfs, cleanfs, console, functions, halt, ifdown, ifup, + localnet, mountfs, mountkernfs, network, rc, reboot, sendsignals, + setclock, static, swap, sysklogd, template, and udev + + + + + Short Descriptions + + + + + checkfs + + Checks the integrity of the file systems before they are mounted + (with the exception of journal and network based file systems) + + checkfs + + + + + + cleanfs + + Removes files that should not be preserved between reboots, such + as those in /var/run/ and + /var/lock/; it re-creates + /var/run/utmp and removes the possibly present + /etc/nologin, /fastboot, and + /forcefsck files + + cleanfs + + + + + + console + + Loads the correct keymap table for the desired keyboard layout; + it also sets the screen font + + console + + + + + + functions + + Contains common functions, such as error and status checking, + that are used by several bootscripts + + functions + + + + + + halt + + Halts the system + + halt + + + + + + ifdown + + Assists the network script with stopping network devices + + ifdown + + + + + + ifup + + Assists the network script with starting network devices + + ifup + + + + + + localnet + + Sets up the system's hostname and local loopback device + + localnet + + + + + + mountfs + + Mounts all file systems, except ones that are marked + noauto or are network based + + mountfs + + + + + + mountkernfs + + Mounts virtual kernel file systems, such as proc + + mountkernfs + + + + + + network + + Sets up network interfaces, such as network cards, and sets up + the default gateway (where applicable) + + network + + + + + + rc + + The master run-level control script; it is responsible for + running all the other bootscripts one-by-one, in a sequence determined + by the name of the symbolic links being processed + + rc + + + + + + reboot + + Reboots the system + + reboot + + + + + + sendsignals + + Makes sure every process is terminated before the system reboots + or halts + + sendsignals + + + + + + setclock + + Resets the kernel clock to local time in case the hardware clock + is not set to UTC time + + setclock + + + + + + static + + Provides the functionality needed to assign a static Internet + Protocol (IP) address to a network interface + + static + + + + + + swap + + Enables and disables swap files and partitions + + swap + + + + + + sysklogd + + Starts and stops the system and kernel log daemons + + sysklogd + + + + + + template + + A template to create custom bootscripts for other + daemons + + template + + + + + + udev + + Prepares the /dev + directory and starts Udev + + udev + + + + + + + + + diff --git a/chapter07/chapter07.xml b/chapter07/chapter07.xml new file mode 100644 index 000000000..5f654f787 --- /dev/null +++ b/chapter07/chapter07.xml @@ -0,0 +1,28 @@ + + + %general-entities; +]> + + + + + + Setting Up System Bootscripts + + + + + + + + + + + + + + + + diff --git a/chapter07/console.xml b/chapter07/console.xml new file mode 100644 index 000000000..ee34edcb9 --- /dev/null +++ b/chapter07/console.xml @@ -0,0 +1,225 @@ + + + %general-entities; +]> + + + + + Configuring the Linux Console + + + console + configuring + + + This section discusses how to configure the console + bootscript that sets up the keyboard map and the console font. If non-ASCII + characters (e.g., the copyright sign, the British pound sign and Euro symbol) + will not be used and the keyboard is a U.S. one, skip this section. Without + the configuration file, the console bootscript will do + nothing. + + The console script reads the + /etc/sysconfig/console file for configuration information. + Decide which keymap and screen font will be used. Various language-specific + HOWTOs can also help with this, see . If still in + doubt, look in the /usr/share/kbd + directory for valid keymaps and screen fonts. Read + loadkeys(1) and setfont(8) manual + pages to determine the correct arguments for these programs. + + The /etc/sysconfig/console file should contain lines + of the form: VARIABLE="value". The following variables are recognized: + + + + + KEYMAP + + This variable specifies the arguments for the + loadkeys program, typically, the name of keymap + to load, e.g., es. If this variable is not set, the + bootscript will not run the loadkeys program, + and the default kernel keymap will be used. + + + + + KEYMAP_CORRECTIONS + + This (rarely used) variable + specifies the arguments for the second call to the + loadkeys program. This is useful if the stock keymap + is not completely satisfactory and a small adjustment has to be made. E.g., + to include the Euro sign into a keymap that normally doesn't have it, + set this variable to euro2. + + + + + FONT + + This variable specifies the arguments for the + setfont program. Typically, this includes the font + name, -m, and the name of the application character + map to load. E.g., in order to load the lat1-16 font + together with the 8859-1 application character map + (as it is appropriate in the USA), + set this variable to lat1-16 -m 8859-1. + If this variable is not set, the bootscript will not run the + setfont program, and the default VGA font will be + used together with the default application character map. + + + + + UNICODE + + Set this variable to 1, yes or + true in order to put the + console into UTF-8 mode. This is useful in UTF-8 based locales and + harmful otherwise. + + + + + LEGACY_CHARSET + + For many keyboard layouts, there is no stock Unicode keymap in + the Kbd package. The console bootscript will + convert an available keymap to UTF-8 on the fly if this variable is + set to the encoding of the available non-UTF-8 keymap. Note, however, + that dead keys (i.e., keys that don't produce a character by + themselves, but put an accent onto a character procuced by the next + key; there are no dead keys on the standard US keyboard) and composing + (i.e., pressing Ctrl+. A E in order to produce the Æ character) + will not work in UTF-8 mode without the special kernel patch. + This variable is useful only in UTF-8 mode. + + + + + BROKEN_COMPOSE + + Set this to 0 if you are going to apply the kernel patch in + Chapter 8. Note that you also have to add the character set expected + by composition rules in your keymap to the FONT variable after the + -m switch. This variable is useful only in UTF-8 mode. + + + + + + Support for compiling the keymap directly into the kernel has been + removed because there were reports that it leads to incorrect results. + + Some examples: + + + + + For a non-Unicode setup, only the KEYMAP and FONT variables are + generally needed. E.g., for a Polish setup, one would use: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +KEYMAP="pl2" +FONT="lat2a-16 -m 8859-2" + +# End /etc/sysconfig/console +EOF + + + + As mentioned above, it is sometimes necessary to adjust a + stock keymap slightly. The following example adds the Euro symbol to the + German keymap: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +KEYMAP="de-latin1" +KEYMAP_CORRECTIONS="euro2" +FONT="lat0-16 -m 8859-15" + +# End /etc/sysconfig/console +EOF + + + + The following is a Unicode-enabled example for Bulgarian, where a stock + UTF-8 keymap exists and defines no dead keys or composition rules: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +KEYMAP="bg_bds-utf8" +FONT="LatArCyrHeb-16" + +# End /etc/sysconfig/console +EOF + + + + Due to the use of a 512-glyph LatArCyrHeb-16 font in the previous + example, bright colors are no longer available on the Linux console unless + a framebuffer is used. If one wants to have bright colors without + framebuffer and can live without characters not belonging to his language, + it is still possible to use a language-specific 256-glyph font, as + illustrated below. + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +KEYMAP="bg_bds-utf8" +FONT="cyr-sun16" + +# End /etc/sysconfig/console +EOF + + + + The following example illustrates keymap autoconversion from + ISO-8859-15 to UTF-8 and enabling dead keys in Unicode mode: + +cat > /etc/sysconfig/console << "EOF" +# Begin /etc/sysconfig/console + +UNICODE="1" +KEYMAP="de-latin1" +KEYMAP_CORRECTIONS="euro2" +LEGACY_CHARSET="iso-8859-15" +BROKEN_COMPOSE="0" +FONT="LatArCyrHeb-16 -m 8859-15" + +# End /etc/sysconfig/console +EOF + + + + For Chinese, Japanese, Korean and some other languages, the Linux + console cannot be configured to display the needed characters. Users + who need such languages should install the X Window System, fonts that + cover the necessary character ranges, and the proper input method (e.g., + SCIM, it supports a wide variety of languages). + + + + + + + The /etc/sysconfig/console file only controls the + Linux text console localization. It has nothing to do with setting the proper + keyboard layout and terminal fonts in the X Window System, with ssh sessions + or with a serial console. + + + diff --git a/chapter07/hostname.xml b/chapter07/hostname.xml new file mode 100644 index 000000000..26f1e20b3 --- /dev/null +++ b/chapter07/hostname.xml @@ -0,0 +1,32 @@ + + + %general-entities; +]> + + + + + Configuring the localnet Script + + + localnet + configuring + + + Part of the job of the localnet script is setting the + system's hostname. This needs to be configured in the + /etc/sysconfig/network file. + + Create the /etc/sysconfig/network file and enter a + hostname by running: + +echo "HOSTNAME=<lfs>" > /etc/sysconfig/network + + <lfs> needs to be replaced with the name given + to the computer. Do not enter the Fully Qualified Domain Name (FQDN) here. That + information will be put in the /etc/hosts file in the next + section. + + diff --git a/chapter07/hosts.xml b/chapter07/hosts.xml new file mode 100644 index 000000000..e51aa37be --- /dev/null +++ b/chapter07/hosts.xml @@ -0,0 +1,80 @@ + + + %general-entities; +]> + + + + + Customizing the /etc/hosts File + + + /etc/hosts + + + + localnet + /etc/hosts + + + network + /etc/hosts + + If a network card is to be configured, decide on the IP address, + fully-qualified domain name (FQDN), and possible aliases for use in the + /etc/hosts file. The syntax is: + +IP_address myhost.example.org aliases + + Unless the computer is to be visible to the Internet (i.e., + there is a registered domain and a valid block of assigned IP + addresses—most users do not have this), make sure that the IP + address is in the private network IP address range. Valid ranges + are: + +Private Network Address Range Normal Prefix +10.0.0.1 - 10.255.255.254 8 +172.x.0.1 - 172.x.255.254 16 +192.168.y.1 - 192.168.y.254 24 + + x can be any number in the range 16-31. y can be any number in + the range 0-255. + + A valid private IP address could be 192.168.1.1. A valid FQDN for this + IP could be lfs.example.org. + + Even if not using a network card, a valid FQDN is still required. + This is necessary for certain programs to operate correctly. + + Create the /etc/hosts file by running: + +cat > /etc/hosts << "EOF" +# Begin /etc/hosts (network card version) + +127.0.0.1 localhost +<192.168.1.1> <HOSTNAME.example.org> [alias1] [alias2 ...] + +# End /etc/hosts (network card version) +EOF + + The <192.168.1.1> and + <HOSTNAME.example.org> + values need to be changed for specific users or requirements (if + assigned an IP address by a network/system administrator and the + machine will be connected to an existing network). The optional alias + name(s) can be omitted. + + If a network card is not going to be configured, create the + /etc/hosts file by running: + +cat > /etc/hosts << "EOF" +# Begin /etc/hosts (no network card version) + +127.0.0.1 <HOSTNAME.example.org> <HOSTNAME> localhost + +# End /etc/hosts (no network card version) +EOF + + diff --git a/chapter07/inputrc.xml b/chapter07/inputrc.xml new file mode 100644 index 000000000..5c5ce2278 --- /dev/null +++ b/chapter07/inputrc.xml @@ -0,0 +1,82 @@ + + + %general-entities; +]> + + + + + Creating the /etc/inputrc File + + + /etc/inputrc + + + The inputrc file handles keyboard mapping for + specific situations. This file is the startup file used by Readline — the + input-related library — used by Bash and most other shells. + + Most people do not need user-specific keyboard mappings so the command + below creates a global /etc/inputrc used by everyone who + logs in. If you later decide you need to override the defaults on a per-user + basis, you can create a .inputrc file in the user's home + directory with the modified mappings. + + For more information on how to edit the inputrc + file, see info bash under the Readline Init + File section. info readline is also a good + source of information. + + Below is a generic global inputrc along with comments + to explain what the various options do. Note that comments cannot be on the same + line as commands. Create the file using the following command: + +cat > /etc/inputrc << "EOF" +# Begin /etc/inputrc +# Modified by Chris Lynn <roryo@roryo.dynup.net> + +# Allow the command prompt to wrap to the next line +set horizontal-scroll-mode Off + +# Enable 8bit input +set meta-flag On +set input-meta On + +# Turns off 8th bit stripping +set convert-meta Off + +# Keep the 8th bit for display +set output-meta On + +# none, visible or audible +set bell-style none + +# All of the following map the escape sequence of the +# value contained inside the 1st argument to the +# readline specific functions + +"\eOd": backward-word +"\eOc": forward-word + +# for linux console +"\e[1~": beginning-of-line +"\e[4~": end-of-line +"\e[5~": beginning-of-history +"\e[6~": end-of-history +"\e[3~": delete-char +"\e[2~": quoted-insert + +# for xterm +"\eOH": beginning-of-line +"\eOF": end-of-line + +# for Konsole +"\e[H": beginning-of-line +"\e[F": end-of-line + +# End /etc/inputrc +EOF + + diff --git a/chapter07/introduction.xml b/chapter07/introduction.xml new file mode 100644 index 000000000..a7b846ee7 --- /dev/null +++ b/chapter07/introduction.xml @@ -0,0 +1,28 @@ + + + %general-entities; +]> + + + + + Introduction + + This chapter details how to install and configure the LFS-Bootscripts + package. Most of these scripts will work without modification, but a few require + additional configuration files because they deal with hardware-dependent + information. + + System-V style init scripts are employed in this book because they are + widely used. For additional options, a hint detailing the BSD style init setup + is available at . + Searching the LFS mailing lists for depinit will also offer + additional choices. + + If using an alternative style of init scripts, skip this chapter + and move on to . + + diff --git a/chapter07/network.xml b/chapter07/network.xml new file mode 100644 index 000000000..884aeb94f --- /dev/null +++ b/chapter07/network.xml @@ -0,0 +1,174 @@ + + + %general-entities; +]> + + + + + Configuring the network Script + + + network + configuring + + This section only applies if a network card is to be + configured. + + If a network card will not be used, there is likely no need to + create any configuration files relating to network cards. If that is + the case, remove the network + symlinks from all run-level directories (/etc/rc.d/rc*.d). + + + Creating stable names for network interfaces + + Instructions in this section are optional if you have only one + network card. + + With Udev and modular network drivers, the network interface numbering + is not persistent across reboots by default, because the drivers are loaded + in parallel and, thus, in random order. For example, on a computer having + two network cards made by Intel and Realtek, the network card manufactured + by Intel may become eth0 and the + Realtek card becomes eth1. In some + cases, after a reboot the cards get renumbered the other way around. To + avoid this, create Udev rules that assign stable names to network cards + based on their MAC addresses or bus positions. + + If you are going to use MAC addresses to identify your network + cards, find the addresses with the following command: + +grep -H . /sys/class/net/*/address + + For each network card (but not for the loopback interface), + invent a descriptive name, such as realtek, and create + Udev rules similar to the following: + +cat > /etc/udev/rules.d/26-network.rules << "EOF" +ACTION=="add", SUBSYSTEM=="net", DRIVER=="?*", SYSFS{address}=="00:e0:4c:12:34:56", NAME="realtek" +ACTION=="add", SUBSYSTEM=="net", DRIVER=="?*", SYSFS{address}=="00:a0:c9:78:9a:bc", NAME="intel" +EOF + + The DRIVER=="?*" key prevents Udev from attempting to rename 8021Q + VLAN interfaces (not available without the Vlan package from + ). + This is necessary since VLANs have the same MAC address as + the real network card. + + + + If you are going to use the bus position as a key, create + Udev rules similar to the following: + +cat > /etc/udev/rules.d/26-network.rules << "EOF" +ACTION=="add", SUBSYSTEM=="net", BUS=="pci", ID=="0000:00:0c.0", NAME="realtek" +ACTION=="add", SUBSYSTEM=="net", BUS=="pci", ID=="0000:00:0d.0", NAME="intel" +EOF + + These rules will always rename the network cards to + realtek and intel, independently + of the original numbering provided by the kernel (i.e.: the original + eth0 and eth1 interfaces will no longer + exist, unless you put such descriptive names in the NAME + key). Use the descriptive names from the Udev rules instead + of eth0 in the network interface configuration files + below. + + + + + Creating Network Interface Configuration Files + + Which interfaces are brought up and down by the network script + depends on the files and directories in the /etc/sysconfig/network-devices hierarchy. + This directory should contain a sub-directory for each interface to be + configured, such as ifconfig.xyz, where + xyz is a network interface name. Inside this directory + would be files defining the attributes to this interface, such as its IP + address(es), subnet masks, and so forth. + + The following command creates a sample ipv4 + file for the eth0 device: + +cd /etc/sysconfig/network-devices && +mkdir -v ifconfig.eth0 && +cat > ifconfig.eth0/ipv4 << "EOF" +ONBOOT=yes +SERVICE=ipv4-static +IP=192.168.1.1 +GATEWAY=192.168.1.2 +PREFIX=24 +BROADCAST=192.168.1.255 +EOF + + The values of these variables must be changed in every file to match + the proper setup. If the ONBOOT variable is set to + yes the network script will bring up the Network Interface + Card (NIC) during booting of the system. If set to anything but + yes the NIC will be ignored by the network script and not + be brought up. + + The SERVICE variable defines the method used for + obtaining the IP address. The LFS-Bootscripts package has a modular IP + assignment format, and creating additional files in the /etc/sysconfig/network-devices/services + directory allows other IP assignment methods. This is commonly used for + Dynamic Host Configuration Protocol (DHCP), which is addressed in the + BLFS book. + + The GATEWAY variable should contain the default + gateway IP address, if one is present. If not, then comment out the + variable entirely. + + The PREFIX variable needs to contain the number of + bits used in the subnet. Each octet in an IP address is 8 bits. If the + subnet's netmask is 255.255.255.0, then it is using the first three octets + (24 bits) to specify the network number. If the netmask is 255.255.255.240, + it would be using the first 28 bits. Prefixes longer than 24 bits are + commonly used by DSL and cable-based Internet Service Providers (ISPs). + In this example (PREFIX=24), the netmask is 255.255.255.0. Adjust the + PREFIX variable according to your specific subnet. + + + + + Creating the /etc/resolv.conf File + + + /etc/resolv.conf + + + If the system is going to be connected to the Internet, it will + need some means of Domain Name Service (DNS) name resolution to + resolve Internet domain names to IP addresses, and vice versa. This is + best achieved by placing the IP address of the DNS server, available + from the ISP or network administrator, into + /etc/resolv.conf. Create the file by running the + following: + +cat > /etc/resolv.conf << "EOF" +# Begin /etc/resolv.conf + +domain {<Your Domain Name>} +nameserver <IP address of your primary nameserver> +nameserver <IP address of your secondary nameserver> + +# End /etc/resolv.conf +EOF + + Replace <IP address of the nameserver> + with the IP address of the DNS most appropriate for the setup. There will + often be more than one entry (requirements demand secondary servers for + fallback capability). If you only need or want one DNS server, remove the + second nameserver line from the file. The IP address + may also be a router on the local network. + + + + diff --git a/chapter07/profile.xml b/chapter07/profile.xml new file mode 100644 index 000000000..5f6483133 --- /dev/null +++ b/chapter07/profile.xml @@ -0,0 +1,169 @@ + + + %general-entities; +]> + + + + + The Bash Shell Startup Files + + + /etc/profile + + + The shell program /bin/bash (hereafter referred to + as the shell) uses a collection of startup files to help + create an environment to run in. Each file has a specific use and may affect + login and interactive environments differently. The files in the /etc directory provide global settings. If an + equivalent file exists in the home directory, it may override the global + settings. + + An interactive login shell is started after a successful login, using + /bin/login, by reading the /etc/passwd + file. An interactive non-login shell is started at the command-line (e.g., + [prompt]$/bin/bash). A non-interactive + shell is usually present when a shell script is running. It is non-interactive + because it is processing a script and not waiting for user input between + commands. + + For more information, see info bash under the + Bash Startup Files and Interactive Shells section. + + The files /etc/profile and + ~/.bash_profile are read when the shell is + invoked as an interactive login shell. + + The base /etc/profile below sets some + environment variables necessary for native language support. Setting + them properly results in: + + + + The output of programs translated into the native language + + + Correct classification of characters into letters, digits and other + classes. This is necessary for bash to properly accept + non-ASCII characters in command lines in non-English locales + + + The correct alphabetical sorting order for the country + + + Appropriate default paper size + + + Correct formatting of monetary, time, and date values + + + + This script also sets the INPUTRC environment variable that + makes Bash and Readline use the /etc/inputrc file created + earlier. + + Replace <ll> below with the two-letter code + for the desired language (e.g., en) and + <CC> with the two-letter code for the appropriate + country (e.g., GB). <charmap> should + be replaced with the canonical charmap for your chosen locale. Optional + modifiers such as @euro may also be present. + + The list of all locales supported by Glibc can be obtained by running + the following command: + +locale -a + + Charmaps can have a number of aliases, e.g., ISO-8859-1 + is also referred to as iso8859-1 and iso88591. + Some applications cannot handle the various synonyms correctly (e.g., require + that UTF-8 is written as UTF-8, not + utf8), so it is safest in most + cases to choose the canonical name for a particular locale. To determine + the canonical name, run the following command, where <locale + name> is the output given by locale -a for + your preferred locale (en_GB.iso88591 in our example). + +LC_ALL=<locale name> locale charmap + + For the en_GB.iso88591 locale, the above command + will print: + +ISO-8859-1 + + This results in a final locale setting of en_GB.ISO-8859-1. + It is important that the locale found using the heuristic above is tested prior + to it being added to the Bash startup files: + +LC_ALL=<locale name> locale language +LC_ALL=<locale name> locale charmap +LC_ALL=<locale name> locale int_curr_symbol +LC_ALL=<locale name> locale int_prefix + + The above commands should print the language name, the character + encoding used by the locale, the local currency, and the prefix to dial + before the telephone number in order to get into the country. If any of the + commands above fail with a message similar to the one shown below, this means + that your locale was either not installed in Chapter 6 or is not supported by + the default installation of Glibc. + +locale: Cannot set LC_* to default locale: No such file or directory + + If this happens, you should either install the desired locale using the + localedef command, or consider choosing a different locale. + Further instructions assume that there are no such error messages from + Glibc. + + + Some packages beyond LFS may also lack support for your chosen locale. One + example is the X library (part of the X Window System), which outputs the + following error message if the locale does not exactly match one of the character + map names in its internal files: + +Warning: locale not supported by Xlib, locale set to C + + In several cases Xlib expects that the character map will be listed in + uppercase notation with canonical dashes. For instance, "ISO-8859-1" rather + than "iso88591". It is also possible to find an appropriate specification by + removing the charmap part of the locale specification. This can be checked + by running the locale charmap command in both locales. + For example, one would have to change "de_DE.ISO-8859-15@euro" to + "de_DE@euro" in order to get this locale recognized by Xlib. + + Other packages can also function incorrectly (but may not necessarily + display any error messages) if the locale name does not meet their expectations. + In those cases, investigating how other Linux distributions support your locale + might provide some useful information. + + Once the proper locale settings have been determined, create the + /etc/profile file: + +cat > /etc/profile << "EOF" +# Begin /etc/profile + +export LANG=<ll>_<CC>.<charmap><@modifiers> +export INPUTRC=/etc/inputrc + +# End /etc/profile +EOF + + The C (default) and en_US (the recommended + one for United States English users) locales are different. C + uses the US-ASCII 7-bit character set, and treats bytes with the high bit set + as invalid characters. That's why, e.g., the ls command + substitutes them with question marks in that locale. Also, an attempt to send + mail with such characters from Mutt or Pine results in non-RFC-conforming + messages being sent (the charset in the outgoing mail is indicated as unknown + 8-bit). So you can use the C locale only if you are sure that + you will never need 8-bit characters. + + UTF-8 based locales are not supported well by many programs. E.g., the + watch program displays only ASCII characters in UTF-8 + locales and has no such restriction in traditional 8-bit locales like en_US. + Work is in progress to document and, if possible, fix such problems, see + . + + diff --git a/chapter07/setclock.xml b/chapter07/setclock.xml new file mode 100644 index 000000000..2098fd74d --- /dev/null +++ b/chapter07/setclock.xml @@ -0,0 +1,56 @@ + + + %general-entities; +]> + + + + + Configuring the setclock Script + + + setclock + configuring + + The setclock script reads the time from the hardware + clock, also known as the BIOS or the Complementary Metal Oxide Semiconductor + (CMOS) clock. If the hardware clock is set to UTC, this script will convert the + hardware clock's time to the local time using the + /etc/localtime file (which tells the + hwclock program which timezone the user is in). There is no + way to detect whether or not the hardware clock is set to UTC, so this + needs to be configured manually. + + If you cannot remember whether or not the hardware clock is set to UTC, + find out by running the hwclock --localtime --show + command. This will display what the current time is according to the hardware + clock. If this time matches whatever your watch says, then the hardware clock is + set to local time. If the output from hwclock is not local + time, chances are it is set to UTC time. Verify this by adding or subtracting + the proper amount of hours for the timezone to the time shown by + hwclock. For example, if you are currently in the MST + timezone, which is also known as GMT -0700, add seven hours to the local + time. + + Change the value of the UTC variable below + to a value of 0 (zero) if the hardware clock + is not set to UTC time. + + Create a new file /etc/sysconfig/clock by running + the following: + +cat > /etc/sysconfig/clock << "EOF" +# Begin /etc/sysconfig/clock + +UTC=1 + +# End /etc/sysconfig/clock +EOF + + A good hint explaining how to deal with time on LFS is available + at . It explains issues such as + time zones, UTC, and the TZ environment variable. + + diff --git a/chapter07/symlinks.xml b/chapter07/symlinks.xml new file mode 100644 index 000000000..c3e799867 --- /dev/null +++ b/chapter07/symlinks.xml @@ -0,0 +1,128 @@ + + + %general-entities; +]> + + + + + Creating custom symlinks to devices + + + + CD-ROM symlinks + + Some software that you may want to install later (e.g., various + media players) expect the /dev/cdrom and /dev/dvd symlinks to exist. + Also, it may be convenient to put references to those symlinks into + /etc/fstab. For each of your CD-ROM devices, + find the corresponding directory under + /sys (e.g., this can be + /sys/block/hdd) and + run a command similar to the following: + +udevtest /block/hdd + + Look at the lines containing the output of various *_id programs. + + There are two approaches to creating symlinks. The first one is to + use the model name and the serial number, the second one is based on the + location of the device on the bus. If you are going to use the first + approach, create a file similar to the following: + +cat >/etc/udev/rules.d/82-cdrom.rules <<"EOF" + +# Custom CD-ROM symlinks +SUBSYSTEM=="block", ENV{ID_MODEL}=="SAMSUNG_CD-ROM_SC-148F", ENV{ID_REVISION}=="PS05", SYMLINK+="cdrom" +SUBSYSTEM=="block", ENV{ID_MODEL}=="PHILIPS_CDD5301", ENV{ID_SERIAL}=="5VO1306DM00190", SYMLINK+="cdrom1 dvd" + +EOF + + This way, the symlinks will stay correct even if you move the drives + to different positions on the IDE bus, but the + /dev/cdrom symlink won't be created if you replace + the old SAMSUNG CD-ROM with a new drive. + + + The SUBSYSTEM=="block" key is needed in order to avoid + matching SCSI generic devices. Without it, in the case with SCSI + CD-ROMs, the symlinks will sometimes point to the correct + /dev/srX devices, and sometimes to + /dev/sgX, which is wrong. + + The second approach yields: + +cat >/etc/udev/rules.d/82-cdrom.rules <<"EOF" + +# Custom CD-ROM symlinks +SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", ENV{ID_PATH}=="pci-0000:00:07.1-ide-0:1", SYMLINK+="cdrom" +SUBSYSTEM=="block", ENV{ID_TYPE}=="cd", ENV{ID_PATH}=="pci-0000:00:07.1-ide-1:1", SYMLINK+="cdrom1 dvd" + +EOF + + This way, the symlinks will stay correct even if you replace drives + with different models, but place them to the old positions on the IDE + bus. The ENV{ID_TYPE}=="cd" key makes sure that the symlink + disappears if you put something other than a CD-ROM in that position on + the bus. + + Of course, it is possible to mix the two approaches. + + + + + + Dealing with duplicate devices + + As explained in , the order in + which devices with the same function appear in + /dev is essentially random. + E.g., if you have a USB web camera and a TV tuner, sometimes + /dev/video0 refers to the camera and + /dev/video1 refers to the tuner, and sometimes + after a reboot the order changes to the opposite one. + For all classes of hardware except sound cards and network cards, this is + fixable by creating udev rules for custom persistent symlinks. + The case of network cards is covered separately in + , and sound card configuration can + be found in BLFS. + + For each of your devices that is likely to have this problem + (even if the problem doesn't exist in your current Linux distribution), + find the corresponding directory under + /sys/class or + /sys/block. + For video devices, this may be + /sys/class/video4linux/videoX. + Figure out the attributes that identify the device uniquely (usually, + vendor and product IDs and/or serial numbers work): + +udevinfo -a -p /sys/class/video4linux/video0 + + Then write rules that create the symlinks, e.g.: + +cat >/etc/udev/rules.d/83-duplicate_devs.rules <<"EOF" + +# Persistent symlinks for webcam and tuner +KERNEL=="video*", SYSFS{idProduct}=="1910", SYSFS{idVendor}=="0d81", SYMLINK+="webcam" +KERNEL=="video*", SYSFS{device}=="0x036f", SYSFS{vendor}=="0x109e", SYMLINK+="tvtuner" + +EOF + + The result is that /dev/video0 and + /dev/video1 devices still refer randomly to the tuner + and the web camera (and thus should never be used directly), but there are + symlinks /dev/tvtuner and + /dev/webcam that always point to the correct + device. + + More information on writing Udev rules can be found in + /usr/share/doc/udev-&udev-version;/index.html. + + + + diff --git a/chapter07/sysklogd.xml b/chapter07/sysklogd.xml new file mode 100644 index 000000000..b31420130 --- /dev/null +++ b/chapter07/sysklogd.xml @@ -0,0 +1,26 @@ + + + %general-entities; +]> + + + + + Configuring the sysklogd script + + + sysklogd + configuring + + + The sysklogd script invokes the + syslogd program with the -m 0 option. + This option turns off the periodic timestamp mark that + syslogd writes to the log files every 20 minutes by default. + If you want to turn on this periodic timestamp mark, edit the + sysklogd script and make the changes accordingly. See + man syslogd for more information. + + diff --git a/chapter07/udev.xml b/chapter07/udev.xml new file mode 100644 index 000000000..a37e01732 --- /dev/null +++ b/chapter07/udev.xml @@ -0,0 +1,352 @@ + + + %general-entities; +]> + + + + + Device and Module Handling on an LFS System + + + Udev + usage + + + In , we installed the Udev + package. Before we go into the details regarding how this works, + a brief history of previous methods of handling devices is in + order. + + Linux systems in general traditionally use a static device creation + method, whereby a great many device nodes are created under /dev (sometimes literally thousands of nodes), + regardless of whether the corresponding hardware devices actually exist. This + is typically done via a MAKEDEV script, which contains a + number of calls to the mknod program with the relevant + major and minor device numbers for every possible device that might exist in + the world. + + Using the Udev method, only those devices which are detected by the + kernel get device nodes created for them. Because these device nodes will be + created each time the system boots, they will be stored on a tmpfs file system (a virtual file system that + resides entirely in system memory). Device nodes do not require much space, so + the memory that is used is negligible. + + + History + + In February 2000, a new filesystem called devfs was merged into the 2.3.46 kernel + and was made available during the 2.4 series of stable kernels. Although + it was present in the kernel source itself, this method of creating devices + dynamically never received overwhelming support from the core kernel + developers. + + The main problem with the approach adopted by devfs was the way it handled device + detection, creation, and naming. The latter issue, that of device node + naming, was perhaps the most critical. It is generally accepted that if + device names are allowed to be configurable, then the device naming policy + should be up to a system administrator, not imposed on them by any + particular developer(s). The devfs file system also suffers from race + conditions that are inherent in its design and cannot be fixed without a + substantial revision to the kernel. It has also been marked as deprecated + due to a lack of recent maintenance. + + With the development of the unstable 2.5 kernel tree, later released + as the 2.6 series of stable kernels, a new virtual filesystem called + sysfs came to be. The job of + sysfs is to export a view of + the system's hardware configuration to userspace processes. With this + userspace-visible representation, the possibility of seeing a userspace + replacement for devfs became + much more realistic. + + + + + Udev Implementation + + + Sysfs + + The sysfs filesystem was + mentioned briefly above. One may wonder how sysfs knows about the devices present on + a system and what device numbers should be used for them. Drivers that + have been compiled into the kernel directly register their objects with + sysfs as they are detected by + the kernel. For drivers compiled as modules, this registration will happen + when the module is loaded. Once the sysfs filesystem is mounted (on /sys), data which the built-in drivers + registered with sysfs are + available to userspace processes and to udevd for device + node creation. + + + + + Udev Bootscript + + The S10udev initscript takes care of creating + device nodes when Linux is booted. The script unsets the uevent handler + from the default of /sbin/hotplug. This is done + because the kernel no longer needs to call out to an external binary. + Instead udevd will listen on a netlink socket for + uevents that the kernel raises. Next, the bootscript copies any static + device nodes that exist in /lib/udev/devices to /dev. This is necessary because some devices, + directories, and symlinks are needed before the dynamic device handling + processes are available during the early stages of booting a system. + Creating static device nodes in /lib/udev/devices also provides an easy + workaround for devices that are not supported by the dynamic device + handling infrastructure. The bootscript then starts the Udev daemon, + udevd, which will act on any uevents it receives. + Finally, the bootscript forces the kernel to replay uevents for any + devices that have already been registered and then waits for + udevd to handle them. + + + + + Device Node Creation + + To obtain the right major and minor number for a device, Udev relies + on the information provided by sysfs in /sys. For example, + /sys/class/tty/vcs/dev contains the string + 7:0. This string is used by udevd + to create a device node with major number 7 and minor + 0. The names and permissions of the nodes created + under the /dev directory are + determined by rules specified in the files within the /etc/udev/rules.d/ directory. These are + numbered in a similar fashion to the LFS-Bootscripts package. If + udevd can't find a rule for the device it is creating, + it will default permissions to 660 and ownership to + root:root. Documentation on the syntax of the Udev + rules configuration files are available in + /usr/share/doc/udev-&udev-version;/index.html + + + + + Module Loading + + Device drivers compiled as modules may have aliases built into them. + Aliases are visible in the output of the modinfo + program and are usually related to the bus-specific identifiers of devices + supported by a module. For example, the snd-fm801 + driver supports PCI devices with vendor ID 0x1319 and device ID 0x0801, + and has an alias of pci:v00001319d00000801sv*sd*bc04sc01i*. + For most devices, the bus driver exports the alias of the driver that + would handle the device via sysfs. E.g., the + /sys/bus/pci/devices/0000:00:0d.0/modalias file + might contain the string + pci:v00001319d00000801sv00001319sd00001319bc04sc01i00. + The rules that LFS installs will cause udevd to call + out to /sbin/modprobe with the contents of the + MODALIAS uevent environment variable (that should be the + same as the contents of the modalias file in sysfs), + thus loading all modules whose aliases match this string after wildcard + expansion. + + In this example, this means that, in addition to + snd-fm801, the obsolete (and unwanted) + forte driver will be loaded if it is + available. See below for ways in which the loading of unwanted drivers can + be prevented. + + The kernel itself is also able to load modules for network + protocols, filesystems and NLS support on demand. + + + + + Handling Hotpluggable/Dynamic Devices + + When you plug in a device, such as a Universal Serial Bus (USB) MP3 + player, the kernel recognizes that the device is now connected and + generates a uevent. This uevent is then handled by + udevd as described above. + + + + + + + Problems with Loading Modules and Creating Devices + + There are a few possible problems when it comes to automatically + creating device nodes. + + + A kernel module is not loaded automatically + + Udev will only load a module if it has a bus-specific alias and the + bus driver properly exports the necessary aliases to sysfs. In other cases, one should + arrange module loading by other means. With Linux-&linux-version;, Udev is + known to load properly-written drivers for INPUT, IDE, PCI, USB, SCSI, + SERIO and FireWire devices. + + To determine if the device driver you require has the necessary + support for Udev, run modinfo with the module name as + the argument. Now try locating the device directory under + /sys/bus and check whether there is + a modalias file there. + + If the modalias file exists in sysfs, the driver supports the device and + can talk to it directly, but doesn't have the alias, it is a bug in the + driver. Load the driver without the help from Udev and expect the issue + to be fixed later. + + If there is no modalias file in the relevant + directory under /sys/bus, this + means that the kernel developers have not yet added modalias support to + this bus type. With Linux-&linux-version;, this is the case with ISA + busses. Expect this issue to be fixed in later kernel versions. + + Udev is not intended to load wrapper drivers such as + snd-pcm-oss and non-hardware drivers such as + loop at all. + + + + + A kernel module is not loaded automatically, and Udev is not + intended to load it + + If the wrapper module only enhances the functionality + provided by some other module (e.g., snd-pcm-oss + enhances the functionality of snd-pcm by making the + sound cards available to OSS applications), configure + modprobe to load the wrapper after Udev loads the + wrapped module. To do this, add an install line in + /etc/modprobe.conf. For example: + +install snd-pcm /sbin/modprobe -i snd-pcm ; \ + /sbin/modprobe snd-pcm-oss ; true + + If the module in question is not a wrapper and is useful by itself, + configure the S05modules bootscript to load this + module on system boot. To do this, add the module name to the + /etc/sysconfig/modules file on a separate line. + This works for wrapper modules too, but is suboptimal in that case. + + + + + Udev loads some unwanted module + + Either don't build the module, or blacklist it in + /etc/modprobe.conf file as done with the + forte module in the example below: + +blacklist forte + + Blacklisted modules can still be loaded manually with the + explicit modprobe command. + + + + + Udev creates a device incorrectly, or makes a wrong symlink + + This usually happens if a rule unexpectedly matches a device. For + example, a poorly-writen rule can match both a SCSI disk (as desired) + and the corresponding SCSI generic device (incorrectly) by vendor. + Find the offending rule and make it more specific. + + + + + Udev rule works unreliably + + This may be another manifestation of the previous problem. If not, + and your rule uses sysfs + attributes, it may be a kernel timing issue, to be fixed in later kernels. + For now, you can work around it by creating a rule that waits for the used + sysfs attribute and appending + it to the /etc/udev/rules.d/10-wait_for_sysfs.rules + file. Please notify the LFS Development list if you do so and it + helps. + + + + + Udev does not create a device + + Further text assumes that the driver is built statically into the + kernel or already loaded as a module, and that you have already checked + that Udev doesn't create a misnamed device. + + Udev has no information needed to create a device node if a kernel + driver does not export its data to sysfs. + This is most common with third party drivers from outside the kernel + tree. Create a static device node in + /lib/udev/devices with the appropriate major/minor + numbers (see the file devices.txt inside the kernel + documentation or the documentation provided by the third party driver + vendor). The static device node will be copied to + /dev by the + S10udev bootscript. + + + + + Device naming order changes randomly after rebooting + + This is due to the fact that Udev, by design, handles uevents and + loads modules in parallel, and thus in an unpredictable order. This will + never be fixed. You should not rely upon the kernel device + names being stable. Instead, create your own rules that make symlinks with + stable names based on some stable attributes of the device, such as a + serial number or the output of various *_id utilities installed by Udev. + See and + for examples. + + + + + + + Useful Reading + + Additional helpful documentation is available at the following + sites: + + + + + A Userspace Implementation of devfs + + + + + udev FAQ + + + + + The Linux Kernel Driver Model + + + + + + + + diff --git a/chapter07/usage.xml b/chapter07/usage.xml new file mode 100644 index 000000000..6e2bab32f --- /dev/null +++ b/chapter07/usage.xml @@ -0,0 +1,129 @@ + + + %general-entities; +]> + + + + + How Do These Bootscripts Work? + + + Bootscripts + usage + + + Linux uses a special booting facility named SysVinit that is based on a + concept of run-levels. It can be quite different from one + system to another, so it cannot be assumed that because things worked in one + particular Linux distribution, they should work the same in LFS too. LFS has its + own way of doing things, but it respects generally accepted standards. + + SysVinit (which will be referred to as init from now on) + works using a run-levels scheme. There are seven (numbered 0 to 6) run-levels + (actually, there are more run-levels, but they are for special cases and are + generally not used. See init(8) for more details), and + each one of those corresponds to the actions the computer is supposed to + perform when it starts up. The default run-level is 3. Here are the + descriptions of the different run-levels as they are implemented: + +0: halt the computer +1: single-user mode +2: multi-user mode without networking +3: multi-user mode with networking +4: reserved for customization, otherwise does the same as 3 +5: same as 4, it is usually used for GUI login (like X's xdm or KDE's kdm) +6: reboot the computer + + The command used to change run-levels is init + <runlevel>, where + <runlevel> is the target run-level. For example, to + reboot the computer, a user could issue the init 6 command, + which is an alias for the reboot command. Likewise, + init 0 is an alias for the halt + command. + + There are a number of directories under /etc/rc.d that look like rc?.d (where ? is the number of the run-level) and + rcsysinit.d, all containing a number of + symbolic links. Some begin with a K, the others begin with + an S, and all of them have two numbers following the + initial letter. The K means to stop (kill) a service and the S means to start a + service. The numbers determine the order in which the scripts are run, from 00 + to 99—the lower the number the earlier it gets executed. When + init switches to another run-level, the appropriate services + are either started or stopped, depending on the runlevel chosen. + + The real scripts are in /etc/rc.d/init.d. They do the actual work, and + the symlinks all point to them. Killing links and starting links point to + the same script in /etc/rc.d/init.d. + This is because the scripts can be called with different parameters like + start, stop, + restart, reload, and + status. When a K link is encountered, the appropriate + script is run with the stop argument. When an S link + is encountered, the appropriate script is run with the + start argument. + + There is one exception to this explanation. Links that start + with an S in the rc0.d and rc6.d directories will not cause anything + to be started. They will be called with the parameter + stop to stop something. The logic behind this + is that when a user is going to reboot or halt the system, nothing + needs to be started. The system only needs to be stopped. + + These are descriptions of what the arguments make the scripts + do: + + + + + start + + The service is started. + + + + + stop + + The service is stopped. + + + + + restart + + The service is stopped and then started again. + + + + + reload + + The configuration of the service is updated. + This is used after the configuration file of a service was modified, when + the service does not need to be restarted. + + + + + status + + Tells if the service is running and with which PIDs. + + + + + + Feel free to modify the way the boot process works (after all, + it is your own LFS system). The files given here are an example of how + it can be done. + + diff --git a/chapter08/chapter08.xml b/chapter08/chapter08.xml new file mode 100644 index 000000000..ace47328b --- /dev/null +++ b/chapter08/chapter08.xml @@ -0,0 +1,19 @@ + + + %general-entities; +]> + + + + + + Making the LFS System Bootable + + + + + + + diff --git a/chapter08/fstab.xml b/chapter08/fstab.xml new file mode 100644 index 000000000..f5e1ba626 --- /dev/null +++ b/chapter08/fstab.xml @@ -0,0 +1,95 @@ + + + %general-entities; +]> + + + + + Creating the /etc/fstab File + + + /etc/fstab + + + The /etc/fstab file is used by some programs to + determine where file systems are to be mounted by default, in which order, and + which must be checked (for integrity errors) prior to mounting. Create a new + file systems table like this: + +cat > /etc/fstab << "EOF" +# Begin /etc/fstab + +# file system mount-point type options dump fsck +# order + +/dev/<xxx> / <fff> defaults 1 1 +/dev/<yyy> swap swap pri=1 0 0 +proc /proc proc defaults 0 0 +sysfs /sys sysfs defaults 0 0 +devpts /dev/pts devpts gid=4,mode=620 0 0 +shm /dev/shm tmpfs defaults 0 0 +# End /etc/fstab +EOF + + Replace <xxx>, + <yyy>, and <fff> + with the values appropriate for the system, for example, hda2, hda5, and ext3. For details on the six + fields in this file, see man 5 fstab. + + The /dev/shm mount point + for tmpfs is included to + allow enabling POSIX-shared memory. The kernel must have the required + support built into it for this to work (more about this is in the next + section). Please note that very little software currently uses + POSIX-shared memory. Therefore, consider the /dev/shm mount point optional. For more + information, see + Documentation/filesystems/tmpfs.txt in the kernel + source tree. + + Filesystems with MS-DOS or Windows origin (i.e.: vfat, ntfs, smbfs, cifs, + iso9660, udf) need the iocharset mount option in order for + non-ASCII characters in file names to be interpreted properly. The value + of this option should be the same as the character set of your locale, + adjusted in such a way that the kernel understands it. This works if the + relevant character set definition (found under File systems -> + Native Language Support) has been compiled into the kernel + or built as a module. The codepage option is also needed for + vfat and smbfs filesystems. It + should be set to the codepage number used under MS-DOS in your country. E.g., + in order to mount USB flash drives, a ru_RU.KOI8-R user would need the + following line in /etc/fstab: + +/dev/sda1 /media/flash vfat noauto,user,quiet,showexec,iocharset=koi8r,codepage=866 0 0 + + The corresponding line for ru_RU.UTF-8 users is: + +/dev/sda1 /media/flash vfat noauto,user,quiet,showexec,iocharset=utf8,codepage=866 0 0 + + In the latter case, the kernel emits the following message: + +FAT: utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive! + + This negative recommendation should be ignored, since all other values + of the iocharset option result in wrong display of filenames in + UTF-8 locales. + + It is also possible to specify default codepage and iocharset values for + some filesystems during kernel configuration. The relevant parameters + are named + Default NLS Option (CONFIG_NLS_DEFAULT), + Default Remote NLS Option (CONFIG_SMB_NLS_DEFAULT), + Default codepage for FAT (CONFIG_FAT_DEFAULT_CODEPAGE), and + Default iocharset for FAT (CONFIG_FAT_DEFAULT_IOCHARSET). + There is no way to specify these settings for the + ntfs filesystem at kernel compilation time. + + + diff --git a/chapter08/grub.xml b/chapter08/grub.xml new file mode 100644 index 000000000..172026016 --- /dev/null +++ b/chapter08/grub.xml @@ -0,0 +1,140 @@ + + + %general-entities; +]> + + + + + Making the LFS System Bootable + + + GRUB + configuring + + + Your shiny new LFS system is almost complete. One of the last + things to do is to ensure that the system can be properly booted. The + instructions below apply only to computers of IA-32 architecture, + meaning mainstream PCs. Information on boot loading for + other architectures should be available in the usual resource-specific + locations for those architectures. + + Boot loading can be a complex area, so a few cautionary + words are in order. Be familiar with the current boot loader and any other + operating systems present on the hard drive(s) that need to be + bootable. Make sure that an emergency boot disk is ready to + rescue the computer if the computer becomes + unusable (un-bootable). + + Earlier, we compiled and installed the GRUB boot loader software + in preparation for this step. The procedure involves writing some + special GRUB files to specific locations on the hard drive. We highly + recommend creating a GRUB boot floppy diskette as a backup. Insert a + blank floppy diskette and run the following commands: + +dd if=/boot/grub/stage1 of=/dev/fd0 bs=512 count=1 +dd if=/boot/grub/stage2 of=/dev/fd0 bs=512 seek=1 + + Remove the diskette and store it somewhere safe. Now, run the + grub shell: + +grub + + GRUB uses its own naming structure for drives and partitions in + the form of (hdn,m), where n + is the hard drive number and m is the partition + number, both starting from zero. For example, partition hda1 is (hd0,0) to + GRUB and hdb3 is + (hd1,2). In contrast to Linux, GRUB does not + consider CD-ROM drives to be hard drives. For example, if using a CD + on hdb and a second hard drive + on hdc, that second hard drive + would still be (hd1). + + Using the above information, determine the appropriate + designator for the root partition (or boot partition, if a separate + one is used). For the following example, it is assumed that the root + (or separate boot) partition is hda4. + + Tell GRUB where to search for its + stage{1,2} files. The Tab key can be used + everywhere to make GRUB show the alternatives: + +root (hd0,3) + + + The following command will overwrite the current boot loader. Do not + run the command if this is not desired, for example, if using a third party + boot manager to manage the Master Boot Record (MBR). In this scenario, it + would make more sense to install GRUB into the boot sector + of the LFS partition. In this case, this next command would become + setup (hd0,3). + + + Tell GRUB to install itself into the MBR of + hda: + +setup (hd0) + + If all went well, GRUB will have reported finding its files in + /boot/grub. That's all there is + to it. Quit the grub shell: + +quit + + Create a menu list file defining GRUB's boot menu: + +cat > /boot/grub/menu.lst << "EOF" +# Begin /boot/grub/menu.lst + +# By default boot the first menu entry. +default 0 + +# Allow 30 seconds before booting the default. +timeout 30 + +# Use prettier colors. +color green/black light-green/black + +# The first entry is for LFS. +title LFS &version; +root (hd0,3) +kernel /boot/lfskernel-&linux-version; root=/dev/hda4 +EOF + + Add an entry for the host distribution if desired. It might look + like this: + +cat >> /boot/grub/menu.lst << "EOF" +title Red Hat +root (hd0,2) +kernel /boot/kernel-2.6.5 root=/dev/hda3 +initrd /boot/initrd-2.6.5 +EOF + + If dual-booting Windows, the following entry will allow + booting it: + +cat >> /boot/grub/menu.lst << "EOF" +title Windows +rootnoverify (hd0,0) +chainloader +1 +EOF + + If info grub does not provide all necessary material, + additional information regarding GRUB is located on its website at: + . + + The FHS stipulates that GRUB's menu.lst file should + be symlinked to /etc/grub/menu.lst. To + satisfy this requirement, issue the following command: + +mkdir -v /etc/grub && +ln -sv /boot/grub/menu.lst /etc/grub + + diff --git a/chapter08/introduction.xml b/chapter08/introduction.xml new file mode 100644 index 000000000..d1c15fcfe --- /dev/null +++ b/chapter08/introduction.xml @@ -0,0 +1,18 @@ + + + %general-entities; +]> + + + + + Introduction + + It is time to make the LFS system bootable. This chapter + discusses creating an fstab file, building a + kernel for the new LFS system, and installing the GRUB boot loader so + that the LFS system can be selected for booting at startup. + + diff --git a/chapter08/kernel.xml b/chapter08/kernel.xml new file mode 100644 index 000000000..8545dd4dc --- /dev/null +++ b/chapter08/kernel.xml @@ -0,0 +1,225 @@ + + + %general-entities; +]> + + + + + Linux-&linux-version; + + + Linux + + + + + + <para>The Linux package contains the Linux kernel.</para> + + <segmentedlist> + <segtitle>&buildtime;</segtitle> + <segtitle>&diskspace;</segtitle> + + <seglistitem> + <seg>&linux-ch8-sbu;</seg> + <seg>&linux-ch8-du;</seg> + </seglistitem> + </segmentedlist> + + </sect2> + + <sect2 role="installation"> + <title>Installation of the kernel + + Building the kernel involves a few steps—configuration, + compilation, and installation. Read the README file + in the kernel source tree for alternative methods to the way this book + configures the kernel. + + By default, the Linux kernel generates wrong sequences of bytes when + dead keys are used in UTF-8 keyboard mode. Also, one cannot copy and paste + non-ASCII characters when UTF-8 mode is active. Fix these issues with the + patch: + +patch -Np1 -i ../&linux-utf8-patch; + + Prepare for compilation by running the following command: + +make mrproper + + This ensures that the kernel tree is absolutely clean. The + kernel team recommends that this command be issued prior to each + kernel compilation. Do not rely on the source tree being clean after + un-tarring. + + + + Configure the kernel via a menu-driven interface. BLFS has some + information regarding particular kernel configuration requirements of + packages outside of LFS at : + +make menuconfig + + Alternatively, make oldconfig may be more + appropriate in some situations. See the README + file for more information. + + If desired, skip kernel configuration by copying the kernel + config file, .config, from the host system + (assuming it is available) to the unpacked linux-&linux-version; directory. However, + we do not recommend this option. It is often better to explore all the + configuration menus and create the kernel configuration from + scratch. + + + NPTL requires the kernel to be compiled with GCC-3.x or later, in + this case &gcc-version;. It is not recommended to compile the kernel with + GCC-2.95.x, as this causes failures in the Glibc test suite. Normally, + this wouldn't be mentioned as LFS doesn't build GCC-2.95.x. Unfortunately, + the kernel documentation is outdated and still claims GCC-2.95.3 is the + recommended compiler. + + + Compile the kernel image and modules: + +make + + If using kernel modules, an /etc/modprobe.conf + file may be needed. Information pertaining to modules and kernel + configuration is located in and in the + kernel documentation in the linux-&linux-version;/Documentation directory. + Also, modprobe.conf(5) may be of interest. + + Install the modules, if the kernel configuration uses them: + +make modules_install + + After kernel compilation is complete, additional steps are + required to complete the installation. Some files need to be copied to + the /boot directory. + + The path to the kernel image may vary depending on the platform + being used. The following command assumes an x86 architecture: + +cp -v arch/i386/boot/bzImage /boot/lfskernel-&linux-version; + + System.map is a symbol file for the kernel. + It maps the function entry points of every function in the kernel API, + as well as the addresses of the kernel data structures for the running + kernel. Issue the following command to install the map file: + +cp -v System.map /boot/System.map-&linux-version; + + The kernel configuration file .config + produced by the make menuconfig step + above contains all the configuration selections for the kernel + that was just compiled. It is a good idea to keep this file for future + reference: + +cp -v .config /boot/config-&linux-version; + + Install the documentation for the Linux kernel: + +install -d /usr/share/doc/linux-&linux-version; && +cp -r Documentation/* /usr/share/doc/linux-&linux-version; + + It is important to note that the files in the kernel source + directory are not owned by root. Whenever a + package is unpacked as user root (like we did + inside chroot), the files have the user and group IDs of whatever + they were on the packager's computer. This is usually not a problem + for any other package to be installed because the source tree is + removed after the installation. However, the Linux source tree is + often retained for a long time. Because of this, there is a chance + that whatever user ID the packager used will be assigned to somebody + on the machine. That person would then have write access to the kernel + source. + + If the kernel source tree is going to be retained, run + chown -R 0:0 on the linux-&linux-version; directory to ensure + all files are owned by user root. + + + Some kernel documentation recommends creating a symlink from + /usr/src/linux pointing to the kernel + source directory. This is specific to kernels prior to the 2.6 series and + must not be created on an LFS system as it can cause + problems for packages you may wish to build once your base LFS system is + complete. + + Also, the headers in the system's + include directory should + always be the ones against which Glibc was compiled, + that is, the ones from the Linux-Libc-Headers package, and therefore, should + never be replaced by the kernel headers. + + + + + + + Contents of Linux + + + Installed files + + + config-&linux-version;, lfskernel-&linux-version;, and + System.map-&linux-version; + + + + + Short Descriptions + + + + + config-&linux-version; + + Contains all the configuration selections for the kernel + + /boot/config-&linux-version; + + + + + + lfskernel-&linux-version; + + The engine of the Linux system. When turning on the computer, + the kernel is the first part of the operating system that gets loaded. + It detects and initializes all components of the computer's hardware, + then makes these components available as a tree of files to the + software and turns a single CPU into a multitasking machine capable + of running scores of programs seemingly at the same time + + lfskernel-&linux-version; + + + + + + System.map-&linux-version; + + A list of addresses and symbols; it maps the entry points and + addresses of all the functions and data structures in the + kernel + + /boot/System.map-&linux-version; + + + + + + + + + diff --git a/chapter09/chapter09.xml b/chapter09/chapter09.xml new file mode 100644 index 000000000..6de50a3d3 --- /dev/null +++ b/chapter09/chapter09.xml @@ -0,0 +1,19 @@ + + + %general-entities; +]> + + + + + + The End + + + + + + + diff --git a/chapter09/getcounted.xml b/chapter09/getcounted.xml new file mode 100644 index 000000000..fbcda8a50 --- /dev/null +++ b/chapter09/getcounted.xml @@ -0,0 +1,20 @@ + + + %general-entities; +]> + + + + + Get Counted + + Now that you have finished the book, do you want to be counted as an + LFS user? Head over to and + register as an LFS user by entering your name and the first LFS version you + have used. + + Let's reboot into LFS now. + + diff --git a/chapter09/reboot.xml b/chapter09/reboot.xml new file mode 100644 index 000000000..2011c4bba --- /dev/null +++ b/chapter09/reboot.xml @@ -0,0 +1,62 @@ + + + %general-entities; +]> + + + + + Rebooting the System + + Now that all of the software has been installed, it is time to reboot + your computer. However, you should be aware of a few things. The system you + have created in this book is quite minimal, and most likely will not have + the functionality you would need to be able to continue forward. By installing + a few extra packages from the BLFS book while still in our current chroot + environment, you can leave yourself in a much better position to continue on + once you reboot into your new LFS installation. Installing a text mode web + browser, such as Lynx, you can easily view the BLFS book in one virtual + terminal, while building packages in another. The GPM package will also allow + you to perform copy/paste actions in your virtual terminals. Lastly, if you + are in a situation where static IP configuration does not meet your networking + requirements, installing packages such as Dhcpcd or PPP at this point might + also be useful. + + + Now that we have said that, lets move on to booting our shiny new LFS + installation for the first time! First exit from the chroot environment: + +logout + + Then unmount the virtual files systems: + +umount -v $LFS/dev/pts +umount -v $LFS/dev/shm +umount -v $LFS/dev +umount -v $LFS/proc +umount -v $LFS/sys + + Unmount the LFS file system itself: + +umount -v $LFS + + If multiple partitions were created, unmount the other + partitions before unmounting the main one, like this: + +umount -v $LFS/usr +umount -v $LFS/home +umount -v $LFS + + Now, reboot the system with: + +shutdown -r now + + Assuming the GRUB boot loader was set up as outlined earlier, the menu + is set to boot LFS &version; automatically. + + When the reboot is complete, the LFS system is ready for use and + more software may be added to suit your needs. + + diff --git a/chapter09/theend.xml b/chapter09/theend.xml new file mode 100644 index 000000000..ddafe43b8 --- /dev/null +++ b/chapter09/theend.xml @@ -0,0 +1,27 @@ + + + %general-entities; +]> + + + + + The End + + + /etc/lfs-release + + + Well done! The new LFS system is installed! We wish you much + success with your shiny new custom-built Linux system. + + It may be a good idea to create an /etc/lfs-release + file. By having this file, it is very easy for you (and for us if you need to + ask for help at some point) to find out which LFS version is installed on the + system. Create this file by running: + +echo &version; > /etc/lfs-release + + diff --git a/chapter09/whatnow.xml b/chapter09/whatnow.xml new file mode 100644 index 000000000..8e7fa33c7 --- /dev/null +++ b/chapter09/whatnow.xml @@ -0,0 +1,99 @@ + + + %general-entities; +]> + + + + + What Now? + + Thank you for reading this LFS book. We hope that you have + found this book helpful and have learned more about the system + creation process. + + Now that the LFS system is installed, you may be wondering + What next? To answer that question, we have compiled a + list of resources for you. + + + + + Maintenance + + Bugs and security notices are reported regularly for all software. + Since an LFS system is compiled from source, it is up to you to keep + abreast of such reports. There are several online resources that track + such reports, some of which are shown below: + + + + + Freshmeat.net () + + Freshmeat can notify you (via email) of new versions of packages + installed on your system. + + + + CERT (Computer + Emergency Response Team) + + CERT has a mailing list that publishes security alerts concerning + various operating systems and applications. Subscription information is + available at . + + + + Bugtraq + + Bugtraq is a full-disclosure computer security mailing list. It + publishes newly discovered security issues, and occasionally potential + fixes for them. Subscription information is available at . + + + + + + + Beyond Linux From Scratch + + The Beyond Linux From Scratch book covers installation + procedures for a wide range of software beyond the scope of the LFS + Book. The BLFS project is located at . + + + + LFS Hints + + The LFS Hints are a collection of educational documents + submitted by volunteers in the LFS community. The hints are available + at . + + + + Mailing lists + + There are several LFS mailing lists you may subscribe to if you + are in need of help, want to stay current with the latest developments, + want to contribute to the project, and more. See for more + information. + + + + The Linux Documentation Project + + The goal of The Linux Documentation Project (TLDP) is to + collaborate on all of the issues of Linux documentation. The TLDP features + a large collection of HOWTOs, guides, and man pages. It is located at + . + + + + + diff --git a/general.ent b/general.ent new file mode 100644 index 000000000..3da339ab3 --- /dev/null +++ b/general.ent @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +%packages-entities; + + +%patches-entities; diff --git a/index.xml b/index.xml new file mode 100644 index 000000000..c66f088e2 --- /dev/null +++ b/index.xml @@ -0,0 +1,49 @@ + + + %general-entities; +]> + + + + + + + +Introduction + + + + + +Preparing for the Build + + + + + + + + +Building the LFS System + + + + + + + + +Appendices + + + + + + + + + + diff --git a/obfuscate.sh b/obfuscate.sh new file mode 100644 index 000000000..0e9f8f8fe --- /dev/null +++ b/obfuscate.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# obfuscate.sh +# obfuscate email addresses in XML/HTML +# Script written (and slight perl modification) by Archaic +# Original Perl expression by Anderson Lizardo +# Released under the GNU General Public License +# +# This script currently only seeks out mailto: addresses. If those same +# addresses also appear in plaintext, we need to obfuscate those as well. +# +# This script was made for a very specific purpose so I was a bit lazy in +# writing the regex's. +# +# Please send comments, enhancements, etc. to the above address + +#set -e # Bail on all errors + +# First, ensure that we are given a file to process +# if [ $# -lt 1 ]; then +# echo -e "\nYou must provide an input file." +# exit 1 +# fi + +# Nothing like a backup plan! +#cp "$1" "$1".bak + +for i in `grep -o '"mailto:.*@.*"' "$1" |sed -e 's|^"mailto:||' -e 's|"$||'`; do + link=`echo $i | perl -pe 's/[^\n]/"\\\&#".ord($&)."\;"/ge'` + plaintext=`echo $i | sed -e 's|@| AT |' -e 's|\.| D0T |g'` + sed -i "s|mailto:$i|mailto:$link|" "$1" + sed -i "s|$i|$plaintext|" "$1" +done + +#exit 0 diff --git a/packages.ent b/packages.ent new file mode 100644 index 000000000..a11a2ac61 --- /dev/null +++ b/packages.ent @@ -0,0 +1,530 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/patches.ent b/patches.ent new file mode 100644 index 000000000..7aaaa6c9b --- /dev/null +++ b/patches.ent @@ -0,0 +1,157 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/prologue/audience.xml b/prologue/audience.xml new file mode 100644 index 000000000..eb8950efb --- /dev/null +++ b/prologue/audience.xml @@ -0,0 +1,86 @@ + + + %general-entities; +]> + + + + + Audience + + There are many reasons why somebody would want to read this book. + The principal reason is to install a Linux system from the source code. + A question many people raise is, why go through all the hassle of + manually building a Linux system from scratch when you can just download + and install an existing one? That is a good question and is the + impetus for this section of the book. + + One important reason for LFS's existence is to help people learn + how a Linux system works from the inside out. Building an LFS system + helps demonstrate what makes Linux tick, and how things work together + and depend on each other. One of the best things that this learning + experience provides is the ability to customize Linux to your own tastes + and needs. + + A key benefit of LFS is that it allows users to have more control + over the system without relying on someone else's Linux implementation. + With LFS, you are in the driver's seat and dictate + every aspect of the system, such as the directory layout and bootscript + setup. You also dictate where, why, and how programs are installed. + + Another benefit of LFS is the ability to create a very compact Linux + system. When installing a regular distribution, one is often forced to + include several programs which are probably never used. These programs + waste disk space, or worse, CPU cycles. It is not difficult to build an + LFS system of less than 100 megabytes (MB), which is substantially smaller + than the majority of existing installations. Does this still sound like a + lot of space? A few of us have been working on creating a very small + embedded LFS system. We successfully built a system that was specialized + to run the Apache web server with approximately 8MB of disk space used. + Further stripping could bring this down to 5 MB or less. Try that with a + regular distribution! This is only one of the many benefits of designing + your own Linux implementation. + + We could compare Linux distributions to a hamburger purchased at a + fast-food restaurant—you have no idea what might be in what you are + eating. LFS, on the other hand, does not give you a hamburger. Rather, + LFS provides the recipe to make the exact hamburger desired. This allows + users to review the recipe, omit unwanted ingredients, and add your own + ingredients to enhance the flavor of the burger. When you are satisfied + with the recipe, move on to preparing it. It can be made to exact + specifications—broil it, bake it, deep-fry it, or barbecue it. + + Another analogy that we can use is that of comparing LFS with a + finished house. LFS provides the skeletal plan of a house, but it is up + to you to build it. LFS maintains the freedom to adjust plans throughout + the process, customizing it to the user's needs and preferences. + + An additional advantage of a custom built Linux system is security. + By compiling the entire system from source code, you are empowered to audit + everything and apply all the security patches desired. It is no longer + necessary to wait for somebody else to compile binary packages that fix a + security hole. Unless you examine the patch and implement it yourself, you + have no guarantee that the new binary package was built correctly and + adequately fixes the problem. + + The goal of Linux From Scratch is to build a complete and usable + foundation-level system. Readers who do not wish to build their own Linux + system from scratch may not benefit from the information in this book. If + you only want to know what happens while the computer boots, we recommend + the From Power Up To Bash Prompt HOWTO located at + or on The Linux + Documentation Project's (TLDP) website at . + The HOWTO builds a system which is similar to that of this book, but it + focuses strictly on creating a system capable of booting to a BASH prompt. + Consider your objective. If you wish to build a Linux system while learning + along the way, then this book is your best choice. + + There are too many good reasons to build your own LFS system to + list them all here. This section is only the tip of the iceberg. As + you continue in your LFS experience, you will find the power that + information and knowledge truly bring. + + diff --git a/prologue/bookinfo.xml b/prologue/bookinfo.xml new file mode 100644 index 000000000..2e70662ff --- /dev/null +++ b/prologue/bookinfo.xml @@ -0,0 +1,66 @@ + + + %general-entities; +]> + + + Linux From Scratch + Version &version; + + + + + Gerard + Beekmans + + + + + + 1999–2006 + Gerard Beekmans + + + + Copyright (c) 1999–2006, Gerard Beekmans + + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + + + Redistributions in any form must retain the above copyright + notice, this list of conditions and the following disclaimer + + + Neither the name of Linux From Scratch nor the + names of its contributors may be used to endorse or promote products + derived from this material without specific prior written + permission + + + Any material derived from Linux From Scratch must contain + a reference to the Linux From Scratch project + + + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + AS IS AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + + + diff --git a/prologue/dedication.xml b/prologue/dedication.xml new file mode 100644 index 000000000..e919ae5ac --- /dev/null +++ b/prologue/dedication.xml @@ -0,0 +1,11 @@ + + + %general-entities; +]> + + + Dedication + This book is dedicated + diff --git a/prologue/errata.xml b/prologue/errata.xml new file mode 100644 index 000000000..69e196210 --- /dev/null +++ b/prologue/errata.xml @@ -0,0 +1,22 @@ + + + %general-entities; +]> + + + + + Errata + + The software used to create an LFS system is constantly being updated + and enhanced. Security warnings and bug fixes may become available after + the LFS book has been released. To check whether the package versions or + instructions in this release of LFS need any modifications to accommodate + security vulnerabilities or other bug fixes, please visit before proceeding with your build. You should note any + changes shown and apply them to the relevant section of the book as you + progress with building the LFS system. + + diff --git a/prologue/foreword.xml b/prologue/foreword.xml new file mode 100644 index 000000000..2ebe3414c --- /dev/null +++ b/prologue/foreword.xml @@ -0,0 +1,67 @@ + + + %general-entities; +]> + + + + + Foreword + + My adventures in Linux began in 1998 when I downloaded and + installed my first distribution. After working with it for a while, I + discovered issues I definitely would have liked to see improved upon. + For example, I didn't like the arrangement of the bootscripts or the way + programs were configured by default. I tried a number of alternative + distributions to address these issues, yet each had its pros and cons. + Finally, I realized that if I wanted full satisfaction from my Linux + system, I would have to build my own from scratch. + + What does this mean? I resolved not to use pre-compiled packages + of any kind, nor CD-ROMs or boot disks that would install basic + utilities. I would use my current Linux system to develop my own + customized system. This perfect Linux system would then + have the strengths of various systems without their associated + weaknesses. In the beginning, the idea was rather daunting, but I + remained committed to the idea that a system could be built that would + conform to my needs and desires rather than to a standard that just + did not fit what I was looking for. + + After sorting through issues such as circular dependencies and + compile-time errors, I created a custom-built Linux system that was + fully operational and suitable to individual needs. This process also + allowed me to create compact and streamlined Linux systems which are + faster and take up less space than traditional operating systems. I + called this system a Linux From Scratch system, or an LFS system for + short. + + As I shared my goals and experiences with other members of the + Linux community, it became apparent that there was sustained interest + in the ideas set forth in my Linux adventures. Such custom-built LFS + systems serve not only to meet user specifications and requirements, but + also serve as an ideal learning opportunity for programmers and system + administrators to enhance their Linux skills. Out of this broadened + interest, the Linux From Scratch Project was born. + + This Linux From Scratch book provides + readers with the background and instruction to design and build custom + Linux systems. This book highlights the Linux from Scratch project and + the benefits of using this system. Users can dictate all aspects of + their system, including directory layout, script setup, and security. + The resulting system will be compiled completely from the source code, + and the user will be able to specify where, why, and how programs are + installed. This book allows readers to fully customize Linux systems + to their own needs and allows users more control over their + system. + + I hope you will have a great time working on your own LFS + system, and enjoy the numerous benefits of having a system that is + truly your own. + +-- +Gerard Beekmans +gerard@linuxfromscratch.org + + diff --git a/prologue/hostreqs.xml b/prologue/hostreqs.xml new file mode 100644 index 000000000..a0a2db221 --- /dev/null +++ b/prologue/hostreqs.xml @@ -0,0 +1,141 @@ + + + %general-entities; +]> + + + + + Host System Requirements + + Your host system should have the following software with the + minimum versions indicated. This should not be an issue for most + modern Linux distributions. Also note that many distributions will + place software headers into separate packages, often in the form of + <package-name>-devel or + <package-name>-dev. Be sure to install those if + your distribution provides them. + + + + + Bash-2.05a + + + + Binutils-2.12 (Versions + greater than &binutils-version; are not recommended as they have + not been tested) + + + + Bzip2-1.0.2 + + + + Coreutils-5.0 (or Sh-Utils-2.0, + Textutils-2.0, and Fileutils-4.1) + + + + Diffutils-2.8 + + + + Findutils-4.1.20 + + + + Gawk-3.0 + + + + Gcc-2.95.3 (Versions + greater than &gcc-version; are not recommended as they have not + been tested) + + + + Glibc-2.2.5 (Versions + greater than &glibc-version; are not recommended as they have + not been tested) + + + + Grep-2.5 + + + + Gzip-1.2.4 + + + + Linux Kernel-2.6.x + (having been compiled with GCC-3.0 or greater) + + The reason for the kernel version requirement is that thread-local + storage support in Binutils will not be built and the Native POSIX + Threading Library (NPTL) test suite will segfault if the host's kernel + isn't at least a 2.6.x version compiled with a 3.0 or later release of + GCC. + + If the host kernel is either earlier than 2.6.x, or it was not + compiled using a GCC-3.0 (or later) compiler, you will have to replace + the kernel with one adhering to the specifications. There are two methods + you can take to solve this. First, see if your Linux vendor provides a + 2.6 kernel package. If so, you may wish to install it. If your vendor + doesn't offer a 2.6 kernel package, or you would prefer not to install it, + then you can compile a 2.6 kernel yourself. Instructions for compiling the + kernel and configuring the boot loader (assuming the host uses GRUB) are + located in . + + + + Make-3.79.1 + + + + Patch-2.5.4 + + + + Sed-3.0.2 + + + + Tar-1.14 + + + + + To see whether your host system has all the appropriate versions, run the following: + +cat > version-check.sh << "EOF" +#!/bin/bash + +# Simple script to list version numbers of critical development tools + +bash --version | head -n1 | cut -d" " -f2-4 +echo -n "Binutils: "; ld --version | head -n1 | cut -d" " -f3-4 +bzip2 --version 2>&1 < /dev/null | head -n1 | cut -d" " -f1,6- +echo -n "Coreutils: "; chown --version | head -n1 | cut -d")" -f2 +diff --version | head -n1 +find --version | head -n1 +gawk --version | head -n1 +gcc --version | head -n1 +/lib/libc.so.6 | head -n1 | cut -d" " -f1-7 +grep --version | head -n1 +gzip --version | head -n1 +cat /proc/version | head -n1 | cut -d" " -f1-3,5-7 +make --version | head -n1 +patch --version | head -n1 +sed --version | head -n1 +tar --version | head -n1 + +EOF + +bash version-check.sh + + diff --git a/prologue/organization.xml b/prologue/organization.xml new file mode 100644 index 000000000..c4ca2cd31 --- /dev/null +++ b/prologue/organization.xml @@ -0,0 +1,43 @@ + + + %general-entities; +]> + + + + + Structure + + This book is divided into the following parts. + + + Part I - Introduction + + Part I explains a few important notes on how to proceed with the + LFS installation. This section also provides meta-information about + the book. + + + + Part II - Preparing for the Build + + Part II describes how to prepare for the building process—making + a partition, downloading the packages, and compiling temporary + tools. + + + + Part III - Building the LFS System + + Part III guides the reader through the building of the LFS + system—compiling and installing all the packages one by one, + setting up the boot scripts, and installing the kernel. The resulting + Linux system is the foundation on which other software can be built to + expand the system as desired. At the end of this book, there is an + easy to use reference listing all of the programs, libraries, and + important files that have been installed. + + + diff --git a/prologue/preface.xml b/prologue/preface.xml new file mode 100644 index 000000000..97f9a4733 --- /dev/null +++ b/prologue/preface.xml @@ -0,0 +1,22 @@ + + + %general-entities; +]> + + + + + + Preface + + + + + + + + + + diff --git a/prologue/prerequisites.xml b/prologue/prerequisites.xml new file mode 100644 index 000000000..32905f08f --- /dev/null +++ b/prologue/prerequisites.xml @@ -0,0 +1,59 @@ + + + %general-entities; +]> + + + + + Prerequisites + + Building an LFS system is not a simple task. It requires a certain + level of existing knowledge of Unix system administration in order to resolve + problems, and correctly execute the commands listed. In particular, as an + absolute minimum, the reader should already have the ability to use the + command line (shell) to copy or move files and directories, list directory + and file contents, and change the current directory. It is also expected that + the reader has a reasonable knowledge of using and installing Linux + software. + + Because the LFS book assumes at least this basic + level of skill, the various LFS support forums are unlikely to be able to + provide you with much assistance; you will find that your questions regarding + such basic knowledge will likely go unanswered, or you will simply be referred + to the LFS essential pre-reading list. + + Before building an LFS system, we recommend reading the following + HOWTOs: + + + + Software-Building-HOWTO + + + This is a comprehensive guide to building and installing + generic Unix software packages under Linux. + + + + The Linux Users' Guide + + + This guide covers the usage of assorted Linux software. + + + + The Essential Pre-Reading Hint + + + This is an LFS Hint written specifically for users new to Linux. + It includes a list of links to excellent sources of information on a + wide range of topics. Anyone attempting to install LFS should have an + understanding of many of the topics in this hint. + + + + + diff --git a/prologue/typography.xml b/prologue/typography.xml new file mode 100644 index 000000000..ab884840d --- /dev/null +++ b/prologue/typography.xml @@ -0,0 +1,81 @@ + + + %general-entities; +]> + + + + + Typography + + To make things easier to follow, there are a few typographical + conventions used throughout this book. This section contains some + examples of the typographical format found throughout Linux From + Scratch. + +./configure --prefix=/usr + + This form of text is designed to be typed exactly as seen unless + otherwise noted in the surrounding text. It is also used in the explanation + sections to identify which of the commands is being referenced. + +install-info: unknown option '--dir-file=/mnt/lfs/usr/info/dir' + + This form of text (fixed-width text) shows screen output, probably as + the result of commands issued. This format is also used to show filenames, + such as /etc/ld.so.conf. + + Emphasis + + This form of text is used for several purposes in the book. Its main + purpose is to emphasize important points or items. + + + + This format is used for hyperlinks both within the LFS community and to + external pages. It includes HOWTOs, download locations, and websites. + +cat > $LFS/etc/group << "EOF" +root:x:0: +bin:x:1: +...... +EOF + + This format is used when creating configuration files. The first command + tells the system to create the file $LFS/etc/group from + whatever is typed on the following lines until the sequence end of file (EOF) + is encountered. Therefore, this entire section is generally typed as + seen. + + <REPLACED TEXT> + + This format is used to encapsulate text that is not to be typed + as seen or for copy-and-paste operations. + + [OPTIONAL TEXT] + + This format is used to encapsulate text that is optional. + + passwd(5) + + This format is used to refer to a specific manual page (hereinafter + referred to simply as a man page). The number inside parentheses + indicates a specific section inside of man. For example, + passwd has two man pages. Per LFS installation instructions, + those two man pages will be located at + /usr/share/man/man1/passwd.1 and + /usr/share/man/man5/passwd.5. Both man pages have different + information in them. When the book uses passwd(5) it is + specifically referring to /usr/share/man/man5/passwd.5. + man passwd will print the first man page it finds that + matches passwd, which will be + /usr/share/man/man1/passwd.1. For this example, you will + need to run man 5 passwd in order to read the specific page + being referred to. It should be noted that most man pages do not have duplicate + page names in different sections. Therefore, man <program + name> is generally sufficient. + + + diff --git a/stylesheets/dump-commands.xsl b/stylesheets/dump-commands.xsl new file mode 100644 index 000000000..e3cac13b7 --- /dev/null +++ b/stylesheets/dump-commands.xsl @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 00 + + + + 0 + + + + + + + + + + + + + + + + + + + # Run this as root + + # End root commands + + + + + + + + + + + + + # This block must be edited to suit your needs. + + + + + + # End of editable block. + + + + + + **EDITME + + EDITME** + + + diff --git a/stylesheets/lfs-chunked.xsl b/stylesheets/lfs-chunked.xsl new file mode 100644 index 000000000..08d620841 --- /dev/null +++ b/stylesheets/lfs-chunked.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/lfs-chunked2.xsl b/stylesheets/lfs-chunked2.xsl new file mode 100644 index 000000000..675c0a1e5 --- /dev/null +++ b/stylesheets/lfs-chunked2.xsl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/lfs-l10n.xml b/stylesheets/lfs-l10n.xml new file mode 100644 index 000000000..3c90bd196 --- /dev/null +++ b/stylesheets/lfs-l10n.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/lfs-nochunks.xsl b/stylesheets/lfs-nochunks.xsl new file mode 100644 index 000000000..7093af7d0 --- /dev/null +++ b/stylesheets/lfs-nochunks.xsl @@ -0,0 +1,335 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+

+ +

+
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/stylesheets/lfs-pdf.xsl b/stylesheets/lfs-pdf.xsl new file mode 100644 index 000000000..e9c15a21a --- /dev/null +++ b/stylesheets/lfs-pdf.xsl @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + justify + + + 9 + 12pt + + + + book toc + part nop + + 1 + + + + + no + + + + + diff --git a/stylesheets/lfs-print.css b/stylesheets/lfs-print.css new file mode 100644 index 000000000..88e8efabb --- /dev/null +++ b/stylesheets/lfs-print.css @@ -0,0 +1,6 @@ + +@import url(lfs.css); + +.navfooter, .headerlinks { + display: none; +} diff --git a/stylesheets/lfs-profile.xsl b/stylesheets/lfs-profile.xsl new file mode 100644 index 000000000..68dca215b --- /dev/null +++ b/stylesheets/lfs-profile.xsl @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/lfs-tex.xsl b/stylesheets/lfs-tex.xsl new file mode 100644 index 000000000..a312c5214 --- /dev/null +++ b/stylesheets/lfs-tex.xsl @@ -0,0 +1,78 @@ + + + + + + + + + + +\documentclass[12pt]{book} + +\usepackage{lfs} +\usepackage{fancyhdr} +\usepackage{fancyvrb} +\usepackage{makeidx} +\usepackage{hyperref} +\usepackage{fancybox} + +\oddsidemargin -0.5in +\evensidemargin -0.625in +\textwidth 7in +\textheight 8.5in + +%\ifx\pdfoutput\undefined +%\else +%\pdfpagewidth=7in +%\pdfpageheight=8.5in +%\fi + +\pagestyle{fancy} +\newenvironment{admonition}[2] { + \vspace{8mm} + \hspace{0mm}\newline + \noindent +} + + +\fancyhf{} +\fancyhead[LE,RO]{\bfseries\thepage} +\fancyhead[LO]{\bfseries\rightmark} +\fancyhead[RE]{\bfseries\leftmark} +\renewcommand{\headrulewidth}{0.5pt} +\renewcommand{\footrulewidth}{0pt} +\addtolength{\headheight}{3pt} +\fancypagestyle{plain}{% + \fancyhead{} + \renewcommand{\headrulewidth}{0pt} +} + + +\hyphenation{change-log cpp-flags ctrlaltdel ma-cros chil-ton} + + + + + +1 + + + \begin{document} + \frontmatter + + + + + + + \newpage + \section*{} + + + + + + diff --git a/stylesheets/lfs.css b/stylesheets/lfs.css new file mode 100644 index 000000000..56ea50f62 --- /dev/null +++ b/stylesheets/lfs.css @@ -0,0 +1,412 @@ +/* Global settings */ +body { + font-family: sans-serif; + text-align: left; + background: #fff; + color: #333; + margin: 1em; + padding: 0; + font-size: 1em; + line-height: 1.2em +} + +a:link { color: #22b; } +a:visited { color: #7e4988; } +a:hover, a:focus { color: #d30e08; } +a:active { color: #6b77b1;} + +/* Headers */ +h1, h2, b, strong { + color: #000; + font-weight: bold; +} + +h3, h4, h5, h6 { + color: #222; +} + +h1 { font-size: 173%; text-align: center; line-height: 1.2em; } +h2 { font-size: 144%; padding-top: 0.2em; margin-top: 0.3em; line-height: 1.2em; } +h2.subtitle { text-align: center; line-height: 1.2em; } +h3 { font-size: 120%; line-height: 1.2em; } +h4 { font-size: 110%; line-height: 1.2em; } +h5, h6 { font-size: 110%; font-style: italic; line-height: 1.2em; } + +/* Navigation */ +div.headertitles h4 { + margin-bottom: 2px; + text-align: center; +} + +div.headertitles h3 { + margin-top: 2px; + text-align: center; +} + +div.navheader, div.navfooter { + background: #ecedef; + padding: 0.1em 1em; + border-bottom: 1px solid #dbddec; +} + +div.navfooter { + border-bottom: 0; + border-top: 1px solid #dbddec; +} + +div.navheader ul, div.navfooter ul { + padding: .2em .5em .5em 0; + margin-left: 0px; + margin-right: 2px; + position: relative; + background: #dbddec; +} + +div.navheader ul li, div.navfooter ul li { + display: inline; + width: 40%; +} + +div.navheader ul li.prev, div.navfooter ul li.prev { + position: absolute; + display: block; + left: 0; + text-align: left; + padding: 0.2em 1em; + margin-left: 6px; +} + +div.navheader ul li.next, div.navfooter ul li.next { + position: absolute; + display: block; + text-align: right; + right: 5px; + padding: 0.2em 0.5em; + margin-right: 7px; +} + +div.navheader ul li.prev p, div.navfooter ul li.prev p, +div.navheader ul li.next p, div.navfooter ul li.next p { + padding: 0; + margin: 1px 0px; +} + +div.navheader ul li.home, div.navheader ul li.up, +div.navfooter ul li.home, div.navfooter ul li.up { + text-align: center; + padding: 0; + margin: 0px auto; + display: block; + color: #dbddec; +} + +/* TOC & Index*/ + +div.toc ul, div.index ul, div.navheader ul, div.navfooter ul { + list-style: none; +} + +div.toc, div.dedication { + padding-left: 1em; +} + +li.preface, li.appendix { + margin-left: 1em; +} + +div.toc ul li h3, div.toc ul li h4 { + margin: .4em; +} + +.item { + width: 17em; + float: left; +} + +.secitem { + font-weight: normal; + width: 16em; + float: left; +} + +/* Admonitions */ +div.note, div.tip { + background-color: #fffff6; + border: 2px solid #dbddec; + width: 90%; + margin: .5em auto; +} + +div.important, div.warning, div.caution { + background-color: #fffff6; + border: medium solid #400; + width: 90%; + margin: 1.5em auto; + color: #600; + font-size: larger; +} + +div.important h3, div.warning h3, div.caution h3 { + color: #900; +} + +div.admonhead img { + padding: .3em; +} + +div.admonhead h3 { + display: inline; + margin-left: 1.5em; +} + +div.admonbody { + margin: .5em; +} + +div.important em, div.warning em, div.caution em { + color: #000; + font-weight: bold; +} + +div.important tt, div.warning tt, div.caution tt { + font-weight: bold; +} + +div.important tt.literal, div.warning tt.literal, div.caution tt.literal { + font-weight: normal; +} + +/* variablelist & segmentedlist */ +dl { + margin: 0; + padding: 0; +} + +dt { + display: list-item; + font-weight: bold; + margin: .33em 0 0 1em; + padding: 0; +} + +dd { + margin: 0 0 1em 3em; + padding: 0; +} + +table { + width: auto; + margin-left: 1em; +} + +td { + vertical-align: top; +} + +td span, td p { + margin: 0.3em; +} + +span.term { + display: block; +} + +div.variablelist dd { + margin-bottom: 1em; +} + +div.variablelist dd p { + margin-top: 0px; + margin-bottom: 0px; + padding-top: 0px; + padding-bottom: 0px; +} + +div.materials dd { + margin-left: 0px; +} + +div.package div.seg { + margin-bottom: 0em; + margin-top: 0em; + clear: left; +} + +div.package span.segtitle, div.appendix span.segtitle { + float: left; +} + +div.package span.seg, div.appendix span.seg { + display: block; + padding-left: 14em; +} + +div.appendix div.segmentedlist { + padding-left: 1em; +} + +div.appendix h2 { + font-size: 133%; + margin-top: 1em; + margin-bottom: 0.2em; +} + +div.content div.seg { + margin-bottom: 1em; + margin-top: 1em; + clear: left; +} + +div.content span.segtitle { + float: left; +} + +div.content span.seg { + display: block; + padding-left: 12em; +} + +/* itemizedlist */ + +div.itemizedlist { + margin-left: 1em; +} + +ul[compact="compact"] { + list-style: none; +} + +ul[compact="compact"] li { + margin: 0em; + padding: 0em; +} + +ul[compact="compact"] li p { + padding: 0.3em; + margin: 0em; +} + +/*table */ + +div.table { + text-align: center; +} + +div.table table { + margin-left: auto; + margin-right: auto; + text-align: center; +} + +div.table table th, div.table table td { + padding: 0.2em 2em 0.2em 2em; +} + +/* Indented blocks */ +p, ul, dl, code, blockquote { + padding-left: 1em; +} + +/* Monospaced elements */ +tt, code, kbd, pre, .command { + font-family: monospace; +} + +tt.systemitem { + font-style: italic; +} + +pre.userinput { + color: #101310; + background-color: #e5e5e5; + border: 1px solid #050505; + padding: .5em 1em; + margin: 0 2em; + font-weight: bold; +} + +.literal { + font-weight: normal; +} + +pre.screen { + color: #000; + background-color: #e9e9e9; + border: 1px solid #050505; + padding: .5em 1em; + margin: 0 2em; +} + +/* Sections */ +div.wrap h1 { + background: #f5f6f7; + padding: 1em 0 0.5em 0; + margin: 0px auto; +} + +div.package { + background: #f5f6f7; + border-bottom: 0.2em solid #dbddec; + padding: 0.5em 0.5em 0.3em 0.5em; + margin: 0px auto; +} + +div.installation { + padding: 0 0.5em 0.3em 0.5em; + margin: 0.5em 0 0.5em 0; +} + +div.configuration { + background: #fefefe; + border-top: 0.2em solid #dbddec; + padding: 0.5em; + margin: 0.5em 0 .5em 0; +} + +div.content { + background: #f5f6f7; + border-top: 0.2em solid #dbddec; + padding: 0.5em 0.5em 1em 0.5em; + margin: 0.5em 0 .5em 0; +} + +div.installation h2, div.content h2 { + padding-top: 0.3em; + margin: 0; +} + +div.book, div.preface, div.part, div.chapter, div.sect1, div.appendix, div.index { + padding-bottom: 0.5em; +} + +div.preface h1, div.part h1, div.chapter h1, div.sect1 h1, div.appendix h1, div.index h1 { + background: #f5f6f7; + border-bottom: .1em solid #dbddec; + margin: 0px auto; + padding: .5em; +} + +div.book h1 { + background: #f5f6f7; + margin: 0px auto; + padding: 0.5em; +} + +div.book h2.subtitle { + background: #dbddec; + margin: 0px auto; + padding: 0.2em; +} +div.authorgroup, div p.copyright, div.abstract { + background: #f5f6f7; + margin: 0px auto; + padding: 1em 0.5em; +} + +hr { + background: #dbddec; + height: .3em; + border: 0px; + margin: 0px auto; + padding: 0; +} diff --git a/stylesheets/patcheslist.xsl b/stylesheets/patcheslist.xsl new file mode 100644 index 000000000..3946ae52c --- /dev/null +++ b/stylesheets/patcheslist.xsl @@ -0,0 +1,69 @@ + + + %general-entities; +]> + + + + + + + + + + + + #! /bin/bash + +function copy +{ + cp $1 $2 >>copyerrs 2>&1 +} + +umask 002 + + + install -d -m 775 -g lfswww + + && + cd + + && + + rm -f *.patch copyerrs && + + + chgrp lfswww *.patch && + +if [ `wc -l copyerrs | sed 's/ *//' | cut -f1 -d' '` -gt 0 ]; then + mail -s "Missing LFS patches" lfs-book@linuxfromscratch.org < copyerrs +fi + + exit + + + + + + + + + + + + - + + + copy /home/httpd/www.linuxfromscratch.org/patches/downloads/ + + / + + . + + + + diff --git a/stylesheets/pdf/lfs-admon.xsl b/stylesheets/pdf/lfs-admon.xsl new file mode 100644 index 000000000..b04a4a11e --- /dev/null +++ b/stylesheets/pdf/lfs-admon.xsl @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 6pt + + + + + + + + + + + + + + + + + + + + + + + + + + + #500 + + + #500 + + + #500 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylesheets/pdf/lfs-index.xsl b/stylesheets/pdf/lfs-index.xsl new file mode 100644 index 000000000..6f15ce53e --- /dev/null +++ b/stylesheets/pdf/lfs-index.xsl @@ -0,0 +1,147 @@ + + + + + +]> + + + + + + + + Index + + + + + + + + + + + + + + + + + Packages + + + + + Programs + + + + + Libraries + + + + + Scripts + + + + + Others + + + + + + + + + + + + + + + + + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/pdf/lfs-mixed.xsl b/stylesheets/pdf/lfs-mixed.xsl new file mode 100644 index 000000000..ac096e5c9 --- /dev/null +++ b/stylesheets/pdf/lfs-mixed.xsl @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + 0.1em + 0em + 0.2em + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + [ + + + + ] + + + + + + + + + + + + + + + + + + + 32 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1.5em + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/pdf/lfs-pagesetup.xsl b/stylesheets/pdf/lfs-pagesetup.xsl new file mode 100644 index 000000000..7e19099ce --- /dev/null +++ b/stylesheets/pdf/lfs-pagesetup.xsl @@ -0,0 +1,117 @@ + + + + + + + + + + + right + left + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.5in + 0.375in + + -0.7pc + + 0.6em + 0.4em + 0.8em + + + 0.6em + 0.4em + 0.8em + 0.6em + 0.4em + 0.8em + + + 0.6em + 0.4em + 0.8em + + + 0.6em + 0.4em + 0.8em + 0.6em + 0.4em + 0.8em + + + + + + + + + + + + diff --git a/stylesheets/pdf/lfs-sections.xsl b/stylesheets/pdf/lfs-sections.xsl new file mode 100644 index 000000000..1fb9f0f95 --- /dev/null +++ b/stylesheets/pdf/lfs-sections.xsl @@ -0,0 +1,100 @@ + + + + + + + + + + page + + + auto + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + label.markup: this can't happen! + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/pdf/lfs-xref.xsl b/stylesheets/pdf/lfs-xref.xsl new file mode 100644 index 000000000..57279c6ec --- /dev/null +++ b/stylesheets/pdf/lfs-xref.xsl @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + XRef to nonexistent id: + + + ??? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + object.xref.markup: empty xref template + for linkend=" + + " and @xrefstyle=" + + " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + Attempt to use %d in gentext with no referrer! + + + + + + + % + + + % + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/stylesheets/xhtml/lfs-admon.xsl b/stylesheets/xhtml/lfs-admon.xsl new file mode 100644 index 000000000..9b03394a9 --- /dev/null +++ b/stylesheets/xhtml/lfs-admon.xsl @@ -0,0 +1,46 @@ + + + + + + + ../images/ + + + + + + + Note + Warning + Caution + Tip + Important + Note + + + + + + + +
+
+ [{$alt}] + + + + +

+ +

+
+
+ +
+
+
+ +
diff --git a/stylesheets/xhtml/lfs-index.xsl b/stylesheets/xhtml/lfs-index.xsl new file mode 100644 index 000000000..15f1f07ec --- /dev/null +++ b/stylesheets/xhtml/lfs-index.xsl @@ -0,0 +1,202 @@ + + + + + +]> + + + + + + longindex.html + + + + Index + + + + + + + + +
+

+ + + +

+
+
+ + + + + + + + +
+ +

+ + + + Packages + + + + + Programs + + + + + Libraries + + + + + Scripts + + + + + Others + + + + + + +

+
+
    + + + + +
+
+
+
+ + + + + + + + + + + + + + + +
  • + + + : + + + + + + + +
      + + + + +
    +
    +
  • +
    + + + + + +
  • + + + : + + + + + + +
  • +
    + + + + + + + + + + + +
    + + + + + + + + -- + + + + + + + + description + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/xhtml/lfs-legalnotice.xsl b/stylesheets/xhtml/lfs-legalnotice.xsl new file mode 100644 index 000000000..bc677d8d1 --- /dev/null +++ b/stylesheets/xhtml/lfs-legalnotice.xsl @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +
    + + + +

    + + + + + + + + + + + copyright + + + + + + + + + +

    +
    + +
    diff --git a/stylesheets/xhtml/lfs-mixed.xsl b/stylesheets/xhtml/lfs-mixed.xsl new file mode 100644 index 000000000..28460256b --- /dev/null +++ b/stylesheets/xhtml/lfs-mixed.xsl @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +            
    +        
    +
    + +
    +          
    +        
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + +
    + + + + : + + + + + +
    +
    + + + + + + +
    + +
    +
    + + + +
    +
    + + + + + + lfs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + KB + + + + , + + KB + + + + MB + + + + + + + +
    diff --git a/stylesheets/xhtml/lfs-navigational.xsl b/stylesheets/xhtml/lfs-navigational.xsl new file mode 100644 index 000000000..bab237142 --- /dev/null +++ b/stylesheets/xhtml/lfs-navigational.xsl @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/xhtml/lfs-sections.xsl b/stylesheets/xhtml/lfs-sections.xsl new file mode 100644 index 000000000..17944124d --- /dev/null +++ b/stylesheets/xhtml/lfs-sections.xsl @@ -0,0 +1,143 @@ + + + + + + + +
    + + + + + + + + + + + + + + + + +
    +
    + + + +
    + + + + + + + + + + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + label.markup: this can't happen! + + + + + + + +
    \ No newline at end of file diff --git a/stylesheets/xhtml/lfs-titles.xsl b/stylesheets/xhtml/lfs-titles.xsl new file mode 100644 index 000000000..e44108e59 --- /dev/null +++ b/stylesheets/xhtml/lfs-titles.xsl @@ -0,0 +1,117 @@ + + + + + +
    +

    + + . + +

    +
    +
    + + +
    +

    + + . + +

    +
    +
    + + +
    +

    + +

    +
    +
    + + +
    +

    + + . + +

    +
    +
    + + + + + + + + +
    +

    + + . + +

    +
    +
    +
    +
    + + + + + + + + +
    + + +
    +

    + +

    +
    +
    + + + + + + + + + + + + + + + + + + + diff --git a/stylesheets/xhtml/lfs-toc.xsl b/stylesheets/xhtml/lfs-toc.xsl new file mode 100644 index 000000000..0a6f39d91 --- /dev/null +++ b/stylesheets/xhtml/lfs-toc.xsl @@ -0,0 +1,159 @@ + + + + + + + appendix nop + book toc,title + chapter nop + part toc + preface nop + qandadiv nop + qandaset nop + reference nop + sect1 nop + sect2 nop + sect3 nop + sect4 nop + sect5 nop + section nop + set nop + + + 1 + + 3 + + + + + + +
    +

    + + TableofContents + +

    +
      + + + +
    +
    +
    +
    + + + + + + +
      + + + +
    +
    + + + 1 + 0 + + + +
  • + + + + + + +
  • +
    + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +

    + + + + + + + + +

    +
    + +

    + + + + + + + + +

    +
    + +

    + + + + + + + + + + + + + + + +

    +
    + + + + diff --git a/stylesheets/xhtml/lfs-xref.xsl b/stylesheets/xhtml/lfs-xref.xsl new file mode 100644 index 000000000..f82037fe5 --- /dev/null +++ b/stylesheets/xhtml/lfs-xref.xsl @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + XRef to nonexistent id: + + + ??? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + object.xref.markup: empty xref template + for linkend=" + + " and @xrefstyle=" + + " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + Attempt to use %d in gentext with no referrer! + + + + + + + % + + + % + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tidy.conf b/tidy.conf new file mode 100644 index 000000000..cd77f2b09 --- /dev/null +++ b/tidy.conf @@ -0,0 +1,18 @@ +indent-spaces: 2 +wrap: 78 +tab-size: 8 +input-encoding: latin1 +output-encoding: latin1 +newline: CRLF +write-back: yes +markup: yes +indent: yes +hide-endtags: no +uppercase-tags: no +logical-emphasis: no +drop-font-tags: no +tidy-mark: no +numeric-entities: no +show-warnings: no +quiet: yes +newline: LF