Renaming /stage1 to /tools.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2725 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Alex Gronenwoud 2003-09-02 22:03:51 +00:00
parent 40add94459
commit 148bb04f80
44 changed files with 120 additions and 114 deletions

View File

@ -14,10 +14,10 @@ issue the following commands to add the new user:</para>
passwd lfs</userinput></screen></para> passwd lfs</userinput></screen></para>
<para>Now grant this new user <emphasis>lfs</emphasis> full access to <para>Now grant this new user <emphasis>lfs</emphasis> full access to
<filename class="directory">$LFS/stage1</filename> by giving it ownership <filename class="directory">$LFS/tools</filename> by giving it ownership
of the directory:</para> of the directory:</para>
<para><screen><userinput>chown lfs $LFS/stage1</userinput></screen></para> <para><screen><userinput>chown lfs $LFS/tools</userinput></screen></para>
<para>Next, login as user <emphasis>lfs</emphasis>. This can be done via a <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 virtual console, through a display manager, or with the following substitute

View File

@ -10,7 +10,7 @@ patch:</para>
<para>Now prepare Bash for compilation:</para> <para>Now prepare Bash for compilation:</para>
<para><screen><userinput>./configure --prefix=/stage1 --with-curses</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools --with-curses</userinput></screen></para>
<para>Compile the program:</para> <para>Compile the program:</para>
@ -27,7 +27,7 @@ patch:</para>
<para>And make a link for the programs that use <userinput>sh</userinput> <para>And make a link for the programs that use <userinput>sh</userinput>
for a shell:</para> for a shell:</para>
<para><screen><userinput>ln -s bash /stage1/bin/sh</userinput></screen></para> <para><screen><userinput>ln -s bash /tools/bin/sh</userinput></screen></para>
</sect2> </sect2>

View File

@ -22,14 +22,14 @@ cd ../binutils-build</userinput></screen></para>
<para>Next, prepare Binutils to be compiled:</para> <para>Next, prepare Binutils to be compiled:</para>
<para><screen><userinput>../binutils-&binutils-version;/configure \ <para><screen><userinput>../binutils-&binutils-version;/configure \
&nbsp;&nbsp;&nbsp;&nbsp;--prefix=/stage1 --disable-nls</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--prefix=/tools --disable-nls</userinput></screen></para>
<para>The meaning of the configure switches:</para> <para>The meaning of the configure switches:</para>
<itemizedlist> <itemizedlist>
<listitem><para><userinput>--prefix=/stage1</userinput>: This tells the <listitem><para><userinput>--prefix=/tools</userinput>: This tells the
configure script to prepare to install the Binutils programs in the configure script to prepare to install the Binutils programs in the
<filename>/stage1</filename> directory.</para></listitem> <filename>/tools</filename> directory.</para></listitem>
<listitem><para><userinput>--disable-nls</userinput>: This disables <listitem><para><userinput>--disable-nls</userinput>: This disables
internationalization (a word often shortened to i18n). We don't need this internationalization (a word often shortened to i18n). We don't need this
for our static programs and <emphasis>nls</emphasis> often causes problems for our static programs and <emphasis>nls</emphasis> often causes problems
@ -57,7 +57,7 @@ statically.</para></listitem>
on:</para> on:</para>
<para><screen><userinput>make -C ld clean <para><screen><userinput>make -C ld clean
make -C ld LIB_PATH=/stage1/lib</userinput></screen></para> make -C ld LIB_PATH=/tools/lib</userinput></screen></para>
<para><emphasis>Do not yet remove</emphasis> the Binutils build and source <para><emphasis>Do not yet remove</emphasis> the Binutils build and source
directories. You will need them again in their current state a bit further on directories. You will need them again in their current state a bit further on

View File

@ -10,8 +10,8 @@ cd ../binutils-build</userinput></screen></para>
<para>Now prepare Binutils to be compiled:</para> <para>Now prepare Binutils to be compiled:</para>
<para><screen><userinput>../binutils-&binutils-version;/configure --prefix=/stage1 \ <para><screen><userinput>../binutils-&binutils-version;/configure --prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-shared --with-lib-path=/stage1/lib</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--enable-shared --with-lib-path=/tools/lib</userinput></screen></para>
<para>Before starting to build Binutils, remember to unset any environment <para>Before starting to build Binutils, remember to unset any environment
variables that override the default optimization flags.</para> variables that override the default optimization flags.</para>

View File

@ -6,7 +6,7 @@
<para>The Bzip2 package doesn't contain a <userinput>configure</userinput> <para>The Bzip2 package doesn't contain a <userinput>configure</userinput>
script. Compile and install it with a straightforward:</para> script. Compile and install it with a straightforward:</para>
<para><screen><userinput>make PREFIX=/stage1 install</userinput></screen></para> <para><screen><userinput>make PREFIX=/tools install</userinput></screen></para>
</sect2> </sect2>

View File

