mirror of
https://git.linuxfromscratch.org/lfs.git
synced 2025-03-06 06:14:47 +00:00
Added a separate file for the strippingagain section.
Tags correcitions. git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3780 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
parent
7db6ac519b
commit
3c928f1c57
@ -8,7 +8,7 @@
|
||||
<?dbhtml filename="aboutdebug.html"?>
|
||||
|
||||
<para>Most programs and libraries are, by default, compiled with debugging
|
||||
symbols included (with <command>gcc</command>'s <emphasis>-g</emphasis>
|
||||
symbols included (with <command>gcc</command>'s <parameter>-g</parameter>
|
||||
option). This means that, when debugging a program or library that was compiled
|
||||
with debugging information included, the debugger can give you not only memory
|
||||
addresses but also the names of the routines and variables.</para>
|
||||
@ -25,7 +25,8 @@ with debugging symbols: 1200 KB</para></listitem>
|
||||
<listitem><para>a bash binary
|
||||
without debugging symbols: 480 KB</para></listitem>
|
||||
|
||||
<listitem><para>Glibc and GCC files (/lib and /usr/lib)
|
||||
<listitem><para>Glibc and GCC files (<filename class="directory">/lib</filename>
|
||||
and <filename class="directory">/usr/lib</filename>)
|
||||
with debugging symbols: 87 MB</para></listitem>
|
||||
|
||||
<listitem><para>Glibc and GCC files
|
||||
|
@ -184,7 +184,7 @@ missing GNU programs during an installation.</para>
|
||||
<term><command>ylwrap</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-automake ylwrap"><primary sortas="b-ylwrap">ylwrap</primary></indexterm>
|
||||
<para>is a wrapper for lex and yacc.</para>
|
||||
<para>is a wrapper for <command>lex</command> and <command>yacc</command>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -54,11 +54,12 @@ patch:</para>
|
||||
|
||||
<screen><userinput>exec /bin/bash --login +h</userinput></screen>
|
||||
|
||||
<para>Note that the parameters used make it an interactive login instance
|
||||
(so /etc/profile is read, if it exists, and the first found
|
||||
~/.bash_profile, ~/.bash_login or and ~/.profile) and continue to
|
||||
<note><para>The parameters used make it an interactive login instance
|
||||
(so <filename>/etc/profile</filename> is read, if it exists, and the first found
|
||||
<filename>~/.bash_profile</filename>, <filename>~/.bash_login</filename> or
|
||||
and <filename>~/.profile</filename>) and continue to
|
||||
disable hashing so that new programs are found as they become
|
||||
available.</para>
|
||||
available.</para></note>
|
||||
|
||||
</sect2>
|
||||
|
||||
@ -87,7 +88,7 @@ before executing it, thus making this interpreter a powerful tool.</para>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bash bashbug"><primary sortas="b-bashbug">bashbug</primary></indexterm>
|
||||
<para>is a shell script to help the user
|
||||
compose and mail bug reports concerning bash in a standard format.</para>
|
||||
compose and mail bug reports concerning <command>bash</command> in a standard format.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -96,7 +97,8 @@ compose and mail bug reports concerning bash in a standard format.</para>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bash sh"><primary sortas="b-sh">sh</primary></indexterm>
|
||||
<para>is a symlink to the bash program. When invoked
|
||||
as sh, bash tries to mimic the startup behavior of historical versions of sh as
|
||||
as <command>sh</command>, <command>bash</command> tries to mimic the
|
||||
startup behavior of historical versions of <command>sh</command> as
|
||||
closely as possible, while conforming to the POSIX standard as well.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -37,14 +37,14 @@ everything is set up correctly by performing a simple test:</para>
|
||||
|
||||
<para>If you receive the message:</para>
|
||||
|
||||
<blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote>
|
||||
<screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
|
||||
|
||||
<para>Your chroot environment is not set up for proper PTY operation. In this
|
||||
case there is no point in running the test suites for Binutils and GCC until you
|
||||
are able to resolve the issue.</para>
|
||||
|
||||
<para>This package is known to behave badly when you have changed its
|
||||
default optimization flags (including the -march and -mcpu options).
|
||||
default optimization flags (including the <parameter>-march</parameter> and <parameter>-mcpu</parameter> options).
|
||||
Therefore, if you have defined any environment variables that override
|
||||
default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
|
||||
or modifying them when building Binutils.</para>
|
||||
@ -65,9 +65,9 @@ cd ../binutils-build</userinput></screen>
|
||||
|
||||
<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
|
||||
executables end up) is set to $(exec_prefix)/$(target_alias), which expands
|
||||
into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only
|
||||
into, for example, <filename class="directory">/usr/i686-pc-linux-gnu</filename>. Since we only
|
||||
build for our own system, we don't need this target specific directory in
|
||||
<filename>/usr</filename>. That setup would be used if the system was used to
|
||||
<filename class="directory">/usr</filename>. That setup would be used if the system was used to
|
||||
cross-compile (for example compiling a package on an Intel machine that
|
||||
generates code that can be executed on PowerPC machines).</para>
|
||||
|
||||
@ -87,7 +87,7 @@ doubts.</para>
|
||||
|
||||
<screen><userinput>make tooldir=/usr install</userinput></screen>
|
||||
|
||||
<para>Install the <emphasis>libiberty</emphasis> header file that is needed by
|
||||
<para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by
|
||||
some packages:</para>
|
||||
|
||||
<screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
|
||||
@ -133,7 +133,7 @@ the archive).</para>
|
||||
<term><command>as</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
|
||||
<para>is an assembler. It assembles the output of gcc into object files.</para>
|
||||
<para>is an assembler. It assembles the output of <command>gcc</command> into object files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -61,7 +61,7 @@ GCC, Gettext, Glibc, Grep, M4, Make, Sed</seg></seglistitem>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bison bison"><primary sortas="b-bison">bison</primary></indexterm>
|
||||
<para>generates, from a series of rules, a program
|
||||
for analyzing the structure of text files. Bison is a replacement for yacc
|
||||
for analyzing the structure of text files. <command>bison</command> is a replacement for <command>yacc</command>
|
||||
(Yet Another Compiler Compiler).</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -70,8 +70,9 @@ for analyzing the structure of text files. Bison is a replacement for yacc
|
||||
<term><command>yacc</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bison yacc"><primary sortas="b-yacc">yacc</primary></indexterm>
|
||||
<para>is a wrapper for bison, meant for programs
|
||||
that still call yacc instead of bison. It calls bison with the -y option.</para>
|
||||
<para>is a wrapper for <command>bison</command>, meant for programs
|
||||
that still call <command>yacc</command> instead of <command>bison</command>.
|
||||
It calls <command>bison</command> with the <parameter>-y</parameter> option.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -35,10 +35,10 @@ GCC, Glibc, Make</seg></seglistitem>
|
||||
<screen><userinput>make -f Makefile-libbz2_so
|
||||
make clean</userinput></screen>
|
||||
|
||||
<para>The <emphasis>-f</emphasis> flag will cause Bzip2 to be built
|
||||
<para>The <parameter>-f</parameter> flag will cause Bzip2 to be built
|
||||
using a different <filename>Makefile</filename> file, in this case the
|
||||
<filename>Makefile-libbz2_so</filename> file, which creates a dynamic
|
||||
<filename>libbz2.so</filename> library and links the Bzip2 utilities
|
||||
<filename class="libraryfile">libbz2.so</filename> library and links the Bzip2 utilities
|
||||
against it.</para>
|
||||
|
||||
<para>Compile the package:</para>
|
||||
@ -100,7 +100,7 @@ libbz2.so.&bzip2-version;) and libbz2.so.&bzip2-version;</seg></seglistitem>
|
||||
<term><command>bzcmp</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bzip2 bzcmp"><primary sortas="b-bzcmp">bzcmp</primary></indexterm>
|
||||
<para>runs cmp on bzipped files.</para>
|
||||
<para>runs <command>cmp</command> on bzipped files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -108,7 +108,7 @@ libbz2.so.&bzip2-version;) and libbz2.so.&bzip2-version;</seg></seglistitem>
|
||||
<term><command>bzdiff</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bzip2 bzdiff"><primary sortas="b-bzdiff">bzdiff</primary></indexterm>
|
||||
<para>runs diff on bzipped files.</para>
|
||||
<para>runs <command>diff</command> on bzipped files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -116,7 +116,7 @@ libbz2.so.&bzip2-version;) and libbz2.so.&bzip2-version;</seg></seglistitem>
|
||||
<term><command>bzgrep</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bzip2 bzgrep"><primary sortas="b-bzgrep">bzgrep</primary></indexterm>
|
||||
<para>and friends run grep on bzipped files.</para>
|
||||
<para>and friends run <command>grep</command> on bzipped files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -135,7 +135,7 @@ compressors using LZ77/LZ78, like <command>gzip</command>.</para>
|
||||
<term><command>bzip2recover</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bzip2 bzip2recover"><primary sortas="b-bzip2recover">bzip2recover</primary></indexterm>
|
||||
<para>tries to recover data from damaged bzip2 files.</para>
|
||||
<para>tries to recover data from damaged bzipped files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -143,7 +143,7 @@ compressors using LZ77/LZ78, like <command>gzip</command>.</para>
|
||||
<term><command>bzless</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bzip2 bzless"><primary sortas="b-bzless">bzless</primary></indexterm>
|
||||
<para>runs less on bzipped files.</para>
|
||||
<para>runs <command>less</command> on bzipped files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -151,7 +151,7 @@ compressors using LZ77/LZ78, like <command>gzip</command>.</para>
|
||||
<term><command>bzmore</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-bzip2 bzmore"><primary sortas="b-bzmore">bzmore</primary></indexterm>
|
||||
<para>runs more on bzipped files.</para>
|
||||
<para>runs <command>more</command> on bzipped files.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
@ -29,7 +29,7 @@ user <emphasis>root</emphasis> by running the following command:</para>
|
||||
|
||||
<screen><userinput>chown -R 0:0 /tools</userinput></screen>
|
||||
|
||||
<para>The command uses <quote>0:0</quote> instead of <quote>root:root</quote>,
|
||||
<para>The command uses <parameter>0:0</parameter> instead of <parameter>root:root</parameter>,
|
||||
because <userinput>chown</userinput> is unable to resolve the name
|
||||
<quote>root</quote> until the password file has been created.</para>
|
||||
|
||||
|
@ -68,52 +68,7 @@
|
||||
<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"/>
|
||||
|
||||
<sect1 id="ch-system-strippingagain">
|
||||
<title>Stripping again</title>
|
||||
<?dbhtml filename="strippingagain.html"?>
|
||||
|
||||
<para>If you are not a programmer and don't plan to do any debugging on your
|
||||
system software, you can shrink your system by about 200 MB by removing the
|
||||
debugging symbols from binaries and libraries. This causes no inconvenience
|
||||
other than not being able to debug the software fully any more.</para>
|
||||
|
||||
<para>Most people who use the command mentioned below don't experience any
|
||||
problems. But it is easy to make a typo and render your new system unusable, so
|
||||
before running the strip command it is probably a good idea to make a backup of
|
||||
the current situation.</para>
|
||||
|
||||
<para>If you are going to perform the stripping, special care is needed to
|
||||
ensure you're not running any of the binaries that are about to be stripped.
|
||||
If you're not sure whether you entered chroot with the command given in
|
||||
<xref linkend="ch-system-chroot"/>, then first exit from chroot:</para>
|
||||
|
||||
<screen><userinput>logout</userinput></screen>
|
||||
|
||||
<para>Then reenter it with:</para>
|
||||
|
||||
<screen><userinput>chroot $LFS /tools/bin/env -i \
|
||||
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
||||
/tools/bin/bash --login</userinput></screen>
|
||||
|
||||
<para>Now you can safely strip the binaries and libraries:</para>
|
||||
|
||||
<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
|
||||
-exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
|
||||
|
||||
<para>A large number of files will be reported as having their file format not
|
||||
recognized. These warnings can be safely ignored, they just mean that those
|
||||
files are scripts instead of binaries, no harm is done.</para>
|
||||
|
||||
<para>If you are really tight on disk space, you may want to use
|
||||
<emphasis>--strip-all</emphasis> on the binaries in
|
||||
<filename>/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do
|
||||
<emphasis>not</emphasis> use this option on libraries: they would be
|
||||
destroyed.</para>
|
||||
|
||||
</sect1>
|
||||
|
||||
<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>
|
||||
|
@ -17,10 +17,10 @@ populated with only the temporary tools:</para>
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
|
||||
/tools/bin/bash --login +h</userinput></screen>
|
||||
|
||||
<para>The <emphasis>-i</emphasis> option given to the
|
||||
<para>The <parameter>-i</parameter> option given to the
|
||||
<command>env</command> command will clear all variables of the chroot
|
||||
environment. After that, only the HOME, TERM, PS1 and PATH variables are
|
||||
set again. The TERM=$TERM construct will set the TERM variable inside chroot
|
||||
set again. The <parameter>TERM=$TERM</parameter> construct will set the TERM variable inside chroot
|
||||
to the same value as outside chroot; this variable is needed for programs
|
||||
like <command>vim</command> and <command>less</command> to operate
|
||||
properly. If you need other variables present, such as CFLAGS or CXXFLAGS,
|
||||
@ -36,17 +36,19 @@ the chroot command.</para>
|
||||
last in the PATH. This means that a temporary tool will not be used any more
|
||||
as soon as its final version is installed. Well, at least when the shell
|
||||
doesn't remember the locations of executed binaries -- for this reason hashing
|
||||
is switched off by passing the <emphasis>+h</emphasis> option to
|
||||
is switched off by passing the <parameter>+h</parameter> option to
|
||||
<command>bash</command>.</para>
|
||||
|
||||
<para>You have to make sure all the commands in the rest of this chapter and
|
||||
in the following chapters are run from within the chroot environment.
|
||||
If you ever leave this environment for any reason (rebooting for example),
|
||||
you must remember to first mount the proc and devpts file systems (discussed
|
||||
you must remember to first mount the <systemitem class="filesystem">proc</systemitem>
|
||||
and <systemitem class="filesystem">devpts</systemitem> file systems (discussed
|
||||
in the previous section) <emphasis>and</emphasis> enter chroot again before
|
||||
continuing with the installations.</para>
|
||||
|
||||
<para>Note that the bash prompt will say <quote>I have no name!</quote> This is
|
||||
<para>Note that the <command>bash</command> prompt will say
|
||||
<computeroutput>I have no name!</computeroutput> This is
|
||||
normal, as the <filename>/etc/passwd</filename> file has not been created yet.
|
||||
</para>
|
||||
|
||||
|
@ -30,8 +30,8 @@ Gettext, Glibc, Grep, Make, Perl, Sed</seg></seglistitem>
|
||||
<title>Installation of Coreutils</title>
|
||||
|
||||
<para>Normally the functionality of <command>uname</command> is somewhat
|
||||
broken, in that the <emphasis>-p</emphasis> switch always returns
|
||||
<quote>unknown</quote>. The following patch fixes this behavior for Intel
|
||||
broken, in that the <parameter>-p</parameter> switch always returns
|
||||
<computeroutput>unknown</computeroutput>. The following patch fixes this behavior for Intel
|
||||
architectures:</para>
|
||||
|
||||
<screen><userinput>patch -Np1 -i ../coreutils-&coreutils-version;-uname-2.patch</userinput></screen>
|
||||
@ -160,7 +160,7 @@ each given file to the given user:group pair.</para>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-coreutils chroot"><primary sortas="b-chroot">chroot</primary></indexterm>
|
||||
<para>runs a given command with the specified directory as the
|
||||
<filename>/</filename> directory. The given command can be an interactive shell.
|
||||
<filename class="directory">/</filename> directory. The given command can be an interactive shell.
|
||||
On most systems only <emphasis>root</emphasis> can do this.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -241,7 +241,7 @@ given files.</para>
|
||||
<term><command>dir</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-coreutils dir"><primary sortas="b-dir">dir</primary></indexterm>
|
||||
<para>is the same as ls.</para>
|
||||
<para>is the same as <command>ls</command>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -250,7 +250,7 @@ given files.</para>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-coreutils dircolors"><primary sortas="b-dircolors">dircolors</primary></indexterm>
|
||||
<para>outputs commands to set the LS_COLOR
|
||||
environment variable, to change the color scheme used by ls.</para>
|
||||
environment variable, to change the color scheme used by <command>ls</command>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -448,7 +448,7 @@ By default it orders the files and subdirectories alphabetically.</para>
|
||||
<term><command>mkfifo</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-coreutils mkfifo"><primary sortas="b-mkfifo">mkfifo</primary></indexterm>
|
||||
<para>creates FIFOs (First-In, First-Out, a "named pipe" in UNIX parlance) with
|
||||
<para>creates FIFOs (First-In, First-Out, a <quote>named pipe</quote> in UNIX parlance) with
|
||||
the given names.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
@ -808,7 +808,7 @@ running, how many users are logged on, and the system load averages.</para>
|
||||
<term><command>vdir</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-coreutils vdir"><primary sortas="b-vdir">vdir</primary></indexterm>
|
||||
<para>is the same as ls -l.</para>
|
||||
<para>is the same as <command>ls -l</command>.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@ -841,7 +841,7 @@ for each given file, and a total line when more than one file is given.</para>
|
||||
<term><command>yes</command></term>
|
||||
<listitem>
|
||||
<indexterm zone="ch-system-coreutils yes"><primary sortas="b-yes">yes</primary></indexterm>
|
||||
<para>outputs 'y' or a given string repeatedly, until killed.</para>
|
||||
<para>outputs <quote>y</quote> or a given string repeatedly, until killed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
@ -7,13 +7,14 @@
|
||||
<title>Populating /dev with device nodes</title>
|
||||
<?dbhtml filename="devices.html"?>
|
||||
|
||||
<indexterm zone="ch-system-devices"><primary sortas="a-Devices">Devices</primary></indexterm>
|
||||
<indexterm zone="ch-system-devices"><primary sortas="e-Devices">Devices</primary></indexterm>
|
||||
|
||||
<sect2>
|
||||
<title>Creating initial device nodes</title>
|
||||
|
||||
<para>When the kernel boots the system, it requires the presence of a few device
|
||||
nodes, in particular the console and null devices:</para>
|
||||
nodes, in particular the <filename class="devicefile">console</filename> and
|
||||
<filename class="devicefile">null</filename> devices:</para>
|
||||
|
||||
<screen><userinput>mknod -m 600 /dev/console c 5 1
|
||||
mknod -m 666 /dev/null c 1 3</userinput></screen>
|
||||
@ -22,15 +23,17 @@ mknod -m 666 /dev/null c 1 3</userinput></screen>
|
||||
<sect2>
|
||||
<title>Mounting ramfs and populating /dev</title>
|
||||
|
||||
<para>The ideal way to populate /dev is to mount a ramfs onto /dev (like tmpfs, but it
|
||||
<para>The ideal way to populate <filename class="directory">/dev</filename> is
|
||||
to mount a <systemitem class="filesystem">ramfs</systemitem> onto <filename class="directory">/dev </filename>
|
||||
like <systemitem class="filesystem">tmpfs</systemitem>, but it
|
||||
cannot be swapped) and create the devices on there during each bootup. Since we haven't
|
||||
booted the system, we have to do what the bootscripts would otherwise do for us, and
|
||||
populate /dev ourselves. Begin by mounting /dev:</para>
|
||||
populate <filename class="directory">/dev</filename> ourselves. Begin by mounting <filename class="directory">/dev</filename>:</para>
|
||||
|
||||
<screen><userinput>mount -n -t ramfs none /dev</userinput></screen>
|
||||
|
||||
<para>Now use the provided udevstart utility to create the initial devices based on
|
||||
all the information in /sys:</para>
|
||||
all the information in <filename class="directory">/sys</filename>:</para>
|
||||
|
||||
<screen><userinput>/tools/sbin/udevstart</userinput></screen>
|
||||
|
||||
|
47
chapter06/strippingagain.xml
Normal file
47
chapter06/strippingagain.xml
Normal file
@ -0,0 +1,47 @@
|
||||
<?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">
|
||||
<sect1 id="ch-system-strippingagain">
|
||||
<title>Stripping again</title>
|
||||
<?dbhtml filename="strippingagain.html"?>
|
||||
|
||||
<para>If you are not a programmer and don't plan to do any debugging on your
|
||||
system software, you can shrink your system by about 200 MB by removing the
|
||||
debugging symbols from binaries and libraries. This causes no inconvenience
|
||||
other than not being able to debug the software fully any more.</para>
|
||||
|
||||
<para>Most people who use the command mentioned below don't experience any
|
||||
problems. But it is easy to make a typo and render your new system unusable, so
|
||||
before running the strip command it is probably a good idea to make a backup of
|
||||
the current situation.</para>
|
||||
|
||||
<para>If you are going to perform the stripping, special care is needed to
|
||||
ensure you're not running any of the binaries that are about to be stripped.
|
||||
If you're not sure whether you entered chroot with the command given in
|
||||
<xref linkend="ch-system-chroot"/>, then first exit from chroot:</para>
|
||||
|
||||
<screen><userinput>logout</userinput></screen>
|
||||
|
||||
<para>Then reenter it with:</para>
|
||||
|
||||
<screen><userinput>chroot $LFS /tools/bin/env -i \
|
||||
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
||||
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
||||
/tools/bin/bash --login</userinput></screen>
|
||||
|
||||
<para>Now you can safely strip the binaries and libraries:</para>
|
||||
|
||||
<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
|
||||
-exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
|
||||
|
||||
<para>A large number of files will be reported as having their file format not
|
||||
recognized. These warnings can be safely ignored, they just mean that those
|
||||
files are scripts instead of binaries, no harm is done.</para>
|
||||
|
||||
<para>If you are really tight on disk space, you may want to use
|
||||
<parameter>--strip-all</parameter> on the binaries in
|
||||
<filename class="directory">/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do
|
||||
<emphasis>not</emphasis> use this option on libraries: they would be
|
||||
destroyed.</para>
|
||||
|
||||
</sect1>
|
||||
|
Loading…
Reference in New Issue
Block a user