r150 - in trunk/BOOK: . chapter01 chapter02 chapter03 chapter04 chapter05 chapter06 prologue

archaic at linuxfromscratch.org archaic at linuxfromscratch.org
Mon Feb 7 17:17:22 PST 2005


Author: archaic
Date: 2005-02-07 18:17:21 -0700 (Mon, 07 Feb 2005)
New Revision: 150

Added:
   trunk/BOOK/chapter02/
   trunk/BOOK/chapter02/chapter02.xml
   trunk/BOOK/chapter02/hostreqs.xml
   trunk/BOOK/chapter02/introduction.xml
   trunk/BOOK/chapter02/pie.xml
   trunk/BOOK/chapter02/ssp.xml
   trunk/BOOK/chapter02/toolchain.xml
   trunk/BOOK/chapter03/
   trunk/BOOK/chapter03/chapter03.xml
   trunk/BOOK/chapter03/introduction.xml
   trunk/BOOK/chapter03/packages.xml
   trunk/BOOK/chapter03/patches.xml
   trunk/BOOK/chapter04/
   trunk/BOOK/chapter04/aboutlfs.xml
   trunk/BOOK/chapter04/aboutsbus.xml
   trunk/BOOK/chapter04/abouttestsuites.xml
   trunk/BOOK/chapter04/addinguser.xml
   trunk/BOOK/chapter04/chapter04.xml
   trunk/BOOK/chapter04/creatingtoolsdir.xml
   trunk/BOOK/chapter04/settingenviron.xml
   trunk/BOOK/chapter05/
   trunk/BOOK/chapter05/chapter05.xml
   trunk/BOOK/chapter05/environment.xml
   trunk/BOOK/chapter05/introduction.xml
   trunk/BOOK/chapter06/
   trunk/BOOK/chapter06/chapter06.xml
   trunk/BOOK/chapter06/introduction.xml
   trunk/BOOK/template-chap5.xml
   trunk/BOOK/template-chap6.xml
   trunk/BOOK/template-readme
Removed:
   trunk/BOOK/stylesheets/
Modified:
   trunk/BOOK/INSTALL
   trunk/BOOK/Makefile
   trunk/BOOK/chapter01/administrativa.xml
   trunk/BOOK/chapter01/askforhelp.xml
   trunk/BOOK/general.ent
   trunk/BOOK/index.xml
   trunk/BOOK/prologue/bookinfo.xml
   trunk/BOOK/prologue/organization.xml
   trunk/BOOK/prologue/preface.xml
   trunk/BOOK/prologue/prerequisites.xml
   trunk/BOOK/prologue/typography.xml
Log:
Rough framework of the first 6 chapters.

Modified: trunk/BOOK/INSTALL
===================================================================
--- trunk/BOOK/INSTALL	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/INSTALL	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,10 +1,10 @@
-HLFS Book Conversion Tools Installation Instructions
+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, PS 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 hlfs-dev mailing list, then you do not need this 
+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.
 
@@ -20,23 +20,8 @@
 * DocBook DTD 
   - http://www.linuxfromscratch.org/blfs/view/svn/pst/xml.html
 