@ -4,7 +4,7 @@
&c5-introduction; &c5-introduction;
&c5-whystatic; &c5-whystatic;
&c5-creatingstage1dir; &c5-creatingtoolsdir;
&c5-addinguser; &c5-addinguser;
&c5-settingenviron; &c5-settingenviron;
&c5-binutils-pass1; &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 built so far contain about 130 MB of unneeded debugging symbols. Remove those
symbols like this:</para> symbols like this:</para>
<para><screen><userinput>strip --strip-unneeded /stage1/{,s}bin/* <para><screen><userinput>strip --strip-unneeded /tools/{,s}bin/*
strip --strip-debug /stage1/lib/*</userinput></screen></para> strip --strip-debug /tools/lib/*</userinput></screen></para>
<para>The first of the above commands will skip some twenty files, reporting <para>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 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.</para>
<para>To save another couple of megabytes, you can throw away the documentation <para>To save another couple of megabytes, you can throw away the documentation
and some of the bigger unneeded programs:</para> and some of the bigger unneeded programs:</para>
<para><screen><userinput>rm -r /stage1/share/{doc,info,man} <para><screen><userinput>rm -r /tools/share/{doc,info,man}
rm /stage1/bin/{addr2line,gprof,nm,size,strings,strip}</userinput></screen></para> rm /tools/bin/{addr2line,gprof,nm,size,strings,strip}</userinput></screen></para>
<para>You will now need to have at least 700 MB of free space on your LFS <para>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.</para> filesystem to be able to build and install Glibc in the next phase.</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Coreutils to be compiled:</para> <para>Prepare Coreutils to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -1,24 +1,30 @@
<sect1 id="ch05-creatingstage1dir"> <sect1 id="ch05-creatingtoolsdir">
<title>Creating the $LFS/stage1 directory</title> <title>Creating the $LFS/tools directory</title>
<?dbhtml filename="creatingstage1dir.html" dir="chapter05"?> <?dbhtml filename="creatingtoolsdir.html" dir="chapter05"?>
<para>All programs compiled in this chapter will be installed under <filename <para>All programs compiled in this chapter will be installed under <filename
class="directory">$LFS/stage1</filename> to keep them separate from the class="directory">$LFS/tools</filename> to keep them separate from the
programs compiled in the next chapter. The programs compiled here are only 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 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 in a separate directory, we can later easily throw them away.</para>
required directory by running the following:</para>
<para><screen><userinput>mkdir $LFS/stage1</userinput></screen></para> <para>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".</para>
<para>The next step is to create a <filename>/stage1</filename> symlink on <para>Create the required directory by running the following:</para>
<para><screen><userinput>mkdir $LFS/tools</userinput></screen></para>
<para>The next step is to create a <filename>/tools</filename> symlink on
your host system. It will point to the directory we just created on the LFS your host system. It will point to the directory we just created on the LFS
partition:</para> partition:</para>
<para><screen><userinput>ln -s $LFS/stage1 /</userinput></screen></para> <para><screen><userinput>ln -s $LFS/tools /</userinput></screen></para>
<para>This symlink enables us to compile our toolchain so that it always <para>This symlink enables us to compile our toolchain so that it always
refers to <filename>/stage1</filename>, meaning that the compiler, assembler refers to <filename>/tools</filename>, meaning that the compiler, assembler
and linker will work both in this chapter (when we are still using some tools and linker will work both in this chapter (when we are still using some tools
from the host) <emphasis>and</emphasis> in the next (when we are chrooted to from the host) <emphasis>and</emphasis> in the next (when we are chrooted to
the LFS partition).</para> the LFS partition).</para>

View File

@ -5,7 +5,7 @@
<para>Prepare DejaGNU to be compiled:</para> <para>Prepare DejaGNU to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Build and install the package:</para> <para>Build and install the package:</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Diffutils to be compiled:</para> <para>Prepare Diffutils to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -12,7 +12,7 @@ GCC test suite run.</para>
<para>Now prepare Expect to be compiled:</para> <para>Now prepare Expect to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1 --with-tcl=/stage1/lib --with-x=no</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools --with-tcl=/tools/lib --with-x=no</userinput></screen></para>
<para>Build, test, and install the package:</para> <para>Build, test, and install the package:</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Findutils to be compiled:</para> <para>Prepare Findutils to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Gawk to be compiled:</para> <para>Prepare Gawk to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -20,15 +20,15 @@ cd ../gcc-build</userinput></screen></para>
<para>Prepare GCC to be compiled:</para> <para>Prepare GCC to be compiled:</para>
<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/stage1 \ <para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--with-local-prefix=/stage1 \ &nbsp;&nbsp;&nbsp;&nbsp;--with-local-prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--disable-nls --enable-shared \ &nbsp;&nbsp;&nbsp;&nbsp;--disable-nls --enable-shared \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-languages=c</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--enable-languages=c</userinput></screen></para>
<para>The meaning of the new configure options:</para> <para>The meaning of the new configure options:</para>
<itemizedlist> <itemizedlist>
<listitem><para><userinput>--with-local-prefix=/stage1</userinput>: The <listitem><para><userinput>--with-local-prefix=/tools</userinput>: The
purpose of this switch is to remove <filename>/usr/local/include</filename> purpose of this switch is to remove <filename>/usr/local/include</filename>
from <userinput>gcc</userinput>'s include search path. This is not absolutely from <userinput>gcc</userinput>'s include search path. This is not absolutely
essential, but we want to try and minimize the influence from the host system, essential, but we want to try and minimize the influence from the host system,
@ -71,14 +71,14 @@ compiled correctly.</para></listitem>
<para><screen><userinput>make install</userinput></screen></para> <para><screen><userinput>make install</userinput></screen></para>
<para>As a finishing touch we'll create the <filename <para>As a finishing touch we'll create the <filename
class="symlink">/stage1/bin/cc</filename> symlink. Many programs and class="symlink">/tools/bin/cc</filename> symlink. Many programs and
scripts run <userinput>cc</userinput> instead of <userinput>gcc</userinput>, scripts run <userinput>cc</userinput> instead of <userinput>gcc</userinput>,
a thing meant to keep programs generic and therefore usable on all kinds of 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 Unix systems. Not everybody has the GNU C compiler installed. Simply running
<userinput>cc</userinput> leaves the system administrator free to decide what <userinput>cc</userinput> leaves the system administrator free to decide what
C compiler to install, as long as there's a symlink pointing to it:</para> C compiler to install, as long as there's a symlink pointing to it:</para>
<para><screen><userinput>ln -sf gcc /stage1/bin/cc</userinput></screen></para> <para><screen><userinput>ln -sf gcc /tools/bin/cc</userinput></screen></para>
</sect2> </sect2>

View File

@ -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.</para> version actually used for the LFS system.</para>
<para>The last patch changes GCC's default location of the dynamic linker, <para>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 <filename>config/i386/linux.h</filename>. Patching now rather than adjusting in <filename>config/i386/linux.h</filename>. Patching now rather than adjusting
the specs file after installation ensures that our new dynamic linker gets 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) 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.</para>
<para>Now prepare GCC to be compiled:</para> <para>Now prepare GCC to be compiled:</para>
<para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/stage1 \ <para><screen><userinput>../gcc-&gcc-version;/configure --prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--with-local-prefix=/stage1 \ &nbsp;&nbsp;&nbsp;&nbsp;--with-local-prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-clocale=gnu --enable-shared \ &nbsp;&nbsp;&nbsp;&nbsp;--enable-clocale=gnu --enable-shared \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-threads=posix --enable-__cxa_atexit \ &nbsp;&nbsp;&nbsp;&nbsp;--enable-threads=posix --enable-__cxa_atexit \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-languages=c,c++</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--enable-languages=c,c++</userinput></screen></para>

View File

@ -5,7 +5,7 @@
<para>Prepare Gettext to be compiled:</para> <para>Prepare Gettext to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the programs:</para> <para>Compile the programs:</para>

View File

@ -21,8 +21,8 @@ is putting the stability of your system at risk.</para>
complain about the absence of <filename>/etc/ld.so.conf</filename>. complain about the absence of <filename>/etc/ld.so.conf</filename>.
Fix this annoying little error with:</para> Fix this annoying little error with:</para>
<para><screen><userinput>mkdir /stage1/etc <para><screen><userinput>mkdir /tools/etc
touch /stage1/etc/ld.so.conf</userinput></screen></para> touch /tools/etc/ld.so.conf</userinput></screen></para>
<para>Also, Glibc has a subtle problem when compiled with GCC 3.3.1. <para>Also, Glibc has a subtle problem when compiled with GCC 3.3.1.
Apply the following patch to fix this:</para> Apply the following patch to fix this:</para>
@ -38,10 +38,10 @@ cd ../glibc-build</userinput></screen></para>
<para>Next, prepare Glibc to be compiled:</para> <para>Next, prepare Glibc to be compiled:</para>
<para><screen><userinput>../glibc-&glibc-version;/configure --prefix=/stage1 \ <para><screen><userinput>../glibc-&glibc-version;/configure --prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--disable-profile --enable-add-ons \ &nbsp;&nbsp;&nbsp;&nbsp;--disable-profile --enable-add-ons \
&nbsp;&nbsp;&nbsp;&nbsp;--with-headers=/stage1/include \ &nbsp;&nbsp;&nbsp;&nbsp;--with-headers=/tools/include \
&nbsp;&nbsp;&nbsp;&nbsp;--with-binutils=/stage1/bin \ &nbsp;&nbsp;&nbsp;&nbsp;--with-binutils=/tools/bin \
&nbsp;&nbsp;&nbsp;&nbsp;--without-gd</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--without-gd</userinput></screen></para>
<para>The meaning of the new configure options:</para> <para>The meaning of the new configure options:</para>
@ -54,8 +54,8 @@ plan to do profiling.</para></listitem>
<listitem><para><userinput>--enable-add-ons</userinput>: This enables any <listitem><para><userinput>--enable-add-ons</userinput>: This enables any
add-ons that were installed with Glibc, in our case Linuxthreads.</para></listitem> add-ons that were installed with Glibc, in our case Linuxthreads.</para></listitem>
<listitem><para><userinput>--with-binutils=/stage1/bin</userinput> and <listitem><para><userinput>--with-binutils=/tools/bin</userinput> and
<userinput>--with-headers=/stage1/include</userinput>: Strictly speaking <userinput>--with-headers=/tools/include</userinput>: Strictly speaking
these switches are not required. But they ensure nothing can go wrong with 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 regard to what kernel headers and Binutils programs get used during the
Glibc build.</para></listitem> Glibc build.</para></listitem>

View File

@ -5,7 +5,7 @@
<para>Prepare Grep to be compiled:</para> <para>Prepare Grep to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1 \ <para><screen><userinput>./configure --prefix=/tools \
&nbsp;&nbsp;&nbsp;&nbsp;--disable-perl-regexp --with-included-regex</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--disable-perl-regexp --with-included-regex</userinput></screen></para>
<para>Compile the programs:</para> <para>Compile the programs:</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Gzip to be compiled:</para> <para>Prepare Gzip to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the package:</para> <para>Compile the package:</para>

View File

@ -12,7 +12,7 @@ linker and libraries), and then use this to build all the other essential
tools.</para> tools.</para>
<para>The files compiled in this chapter will be installed under the <para>The files compiled in this chapter will be installed under the
<filename class="directory">$LFS/stage1</filename> directory, <filename class="directory">$LFS/tools</filename> directory,
to keep them separate from the files installed in the next chapter. to keep them separate from the files installed in the next chapter.
Since the packages compiled here are merely temporary, we don't want Since the packages compiled here are merely temporary, we don't want
them to pollute the soon-to-be LFS system.</para> them to pollute the soon-to-be LFS system.</para>

View File

@ -27,20 +27,20 @@ symlink:</para>
<para>Install the platform-specific header files:</para> <para>Install the platform-specific header files:</para>
<para><screen><userinput>mkdir /stage1/include/asm <para><screen><userinput>mkdir /tools/include/asm
cp include/asm/* /stage1/include/asm cp include/asm/* /tools/include/asm
cp -R include/asm-generic /stage1/include</userinput></screen></para> cp -R include/asm-generic /tools/include</userinput></screen></para>
<para>Install the cross-platform kernel header files:</para> <para>Install the cross-platform kernel header files:</para>
<para><screen><userinput>cp -R include/linux /stage1/include</userinput></screen></para> <para><screen><userinput>cp -R include/linux /tools/include</userinput></screen></para>
<para>There are a few kernel header files which make use of the <para>There are a few kernel header files which make use of the
<filename>autoconf.h</filename> header file. Since we do not yet configure the <filename>autoconf.h</filename> header file. Since we do not yet configure the
kernel, we need to create this file ourselves in order to avoid compilation kernel, we need to create this file ourselves in order to avoid compilation
failures. Create an empty <filename>autoconf.h</filename> file:</para> failures. Create an empty <filename>autoconf.h</filename> file:</para>
<para><screen><userinput>touch /stage1/include/linux/autoconf.h</userinput></screen></para> <para><screen><userinput>touch /tools/include/linux/autoconf.h</userinput></screen></para>
</sect2> </sect2>

View File

@ -17,23 +17,23 @@ directory:</para>
pass of Binutils, and contain no mention of <filename>/lib</filename>, pass of Binutils, and contain no mention of <filename>/lib</filename>,
<filename>/usr/lib</filename> or <filename>/usr/local/lib</filename>. <filename>/usr/lib</filename> or <filename>/usr/local/lib</filename>.
From this point onwards everything will link <emphasis>only</emphasis> From this point onwards everything will link <emphasis>only</emphasis>
against the libraries in <filename>/stage1/lib</filename>.</para> against the libraries in <filename>/tools/lib</filename>.</para>
<para>You can now remove Binutils' build and source directories.</para> <para>You can now remove Binutils' build and source directories.</para>
<para>The other thing to do is to amend our GCC specs file so that it points <para>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:</para> to the new dynamic linker. A simple sed will accomplish this:</para>
<para><screen><userinput>SPECFILE=/stage1/lib/gcc-lib/*/*/specs <para><screen><userinput>SPECFILE=/tools/lib/gcc-lib/*/*/specs
sed -e 's@/lib/ld.so.1@/stage1/lib/ld.so.1@g' \ sed -e 's@/lib/ld.so.1@/tools/lib/ld.so.1@g' \
&nbsp;&nbsp;&nbsp;&nbsp;-e 's@/lib/ld-linux.so.2@/stage1/lib/ld-linux.so.2@g' \ &nbsp;&nbsp;&nbsp;&nbsp;-e 's@/lib/ld-linux.so.2@/tools/lib/ld-linux.so.2@g' \
&nbsp;&nbsp;&nbsp;&nbsp;$SPECFILE > tempspecfile &nbsp;&nbsp;&nbsp;&nbsp;$SPECFILE > tempspecfile
mv tempspecfile $SPECFILE mv tempspecfile $SPECFILE
unset SPECFILE</userinput></screen></para> unset SPECFILE</userinput></screen></para>
<para>We recommend that you cut-and-paste the above rather than try and type <para>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 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".</para> "/lib/ld-linux.so.2" with "/tools/lib/ld-linux.so.2".</para>
<para>Lastly, there is a possibility that some include files from the host <para>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 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 explain more about this further on in this chapter. For now, run the
following commands to eliminate this possibility.</para> following commands to eliminate this possibility.</para>
<para><screen><userinput>rm -f /stage1/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}</userinput></screen></para> <para><screen><userinput>rm -f /tools/lib/gcc-lib/*/*/include/{pthread.h,bits/sigthread.h}</userinput></screen></para>
<para>This completes the installation of the self-contained toolchain, which <para>This completes the installation of the self-contained toolchain, which
can now be used to build the rest of the temporary tools.</para> can now be used to build the rest of the temporary tools.</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Make to be compiled:</para> <para>Prepare Make to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the program:</para> <para>Compile the program:</para>

