diff --git a/chapter05/adding-user.xml b/chapter05/adding-user.xml index 8e4881815..d8dd85422 100644 --- a/chapter05/adding-user.xml +++ b/chapter05/adding-user.xml @@ -14,10 +14,10 @@ issue the following commands to add the new user: passwd lfs Now grant this new user lfs full access to -$LFS/stage1 by giving it ownership +$LFS/tools by giving it ownership of the directory: -chown lfs $LFS/stage1 +chown lfs $LFS/tools Next, login as user lfs. This can be done via a virtual console, through a display manager, or with the following substitute diff --git a/chapter05/bash-inst.xml b/chapter05/bash-inst.xml index a8dc236f2..eab96f228 100644 --- a/chapter05/bash-inst.xml +++ b/chapter05/bash-inst.xml @@ -10,7 +10,7 @@ patch: Now prepare Bash for compilation: -./configure --prefix=/stage1 --with-curses +./configure --prefix=/tools --with-curses Compile the program: @@ -27,7 +27,7 @@ patch: And make a link for the programs that use sh for a shell: -ln -s bash /stage1/bin/sh +ln -s bash /tools/bin/sh diff --git a/chapter05/binutils-pass1-inst.xml b/chapter05/binutils-pass1-inst.xml index 53c37be56..00a5c340d 100644 --- a/chapter05/binutils-pass1-inst.xml +++ b/chapter05/binutils-pass1-inst.xml @@ -22,14 +22,14 @@ cd ../binutils-build Next, prepare Binutils to be compiled: ../binutils-&binutils-version;/configure \ -    --prefix=/stage1 --disable-nls +    --prefix=/tools --disable-nls The meaning of the configure switches: ---prefix=/stage1: This tells the +--prefix=/tools: This tells the configure script to prepare to install the Binutils programs in the -/stage1 directory. +/tools directory. --disable-nls: This disables internationalization (a word often shortened to i18n). We don't need this for our static programs and nls often causes problems @@ -57,7 +57,7 @@ statically. on: make -C ld clean -make -C ld LIB_PATH=/stage1/lib +make -C ld LIB_PATH=/tools/lib Do not yet remove the Binutils build and source directories. You will need them again in their current state a bit further on diff --git a/chapter05/binutils-pass2-inst.xml b/chapter05/binutils-pass2-inst.xml index 759fe311b..384c8f455 100644 --- a/chapter05/binutils-pass2-inst.xml +++ b/chapter05/binutils-pass2-inst.xml @@ -10,8 +10,8 @@ cd ../binutils-build Now prepare Binutils to be compiled: -../binutils-&binutils-version;/configure --prefix=/stage1 \ -    --enable-shared --with-lib-path=/stage1/lib +../binutils-&binutils-version;/configure --prefix=/tools \ +    --enable-shared --with-lib-path=/tools/lib Before starting to build Binutils, remember to unset any environment variables that override the default optimization flags. diff --git a/chapter05/bzip2-inst.xml b/chapter05/bzip2-inst.xml index bdfb951ab..ad250d87b 100644 --- a/chapter05/bzip2-inst.xml +++ b/chapter05/bzip2-inst.xml @@ -6,7 +6,7 @@ The Bzip2 package doesn't contain a configure script. Compile and install it with a straightforward: -make PREFIX=/stage1 install +make PREFIX=/tools install diff --git a/chapter05/chapter05.xml b/chapter05/chapter05.xml index 7d8cd2951..bcb86198d 100644 --- a/chapter05/chapter05.xml +++ b/chapter05/chapter05.xml @@ -4,7 +4,7 @@ &c5-introduction; &c5-whystatic; -&c5-creatingstage1dir; +&c5-creatingtoolsdir; &c5-addinguser; &c5-settingenviron; &c5-binutils-pass1; @@ -45,8 +45,8 @@ can throw away some unnecessary things. The executables and libraries you have built so far contain about 130 MB of unneeded debugging symbols. Remove those symbols like this: -strip --strip-unneeded /stage1/{,s}bin/* -strip --strip-debug /stage1/lib/* +strip --strip-unneeded /tools/{,s}bin/* +strip --strip-debug /tools/lib/* The first of the above commands will skip some twenty files, reporting that it doesn't recognize their file format. Most of them are scripts instead @@ -59,8 +59,8 @@ destroyed and you would have to build Glibc all over again. To save another couple of megabytes, you can throw away the documentation and some of the bigger unneeded programs: -rm -r /stage1/share/{doc,info,man} -rm /stage1/bin/{addr2line,gprof,nm,size,strings,strip} +rm -r /tools/share/{doc,info,man} +rm /tools/bin/{addr2line,gprof,nm,size,strings,strip} You will now need to have at least 700 MB of free space on your LFS filesystem to be able to build and install Glibc in the next phase. diff --git a/chapter05/coreutils-inst.xml b/chapter05/coreutils-inst.xml index 455185064..277c045e3 100644 --- a/chapter05/coreutils-inst.xml +++ b/chapter05/coreutils-inst.xml @@ -5,7 +5,7 @@ Prepare Coreutils to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the package: diff --git a/chapter05/creatingstage1dir.xml b/chapter05/creatingstage1dir.xml index 4ff58628c..0d466c034 100644 --- a/chapter05/creatingstage1dir.xml +++ b/chapter05/creatingstage1dir.xml @@ -1,24 +1,30 @@ - -Creating the $LFS/stage1 directory - + +Creating the $LFS/tools directory + All programs compiled in this chapter will be installed under $LFS/stage1 to keep them separate from the +class="directory">$LFS/tools to keep them separate from the programs compiled in the next chapter. The programs compiled here are only temporary tools and won't be a part of the final LFS system and by keeping them -in a separate directory, we can later easily throw them away. Create the -required directory by running the following: +in a separate directory, we can later easily throw them away. -mkdir $LFS/stage1 +If later you wish to search through the binaries of your system to see +what files they make use of or link against, then to make this searching easier +you may want to choose a unique name. Instead of the simple "tools" you could +use something like "tools-for-lfs". -The next step is to create a /stage1 symlink on +Create the required directory by running the following: + +mkdir $LFS/tools + +The next step is to create a /tools symlink on your host system. It will point to the directory we just created on the LFS partition: -ln -s $LFS/stage1 / +ln -s $LFS/tools / This symlink enables us to compile our toolchain so that it always -refers to /stage1, meaning that the compiler, assembler +refers to /tools, meaning that the compiler, assembler and linker will work both in this chapter (when we are still using some tools from the host) and in the next (when we are chrooted to the LFS partition). diff --git a/chapter05/dejagnu-inst.xml b/chapter05/dejagnu-inst.xml index 0a948fdb9..c1794e6ac 100644 --- a/chapter05/dejagnu-inst.xml +++ b/chapter05/dejagnu-inst.xml @@ -5,7 +5,7 @@ Prepare DejaGNU to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Build and install the package: diff --git a/chapter05/diffutils-inst.xml b/chapter05/diffutils-inst.xml index edaf67440..2005334d8 100644 --- a/chapter05/diffutils-inst.xml +++ b/chapter05/diffutils-inst.xml @@ -5,7 +5,7 @@ Prepare Diffutils to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the package: diff --git a/chapter05/expect-inst.xml b/chapter05/expect-inst.xml index 2daab650c..73fefd214 100644 --- a/chapter05/expect-inst.xml +++ b/chapter05/expect-inst.xml @@ -12,7 +12,7 @@ GCC test suite run. Now prepare Expect to be compiled: -./configure --prefix=/stage1 --with-tcl=/stage1/lib --with-x=no +./configure --prefix=/tools --with-tcl=/tools/lib --with-x=no Build, test, and install the package: diff --git a/chapter05/findutils-inst.xml b/chapter05/findutils-inst.xml index 650a7caf8..a43cf15bf 100644 --- a/chapter05/findutils-inst.xml +++ b/chapter05/findutils-inst.xml @@ -5,7 +5,7 @@ Prepare Findutils to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the package: diff --git a/chapter05/gawk-inst.xml b/chapter05/gawk-inst.xml index b60048eb1..d77249ada 100644 --- a/chapter05/gawk-inst.xml +++ b/chapter05/gawk-inst.xml @@ -5,7 +5,7 @@ Prepare Gawk to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the package: diff --git a/chapter05/gcc-pass1-inst.xml b/chapter05/gcc-pass1-inst.xml index 37cf4836e..00be02adc 100644 --- a/chapter05/gcc-pass1-inst.xml +++ b/chapter05/gcc-pass1-inst.xml @@ -20,15 +20,15 @@ cd ../gcc-build Prepare GCC to be compiled: -../gcc-&gcc-version;/configure --prefix=/stage1 \ -    --with-local-prefix=/stage1 \ +../gcc-&gcc-version;/configure --prefix=/tools \ +    --with-local-prefix=/tools \     --disable-nls --enable-shared \     --enable-languages=c The meaning of the new configure options: ---with-local-prefix=/stage1: The +--with-local-prefix=/tools: The purpose of this switch is to remove /usr/local/include from gcc's include search path. This is not absolutely essential, but we want to try and minimize the influence from the host system, @@ -71,14 +71,14 @@ compiled correctly. make install As a finishing touch we'll create the /stage1/bin/cc symlink. Many programs and +class="symlink">/tools/bin/cc symlink. Many programs and scripts run cc instead of gcc, a thing meant to keep programs generic and therefore usable on all kinds of Unix systems. Not everybody has the GNU C compiler installed. Simply running cc leaves the system administrator free to decide what C compiler to install, as long as there's a symlink pointing to it: -ln -sf gcc /stage1/bin/cc +ln -sf gcc /tools/bin/cc diff --git a/chapter05/gcc-pass2-inst.xml b/chapter05/gcc-pass2-inst.xml index f014658d7..1657d067e 100644 --- a/chapter05/gcc-pass2-inst.xml +++ b/chapter05/gcc-pass2-inst.xml @@ -24,7 +24,7 @@ fixed headers from the host system, which would most likely not match the Glibc version actually used for the LFS system. The last patch changes GCC's default location of the dynamic linker, -a simple substitution of "/lib/ld-linux.so.2" with "/stage1/lib/ld-linux.so.2" +a simple substitution of "/lib/ld-linux.so.2" with "/tools/lib/ld-linux.so.2" in config/i386/linux.h. Patching now rather than adjusting the specs file after installation ensures that our new dynamic linker gets used during the actual build of GCC. That is, all the final (and temporary) @@ -40,8 +40,8 @@ variables that override the default optimization flags. Now prepare GCC to be compiled: -../gcc-&gcc-version;/configure --prefix=/stage1 \ -    --with-local-prefix=/stage1 \ +../gcc-&gcc-version;/configure --prefix=/tools \ +    --with-local-prefix=/tools \     --enable-clocale=gnu --enable-shared \     --enable-threads=posix --enable-__cxa_atexit \     --enable-languages=c,c++ diff --git a/chapter05/gettext-inst.xml b/chapter05/gettext-inst.xml index 4aa9bae58..dd93ed683 100644 --- a/chapter05/gettext-inst.xml +++ b/chapter05/gettext-inst.xml @@ -5,7 +5,7 @@ Prepare Gettext to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the programs: diff --git a/chapter05/glibc-inst.xml b/chapter05/glibc-inst.xml index 6e57b51d5..7e433d3db 100644 --- a/chapter05/glibc-inst.xml +++ b/chapter05/glibc-inst.xml @@ -21,8 +21,8 @@ is putting the stability of your system at risk. complain about the absence of /etc/ld.so.conf. Fix this annoying little error with: -mkdir /stage1/etc -touch /stage1/etc/ld.so.conf +mkdir /tools/etc +touch /tools/etc/ld.so.conf Also, Glibc has a subtle problem when compiled with GCC 3.3.1. Apply the following patch to fix this: @@ -38,10 +38,10 @@ cd ../glibc-build Next, prepare Glibc to be compiled: -../glibc-&glibc-version;/configure --prefix=/stage1 \ +../glibc-&glibc-version;/configure --prefix=/tools \     --disable-profile --enable-add-ons \ -    --with-headers=/stage1/include \ -    --with-binutils=/stage1/bin \ +    --with-headers=/tools/include \ +    --with-binutils=/tools/bin \     --without-gd The meaning of the new configure options: @@ -54,8 +54,8 @@ plan to do profiling. --enable-add-ons: This enables any add-ons that were installed with Glibc, in our case Linuxthreads. ---with-binutils=/stage1/bin and ---with-headers=/stage1/include: Strictly speaking +--with-binutils=/tools/bin and +--with-headers=/tools/include: Strictly speaking these switches are not required. But they ensure nothing can go wrong with regard to what kernel headers and Binutils programs get used during the Glibc build. diff --git a/chapter05/grep-inst.xml b/chapter05/grep-inst.xml index 2364146a7..e72404e54 100644 --- a/chapter05/grep-inst.xml +++ b/chapter05/grep-inst.xml @@ -5,7 +5,7 @@ Prepare Grep to be compiled: -./configure --prefix=/stage1 \ +./configure --prefix=/tools \     --disable-perl-regexp --with-included-regex Compile the programs: diff --git a/chapter05/gzip-inst.xml b/chapter05/gzip-inst.xml index bd0c4964e..92f254a6a 100644 --- a/chapter05/gzip-inst.xml +++ b/chapter05/gzip-inst.xml @@ -5,7 +5,7 @@ Prepare Gzip to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the package: diff --git a/chapter05/introduction.xml b/chapter05/introduction.xml index aecb28cfb..6f1ba6396 100644 --- a/chapter05/introduction.xml +++ b/chapter05/introduction.xml @@ -12,7 +12,7 @@ linker and libraries), and then use this to build all the other essential tools. The files compiled in this chapter will be installed under the -$LFS/stage1 directory, +$LFS/tools directory, to keep them separate from the files installed in the next chapter. Since the packages compiled here are merely temporary, we don't want them to pollute the soon-to-be LFS system. diff --git a/chapter05/kernelheaders-inst.xml b/chapter05/kernelheaders-inst.xml index 96f629dd0..15cf446ac 100644 --- a/chapter05/kernelheaders-inst.xml +++ b/chapter05/kernelheaders-inst.xml @@ -27,20 +27,20 @@ symlink: Install the platform-specific header files: -mkdir /stage1/include/asm -cp include/asm/* /stage1/include/asm -cp -R include/asm-generic /stage1/include +mkdir /tools/include/asm +cp include/asm/* /tools/include/asm +cp -R include/asm-generic /tools/include Install the cross-platform kernel header files: -cp -R include/linux /stage1/include +cp -R include/linux /tools/include There are a few kernel header files which make use of the autoconf.h header file. Since we do not yet configure the kernel, we need to create this file ourselves in order to avoid compilation failures. Create an empty autoconf.h file: -touch /stage1/include/linux/autoconf.h +touch /tools/include/linux/autoconf.h diff --git a/chapter05/lockingglibc.xml b/chapter05/lockingglibc.xml index 694e529b3..a8360ca51 100644 --- a/chapter05/lockingglibc.xml +++ b/chapter05/lockingglibc.xml @@ -17,23 +17,23 @@ directory: pass of Binutils, and contain no mention of /lib, /usr/lib or /usr/local/lib. From this point onwards everything will link only -against the libraries in /stage1/lib. +against the libraries in /tools/lib. You can now remove Binutils' build and source directories. The other thing to do is to amend our GCC specs file so that it points to the new dynamic linker. A simple sed will accomplish this: -SPECFILE=/stage1/lib/gcc-lib/*/*/specs -sed -e 's@/lib/ld.so.1@/stage1/lib/ld.so.1@g' \ -    -e 's@/lib/ld-linux.so.2@/stage1/lib/ld-linux.so.2@g' \ +SPECFILE=/tools/lib/gcc-lib/*/*/specs +sed -e 's@/lib/ld.so.1@/tools/lib/ld.so.1@g' \ +    -e 's@/lib/ld-linux.so.2@/tools/lib/ld-linux.so.2@g' \     $SPECFILE > tempspecfile mv tempspecfile $SPECFILE unset SPECFILE We recommend that you cut-and-paste the above rather than try and type it all in. Or you can edit the specs file by hand if you want to: just replace -"/lib/ld-linux.so.2" with "/stage1/lib/ld-linux.so.2". +"/lib/ld-linux.so.2" with "/tools/lib/ld-linux.so.2". Lastly, there is a possibility that some include files from the host system have found their way into gcc's private include dir. This can happen @@ -41,7 +41,7 @@ because of GCC's "fixincludes" process which part of the GCC build. We'll explain more about this further on in this chapter. For now, run the following commands to eliminate this possibility. -rm -f /stage1/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h} +rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h} This completes the installation of the self-contained toolchain, which can now be used to build the rest of the temporary tools. diff --git a/chapter05/make-inst.xml b/chapter05/make-inst.xml index 61b64de51..7f5d2b18e 100644 --- a/chapter05/make-inst.xml +++ b/chapter05/make-inst.xml @@ -5,7 +5,7 @@ Prepare Make to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the program: diff --git a/chapter05/ncurses-inst.xml b/chapter05/ncurses-inst.xml index e5a926e17..74cf6237b 100644 --- a/chapter05/ncurses-inst.xml +++ b/chapter05/ncurses-inst.xml @@ -14,7 +14,7 @@ deprecated headers. Now prepare Ncurses to be compiled: -./configure --prefix=/stage1 --with-shared \ +./configure --prefix=/tools --with-shared \     --without-debug --without-ada Compile the programs and libraries: diff --git a/chapter05/patch-inst.xml b/chapter05/patch-inst.xml index bdc9f9fb8..3b5badbb3 100644 --- a/chapter05/patch-inst.xml +++ b/chapter05/patch-inst.xml @@ -5,7 +5,7 @@ Prepare Patch to be compiled: -CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/stage1 +CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/tools The preprocessor flag -D_GNU_SOURCE is only needed on the PowerPC platform. On other architectures you can leave it out. diff --git a/chapter05/perl-inst.xml b/chapter05/perl-inst.xml index 99292f86c..e093cb96c 100644 --- a/chapter05/perl-inst.xml +++ b/chapter05/perl-inst.xml @@ -13,7 +13,7 @@ echo 'static_ext="IO re Fcntl"' >> hints/linux.sh Now prepare Perl for compilation: -./configure.gnu --prefix=/stage1 +./configure.gnu --prefix=/tools Compile only the required tools: @@ -21,9 +21,9 @@ echo 'static_ext="IO re Fcntl"' >> hints/linux.sh Then copy these tools and their libraries: -cp perl pod/pod2man /stage1/bin -mkdir -p /stage1/lib/perl5/5.8.0 -cp -R lib/* /stage1/lib/perl5/5.8.0 +cp perl pod/pod2man /tools/bin +mkdir -p /tools/lib/perl5/5.8.0 +cp -R lib/* /tools/lib/perl5/5.8.0 diff --git a/chapter05/sed-inst.xml b/chapter05/sed-inst.xml index 79ccf256c..9a5bf4111 100644 --- a/chapter05/sed-inst.xml +++ b/chapter05/sed-inst.xml @@ -5,7 +5,7 @@ Prepare Sed to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the program: diff --git a/chapter05/setting-environment.xml b/chapter05/setting-environment.xml index 20d8f7ea1..a43e8d492 100644 --- a/chapter05/setting-environment.xml +++ b/chapter05/setting-environment.xml @@ -10,7 +10,7 @@ set +h umask 022 LFS=/mnt/lfs LC_ALL=POSIX -PATH=/stage1/bin:$PATH +PATH=/tools/bin:$PATH export LFS LC_ALL PATH EOF @@ -42,7 +42,7 @@ may cause trouble if you exit the chroot environment and wish to return later. By setting LC_ALL to "POSIX" (or "C", the two are equivalent) we ensure that everything will work as expected in the chroot environment. -We prepend /stage1/bin to the standard PATH so +We prepend /tools/bin to the standard PATH so that, as we move along through this chapter, the tools we build will get used during the rest of the building process. diff --git a/chapter05/tar-inst.xml b/chapter05/tar-inst.xml index 3a17903e7..be4c2f075 100644 --- a/chapter05/tar-inst.xml +++ b/chapter05/tar-inst.xml @@ -5,7 +5,7 @@ Prepare Tar to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the programs: diff --git a/chapter05/tcl-inst.xml b/chapter05/tcl-inst.xml index e5528c884..a0be4332d 100644 --- a/chapter05/tcl-inst.xml +++ b/chapter05/tcl-inst.xml @@ -11,7 +11,7 @@ essential, to know that our most important tools are working properly. Prepare Tcl to be compiled: cd unix -./configure --prefix=/stage1 +./configure --prefix=/tools Build, test, and install the package: @@ -24,7 +24,7 @@ This is, however, not a problem: the program will work well enough to be able to run the GCC and Binutils test suites. Make a link: -ln -s tclsh8.4 /stage1/bin/tclsh +ln -s tclsh8.4 /tools/bin/tclsh Do not remove the tcl&tcl-version; source directory yet, as the next package diff --git a/chapter05/texinfo-inst.xml b/chapter05/texinfo-inst.xml index 0249cd361..6cb7bbb0b 100644 --- a/chapter05/texinfo-inst.xml +++ b/chapter05/texinfo-inst.xml @@ -5,7 +5,7 @@ Prepare Texinfo to be compiled: -./configure --prefix=/stage1 +./configure --prefix=/tools Compile the programs: diff --git a/chapter05/utillinux-inst.xml b/chapter05/utillinux-inst.xml index 9b3bc6d63..2f7bf29c2 100644 --- a/chapter05/utillinux-inst.xml +++ b/chapter05/utillinux-inst.xml @@ -19,7 +19,7 @@ make -C text-utils more Now copy these programs to the temporary tools directory: -cp mount/{,u}mount text-utils/more /stage1/bin +cp mount/{,u}mount text-utils/more /tools/bin diff --git a/chapter06/aboutdebug.xml b/chapter06/aboutdebug.xml index d92e0abf9..141bc93d9 100644 --- a/chapter06/aboutdebug.xml +++ b/chapter06/aboutdebug.xml @@ -39,7 +39,7 @@ software, a lot of disk space can be regained by removing these symbols . To remove debugging symbols from a binary (which must be an a.out or ELF binary), run strip --strip-debug filename. Wildcards can be used to treat multiple files (use something like -strip --strip-debug $LFS/stage1/bin/*). +strip --strip-debug $LFS/tools/bin/*). For your convenience, Chapter 9 includes one simple command to strip all debugging symbols from all programs and libraries on your system. diff --git a/chapter06/adjustingtoolchain.xml b/chapter06/adjustingtoolchain.xml index 3f31d81ee..eef803d7d 100644 --- a/chapter06/adjustingtoolchain.xml +++ b/chapter06/adjustingtoolchain.xml @@ -12,14 +12,14 @@ retained the source and build directories from the second pass over Binutils. Install the adjusted linker scripts by running the following from within the binutils-build directory: -make -C ld INSTALL=/stage1/bin/install install-data-local +make -C ld INSTALL=/tools/bin/install install-data-local The linker scripts now contain -no mention of /stage1/lib anymore. +no mention of /tools/lib anymore. From now on every compiled program will link only against the libraries in /usr/lib and /lib. The extra -INSTALL=/stage1/bin/install is needed because the +INSTALL=/tools/bin/install is needed because the Makefile created during the second pass still contains the reference to /usr/bin/install, which we obviously haven't installed yet. @@ -30,9 +30,9 @@ yet. to the new dynamic linker. Just like earlier on, we use a sed to accomplish this: -SPECFILE=/stage1/lib/gcc-lib/*/*/specs -sed -e 's@/stage1/lib/ld.so.1@/lib/ld.so.1@g' \ -    -e 's@/stage1/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \ +SPECFILE=/tools/lib/gcc-lib/*/*/specs +sed -e 's@/tools/lib/ld.so.1@/lib/ld.so.1@g' \ +    -e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \     $SPECFILE > newspecfile mv newspecfile $SPECFILE unset SPECFILE @@ -42,10 +42,10 @@ before, it is a good idea to check the linker scripts and the specs file to ensure the intended changes were actually made. Note that the linker scripts will still contain a reference to -/stage1/i686-pc-linux-gnu/lib. This +/tools/i686-pc-linux-gnu/lib. This is unavoidable, but luckily does not present a problem. There are no -libraries in that location as all the temporary stage1 libraries are -located in /stage1/lib. +libraries in that location as all the temporary tools libraries are +located in /tools/lib. diff --git a/chapter06/changingowner.xml b/chapter06/changingowner.xml index 5bca385d0..2c61f61e7 100644 --- a/chapter06/changingowner.xml +++ b/chapter06/changingowner.xml @@ -2,16 +2,16 @@ Changing ownership -Right now the /stage1 directory +Right now the /tools directory is owned by the user lfs, a user that exists only on your host system. Although you will probably want to delete the -/stage1 directory once you have +/tools directory once you have finished your LFS system, you may want to keep it around, for example to build more LFS systems. But if you keep the -/stage1 directory as it is, you end up +/tools directory as it is, you end up with files owned by a user ID without a corresponding account. This is dangerous because a user account created later on could get this same user ID -and would suddenly own the /stage1 +and would suddenly own the /tools directory and all the files therein, thus exposing these files to possible malicious manipulation. @@ -19,10 +19,10 @@ malicious manipulation. your new LFS system later on when creating the /etc/passwd file, taking care to assign it the same user and group IDs as on your host system. Alternatively, you can (and the book assumes you do) assign the -contents of the /stage1 directory to +contents of the /tools directory to user root by running the following command: -chown -R 0:0 /stage1 +chown -R 0:0 /tools The command uses "0:0" instead of "root:root", because chown is unable to resolve the name "root" until glibc has been installed. diff --git a/chapter06/chroot.xml b/chapter06/chroot.xml index f86ce99f1..3664b6abe 100644 --- a/chapter06/chroot.xml +++ b/chapter06/chroot.xml @@ -10,10 +10,10 @@ can execute the chroot command. Become root and run the following command to enter the chroot environment: -chroot $LFS /stage1/bin/env -i \ +chroot $LFS /tools/bin/env -i \     HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ -    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/stage1/bin \ -    /stage1/bin/bash --login +    PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ +    /tools/bin/bash --login set +h diff --git a/chapter06/createfiles.xml b/chapter06/createfiles.xml index 4a71803b5..9c447a198 100644 --- a/chapter06/createfiles.xml +++ b/chapter06/createfiles.xml @@ -7,10 +7,10 @@ order to satisfy these programs, we create a number of symbolic links which will be replaced by real files throughout the course of this chapter when we're installing all the software. -ln -s /stage1/bin/{bash,pwd,cat,stty,echo,sed} /bin -ln -s /stage1/bin/{rm,mv,chmod,chgrp} /bin -ln -s /stage1/bin/{perl,msgfmt,xgettext,msgmerge,install} /usr/bin -ln -s /stage1/bin/{sort,gawk,cmp} /usr/bin +ln -s /tools/bin/{bash,pwd,cat,stty,echo,sed} /bin +ln -s /tools/bin/{rm,mv,chmod,chgrp} /bin +ln -s /tools/bin/{perl,msgfmt,xgettext,msgmerge,install} /usr/bin +ln -s /tools/bin/{sort,gawk,cmp} /usr/bin ln -s bash /bin/sh ln -s ../usr/bin/install /bin diff --git a/chapter06/glibc-inst.xml b/chapter06/glibc-inst.xml index da3431883..4b6d42abf 100644 --- a/chapter06/glibc-inst.xml +++ b/chapter06/glibc-inst.xml @@ -5,7 +5,7 @@ The Glibc build system is very well self-contained and will install perfectly, even though our compiler specs file and linker scripts are still -pointing at /stage1. We cannot adjust the specs and +pointing at /tools. We cannot adjust the specs and ldscripts before the Glibc install, because the Glibc autoconf tests would then give bogus results and thus defeat our goal of achieving a clean build. @@ -48,7 +48,7 @@ cause the pt_chown program to be installed in the --with-headers=/usr/include: This ensures that the kernel headers in /usr/include are used for this build. If you don't pass this switch then the headers from -/stage1/include are used which of course is not ideal +/tools/include are used which of course is not ideal (although they should be identical). Using the switch has the advantage that you will be informed immediately should you have forgotten to install the kernel headers into /usr/include. diff --git a/chapter06/introduction.xml b/chapter06/introduction.xml index 421c6eb8d..32c192852 100644 --- a/chapter06/introduction.xml +++ b/chapter06/introduction.xml @@ -25,11 +25,11 @@ optimization and see if the problem goes away. The order in which packages are installed in this chapter has to be strictly followed, to ensure that no program gets a path referring -to /stage1 hard-wired into it. +to /tools hard-wired into it. For the same reason, do not compile packages in parallel. Compiling in parallel may save you some time (especially on dual-CPU machines), but it could result in a program containing a -hard-wired path to /stage1, +hard-wired path to /tools, which will cause the program to stop working when the static directory is removed. diff --git a/chapter06/man-inst.xml b/chapter06/man-inst.xml index 5862f110c..d57b1924b 100644 --- a/chapter06/man-inst.xml +++ b/chapter06/man-inst.xml @@ -28,7 +28,7 @@ Unfortunately, the configuration script picks the last location in PATH rather than the first place a program is found. By appending /usr/bin:/bin to PATH for the ./configure command, we ensure that Man doesn't -use the programs in the /stage1 +use the programs in the /tools directory. Now prepare Man for compilation: diff --git a/chapter06/pwdgroup.xml b/chapter06/pwdgroup.xml index c26f90ae5..993228e86 100644 --- a/chapter06/pwdgroup.xml +++ b/chapter06/pwdgroup.xml @@ -46,7 +46,7 @@ the LSB () recommends only a group chosen freely by the user, as well-written packages don't depend on GID numbers but use the group's name. -exec /stage1/bin/bash --login +exec /tools/bin/bash --login set +h diff --git a/chapter06/revisedchroot.xml b/chapter06/revisedchroot.xml index 61294adb3..cf215a677 100644 --- a/chapter06/revisedchroot.xml +++ b/chapter06/revisedchroot.xml @@ -6,13 +6,13 @@ it, you need to run the following modified chroot command. The one at the beginning of this chapter might not work anymore (if your host distribution was based on Glibc-2.2.x or older, the programs in /stage1/bin, such as bash, +class="directory">/tools/bin, such as bash, will not work anymore). The following chroot command will work regardless of your host distribution's Glibc version. Additionally, now that all software has been installed there is no need to use anything from the /stage1 directory anymore. +class="directory">/tools directory anymore. chroot $LFS /usr/bin/env -i \     HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ diff --git a/chapter09/reboot.xml b/chapter09/reboot.xml index 11445d115..b3b53ea3e 100644 --- a/chapter09/reboot.xml +++ b/chapter09/reboot.xml @@ -39,11 +39,11 @@ on LFS active: /sbin/lilo -You may now remove the stage1 directory. If you think you may -need to redo Chapter 5, then you may wish to backup the directory before -removing it. To remove the stage1 directory, type the following -command: +You may now remove the tools directory. If you +think you may need to redo Chapter 5, then you may wish to backup the directory +before removing it. To remove the tools directory, type +the following command, carefully: -rm -rf /stage1 +rm -rf /tools diff --git a/entities/chapter05.ent b/entities/chapter05.ent index aca35fcb0..e0d0dfc24 100644 --- a/entities/chapter05.ent +++ b/entities/chapter05.ent @@ -1,6 +1,6 @@ - +