last text additions in chapter 5, added a section on stripping

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2672 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Alex Gronenwoud 2003-08-18 20:53:34 +00:00
parent 2cff2cc411
commit 69a52c1270
4 changed files with 86 additions and 38 deletions

View File

@ -3,37 +3,31 @@
<sect2> <sect2>
<title>Installation of Bash</title> <title>Installation of Bash</title>
<para>Bash has a number of bugs in it that cause it to not behave the <para>Bash contains several known bugs. Fix these with the following
way it is expected at times. Fix this behaviour with the following
patch:</para> patch:</para>
<para><screen><userinput>patch -Np1 -i ../bash-&bash-patch-version;.patch</userinput></screen></para> <para><screen><userinput>patch -Np1 -i ../bash-&bash-patch-version;.patch</userinput></screen></para>
<para><screen><userinput>./configure --prefix=/stage1 \ <para>Now prepare Bash for compilation:</para>
&nbsp;&nbsp;&nbsp;&nbsp;--with-curses
make
make tests
make install
ln -s bash /stage1/bin/sh</userinput></screen></para>
<para><screen><userinput>./configure --prefix=/stage1 --with-curses</userinput></screen></para>
<blockquote><screen>install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir' <para>Compile the program:</para>
usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn]
[--section regexp title] [--infodir=xxx] [--align=nnn]
[--calign=nnn] [--quiet] [--menuentry=xxx]
[--info-dir=xxx]
[--keep-old] [--description=xxx] [--test]
[--remove] [--] filename
make[1]: *** [install] Error 1
make[1]: Leaving directory `/mnt/lfs/usr/src/bash-&bash-version;/doc'
make: [install] Error 2 (ignored)</screen></blockquote>
<para>then that means that you are probably using Debian-2.2 (potato), and <para><screen><userinput>make</userinput></screen></para>
that you have an old version of the texinfo package and the info pages
can't be installed at this time. This error is not a problem as the info <para>Check that it works correctly:</para>
pages will be installed when we recompile bash dynamically in Chapter 6, so
you can ignore it. It is reported that the current release of Debian <para><screen><userinput>make tests</userinput></screen></para>
(3.0; also known as Woody) doesn't have this problem.</para>
<para>Then install it and its documentation:</para>
<para><screen><userinput>make install</userinput></screen></para>
<para>And make a link for the programs that use <userinput>sh</userinput>
for a shell:</para>
<para><screen><userinput>ln -s bash /stage1/bin/sh</userinput></screen></para>
</sect2> </sect2>

View File

@ -35,5 +35,36 @@
&c5-utillinux; &c5-utillinux;
&c5-perl; &c5-perl;
<sect1 id="ch05-stripping">
<title>Stripping</title>
<?dbhtml filename="stripping.html" dir="chapter05"?>
<para>If your LFS partition is rather small, you will be glad to learn that you
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:</para>
<para><screen><userinput>strip --strip-unneeded /stage1/{,s}bin/*
strip --strip-debug /stage1/lib/*</userinput></screen></para>
<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
of binaries.</para>
<para>Take care <emphasis>not</emphasis> to use
<userinput>--strip-unneeded</userinput> on the libraries -- they would be
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
and some of the bigger unneeded programs:</para>
<para><screen><userinput>rm -r /stage1/share/{doc,info,man}
rm /stage1/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
filesystem to be able to build and install Glibc in the next phase.</para>
</sect1>
</chapter> </chapter>

View File

@ -2,14 +2,26 @@
<sect2> <sect2>
<title>Installation of Perl</title> <title>Installation of Perl</title>
<para><screen><userinput>patch -Np1 -i ../perl-&perl-version;-libc.patch <para>First adapt some hard-wired paths to the C library:</para>
chmod u+w hints/linux.sh
echo 'static_ext="IO re Fcntl"' >> hints/linux.sh <para><screen><userinput>patch -Np1 -i ../perl-&perl-version;-libc.patch</userinput></screen></para>
./configure.gnu --prefix=/stage1
make perl <para>And make sure some static extensions get built:</para>
make utilities
cp perl /stage1/bin/perl <para><screen><userinput>chmod u+w hints/linux.sh
cp pod/pod2man /stage1/bin echo 'static_ext="IO re Fcntl"' >> hints/linux.sh</userinput></screen></para>
<para>Now prepare Perl for compilation:</para>
<para><screen><userinput>./configure.gnu --prefix=/stage1</userinput></screen></para>
<para>Compile only the required tools:</para>
<para><screen><userinput>make perl utilities</userinput></screen></para>
<para>Then copy these tools and their libraries:</para>
<para><screen><userinput>cp perl pod/pod2man /stage1/bin
mkdir -p /stage1/lib/perl5/5.8.0 mkdir -p /stage1/lib/perl5/5.8.0
cp -R lib/* /stage1/lib/perl5/5.8.0</userinput></screen></para> cp -R lib/* /stage1/lib/perl5/5.8.0</userinput></screen></para>

View File

@ -3,12 +3,23 @@
<sect2> <sect2>
<title>Installation of Util-linux</title> <title>Installation of Util-linux</title>
<para><screen><userinput>./configure <para>Prepare Util-linux for compilation:</para>
make -C lib
make -C mount mount umount <para><screen><userinput>./configure</userinput></screen></para>
make -C text-utils more
cp mount/{mount,umount} /stage1/bin <para>Compile some support routines:</para>
cp text-utils/more /stage1/bin</userinput></screen></para>
<para><screen><userinput>make -C lib</userinput></screen></para>
<para>And, since you'll need only a couple of the utilities contained in this
package, build just those:</para>
<para><screen><userinput>make -C mount mount umount
make -C text-utils more</userinput></screen></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>
</sect2> </sect2>