View File

@ -14,7 +14,7 @@ deprecated headers.</para>
<para>Now prepare Ncurses to be compiled:</para> <para>Now prepare Ncurses to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1 --with-shared \ <para><screen><userinput>./configure --prefix=/tools --with-shared \
&nbsp;&nbsp;&nbsp;&nbsp;--without-debug --without-ada</userinput></screen></para> &nbsp;&nbsp;&nbsp;&nbsp;--without-debug --without-ada</userinput></screen></para>
<para>Compile the programs and libraries:</para> <para>Compile the programs and libraries:</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Patch to be compiled:</para> <para>Prepare Patch to be compiled:</para>
<para><screen><userinput>CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>CPPFLAGS=-D_GNU_SOURCE ./configure --prefix=/tools</userinput></screen></para>
<para>The preprocessor flag <userinput>-D_GNU_SOURCE</userinput> is only needed <para>The preprocessor flag <userinput>-D_GNU_SOURCE</userinput> is only needed
on the PowerPC platform. On other architectures you can leave it out.</para> on the PowerPC platform. On other architectures you can leave it out.</para>

View File

@ -13,7 +13,7 @@ echo 'static_ext="IO re Fcntl"' >> hints/linux.sh</userinput></screen></para>
<para>Now prepare Perl for compilation:</para> <para>Now prepare Perl for compilation:</para>
<para><screen><userinput>./configure.gnu --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure.gnu --prefix=/tools</userinput></screen></para>
<para>Compile only the required tools:</para> <para>Compile only the required tools:</para>
@ -21,9 +21,9 @@ echo 'static_ext="IO re Fcntl"' >> hints/linux.sh</userinput></screen></para>
<para>Then copy these tools and their libraries:</para> <para>Then copy these tools and their libraries:</para>
<para><screen><userinput>cp perl pod/pod2man /stage1/bin <para><screen><userinput>cp perl pod/pod2man /tools/bin
mkdir -p /stage1/lib/perl5/5.8.0 mkdir -p /tools/lib/perl5/5.8.0
cp -R lib/* /stage1/lib/perl5/5.8.0</userinput></screen></para> cp -R lib/* /tools/lib/perl5/5.8.0</userinput></screen></para>
</sect2> </sect2>

View File

@ -5,7 +5,7 @@
<para>Prepare Sed to be compiled:</para> <para>Prepare Sed to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the program:</para> <para>Compile the program:</para>

View File

@ -10,7 +10,7 @@ set +h
umask 022 umask 022
LFS=/mnt/lfs LFS=/mnt/lfs
LC_ALL=POSIX LC_ALL=POSIX
PATH=/stage1/bin:$PATH PATH=/tools/bin:$PATH
export LFS LC_ALL PATH export LFS LC_ALL PATH
EOF 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 By setting LC_ALL to "POSIX" (or "C", the two are equivalent) we ensure that
everything will work as expected in the chroot environment.</para> everything will work as expected in the chroot environment.</para>
<para>We prepend <filename>/stage1/bin</filename> to the standard PATH so <para>We prepend <filename>/tools/bin</filename> to the standard PATH so
that, as we move along through this chapter, the tools we build will get used that, as we move along through this chapter, the tools we build will get used
during the rest of the building process.</para> during the rest of the building process.</para>

View File

@ -5,7 +5,7 @@
<para>Prepare Tar to be compiled:</para> <para>Prepare Tar to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the programs:</para> <para>Compile the programs:</para>

View File

@ -11,7 +11,7 @@ essential, to know that our most important tools are working properly.</para>
<para>Prepare Tcl to be compiled:</para> <para>Prepare Tcl to be compiled:</para>
<para><screen><userinput>cd unix <para><screen><userinput>cd unix
./configure --prefix=/stage1</userinput></screen></para> ./configure --prefix=/tools</userinput></screen></para>
<para>Build, test, and install the package:</para> <para>Build, test, and install the package:</para>
@ -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.</para> to run the GCC and Binutils test suites.</para>
<para>Make a link:</para> <para>Make a link:</para>
<para><screen><userinput>ln -s tclsh8.4 /stage1/bin/tclsh</userinput></screen></para> <para><screen><userinput>ln -s tclsh8.4 /tools/bin/tclsh</userinput></screen></para>
<caution><para><emphasis>Do not remove</emphasis> the <caution><para><emphasis>Do not remove</emphasis> the
<filename>tcl&tcl-version;</filename> source directory yet, as the next package <filename>tcl&tcl-version;</filename> source directory yet, as the next package

View File

@ -5,7 +5,7 @@
<para>Prepare Texinfo to be compiled:</para> <para>Prepare Texinfo to be compiled:</para>
<para><screen><userinput>./configure --prefix=/stage1</userinput></screen></para> <para><screen><userinput>./configure --prefix=/tools</userinput></screen></para>
<para>Compile the programs:</para> <para>Compile the programs:</para>

View File

@ -19,7 +19,7 @@ make -C text-utils more</userinput></screen></para>
<para>Now copy these programs to the temporary tools directory:</para> <para>Now copy these programs to the temporary tools directory:</para>
<para><screen><userinput>cp mount/{,u}mount text-utils/more /stage1/bin</userinput></screen></para> <para><screen><userinput>cp mount/{,u}mount text-utils/more /tools/bin</userinput></screen></para>
</sect2> </sect2>

View File

@ -39,7 +39,7 @@ software, a lot of disk space can be regained by removing these symbols .</para>
<para>To remove debugging symbols from a binary (which must be an a.out <para>To remove debugging symbols from a binary (which must be an a.out
or ELF binary), run <userinput>strip --strip-debug filename</userinput>. or ELF binary), run <userinput>strip --strip-debug filename</userinput>.
Wildcards can be used to treat multiple files (use something like Wildcards can be used to treat multiple files (use something like
<userinput>strip --strip-debug $LFS/stage1/bin/*</userinput>).</para> <userinput>strip --strip-debug $LFS/tools/bin/*</userinput>).</para>
<para>For your convenience, Chapter 9 includes one simple command to strip <para>For your convenience, Chapter 9 includes one simple command to strip
all debugging symbols from all programs and libraries on your system. all debugging symbols from all programs and libraries on your system.

View File

@ -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 Install the adjusted linker scripts by running the following from within the
<filename class="directory">binutils-build</filename> directory:</para> <filename class="directory">binutils-build</filename> directory:</para>
<para><screen><userinput>make -C ld INSTALL=/stage1/bin/install install-data-local</userinput></screen></para> <para><screen><userinput>make -C ld INSTALL=/tools/bin/install install-data-local</userinput></screen></para>
<para>The linker scripts now contain <para>The linker scripts now contain
no mention of <filename class="directory">/stage1/lib</filename> anymore. no mention of <filename class="directory">/tools/lib</filename> anymore.
From now on every compiled program will link <emphasis>only</emphasis> From now on every compiled program will link <emphasis>only</emphasis>
against the libraries in <filename>/usr/lib</filename> and against the libraries in <filename>/usr/lib</filename> and
<filename>/lib</filename>. The extra <filename>/lib</filename>. The extra
<userinput>INSTALL=/stage1/bin/install</userinput> is needed because the <userinput>INSTALL=/tools/bin/install</userinput> is needed because the
Makefile created during the second pass still contains the reference to Makefile created during the second pass still contains the reference to
<filename>/usr/bin/install</filename>, which we obviously haven't installed <filename>/usr/bin/install</filename>, which we obviously haven't installed
yet.</para> yet.</para>
@ -30,9 +30,9 @@ yet.</para>
to the new dynamic linker. Just like earlier on, we use a sed to accomplish to the new dynamic linker. Just like earlier on, we use a sed to accomplish
this:</para> this:</para>
<para><screen><userinput>SPECFILE=/stage1/lib/gcc-lib/*/*/specs <para><screen><userinput>SPECFILE=/tools/lib/gcc-lib/*/*/specs
sed -e 's@/stage1/lib/ld.so.1@/lib/ld.so.1@g' \ sed -e 's@/tools/lib/ld.so.1@/lib/ld.so.1@g' \
&nbsp;&nbsp;&nbsp;&nbsp;-e 's@/stage1/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \ &nbsp;&nbsp;&nbsp;&nbsp;-e 's@/tools/lib/ld-linux.so.2@/lib/ld-linux.so.2@g' \
&nbsp;&nbsp;&nbsp;&nbsp;$SPECFILE > newspecfile &nbsp;&nbsp;&nbsp;&nbsp;$SPECFILE > newspecfile
mv newspecfile $SPECFILE mv newspecfile $SPECFILE
unset SPECFILE</userinput></screen></para> unset SPECFILE</userinput></screen></para>
@ -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.</para> ensure the intended changes were actually made.</para>
<para>Note that the linker scripts will still contain a reference to <para>Note that the linker scripts will still contain a reference to
<filename class="directory">/stage1/i686-pc-linux-gnu/lib</filename>. This <filename class="directory">/tools/i686-pc-linux-gnu/lib</filename>. This
is unavoidable, but luckily does not present a problem. There are no is unavoidable, but luckily does not present a problem. There are no
libraries in that location as all the temporary stage1 libraries are libraries in that location as all the temporary tools libraries are
located in <filename class="directory">/stage1/lib</filename>.</para> located in <filename class="directory">/tools/lib</filename>.</para>
</sect1> </sect1>