-* DocBook XSL Stylesheets (1.67.2)
-  install -d /usr/share/xml/docbook/xsl-stylesheets-1.67.2
-  chown -R root:root .
-  cp -af INSTALL VERSION common eclipse extensions fo html htmlhelp images \
-    javahelp lib manpages params profiling template xhtml \
-    /usr/share/xml/docbook/xsl-stylesheets-1.67.2
-  install -d /usr/share/doc/xml
-  cp -af doc/* /usr/share/doc/xml
-  cd /usr/share/xml/docbook/xsl-stylesheets-1.67.2 && \
-    sed -i -e 's at current/@1.67.2/@' INSTALL && \
-    sh INSTALL
-  xmlcatalog --noout --add "delegateURI" \
-  "http://docbook.sourceforge.net/release/xsl/1.67.2/" \
-  "file:///usr/share/xml/docbook/xsl-stylesheets-1.67.2/catalog.xml" \
-  /etc/xml/catalog
-  ln -sf xsl-stylesheets-$(VERSION) \
-    /usr/share/xml/docbook/xsl-stylesheets-current
+* 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
@@ -59,16 +44,7 @@
   - cd /opt/j2sdk && /path/to/jai-1_1_2_01-lib-linux-i586-jdk.bin
 
 Next install ANT:
-  - download http://www.apache.org/dist/ant/source/apache-ant-1.6.2-src.tar.bz2
-  - tar -xjvf apache-ant-1.6.2-src.tar.bz2
-    (recent versions of tar will warn about "A lone zero block at 33476" but
-    this can be safely ignored)
-  - cd apache-ant-1.6.2 && \
-    ./boostrap.sh && \
-    ./build && \
-    install -d /opt/ant && \
-    cp -r dist/* /opt/ant
-  - edit your bash profile to set ANT_HOME=/opt/ant and PATH=$PATH:/opt/ant/bin
+  - http://www.linuxfromscratch.org/blfs/view/svn/general/apache-ant.html
 
 And finally install FOP:
   - download http://www.apache.org/dist/xml/fop/fop-0.20.5-src.tar.gz

Modified: trunk/BOOK/Makefile
===================================================================
--- trunk/BOOK/Makefile	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/Makefile	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,13 +1,13 @@
-BASEDIR=~/hlfs-book
+BASEDIR=~/public_html/hlfs-book
 CHUNK_QUIET=0
 PDF_OUTPUT=HLFS-BOOK.pdf
 NOCHUNKS_OUTPUT=HLFS-BOOK.html
 XSLROOTDIR=/usr/share/xml/docbook/xsl-stylesheets-current
 
-hlfs:
-	xsltproc --xinclude --nonet -stringparam chunk.quietly $(CHUNK_QUIET) \
-	  -stringparam base.dir $(BASEDIR)/ stylesheets/lfs-chunked.xsl \
-	  index.xml
+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; \
@@ -20,9 +20,9 @@
 	cp $(XSLROOTDIR)/images/*.png \
 	  $(BASEDIR)/images
 	cd $(BASEDIR)/; sed -i -e "s at ../stylesheets at stylesheets@g" \
-	  index.html part1.html part2.html part3.html longindex.html
+	  *.html
 	cd $(BASEDIR)/; sed -i -e "s at ../images at images@g" \
-	  index.html part1.html part2.html part3.html longindex.html
+	  *.html
 
 	for filename in `find $(BASEDIR) -name "*.html"`; do \
 	  tidy -config tidy.conf $$filename; \
@@ -34,8 +34,8 @@
 	done;
 
 pdf:
-	xsltproc --xinclude --nonet --stringparam profile.condition print \
-		--output $(BASEDIR)/lfs-pdf.xml stylesheets/lfs-profile.xsl index-pdf.xml
+	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
@@ -43,10 +43,15 @@
 	rm $(BASEDIR)/lfs-pdf.xml $(BASEDIR)/lfs-pdf.fo
 
 nochunks:
-	xsltproc --xinclude --nonet --output $(BASEDIR)/$(NOCHUNKS_OUTPUT) \
+	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
 
+	sed -i -e "s at text/html at application/xhtml+xml at g"  \
+	  $(BASEDIR)/$(NOCHUNKS_OUTPUT)
+
 validate:
 	xmllint --noout --nonet --xinclude --postvalid index.xml
 

Modified: trunk/BOOK/chapter01/administrativa.xml
===================================================================
--- trunk/BOOK/chapter01/administrativa.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter01/administrativa.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!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;
 ]>
@@ -7,7 +7,6 @@
 <title>Resources</title>
 <?dbhtml filename="resources.html"?>
 
-
 <sect2 id="ch-scatter-faq">
 <title>FAQ</title>
 
@@ -55,10 +54,9 @@
 <sect2 id="ch-scatter-contactinfo">
 <title>Contact information</title>
 
-<para>Please direct all your questions and comments to one of the LFS mailing
-lists (see above).</para>
+<para>Please direct all your questions and comments to the appropriate mailing
+list (see above).</para>
 
 </sect2>
 
-
 </sect1>

Modified: trunk/BOOK/chapter01/askforhelp.xml
===================================================================
--- trunk/BOOK/chapter01/askforhelp.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter01/askforhelp.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!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;
 ]>

Added: trunk/BOOK/chapter02/chapter02.xml
===================================================================
--- trunk/BOOK/chapter02/chapter02.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter02/chapter02.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<chapter id="chapter-partitioning" xreflabel="Chapter 2">
+<?dbhtml dir="chapter02"?>
+<title>Preparing a New Partition</title>
+<?dbhtml filename="chapter02.html"?>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostreqs.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="toolchain.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ssp.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pie.xml"/>
+
+</chapter>

Added: trunk/BOOK/chapter02/hostreqs.xml
===================================================================
--- trunk/BOOK/chapter02/hostreqs.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter02/hostreqs.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,40 @@
+<?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-hostreqs">
+<title>Host System Requirements</title>
+<?dbhtml filename="hostreqs.html"?>
+
+<para>The host must be running at least a 2.6.2 kernel compiled with
+GCC-3.0 or higher. There are two main reasons for this high
+requirement. First, the Native POSIX Threading Library (NPTL)
+test suite will segfault if the host's kernel has not been compiled with
+GCC-3.0 or a later version. Secondly, the 2.6.2 or later version of
+the kernel is required for the use of Udev. Udev creates devices
+dynamically by reading from the <systemitem
+class="filesystem">sysfs</systemitem> file system. However, support
+for this filesystem has only recently been implemented in most of
+the kernel drivers. We must be sure that all critical system devices
+get created properly.</para>
+
+<para>In order to determine whether the host kernel meets the
+requirements outlined above, run the following command:</para>
+
+<screen><userinput>cat /proc/version</userinput></screen>
+
+<para>This will produce output similar to:</para>
+
+<screen><computeroutput>Linux version 2.6.2 (user at host) (gcc version 3.4.0) #1
+    Tue Apr 20 21:22:18 GMT 2004</computeroutput></screen>
+
+<para>If the results of the above command state that the host kernel
+was not compiled using a GCC-3.0 (or later) compiler, one will need to
+be compiled.  The host system will then need to be rebooted to use the
+newly compiled kernel. Instructions for compiling the kernel and
+configuring the boot loader (assuming the host uses GRUB) are located
+in <xref linkend="chapter-bootable"/>.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter02/introduction.xml
===================================================================
--- trunk/BOOK/chapter02/introduction.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter02/introduction.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,15 @@
+<?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="space-introduction">
+<title>Introduction</title>
+<?dbhtml filename="introduction.html"?>
+
+<para>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.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter02/pie.xml
===================================================================
--- trunk/BOOK/chapter02/pie.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter02/pie.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -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-pie">
+<title>Position Independent Exectuables</title>
+<?dbhtml filename="pie.html"?>
+
+<para>Position-Independent-Executable is a features of Binutils, Libc, and GCC
+that creates an executable which is something between a shared library and a
+normal executable. Programs compiled with these features appear as "shared
+object" with the file(1) command. This allows the executable to behave like a
+shared library so base addresses can be relocatable. The PIE program must be
+linked to Scrt1.o. Scrt1.o is available from the newer versions of Libc.
+Furthermore these programs must be linked with the -pie ld(1) command from a
+Binutils version 2.15 or later. GCC supports this natively with the -fPIE switch
+in version 3.4 or later.</para>
+
+<para>When all of the object code is position independent the kernel can
+disallow text relocation. This dramatically increases the security of the system
+with little performance loss. PaX and Grsec kernels have this option available
+though very few systems have been able to take advantage of it. The entire base
+system can be built position independent with the exception of the Grub boot
+loader, and Glibc's utilities due to non-pic assembly code. These programs will
+still function if they are dynamically linked. Other exceptions are X11
+windowing system, Mplayer, and a few other graphical programs which were not
+programed with PIE in mind, this should come in time. Gzip uses assembly code
+which is not position independent, but this can be omitted at compile time and
+Gzip will use only C code.</para>
+
+<para>PaX can also randomize the return addresses of PIE programs with Address
+Space Layout Randomization (ASLR). This can prevent security bugs from being
+taken advantage of by attackers.</para>
+
+<para>You can search for text relocation in programs with the following command:
+readelf -d /path/to/object | grep TEXTREL</para>
+
+<para>It is possible for TEXTREL to be present in both executable programs and
+libraries. Further debugging is needed to find the specific code that is not
+position independent, it is most often assembly. If a program errors at compile
+time with with 'ASM' and 'BREG' in the message, this is non-pic assembly.</para>
+
+<para>The coreutils uname patch from LFS also uses assembly code which is not position
+independent.</para>
+
+<para>The man page for ld has a description for -pie. See: 'man 1 ld'.</para>
+ 
+<para>Use the "NOELFRELOCS" in PaX or Grsec kernel options to disable text
+relocation.</para>
+
+<para>The fPIE flag can only be passed to executables, not libraries. The fPIE
+flag gives some advantages over fPIC in that the compiler can assume the code
+will stay local to the program. This translates into optimizations having a
+greater effect; non-static functions can be inlined at -O3, etc. The
+hardened-specs used in the book adds filters to the GCC link_command spec to
+distinguish executables from libraries, so the ld -pie switch is only passed
+when linking executables.  The same filters can not be used for cc1, so the cc1
+spec passes -fPIC instead of -fPIE to everything unless the -static or -no-pie
+flags are used. Using 'gcc -fPIC' with 'ld -pie' works fairly well, all the
+PaX/Grsec kernel features will be able to have full advantages. fPIE is known to
+cause text relocation in some programs, so it must be used with care. In this
+book we patch some programs, and use sed(1) commands on others, to add 'gcc -pie
+-fpie' on program executables. fPIE must be added surgically, and not to
+environment cflags. The hardened-specs preserves the vanilla 'gcc -pie'
+behaviour, meaning if you use 'gcc -pie' neither -fpic nor -fpie will be
+automatically added, so both '-pie -fpie' must be used together (as per the gcc
+man page). 'gcc -pie' affects which startfiles are used (Scrt.o), so it must be
+used in conjuction with 'ld -pie'. Almost all packages use GCC to do linking, so
+setting environment ldflags is almost never needed.</para>
+
+<para>Beyond the packages in this book the hardened-specs will work perfectly
+fine with -fPIC. If you wish to use -fPIE to have greater optimization be sure
+to use 'readelf -d' to check for TEXTREL. If -fPIE is passed to one object in a
+library it will cause a TEXTREL section in that library, and it will not work
+correctly. Libraries, private or otherwise, need to be compiled with
+-fPIC.</para>
+
+<para>On x86 systems -fPIC and -fpic are exactly the same. Ditto with -fPIE and
+-fpie.</para>
+ 
+<para>
+Also see:
+http://pax.grsecurity.net/docs/index.html
+http://netbsd.gw.com/cgi-bin/man-cgi?link+5+NetBSD-current
+http://gcc.gnu.org/ml/gcc-patches/2003-06/msg00140.html
+http://sources.redhat.com/ml/binutils/2003-05/msg00832.html
+</para>
+
+</sect1>

Added: trunk/BOOK/chapter02/ssp.xml
===================================================================
--- trunk/BOOK/chapter02/ssp.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter02/ssp.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,60 @@
+<?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-ssp">
+<title>Smashing Stack Protector</title>
+<?dbhtml filename="ssp.html"?>
+
+<para>Based on StackGaurd, Smashing Stack Protector (SSP) was developed by IBM's
+Hiroaki Etoh for protecting applications from stack smashing attacks. This is
+the single largest class of attacks. There has been some effort to include SSP
+in the mainstream GCC, but this has yet to surface. Many distributions have
+included SSP, some enable it by default while others leave it optional.  This
+protection uses minimal time and space overhead while protecting all functions.
+Reports of a 1-2% performance loss are typical, which is negligible and can be
+easily overcome by optimizations.</para>
+
+<para>The patch for GCC adds -fstack-protector-all, -fstack-protector, and
+-fno-stack-protector* to extensions for C and C++. -Wstack-protector is also
+available to warn when SSP is not used. The patch for Libc adds __guard_setup
+and __stack_smash_handler to libc.so and libc.a. __guard_setup is a function
+used to create a unique and random value for __guard each run time. The Frandom
+kernel patch was added to solve an entropy starvation bug caused by SSP needing
+a random seed for every program at run time. Frandom adds the Erandom device
+(economical random) which uses the state of Frandom as a seed. Frandom is seeded
+from the kernel's random device. The result is that Erandom does not consume any
+kernel entropy while producing crypto quality output. In the event of a stack
+overflow the __stack_smash_handler function will use the Libc syslog facility to
+record the overflow, which typically depends on /dev/log, and will abort the
+program. The Erandom device is available from the sysctl interface so it will
+work threw chroot. If the Erandom sysctl interface is not working for whatever
+reason the __guard_setup function will attempt to use /dev/urandom or
+gettimeofday to seed the __guard. The use of urandom will cause entropy
+starvation, and gettimeofday is not random, so this fallback is not ideal but
+provided as a safety net.</para>
+
+<para>-fstack-protector only protects functions with arrays of length seven of
+less. -fstack-protector-all protects all functions regardless of array size.
+Because the __guard_setup function is in Libc anything compiled with
+-fstack-protector* will need to preload libc.so (or libc.a). Most applications
+already do this. libc.so itself, ld.so, libbsd-compat.so, etc, are exceptions
+which do not preload libc.so, and so they can not be built with this
+protection.</para>
+ 
+<para>
+Also see:
+man 1 gcc
+http://www.research.ibm.com/trl/projects/security/ssp/
+http://frandom.sourceforge.net/
+http://www.immunix.org/stackguard.html
+
+Operating system distributors using SSP (there are many more):
+http://www.adamantix.org/
+http://www.debian-hardened.org/
+http://www.gentoo.org/
+http://www.openbsd.org/
+</para>
+
+</sect1>

Added: trunk/BOOK/chapter02/toolchain.xml
===================================================================
--- trunk/BOOK/chapter02/toolchain.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter02/toolchain.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,227 @@
+<?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">
+<title>Toolchain Technical Notes</title>
+<?dbhtml filename="toolchaintechnotes.html"?>
+
+<para>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.</para>
+
+<para>The overall goal of <xref linkend="chapter-temporary-tools"/> 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 <xref linkend="chapter-building-system"/>. Along the way, we
+separate 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. In
+other words, more advanced techniques could be used to build the
+system.</para>
+
+<important>
+<para>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 <emphasis>i686-pc-linux-gnu</emphasis>. A
+simple way to determine the name of the target triplet is to run the
+<command>config.guess</command> script that comes with the source for
+many packages. Unpack the Binutils sources and run the script:
+<userinput>./config.guess</userinput> and note the output.</para>
+
+<para>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 <command>ld</command> 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
+<filename class="libraryfile">ld-linux.so.2</filename>. On platforms that are less
+prevalent, the name might be <filename class="libraryfile">ld.so.1</filename>, 
+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
+<filename class="directory">/lib</filename> 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: <userinput>readelf -l <name
+of binary> | grep interpreter</userinput> and noting the output.
+The authoritative reference covering all platforms is in the
+<filename>shlib-versions</filename> file in the root of the Glibc
+source tree.</para>
+</important>
+
+<beginpage/>
+<para>Some key technical points of how the <xref linkend="chapter-temporary-tools"/> build
+method works:</para>
+
+<itemizedlist>
+<listitem><para>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
+<quote>magic</quote></para></listitem>
+
+<listitem><para>Careful manipulation of the standard linker's library
+search path ensures programs are linked only against chosen
+libraries</para></listitem>
+
+<listitem><para>Careful manipulation of <command>gcc</command>'s
+<filename>specs</filename> file tell the compiler which target dynamic
+linker will be used</para></listitem>
+</itemizedlist>
+
+<para>Binutils is installed first because the
+<command>./configure</command> 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 alert this error
+before too much additional work is performed.</para>
+
+<para>Binutils installs its assembler and linker in two locations,
+<filename class="directory">/tools/bin</filename> and <filename
+class="directory">/tools/$TARGET_TRIPLET/bin</filename>. 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 <command>ld</command> by passing it the
+<parameter>--verbose</parameter> flag. For example, an <userinput>ld
+--verbose | grep SEARCH</userinput> will illustrate the current search
+paths and their order. It shows which files are linked by
+<command>ld</command> by compiling a dummy program and passing the
+<parameter>--verbose</parameter> switch to the linker. For example,
+<userinput>gcc dummy.c -Wl,--verbose 2>&1 | grep
+succeeded</userinput> will show all the files successfully opened
+during the linking.</para>
+
+<para>The next package installed is GCC. An example of what can be
+seen during its run of <command>./configure</command> is:</para>
+
+<screen><computeroutput>checking what assembler to use... 
+        /tools/i686-pc-linux-gnu/bin/as
+checking what linker to use... /tools/i686-pc-linux-gnu/bin/ld</computeroutput></screen>
+
+<para>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 <command>gcc</command> itself, the same
+search paths are not necessarily used. To find out which standard
+linker <command>gcc</command> will use, run: <userinput>gcc
+-print-prog-name=ld</userinput>.</para>
+
+<para>Detailed information can be obtained from <command>gcc</command>
+by passing it the <parameter>-v</parameter> command line option while
+compiling a dummy program. For example, <userinput>gcc -v
+dummy.c</userinput> will show detailed information about the
+preprocessor, compilation, and assembly stages, including
+<command>gcc</command>'s included search paths and their order.</para>
+
+<para>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 <command>gcc</command> found in a 
+<envar>PATH</envar> 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
+<command>./configure</command>, check the contents of the
+<filename>config.make</filename> file in the <filename
+class="directory">glibc-build</filename> directory for all important
+details. Note the use of <parameter>CC="gcc -B/tools/bin/"</parameter>
+to control which binary tools are used and the use of the
+<parameter>-nostdinc</parameter> and <parameter>-isystem</parameter>
+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.</para>
+
+<para>After the Glibc installation, make some adjustments to ensure
+that searching and linking take place only within the <filename
+class="directory">/tools</filename> prefix.  Install an adjusted
+<command>ld</command>, which has a hard-wired search path limited to
+<filename class="directory">/tools/lib</filename>. Then amend
+<command>gcc</command>'s specs file to point to the new dynamic linker
+in <filename class="directory">/tools/lib</filename>. 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:
+<userinput>readelf -l <name of binary> | grep
+interpreter</userinput>. 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 <filename
+class="directory">/tools/lib</filename>.</para>
+
+<para>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 <filename
+class="directory">/lib</filename> directory embedded into them, which
+would defeat the goal of getting away from the host.</para> 
+
+<para>During the second pass of Binutils, we are able to utilize the
+<parameter>--with-lib-path</parameter> configure switch to control
+<command>ld</command>'s library search path.  From this point onwards,
+the core toolchain is self-contained and self-hosted. The remainder of
+the <xref linkend="chapter-temporary-tools"/> packages all build
+against the new Glibc in <filename
+class="directory">/tools</filename>.</para>
+
+<para>Upon entering the chroot environment in <xref
+linkend="chapter-building-system"/>, the first major package to be
+installed is Glibc, due to its self-sufficient nature mentioned above.
+Once this Glibc is installed into <filename
+class="directory">/usr</filename>, perform a quick changeover of the
+toolchain defaults, then proceed in building the rest of the target
+LFS system.</para>
+
+<beginpage/>
+
+<sect2>
+<title>Notes on Static Linking</title>
+
+<para>Besides their specific task, most programs have to perform many
+common and sometimes trivial operations. These include allocating
+memory, searching directories, reading and writing files, string
+handling, pattern matching, arithmetic, and other tasks. Instead of
+obliging each program to reinvent the wheel, the GNU system provides
+all these basic functions in ready-made libraries. The major library
+on any Linux system is Glibc.</para>
+
+<para>There are two primary ways of linking the functions from a
+library to a program that uses them—statically or dynamically. When
+a program is linked statically, the code of the used functions is
+included in the executable, resulting in a rather bulky program. When
+a program is dynamically linked, it includes a reference to the
+dynamic linker, the name of the library, and the name of the function,
+resulting in a much smaller executable. A third option is to use the
+programming interface of the dynamic linker (see the
+<emphasis>dlopen</emphasis> man page for more information).</para>
+
+<para>Dynamic linking is the default on Linux and has three major
+advantages over static linking. First, only one copy of the executable
+library code is needed on the hard disk, instead of having multiple
+copies of the same code included in several programs, thus saving
+disk space. Second, when several programs use the same library
+function at the same time, only one copy of the function's code is
+required in core, thus saving memory space. Third, when a library
+function gets a bug fixed or is otherwise improved, only the one
+library needs to be recompiled instead of recompiling all programs
+that make use of the improved function.</para>
+
+<para>If dynamic linking has several advantages, why then do we
+statically link the first two packages in this chapter? The reasons
+are threefold—historical, educational, and technical. The
+historical reason is that earlier versions of LFS statically linked
+every program in this chapter. Educationally, knowing the difference
+between static and dynamic linking is useful. The technical benefit is
+a gained element of independence from the host, meaning that those
+programs can be used independently of the host system. However, it is
+worth noting that an overall successful LFS build can still be
+achieved when the first two packages are built dynamically.</para>
+
+</sect2>
+
+</sect1>
+

Added: trunk/BOOK/chapter03/chapter03.xml
===================================================================
--- trunk/BOOK/chapter03/chapter03.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter03/chapter03.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<chapter id="chapter-getting-materials" xreflabel="Chapter 3">
+<?dbhtml dir="chapter03"?>
+<title>Packages and Patches</title>
+<?dbhtml filename="chapter03.html"?>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="packages.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patches.xml"/>
+
+</chapter>

Added: trunk/BOOK/chapter03/introduction.xml
===================================================================
--- trunk/BOOK/chapter03/introduction.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter03/introduction.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,24 @@
+<?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="materials-introduction">
+<title>Introduction</title>
+<?dbhtml filename="introduction.html"?>
+
+<para>This chapter includes a list of packages that need to be downloaded for
+building the HLFS 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 not using newer versions because the build commands for one
+version may not work with a newer version.</para>
+
+<para>Download locations may not always be accessible. If a download location
+has changed since this book was published, Freshmeat (<ulink
+url="http://www.freshmeat.net"/>) and Google (<ulink
+url="http://www.google.com"/>) provides useful search engines for most packages.
+If this search is unsuccessful, try one of the alternate means of downloading
+discussed at <ulink url="&lfs-root;lfs/packages.html"/>.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter03/packages.xml
===================================================================
--- trunk/BOOK/chapter03/packages.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter03/packages.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,458 @@
+<?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="materials-packages">
+<title>All Packages</title>
+<?dbhtml filename="packages.html"?>
+
+<para>Download or otherwise obtain the following packages:</para>
+
+<variablelist role="materials">
+
+<varlistentry>
+<term>Autoconf (&autoconf-version;) - ?? kilobytes (KB):</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/autoconf/autoconf-2.59.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Automake (&automake-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/automake/automake-1.9.4.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Bash (&bash-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/bash/bash-3.0.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Binutils (&binutils-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.kernel.org/pub/linux/devel/binutils/binutils-2.15.94.0.2.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Bison (&bison-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://alpha.gnu.org/pub/gnu/bison/bison-2.0.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>BLFS-Bootscripts (&blfs-bootscripts-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.linuxfromscratch.org/blfs/downloads/svn/blfs-bootscripts-20041227.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Bzip2 (&bzip2-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Coreutils (&coreutils-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/coreutils/coreutils-5.2.1.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>DejaGNU (&dejagnu-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/dejagnu/dejagnu-1.4.4.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Diffutils (&diffutils-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/diffutils/diffutils-2.8.1.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>E2fsprogs (&e2fsprogs-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://umn.dl.sourceforge.net/sourceforge/e2fsprogs/e2fsprogs-1.35.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Expect (&expect-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://expect.nist.gov/old/expect-5.42.1.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>File (&file-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.astron.com/pub/file/file-4.12.tar.gz"/></para>
+<beginpage/>
+<note><para>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 alternate download location that may have the correct
+version available is <ulink
+url="ftp://ftp.linuxfromscratch.org/pub/lfs/"/>.</para></note>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Findutils (&findutils-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://alpha.gnu.org/pub/gnu/findutils/findutils-4.2.11.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Flex (&flex-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://umn.dl.sourceforge.net/sourceforge/lex/flex-2.5.31.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Gawk (&gawk-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/gawk/gawk-3.1.4.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>GCC (&gcc-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.3/gcc-core-3.4.3.tar.bz2"/></para>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.3/gcc-g++-3.4.3.tar.bz2"/></para>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/gcc/gcc-3.4.3/gcc-testsuite-3.4.3.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<!--
+<varlistentry>
+<term>Gettext (&gettext-version;) - ?? KB:</term>
+<listitem>
+</listitem>
+</varlistentry>
+-->
+
+<varlistentry>
+<term>Glibc (&glibc-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/glibc/glibc-2.3.4.tar.bz2"/></para>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/glibc/glibc-libidn-2.3.4.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Grep (&grep-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/gnu/grep/grep-2.5.1a.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Groff (&groff-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/groff/groff-1.19.1.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Grub (&grub-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://alpha.gnu.org/pub/gnu/grub/grub-0.95.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Gzip (&gzip-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://alpha.gnu.org/gnu/gzip/gzip-1.3.5.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Hotplug (&hotplug-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.kernel.org/pub/linux/utils/kernel/hotplug/hotplug-2004_09_23.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Iana-Etc (&iana-etc-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.sethwklein.net/projects/iana-etc/downloads/iana-etc-1.03.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Inetutils (&inetutils-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/inetutils/inetutils-1.4.2.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>IPRoute2 (&iproute2-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://developer.osdl.org/dev/iproute2/download/iproute2-2.6.9-ss040831.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Kbd (&kbd-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.win.tue.nl/pub/linux-local/utils/kbd/kbd-1.12.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Less (&less-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.greenwoodsoftware.com/less/less-382.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>LFS-Bootscripts (&lfs-bootscripts-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.linuxfromscratch.org/~nathan/lfs-bootscripts/lfs-bootscripts-3.1.0.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry> 
+<term>Libol (&libol-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.balabit.com/downloads/syslog-ng/libol/0.3/libol-0.3.14.tar.gz"/></para>
+
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Libtool (&libtool-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/gnu/libtool/libtool-1.5.10.tar.gz"/></para>
+
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Linux (&linux-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.10.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Linux-Libc-Headers (&linux-libc-headers-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://ep09.pld-linux.org/~mmazur/linux-libc-headers/linux-libc-headers-2.6.10.0.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>M4 (&m4-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/m4/m4-1.4.2.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Make (&make-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/gnu/make/make-3.80.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Man (&man-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.kernel.org/pub/linux/utils/man/man-1.5p.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Man-pages (&man-pages-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.kernel.org/pub/linux/docs/manpages/man-pages-2.01.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Mktemp (&mktemp-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.mktemp.org/pub/mktemp/mktemp-1.5.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Module-Init-Tools (&module-init-tools-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.1.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Ncurses (&ncurses-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.4.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Patch (&patch-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://alpha.gnu.org/pub/gnu/diffutils/patch-2.5.9.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>PaXctl (&paxctl-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://pax.grsecurity.net/paxctl-0.2.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Perl (&perl-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.cpan.org/src/perl-5.8.6.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Procps (&procps-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://procps.sourceforge.net/procps-3.2.4.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Psmisc (&psmisc-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://umn.dl.sourceforge.net/sourceforge/psmisc/psmisc-21.5.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Readline (&readline-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/gnu/readline/readline-5.0.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Sed (&sed-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/gnu/sed/sed-4.1.2.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Shadow (&shadow-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.pld.org.pl/software/shadow/shadow-4.0.7.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Syslog-ng (&syslog-ng-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.balabit.com/downloads/syslog-ng/1.6/src/syslog-ng-1.6.5.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Sysvinit (&sysvinit-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.cistron.nl/pub/people/miquels/sysvinit/sysvinit-2.86.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Tar (&tar-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/pub/gnu/tar/tar-1.15.1.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Tcl (&tcl-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.funet.fi/pub/languages/tcl/tcl/tcl8_4/tcl8.4.9-src.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Texinfo (&texinfo-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.gnu.org/gnu/texinfo/texinfo-4.8.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>uClibc (&uclibc-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.uclibc.org/downloads/uClibc-0.9.27.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Udev (&udev-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.kernel.org/pub/linux/utils/kernel/hotplug/udev-050.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Udev Permissions Configuration - ? KB:</term>
+<listitem>
+<para><ulink url="http://downloads.linuxfromscratch.org/udev-config-2.permissions"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Udev Rules Configuration - ? KB:</term>
+<listitem>
+<para><ulink url="http://downloads.linuxfromscratch.org/udev-config-1.rules"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Util-linux (&util-linux-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.win.tue.nl/pub/home/aeb/linux-local/utils/util-linux/util-linux-2.12q.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Vim (&vim-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="ftp://ftp.vim.org/pub/vim/unix/vim-6.3.tar.bz2"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Zlib (&zlib-version;) - ?? KB:</term>
+<listitem>
+<para><ulink url="http://www.zlib.net/zlib-1.2.2.tar.gz"/></para>
+</listitem>
+</varlistentry>
+
+</variablelist>
+
+<para>Total size of these packages: ?? MB</para>
+
+</sect1>

Added: trunk/BOOK/chapter03/patches.xml
===================================================================
--- trunk/BOOK/chapter03/patches.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter03/patches.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,370 @@
+<?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="materials-patches">
+<title>Needed Patches</title>
+<?dbhtml filename="patches.html"?>
+
+<para>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:</para>
+
+<variablelist role="materials">
+
+<varlistentry>
+<term>Bash Avoid Wcontinued Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;bash-&bash-version;-avoid_WCONTINUED-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Bash Various Fixes - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;bash-&bash-version;-fixes-3.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>BLFS Bootscript Additions - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;blfs-bootscripts-&blfs-bootscripts-version;-hlfs-2.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Binutils Hardened Cflags - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;binutils-&binutils-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Binutils PT PaX - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;binutils-&binutils-version;-pt_pax-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Binutils uClibc - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;binutils-&binutils-version;-uClibc_conf-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Bzip2 Hardened Cflags - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;bzip2-&bzip2-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Coreutils Suppress Uptime, Kill, Su Patch - ?? KB:</term>
+<listitem>
+<para condition="html"><ulink url="&patches-root;coreutils-&coreutils-version;-suppress_uptime_kill_su-1.patch"/></para>
+<para condition="pdf"><ulink url="&patches-root;coreutils-&coreutils-version;-suppress_uptime_ kill_su-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<!--
+<varlistentry>
+<term>Coreutils Uname Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;coreutils-&coreutils-version;-uname-2.patch"/></para>
+</listitem>
+</varlistentry>
+-->
+
+<varlistentry>
+<term>Expect Spawn Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;expect-&expect-version;-spawn-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>File Hardened Cflags - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;file-&file-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Flex Brokenness Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;flex-&flex-version;-debian_fixes-2.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Flex Hardened Cflags Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;flex-&flex-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term> GCC Hardened Cflags Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;gcc-&gcc-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+ 
+<varlistentry>
+<term> GCC Linkonce Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;gcc-&gcc-version;-linkonce-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>GCC No-Fixincludes Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;gcc-&gcc-version;-no_fixincludes-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>GCC Specs Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;gcc-&gcc-version;-specs_x86-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry> 
+<term>GCC SSP Patch - ?? KB:</term>
+<listitem> 
+<para><ulink url="&patches-root;gcc-&gcc-version;-ssp-3.patch"/></para>
+</listitem> 
+</varlistentry>
+
+<varlistentry> 
+<term>GCC uClibc Configure Patch - ?? KB:</term>
+<listitem> 
+<para><ulink url="&patches-root;gcc-&gcc-version;-uClibc_conf-1.patch"/></para>
+</listitem> 
+</varlistentry>
+
+<varlistentry>
+<term>GCC uClibc Libstdc++ Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;gcc-&gcc-version;-uClibc_libstdc++-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>GCC uClibc Locale Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;gcc-&gcc-version;-uClibc_locale-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Glibc dl_execstack Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;glibc-&glibc-version;-dl_execstack_PaX-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Glibc Fstack Protector Patch - ?? KB:</term>
+<listitem> 
+<para><ulink url="&patches-root;glibc-&glibc-version;-fstack_protector-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Glibc PAX Patch - ?? KB:</term>
+<listitem> 
+<para><ulink url="&patches-root;glibc-&glibc-version;-pt_pax-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Glibc SSP Patch - ?? KB:</term>
+<listitem> 
+<para><ulink url="&patches-root;glibc-&glibc-version;-ssp_frandom-6.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>GR Security Patch - ?? KB:</term>
+<listitem>
+<para><ulink url="http://grsecurity.net/grsecurity-2.1.1-2.6.10-as2-200501242254.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Inetutils Kernel Headers Patch - ? KB:</term>
+<listitem>
+<para condition="html"><ulink url="&patches-root;inetutils-&inetutils-version;-kernel_headers-1.patch"/></para>
+<para condition="pdf"><ulink url="&patches-root;inetutils-&inetutils-version;-kernel_headers- 1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Inetutils No-Server-Man-Pages Patch - ? KB:</term>
+<listitem>
+<para condition="html"><ulink url="&patches-root;inetutils-&inetutils-version;-no_server_man_pages-1.patch"/></para>
+<beginpage/>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>IPRoute2 Find Fix Patch - ? KB:</term>
+<listitem>
+<para condition="html"><ulink url="&patches-root;iproute2-&iproute2-patch-version;-find_update-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>IPRoute2 Disable DB Patch - ? KB:</term>
+<listitem>
+<para condition="html"><ulink url="&patches-root;iproute2-&iproute2-patch-version;-remove_db-1.patch"/></para>
+<para condition="pdf"><ulink url="&patches-root;iproute2-&iproute2-patch-version;-remove_ db-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>LFS Bootscript Additions - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;lfs-bootscripts-&lfs-bootscripts-version;-hlfs-2.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Linux Security Patch - ? KB:</term>
+<listitem>
+<para><ulink url="http://www.acm.rpi.edu/~dilinger/patches/2.6.10/as3/patch-2.6.10-as3.gz"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Linux Frandom Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;linux-&linux-version;-frandom-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Linux-Libc-Headers Frandom Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;linux-libc-headers-&linux-libc-headers-version;-frandom-2.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Mktemp Tempfile Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;mktemp-&mktemp-version;-add_tempfile-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Module-Init-Tools No Static Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;module-init-tools-&module-init-tools-version;-nostatic-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Perl Libc Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;perl-&perl-version;-libc-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Perl uClibc Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;perl-&perl-version;-uClibc-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Procps Hardened Cflags Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;procps-&procps-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Readline Display Wrap Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;readline-&readline-version;-fixes-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Shadow uClibc Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;shadow-&shadow-version;-uClibc-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>uClibc Configure Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;uclibc-&uclibc-version;-uClibc-0.9.27-config-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>uClibc SSP Patch - ? KB:</term>
+<listitem> 
+<para><ulink url="&patches-root;uclibc-&uclibc-version;-uClibc-0.9.27-ssp-2.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Util-linux Cramfs Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;util-linux-&util-linux-version;-cramfs-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Util-linux FPIC Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;util-linux-&util-linux-version;-fPIC-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Util-linux Hardened Cflags Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;util-linux-&util-linux-version;-hardened_cflags-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Util-linux Nologin Patch - ? KB:</term>
+<listitem>
+<para><ulink url="&patches-root;util-linux-&util-linux-version;-nologin-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+<varlistentry>
+<term>Vim Security Patch - ? KB:</term><listitem>
+<para><ulink url="&patches-root;vim-&vim-version;-security_fix-1.patch"/></para>
+</listitem>
+</varlistentry>
+
+</variablelist>
+
+<para>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
+<ulink url="&lfs-root;patches/"/> and acquire any additional
+patches to suit the system needs.</para>
+
+</sect1>
+
+

Added: trunk/BOOK/chapter04/aboutlfs.xml
===================================================================
--- trunk/BOOK/chapter04/aboutlfs.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/aboutlfs.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,35 @@
+<?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="prepare-aboutlfs">
+<title>About $LFS</title>
+<?dbhtml filename="aboutlfs.html"?>
+
+<para>Throughout this book, the environment variable <envar>LFS</envar> 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 <envar>LFS</envar> variable is set up properly with:</para>
+
+<screen><userinput>echo $LFS</userinput></screen>
+
+<para>Make sure the output shows the path to the LFS partition's mount
+point, which is <filename class="directory">/mnt/lfs</filename> if the
+provided example was followed. If the output is incorrect, the
+variable can be set with:</para>
+
+<screen><userinput>export LFS=/mnt/lfs</userinput></screen>
+
+<para>Having this variable set is beneficial in that commands such as
+<command>mkdir $LFS/tools</command> can be typed literally. The shell
+will automatically replace <quote>$LFS</quote> with
+<quote>/mnt/lfs</quote> (or whatever the variable was set to) when it
+processes the command line.</para>
+
+<para>Do not forget to check that <envar>$LFS</envar> is set whenever
+you leave and reenter the current working environment (as when doing a
+<quote>su</quote> to <emphasis>root</emphasis> or another user).</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter04/aboutsbus.xml
===================================================================
--- trunk/BOOK/chapter04/aboutsbus.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/aboutsbus.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,50 @@
+<?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="prepare-aboutsbus">
+<title>About SBUs</title>
+<?dbhtml filename="aboutsbus.html"?>
+
+<para>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 Static Build Unit (SBU) measure will be
+used instead.</para>
+
+<para>The SBU measure works as follows. The first package to be compiled
+from this book is the statically-linked Binutils in <xref
+linkend="chapter-temporary-tools"/>.  The time it takes to compile
+this package is what will be referred to as the Static Build Unit
+or SBU. All other compile times will be expressed relative to this
+time.</para>
+
+<para>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 static Binutils, it will take
+<emphasis>approximately</emphasis> 45 minutes to build this example
+package. Fortunately, most build times are shorter than the one
+for Binutils.</para>
+
+<para>Please note that if the system compiler on the host is GCC-2.x based, the
+SBUs listed may be somewhat understated. This is because the SBU is
+based on the very first package, compiled with the old GCC, while the
+rest of the system is compiled with the newer GCC-&gcc-version; (which is
+known to be approximately 30 percent slower). SBUs are also not
+highly accurate for Symmetric Multi-Processor (SMP)-based machines.</para>
+
+<para>To view actual timings for a number of specific machines, we recommend
+<ulink url="&lfs-root;~bdubbs/"/>.</para>
+
+<para>In general, SBUs are not very accurate because they depend on many
+factors, not just the GCC version. 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.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter04/abouttestsuites.xml
===================================================================
--- trunk/BOOK/chapter04/abouttestsuites.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/abouttestsuites.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,50 @@
+<?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="prepare-abouttestsuites">
+<title>About the Test Suites</title>
+<?dbhtml filename="abouttestsuites.html"?>
+
+<para>Most packages provide a test suite. Running the test suite for a
+newly built package is a good idea because it can provide a <quote>sanity
+check</quote> 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.</para>
+
+<para>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.</para>
+
+<note><para>Experience has shown that there is little to be gained
+from running the test suites in <xref
+linkend="chapter-temporary-tools"/>. 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 <xref linkend="chapter-temporary-tools"/> are temporary and
+eventually discarded, we do not recommend running the test suites in
+<xref linkend="chapter-temporary-tools"/> 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.</para></note>
+
+<para>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
+<systemitem class="filesystem">devpts</systemitem> file system set up 
+correctly. This issue is discussed in greater detail in <xref
+linkend="chapter-temporary-tools"/>.</para>
+
+<para>Sometimes package test suites will give false failures. Consult
+the LFS Wiki at <ulink url="&wiki-root;"/> to verify that these
+failures are expected. This site is valid for all tests throughout this
+book.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter04/addinguser.xml
===================================================================
--- trunk/BOOK/chapter04/addinguser.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/addinguser.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -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-addinguser">
+<title>Adding the LFS User</title>
+<?dbhtml filename="addinguser.html"?>
+
+<para>When logged in as user <emphasis>root</emphasis>, 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
+work environment, create a new user called <emphasis>lfs</emphasis> as
+a member of a new group (also named <emphasis>lfs</emphasis>) and use
+this user during the installation process. As
+<emphasis>root</emphasis>, issue the following commands to add the new
+user:</para>
+
+<screen><userinput>groupadd lfs
+useradd -s /bin/bash -g lfs -m -k /dev/null lfs</userinput></screen>
+
+<para>The meaning of the command line options:</para>
+
+<variablelist>
+<varlistentry>
+<term><parameter>-s /bin/bash</parameter></term>
+<listitem><para>This makes
+<command>bash</command> the default shell for user
+<emphasis>lfs</emphasis>.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><parameter>-g lfs</parameter></term>
+<listitem><para>This option adds user <emphasis>lfs</emphasis> to group
+<emphasis>lfs</emphasis>.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><parameter>-m</parameter></term>
+<listitem><para>This creates a home
+directory for <emphasis>lfs</emphasis>.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><parameter>-k /dev/null</parameter></term>
+<listitem><para>This parameter
+prevents possible copying of files from a skeleton directory (default
+is <filename class="directory">/etc/skel</filename>) by changing the input location to
+the special null device.</para></listitem>
+</varlistentry>
+
+<varlistentry>
+<term><parameter>lfs</parameter></term>
+<listitem><para>This is the actual name for the created group and
+user.</para></listitem>
+</varlistentry>
+</variablelist>
+
+<para>To log in as <emphasis>lfs</emphasis> (as opposed to switching
+to user <emphasis>lfs</emphasis> when
+logged in as <emphasis>root</emphasis>, which does not require the
+<emphasis>lfs</emphasis> user to have a
+password), give <emphasis>lfs</emphasis> a password:</para>
+
+<screen><userinput>passwd lfs</userinput></screen>
+
+<para>Grant <emphasis>lfs</emphasis> full access to
+<filename class="directory">$LFS/tools</filename> by making
+<emphasis>lfs</emphasis> the directory owner:</para>
+
+<screen><userinput>chown lfs $LFS/tools</userinput></screen>
+
+<beginpage/>
+<para>If a separate working directory was created as suggested, give
+user <emphasis>lfs</emphasis> ownership of this directory:</para>
+
+<screen><userinput>chown lfs $LFS/sources</userinput></screen>
+
+<para>Next, login as user <emphasis>lfs</emphasis>. This can be done
+via a virtual console, through a display manager, or with the
+following substitute user command:</para>
+
+<screen><userinput>su - lfs</userinput></screen>
+
+<para>The <quote><parameter>-</parameter></quote> instructs
+<command>su</command> 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 the Bash man and info pages.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter04/chapter04.xml
===================================================================
--- trunk/BOOK/chapter04/chapter04.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/chapter04.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<chapter id="chapter-final-preps" xreflabel="Chapter 4">
+<?dbhtml dir="chapter04"?>
+<title>Final Preparations</title>
+<?dbhtml filename="chapter04.html"?>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutlfs.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingtoolsdir.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="addinguser.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="settingenviron.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutsbus.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="abouttestsuites.xml"/>
+
+</chapter>

Added: trunk/BOOK/chapter04/creatingtoolsdir.xml
===================================================================
--- trunk/BOOK/chapter04/creatingtoolsdir.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/creatingtoolsdir.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -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-creatingtoolsdir">
+<title>Creating the $LFS/tools Directory</title>
+<?dbhtml filename="creatingtoolsdir.html"?>
+
+<para>All programs compiled in <xref
+linkend="chapter-temporary-tools"/> will be installed under <filename
+class="directory">$LFS/tools</filename> to keep them separate from the
+programs compiled in <xref linkend="chapter-building-system"/>. 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 <xref
+linkend="chapter-temporary-tools"/>).</para>
+
+<para>Create the required directory by running the following as
+<emphasis>root</emphasis>:</para>
+
+<screen><userinput>mkdir $LFS/tools</userinput></screen>
+
+<para>The next step is to create a <filename class="symlink">/tools</filename> 
+symlink on the host system.  This will point to the newly-created directory on
+the LFS partition. Run this command as <emphasis>root</emphasis> as
+well:</para>
+
+<screen><userinput>ln -s $LFS/tools /</userinput></screen>
+
+<note><para>The above command is correct. The <command>ln</command>
+command has a few syntactic variations, so be sure to check the info
+and man pages before reporting what you may think is an
+error.</para></note>
+
+<para>The created symlink enables the toolchain to be compiled so that
+it always refers to <filename class="directory">/tools</filename>,
+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 <quote>chrooted</quote> to the LFS
+partition).</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter04/settingenviron.xml
===================================================================
--- trunk/BOOK/chapter04/settingenviron.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter04/settingenviron.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,94 @@
+<?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-settingenviron">
+<title>Setting Up the Environment</title>
+<?dbhtml filename="settingenvironment.html"?>
+
+<para>Set up a good working environment by creating two new startup
+files for the <command>bash</command> shell. While logged in as user
+<emphasis>lfs</emphasis>, issue the
+following command to create a new <filename>.bash_profile</filename>:</para>
+
+<screen><userinput>cat > ~/.bash_profile << "EOF"
+<literal>exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash</literal>
+EOF</userinput></screen>
+
+<para>When logged on as user <emphasis>lfs</emphasis>, the
+initial shell is usually a <emphasis>login</emphasis> shell which reads the
+<filename>/etc/profile</filename> of the host (probably containing
+some settings and environment variables) and then
+<filename>.bash_profile</filename>. The <command>exec env
+-i.../bin/bash</command> command in the
+<filename>.bash_profile</filename> file replaces the running shell
+with a new one with a completely empty environment, except for the
+<envar>HOME</envar>, <envar>TERM</envar>, and
+<envar>PS1</envar> 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.</para>
+
+<para>The new instance of the shell is a <emphasis>non-login</emphasis>
+shell, which does not read the <filename>/etc/profile</filename> or
+<filename>.bash_profile</filename> files, but rather reads the
+<filename>.bashrc</filename> file instead. Create the
+<filename>.bashrc</filename> file now:</para>
+
+<screen><userinput>cat > ~/.bashrc << "EOF"
+<literal>set +h
+umask 022
+LFS=/mnt/lfs
+LC_ALL=POSIX
+PATH=/tools/bin:/bin:/usr/bin
+export LFS LC_ALL PATH</literal>
+EOF</userinput></screen>
+
+<para>The <command>set +h</command> command turns off
+<command>bash</command>'s hash function. Hashing is ordinarily a useful 
+feature—<command>bash</command> uses a hash table to remember the
+full path of executable files to avoid searching the <envar>PATH</envar> 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 <envar>PATH</envar> when a program is
+to be run. As such, the shell will find the newly compiled
+tools in <filename class="directory">$LFS/tools</filename> as soon as
+they are available without remembering a previous version of the same
+program in a different location.</para>
+
+<beginpage/>
+<para>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).</para>
+
+<para>The <envar>LFS</envar> variable should be set to the
+chosen mount point.</para>
+
+<para>The <envar>LC_ALL</envar> 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 <envar>LC_ALL</envar> set to something other than
+<quote>POSIX</quote> or <quote>C</quote> (during this chapter) may
+cause issues if you exit the chroot environment and wish to return
+later. Setting <envar>LC_ALL</envar> to <quote>POSIX</quote>
+or <quote>C</quote> (the two are equivalent) ensures that
+everything will work as expected in the chroot environment.</para>
+
+<para>By putting <filename class="directory">/tools/bin</filename>
+ahead of the standard <envar>PATH</envar>, all the programs installed in <xref
+linkend="chapter-temporary-tools"/> are picked up by the shell
+immediately after their installation. This, combined with turning off 
+hashing, limits the risk that old programs from
+the host are being used when they should not be used any
+longer.</para>
+
+<para>Finally, to have the environment fully prepared for building the
+temporary tools, source the just-created user profile:</para>
+
+<screen><userinput>source ~/.bash_profile</userinput></screen>
+
+</sect1>
+

Added: trunk/BOOK/chapter05/chapter05.xml
===================================================================
--- trunk/BOOK/chapter05/chapter05.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter05/chapter05.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<chapter id="chapter-temporary-tools" xreflabel="Chapter 5">
+<?dbhtml dir="chapter05"?>
+<title>Constructing a Temporary System</title>
+<?dbhtml filename="chapter05.html"?>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
+<!--
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hostreqs.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="toolchaintechnotes.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-pass1.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-pass1.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="adjusting.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tcl.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="expect.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="dejagnu.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc-pass2.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils-pass2.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="stripping.xml"/>
+-->
+
+</chapter>

Added: trunk/BOOK/chapter05/environment.xml
===================================================================
--- trunk/BOOK/chapter05/environment.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter05/environment.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,94 @@
+<?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-settingenviron">
+<title>Setting Up the Environment</title>
+<?dbhtml filename="environment.html"?>
+
+<para>Set up a good working environment by creating two new startup
+files for the <command>bash</command> shell. While logged in as user
+<emphasis>lfs</emphasis>, issue the
+following command to create a new <filename>.bash_profile</filename>:</para>
+
+<screen><userinput>cat > ~/.bash_profile << "EOF"
+<literal>exec env -i HOME=$HOME TERM=$TERM PS1='\u:\w\$ ' /bin/bash</literal>
+EOF</userinput></screen>
+
+<para>When logged on as user <emphasis>lfs</emphasis>, the
+initial shell is usually a <emphasis>login</emphasis> shell which reads the
+<filename>/etc/profile</filename> of the host (probably containing
+some settings and environment variables) and then
+<filename>.bash_profile</filename>. The <command>exec env
+-i.../bin/bash</command> command in the
+<filename>.bash_profile</filename> file replaces the running shell
+with a new one with a completely empty environment, except for the
+<envar>HOME</envar>, <envar>TERM</envar>, and
+<envar>PS1</envar> 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.</para>
+
+<para>The new instance of the shell is a <emphasis>non-login</emphasis>
+shell, which does not read the <filename>/etc/profile</filename> or
+<filename>.bash_profile</filename> files, but rather reads the
+<filename>.bashrc</filename> file instead. Create the
+<filename>.bashrc</filename> file now:</para>
+
+<screen><userinput>cat > ~/.bashrc << "EOF"
+<literal>set +h
+umask 022
+LFS=/mnt/lfs
+LC_ALL=POSIX
+PATH=/tools/bin:/bin:/usr/bin
+export LFS LC_ALL PATH</literal>
+EOF</userinput></screen>
+
+<para>The <command>set +h</command> command turns off
+<command>bash</command>'s hash function. Hashing is ordinarily a useful 
+feature—<command>bash</command> uses a hash table to remember the
+full path of executable files to avoid searching the <envar>PATH</envar> 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 <envar>PATH</envar> when a program is
+to be run. As such, the shell will find the newly compiled
+tools in <filename class="directory">$LFS/tools</filename> as soon as
+they are available without remembering a previous version of the same
+program in a different location.</para>
+
+<beginpage/>
+<para>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).</para>
+
+<para>The <envar>LFS</envar> variable should be set to the
+chosen mount point.</para>
+
+<para>The <envar>LC_ALL</envar> 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 <envar>LC_ALL</envar> set to something other than
+<quote>POSIX</quote> or <quote>C</quote> (during this chapter) may
+cause issues if you exit the chroot environment and wish to return
+later. Setting <envar>LC_ALL</envar> to <quote>POSIX</quote>
+or <quote>C</quote> (the two are equivalent) ensures that
+everything will work as expected in the chroot environment.</para>
+
+<para>By putting <filename class="directory">/tools/bin</filename>
+ahead of the standard <envar>PATH</envar>, all the programs installed in <xref
+linkend="chapter-temporary-tools"/> are picked up by the shell
+immediately after their installation. This, combined with turning off 
+hashing, limits the risk that old programs from
+the host are being used when they should not be used any
+longer.</para>
+
+<para>Finally, to have the environment fully prepared for building the
+temporary tools, source the just-created user profile:</para>
+
+<screen><userinput>source ~/.bash_profile</userinput></screen>
+
+</sect1>
+

Added: trunk/BOOK/chapter05/introduction.xml
===================================================================
--- trunk/BOOK/chapter05/introduction.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter05/introduction.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-tools-introduction">
+<title>Introduction</title>
+<?dbhtml filename="introduction.html"?>
+
+<para>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 <xref
+linkend="chapter-building-system"/> and allow a working environment
+with more user convenience than a minimum environment would.</para>
+
+<para>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.</para>
+
+<para>The files compiled in this chapter will be installed under the
+<filename class="directory">$LFS/tools</filename> 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.</para>
+
+<para>Before issuing the build instructions for a package, the package
+should be unpacked as user <emphasis>lfs</emphasis>, and a
+<command>cd</command> into the created directory should be performed. The build
+instructions assume that the <command>bash</command> shell is in use.</para>
+
+<para>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
+<emphasis>offset</emphasis> or <emphasis>fuzz</emphasis> may
+also be encountered when applying a patch. Do not worry about these
+warnings, as the patch was still successfully applied.</para>
+
+<para>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.</para>
+
+<beginpage/>
+
+<para>After installing each package, delete its source and build
+directories, unless specifically instructed otherwise. Deleting the
+sources saves space and prevents mis-configuration when the same
+package is reinstalled later. Only three of the packages need to
+retain the source and build directories in order for their contents to
+be used by later commands. Pay special attention to these
+reminders.</para>
+
+<para>Check one last time that the <envar>LFS</envar> environment 
+variable is set up properly:</para>
+
+<screen><userinput>echo $LFS</userinput></screen>
+
+<para>Make sure the output shows the path to the LFS partition's mount
+point, which is <filename class="directory">/mnt/lfs</filename>, using
+our example.</para>
+
+</sect1>
+

Added: trunk/BOOK/chapter06/chapter06.xml
===================================================================
--- trunk/BOOK/chapter06/chapter06.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter06/chapter06.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<chapter id="chapter-building-system" xreflabel="Chapter 6">
+<?dbhtml dir="chapter06"?>
+<title>Installing Basic System Software</title>
+<?dbhtml filename="chapter06.html"?>
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
+<!--
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kernfs.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chroot.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="changingowner.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingdirs.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="createfiles.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pwdgroup.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="devices.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iana-etc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readline.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="vim.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="less.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inetutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iproute2.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="autoconf.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="automake.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hotplug.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procps.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="psmisc.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="shadow.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libol.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="syslogng.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysvinit.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="strippingagain.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/>
+-->
+
+</chapter>

Added: trunk/BOOK/chapter06/introduction.xml
===================================================================
--- trunk/BOOK/chapter06/introduction.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/chapter06/introduction.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
+  <!ENTITY % general-entities SYSTEM "../general.ent">
+  %general-entities;
+]>
+<sect1 id="ch-system-introduction">
+<title>Introduction</title>
+<?dbhtml filename="introduction.html"?>
+
+<para>In this chapter, we enter the building site and start
+constructing the LFS system in earnest. That is, we chroot into the
+temporary mini Linux system, make a few final preparations, and then
+begin installing the packages.</para>
+
+<para>The installation of this software is straightforward. Although
+in many cases the installation instructions could be made shorter and
+more generic, we have opted to provide the full instructions for every
+package to minimize the possibilities for mistakes.  The key to
+learning what makes a Linux system work is to know what each package
+is used for and why the user (or the system) needs it.  For every
+installed package, a summary of its contents is given, followed by
+concise descriptions of each program and library the package
+installed.</para>
+
+<para>If using the compiler optimizations provided in this chapter,
+please review the optimization hint at <ulink
+url="&hints-root;optimization.txt"/>.  Compiler optimizations can make
+a program run slightly faster, but they may also cause compilation
+difficulties and problems when running the program. If a package
+refuses to compile when using optimization, try to compile it without
+optimization and see if that fixes the problem. Even if the package
+does compile when using optimization, there is the risk it may have
+been compiled incorrectly because of the complex interactions between
+the code and build tools.  The small potential gains achieved in using
+compiler optimizations are often outweighed by the risks. First-time
+builders of LFS are encouraged to build without custom optimizations.
+The subsequent system will still run very fast and be stable at the
+same time.</para>
+
+<para>The order that packages are installed in this chapter needs to
+be strictly followed to ensure that no program accidentally acquires a
+path referring to <filename class="directory">/tools</filename>
+hard-wired into it. For the same reason, do not compile packages in
+parallel. Compiling in parallel may save time (especially on dual-CPU
+machines), but it could result in a program containing a hard-wired
+path to <filename class="directory">/tools</filename>, which will
+cause the program to stop working when that directory is
+removed.</para>
+
+<para>Before the installation instructions, each installation page
+provides information about the package, including a concise
+description of what it contains, approximately how long it will take
+to build, how much disk space is required during this building
+process, and any other packages needed to successfully build the
+package. Following the installation instructions, there is a list of
+programs and libraries (along with brief descriptions of these) that
+the package installs.</para>
+
+<para>To keep track of which package installs particular files, a package
+manager can be used. For a general overview of different styles of package
+managers, please refer to <ulink
+url="&blfs-root;view/svn/introduction/important.html"/>.
+For a package management method specifically geared towards LFS, we recommend <ulink
+url="&hints-root;more_control_and_pkg_man.txt"/>.</para>
+
+<note><para>The remainder of this book is to be performed while logged
+in as user <emphasis>root</emphasis> and no longer as user
+<emphasis>lfs</emphasis>.</para></note>
+
+</sect1>
+

Modified: trunk/BOOK/general.ent
===================================================================
--- trunk/BOOK/general.ent	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/general.ent	2005-02-08 01:17:21 UTC (rev 150)
@@ -9,7 +9,7 @@
 <!ENTITY faq-root "&lfs-root;faq/">
 <!ENTITY hints-root "&lfs-root;hints/downloads/files/">
 <!ENTITY hints-index "&lfs-root;hints/list.html">
-<!ENTITY patches-root "&lfs-root;patches/lfs/cvs/unstable/">
+<!ENTITY patches-root "&lfs-root;patches/hlfs/">
 <!ENTITY wiki-root "http://wiki.linuxfromscratch.org/">
 <!ENTITY freshmeat "http://freshmeat.net/projects/">
 
@@ -19,6 +19,7 @@
 <!ENTITY autoconf-version "2.59">
 <!ENTITY automake-version "1.9.4">
 <!ENTITY bash-version "3.0">
+<!ENTITY blfs-bootscripts-version "20041227">
 <!ENTITY binutils-version "2.15.94.0.2">
 <!ENTITY bison-version "2.0">
 <!ENTITY bzip2-version "1.0.2">

Modified: trunk/BOOK/index.xml
===================================================================
--- trunk/BOOK/index.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/index.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!DOCTYPE book 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;
 ]>
@@ -12,14 +12,11 @@
 <title>Introduction</title>
 <?dbhtml filename="part1.html"?>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter01/chapter01.xml"/>
-<!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter02/chapter02.xml"/>
--->
 </part>
 
-<!--
 <part id="part2">
-<title>Preparing for the build</title>
+<title>Preparing for the Build</title>
 <?dbhtml filename="part2.html"?>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter03/chapter03.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter04/chapter04.xml"/>
@@ -27,15 +24,25 @@
 </part>
 
 <part id="part3">
-<title>Building the LFS system</title>
+<title>Building the LFS System</title>
 <?dbhtml filename="part3.html"?>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter06/chapter06.xml"/>
+<!--
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter07/chapter07.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter08/chapter08.xml"/>
 <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chapter09/chapter09.xml"/>
+-->
 </part>
+
+<!--
+<part id="part4">
+<title>Appendices</title>
+<?dbhtml filename="part4.html"?>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="appendixa/acronymlist.xml"/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="appendixb/acknowledgments.xml"/>
+</part>
 -->
-
 <index/>
 
 </book>
+

Modified: trunk/BOOK/prologue/bookinfo.xml
===================================================================
--- trunk/BOOK/prologue/bookinfo.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/prologue/bookinfo.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE bookinfo PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!DOCTYPE bookinfo 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;
 ]>
@@ -9,22 +9,21 @@
 
 
 <authorgroup>
-<author>HLFS Development Team</author>
+<corpauthor>HLFS Development Team</corpauthor>
 </authorgroup>
 
 <copyright id="copyright">
-	<year>2004</year>
+	<year>2004-2005</year>
 	<holder>HLFS Development Team</holder>
 </copyright>
 
-
 <abstract>
-<para>This book describes the process of creating a Hardened Linux system from
-scratch, using nothing but the sources of the required software.</para>
+<para>This book describes the process of creating a Hardened Linux
+system from scratch, using only the sources of the required software.</para>
 </abstract>
 
 <legalnotice>
-<para>Copyright (c) 2004, HLFS Development Team</para>
+<para>Copyright © 2004-2005, HLFS Development Team</para>
 
 <para>All rights reserved.</para>
 
@@ -46,18 +45,16 @@
 
 </itemizedlist>
 
-<para>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS <quote>AS
-IS</quote> 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.</para>
-</legalnotice>
+<para>THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+<quote>AS IS</quote> 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.</para> </legalnotice>
 
-
 </bookinfo>

Modified: trunk/BOOK/prologue/organization.xml
===================================================================
--- trunk/BOOK/prologue/organization.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/prologue/organization.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!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;
 ]>
@@ -10,9 +10,28 @@
 <para>This book is divided into the following parts:</para>
 
 <sect2>
-<title>Place holder</title>
+<title>Part I - Introduction</title>
 
-<para>Place holder</para>
+<para>Part I explains a few important notes on how to proceed with the HLFS
+installation. This section also provides meta-information about the book.</para>
 </sect2>
 
+<sect2>
+<title>Part II - Preparing for the Build</title>
+
+<para>Part II describes how to prepare for the building
+process—downloading the packages, and compiling temporary tools.</para>
+</sect2>
+
+<sect2>
+<title>Part III - Building the LFS System</title>
+
+<para>Part III guides the reader through the building of the HLFS
+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.</para>
+</sect2>
+
 </sect1>

Modified: trunk/BOOK/prologue/preface.xml
===================================================================
--- trunk/BOOK/prologue/preface.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/prologue/preface.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE preface PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!DOCTYPE preface 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;
 ]>

Modified: trunk/BOOK/prologue/prerequisites.xml
===================================================================
--- trunk/BOOK/prologue/prerequisites.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/prologue/prerequisites.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!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;
 ]>
@@ -8,7 +8,7 @@
 <?dbhtml filename="prerequisites.html"?>
 
 <para>This book assumes that its reader has a good deal of knowledge about using
-and installing Linux software and has successfully built LFS and BLFS.  Many of
+and installing Linux software and has successfully built LFS and BLFS. Many of
 the general comments about the process will <emphasis>not</emphasis> be
 explained as the LFS and BLFS books are written for such purposes.</para>
 

Modified: trunk/BOOK/prologue/typography.xml
===================================================================
--- trunk/BOOK/prologue/typography.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/prologue/typography.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="ISO-8859-1"?>
-<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
+<!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;
 ]>

Added: trunk/BOOK/template-chap5.xml
===================================================================
--- trunk/BOOK/template-chap5.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/template-chap5.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,58 @@
+<?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-Ad4ScdK" role="wrap">
+<title>34jknKJ-&Ad4ScdK-version;</title>
+<?dbhtml filename="Ad4ScdK.html"?>
+
+<indexterm zone="ch-tools-Ad4ScdK">
+<primary sortas="a-34jknKJ">34jknKJ</primary>
+<secondary>tools</secondary></indexterm>
+
+<sect2 role="package"><title/>
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/Ad4ScdK.xml" xpointer="xpointer(/sect1/sect2[1]/para[1])"/>
+
+<!-- Don't forget to time the build and check build size, etc.
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>0.2 SBU</seg><seg>5.2 MB</seg></seglistitem>
+</segmentedlist>
+-->
+
+<xi:include xmlns:xi="http://www.w3.org/2003/XInclude"
+href="../chapter06/Ad4ScdK.xml" xpointer="xpointer(/sect1/sect2[1]/segmentedlist[2])"/>
+
+</sect2>
+
+<sect2 role="installation">
+<title>Installation of 34jknKJ</title>
+
+<para>Prepare 34jknKJ for compilation:</para>
+
+<screen><userinput>./configure --prefix=/tools</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make</userinput></screen>
+
+<para>To test the results, issue: <userinput>make
+check</userinput>.</para>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+
+</sect2>
+
+<!-- Chapter 5 packages just refer to contents in chapter 6 -->
+<sect2 role="content"><title/>
+<para>Details on this package are located in <xref
+linkend="contents-Ad4ScdK" role="."/></para>
+</sect2>
+
+</sect1>
+

Added: trunk/BOOK/template-chap6.xml
===================================================================
--- trunk/BOOK/template-chap6.xml	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/template-chap6.xml	2005-02-08 01:17:21 UTC (rev 150)
@@ -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-system-Lsad823" role="wrap">
+<title>w786etY-&Lsad823-version;</title>
+<?dbhtml filename="Lsad823.html"?>
+
+<indexterm zone="ch-system-Lsad823"><primary sortas="a-w786etY">w786etY</primary></indexterm>
+
+<sect2 role="package"><title/>
+<para>The w786etY package contains programs for <!-- Finish this thought --></para>
+
+<!-- Don't forget to time the build and check build size, etc.
+<segmentedlist>
+<segtitle>&buildtime;</segtitle>
+<segtitle>&diskspace;</segtitle>
+<seglistitem><seg>0.5 SBU</seg><seg>7.7 MB</seg></seglistitem>
+</segmentedlist>
+-->
+
+<!-- Example. Edit and uncomment
+<segmentedlist>
+<segtitle>w786etY installation depends on</segtitle>
+<seglistitem><seg>Bash, Coreutils, Diffutils, Grep,
+M4, Make, Perl, and Sed</seg></seglistitem>
+</segmentedlist>
+</sect2>
+-->
+
+<sect2 role="installation">
+<title>Installation of w786etY</title>
+
+<para>Prepare w786etY for compilation:</para>
+
+<screen><userinput>./configure --prefix=/usr</userinput></screen>
+
+<para>Compile the package:</para>
+
+<screen><userinput>make</userinput></screen>
+
+<para>To test the results, issue:
+<userinput>make check</userinput>. This takes a long time, about 2 SBUs.</para>
+
+<para>Install the package:</para>
+
+<screen><userinput>make install</userinput></screen>
+<beginpage/>
+</sect2>
+
+
+<sect2 id="contents-Lsad823" role="content"><title>Contents of w786etY</title>
+
+<segmentedlist>
+<segtitle>Installed programs</segtitle>
+<!-- Insert installed program names here: -->
+<seglistitem><seg></seg></seglistitem>
+</segmentedlist>
+
+<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
+<?dbfo list-presentation="list"?>
+
+<!-- Leaving this in as an example of how to set up the description of programs
+so that they are properly indexed:
+
+<varlistentry id="autoconf">
+<term><command>autoconf</command></term>
+<listitem>
+<para>Produces shell scripts that automatically
+configure software source code packages to adapt to many kinds of
+Unix-like systems. The configuration scripts it produces are
+independent—running them does not require the <command>autoconf</command> program.</para>
+<indexterm zone="ch-system-autoconf autoconf"><primary sortas="b-autoconf">autoconf</primary></indexterm>
+</listitem>
+</varlistentry>
+-->
+</variablelist>
+
+</sect2>
+
+</sect1>
+

Added: trunk/BOOK/template-readme
===================================================================
--- trunk/BOOK/template-readme	2005-02-07 07:27:26 UTC (rev 149)
+++ trunk/BOOK/template-readme	2005-02-08 01:17:21 UTC (rev 150)
@@ -0,0 +1,20 @@
+Since it can be easy to overlook one of the many little places where this
+template file needs to be edited, I've tried to make it easier for editors to
+quickly bash out an xml page by inserting a unique string in the template files
+that can be sedded out in place of the package name.
+
+In template-chap5.xml the unique string for lowercase is Ad4ScdK
+In template-chap5.xml the unique string for uppercase is 34jknKJ
+
+In template-chap6.xml the unique string for is lowercase Lsad823
+In template-chap6.xml the unique string for is uppercase w786etY
+
+Now, let's say you want to create a page for sed in chapter5. Simply:
+
+sed -e 's|Ad4ScdK|sed|g' \
+    -e 's|34jknKJ|Sed|g' template-chap5.xml >chapter05/sed.xml
+
+Hopefully this will help speed things up a bit.
+
+-- 
+Archaic




More information about the hlfs-dev mailing list