[3c928f1] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
|
---|
| 3 | <sect1 id="ch-system-strippingagain">
|
---|
| 4 | <title>Stripping again</title>
|
---|
| 5 | <?dbhtml filename="strippingagain.html"?>
|
---|
| 6 |
|
---|
[ef13657] | 7 | <para>If the intended user is not a programmer and does not plan to do
|
---|
| 8 | any debugging on the system software, the system size can be decreased
|
---|
| 9 | by about 200 MB by removing the debugging symbols from binaries and
|
---|
| 10 | libraries. This causes no inconvenience other than not being able to
|
---|
| 11 | debug the software fully anymore.</para>
|
---|
| 12 |
|
---|
| 13 | <para>Most people who use the command mentioned below do not
|
---|
| 14 | experience any difficulties. However, it is easy to make a typo and
|
---|
| 15 | render the new system unusable, so before running the strip command,
|
---|
| 16 | it is probably a good idea to make a backup of the current
|
---|
| 17 | situation.</para>
|
---|
| 18 |
|
---|
| 19 | <para>Before perform the stripping, take special care to ensure that
|
---|
| 20 | none of the binaries that are about to be stripped are running. If
|
---|
| 21 | unsure whether the user entered chroot with the command given in
|
---|
| 22 | <xref linkend="ch-system-chroot"/>, first exit from
|
---|
| 23 | chroot:</para>
|
---|
[3c928f1] | 24 |
|
---|
| 25 | <screen><userinput>logout</userinput></screen>
|
---|
| 26 |
|
---|
| 27 | <para>Then reenter it with:</para>
|
---|
| 28 |
|
---|
| 29 | <screen><userinput>chroot $LFS /tools/bin/env -i \
|
---|
| 30 | HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
---|
| 31 | PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
---|
| 32 | /tools/bin/bash --login</userinput></screen>
|
---|
| 33 |
|
---|
[ef13657] | 34 | <para>Now the binaries and libraries can be safely stripped:</para>
|
---|
[3c928f1] | 35 |
|
---|
| 36 | <screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
|
---|
| 37 | -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
|
---|
| 38 |
|
---|
[ef13657] | 39 | <para>A large number of files will be reported as having their file
|
---|
| 40 | format not recognized. These warnings can be safely ignored. These
|
---|
| 41 | warnings indicate that those files are scripts instead of
|
---|
| 42 | binaries.</para>
|
---|
[3c928f1] | 43 |
|
---|
[ef13657] | 44 | <para>If disk space is very tight, the
|
---|
| 45 | <parameter>--strip-all</parameter> options can be used on the binaries
|
---|
| 46 | in <filename class="directory">/{,usr/}{bin,sbin}</filename> to gain
|
---|
| 47 | several more megabytes. Do not use this option on libraries -- they will
|
---|
| 48 | be destroyed.</para>
|
---|
[3c928f1] | 49 |
|
---|
| 50 | </sect1>
|
---|
| 51 |
|
---|