View File

@ -2,16 +2,16 @@
<title>Changing ownership</title> <title>Changing ownership</title>
<?dbhtml filename="changingowner.html" dir="chapter06"?> <?dbhtml filename="changingowner.html" dir="chapter06"?>
<para>Right now the <filename class="directory">/stage1</filename> directory <para>Right now the <filename class="directory">/tools</filename> directory
is owned by the user <emphasis>lfs</emphasis>, a user that exists only on your is owned by the user <emphasis>lfs</emphasis>, a user that exists only on your
host system. Although you will probably want to delete the host system. Although you will probably want to delete the
<filename class="directory">/stage1</filename> directory once you have <filename class="directory">/tools</filename> directory once you have
finished your LFS system, you may want to keep it around, for example to finished your LFS system, you may want to keep it around, for example to
build more LFS systems. But if you keep the build more LFS systems. But if you keep the
<filename class="directory">/stage1</filename> directory as it is, you end up <filename class="directory">/tools</filename> directory as it is, you end up
with files owned by a user ID without a corresponding account. This is 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 dangerous because a user account created later on could get this same user ID
and would suddenly own the <filename class="directory">/stage1</filename> and would suddenly own the <filename class="directory">/tools</filename>
directory and all the files therein, thus exposing these files to possible directory and all the files therein, thus exposing these files to possible
malicious manipulation.</para> malicious manipulation.</para>
@ -19,10 +19,10 @@ malicious manipulation.</para>
your new LFS system later on when creating the <filename>/etc/passwd</filename> your new LFS system later on when creating the <filename>/etc/passwd</filename>
file, taking care to assign it the same user and group IDs as on your host 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 system. Alternatively, you can (and the book assumes you do) assign the
contents of the <filename class="directory">/stage1</filename> directory to contents of the <filename class="directory">/tools</filename> directory to
user <emphasis>root</emphasis> by running the following command:</para> user <emphasis>root</emphasis> by running the following command:</para>
<para><screen><userinput>chown -R 0:0 /stage1</userinput></screen></para> <para><screen><userinput>chown -R 0:0 /tools</userinput></screen></para>
<para>The command uses "0:0" instead of "root:root", because chown is unable <para>The command uses "0:0" instead of "root:root", because chown is unable
to resolve the name "root" until glibc has been installed.</para> to resolve the name "root" until glibc has been installed.</para>

