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