View File

@ -10,10 +10,10 @@ can execute the <userinput>chroot</userinput> command.</para>
<para>Become <emphasis>root</emphasis> and run the following command <para>Become <emphasis>root</emphasis> and run the following command
to enter the chroot environment:</para> to enter the chroot environment:</para>
<para><screen><userinput>chroot $LFS /stage1/bin/env -i \ <para><screen><userinput>chroot $LFS /tools/bin/env -i \
&nbsp;&nbsp;&nbsp;&nbsp;HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ &nbsp;&nbsp;&nbsp;&nbsp;HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
&nbsp;&nbsp;&nbsp;&nbsp;PATH=/bin:/usr/bin:/sbin:/usr/sbin:/stage1/bin \ &nbsp;&nbsp;&nbsp;&nbsp;PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
&nbsp;&nbsp;&nbsp;&nbsp;/stage1/bin/bash --login</userinput></screen> &nbsp;&nbsp;&nbsp;&nbsp;/tools/bin/bash --login</userinput></screen>
</para> </para>
<para><screen><userinput>set +h</userinput></screen></para> <para><screen><userinput>set +h</userinput></screen></para>

View File

@ -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 will be replaced by real files throughout the course of this chapter when
we're installing all the software.</para> we're installing all the software.</para>
<para><screen><userinput>ln -s /stage1/bin/{bash,pwd,cat,stty,echo,sed} /bin <para><screen><userinput>ln -s /tools/bin/{bash,pwd,cat,stty,echo,sed} /bin
ln -s /stage1/bin/{rm,mv,chmod,chgrp} /bin ln -s /tools/bin/{rm,mv,chmod,chgrp} /bin
ln -s /stage1/bin/{perl,msgfmt,xgettext,msgmerge,install} /usr/bin ln -s /tools/bin/{perl,msgfmt,xgettext,msgmerge,install} /usr/bin
ln -s /stage1/bin/{sort,gawk,cmp} /usr/bin ln -s /tools/bin/{sort,gawk,cmp} /usr/bin
ln -s bash /bin/sh ln -s bash /bin/sh
ln -s ../usr/bin/install /bin</userinput></screen></para> ln -s ../usr/bin/install /bin</userinput></screen></para>

View File

@ -5,7 +5,7 @@
<para>The Glibc build system is very well self-contained and will install <para>The Glibc build system is very well self-contained and will install
perfectly, even though our compiler specs file and linker scripts are still perfectly, even though our compiler specs file and linker scripts are still
pointing at <filename>/stage1</filename>. We cannot adjust the specs and pointing at <filename>/tools</filename>. We cannot adjust the specs and
ldscripts before the Glibc install, because the Glibc autoconf tests would then 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.</para> give bogus results and thus defeat our goal of achieving a clean build.</para>
@ -48,7 +48,7 @@ cause the <filename>pt_chown</filename> program to be installed in the
<listitem><para><userinput>--with-headers=/usr/include</userinput>: This <listitem><para><userinput>--with-headers=/usr/include</userinput>: This
ensures that the kernel headers in <filename>/usr/include</filename> are used ensures that the kernel headers in <filename>/usr/include</filename> are used
for this build. If you don't pass this switch then the headers from for this build. If you don't pass this switch then the headers from
<filename>/stage1/include</filename> are used which of course is not ideal <filename>/tools/include</filename> are used which of course is not ideal
(although they should be identical). Using the switch has the advantage (although they should be identical). Using the switch has the advantage
that you will be informed immediately should you have forgotten to install the that you will be informed immediately should you have forgotten to install the
kernel headers into <filename>/usr/include</filename>.</para></listitem> kernel headers into <filename>/usr/include</filename>.</para></listitem>

View File

@ -25,11 +25,11 @@ optimization and see if the problem goes away.</para>
<para>The order in which packages are installed in this chapter has <para>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 be strictly followed, to ensure that no program gets a path referring
to <filename class="directory">/stage1</filename> hard-wired into it. to <filename class="directory">/tools</filename> hard-wired into it.
For the same reason, <emphasis>do not </emphasis> compile packages For the same reason, <emphasis>do not </emphasis> compile packages
in parallel. Compiling in parallel may save you some time (especially on in parallel. Compiling in parallel may save you some time (especially on
dual-CPU machines), but it could result in a program containing a dual-CPU machines), but it could result in a program containing a
hard-wired path to <filename class="directory">/stage1</filename>, hard-wired path to <filename class="directory">/tools</filename>,
which will cause the program to stop working when the static directory which will cause the program to stop working when the static directory
is removed.</para> is removed.</para>

View File

@ -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 rather than the first place a program is found. By appending
<emphasis>/usr/bin:/bin</emphasis> to PATH for the <emphasis>/usr/bin:/bin</emphasis> to PATH for the
<userinput>./configure</userinput> command, we ensure that Man doesn't <userinput>./configure</userinput> command, we ensure that Man doesn't
use the programs in the <filename class="directory">/stage1</filename> use the programs in the <filename class="directory">/tools</filename>
directory.</para> directory.</para>
<para>Now prepare Man for compilation:</para> <para>Now prepare Man for compilation:</para>

View File

@ -46,7 +46,7 @@ the LSB (<ulink url="http://www.linuxbase.org"/>) recommends only a group
chosen freely by the user, as well-written packages don't depend on GID chosen freely by the user, as well-written packages don't depend on GID
numbers but use the group's name.</para> numbers but use the group's name.</para>
<para><screen><userinput>exec /stage1/bin/bash --login <para><screen><userinput>exec /tools/bin/bash --login
set +h</userinput></screen></para> set +h</userinput></screen></para>
</sect1> </sect1>

View File

@ -6,13 +6,13 @@
it, you need to run the following modified chroot command. The one at the 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 beginning of this chapter might not work anymore (if your host distribution
was based on Glibc-2.2.x or older, the programs in <filename was based on Glibc-2.2.x or older, the programs in <filename
class="directory">/stage1/bin</filename>, such as <filename>bash</filename>, class="directory">/tools/bin</filename>, such as <filename>bash</filename>,
will not work anymore). The following chroot command will work regardless will not work anymore). The following chroot command will work regardless
of your host distribution's Glibc version.</para> of your host distribution's Glibc version.</para>
<para>Additionally, now that all software has been installed there is no <para>Additionally, now that all software has been installed there is no
need to use anything from the <filename need to use anything from the <filename
class="directory">/stage1</filename> directory anymore.</para> class="directory">/tools</filename> directory anymore.</para>
<para><screen><userinput>chroot $LFS /usr/bin/env -i \ <para><screen><userinput>chroot $LFS /usr/bin/env -i \
&nbsp;&nbsp;&nbsp;&nbsp;HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ &nbsp;&nbsp;&nbsp;&nbsp;HOME=/root TERM=$TERM PS1='\u:\w\$ ' \

View File

@ -39,11 +39,11 @@ on LFS active:</para>
<para><screen><userinput>/sbin/lilo</userinput></screen></para> <para><screen><userinput>/sbin/lilo</userinput></screen></para>
<para>You may now remove the stage1 directory. If you think you may <para>You may now remove the <filename>tools</filename> directory. If you
need to redo Chapter 5, then you may wish to backup the directory before think you may need to redo Chapter 5, then you may wish to backup the directory
removing it. To remove the stage1 directory, type the following before removing it. To remove the <filename>tools</filename> directory, type
command:</para> the following command, carefully:</para>
<para><screen><userinput>rm -rf /stage1</userinput></screen></para> <para><screen><userinput>rm -rf /tools</userinput></screen></para>
</sect1> </sect1>

View File

@ -1,6 +1,6 @@
<!ENTITY chapter05 SYSTEM "../chapter05/chapter05.xml"> <!ENTITY chapter05 SYSTEM "../chapter05/chapter05.xml">
<!ENTITY c5-introduction SYSTEM "../chapter05/introduction.xml"> <!ENTITY c5-introduction SYSTEM "../chapter05/introduction.xml">
<!ENTITY c5-whystatic SYSTEM "../chapter05/whystatic.xml"> <!ENTITY c5-whystatic SYSTEM "../chapter05/whystatic.xml">
<!ENTITY c5-creatingstage1dir SYSTEM "../chapter05/creatingstage1dir.xml"> <!ENTITY c5-creatingtoolsdir SYSTEM "../chapter05/creatingstage1dir.xml">
<!ENTITY c5-addinguser SYSTEM "../chapter05/adding-user.xml"> <!ENTITY c5-addinguser SYSTEM "../chapter05/adding-user.xml">
<!ENTITY c5-settingenviron SYSTEM "../chapter05/setting-environment.xml"> <!ENTITY c5-settingenviron SYSTEM "../chapter05/setting-environment.xml">