source: chapter06/strippingagain.xml@ 2aee5500

Last change on this file since 2aee5500 was a8f36125, checked in by Matthew Burgess <matthew@…>, 20 years ago
  • (all) Removed all references to the DocBook DTD
  • (docbook.rng) Added the DocBook "Gin" schema
  • (Makefile) Updated with new validation command
  • (prologue/*) Validation fixes

git-svn-id: http://svn.linuxfromscratch.org/LFS/branches/LFS-RNG/BOOK@4329 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 2.0 KB
RevLine 
[3c928f1]1<?xml version="1.0" encoding="ISO-8859-1"?>
[a8f36125]2<!DOCTYPE sect1 [
3]>
[3c928f1]4<sect1 id="ch-system-strippingagain">
5<title>Stripping again</title>
6<?dbhtml filename="strippingagain.html"?>
7
8<para>If you are not a programmer and don't plan to do any debugging on your
9system software, you can shrink your system by about 200 MB by removing the
10debugging symbols from binaries and libraries. This causes no inconvenience
11other than not being able to debug the software fully any more.</para>
12
13<para>Most people who use the command mentioned below don't experience any
14problems. But it is easy to make a typo and render your new system unusable, so
15before running the strip command it is probably a good idea to make a backup of
16the current situation.</para>
17
18<para>If you are going to perform the stripping, special care is needed to
19ensure you're not running any of the binaries that are about to be stripped.
20If you're not sure whether you entered chroot with the command given in
21<xref linkend="ch-system-chroot"/>, then first exit from chroot:</para>
22
23<screen><userinput>logout</userinput></screen>
24
25<para>Then reenter it with:</para>
26
27<screen><userinput>chroot $LFS /tools/bin/env -i \
28 HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
29 PATH=/bin:/usr/bin:/sbin:/usr/sbin \
30 /tools/bin/bash --login</userinput></screen>
31
32<para>Now you can safely strip the binaries and libraries:</para>
33
34<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
35 -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
36
37<para>A large number of files will be reported as having their file format not
38recognized. These warnings can be safely ignored, they just mean that those
39files are scripts instead of binaries, no harm is done.</para>
40
41<para>If you are really tight on disk space, you may want to use
42<parameter>--strip-all</parameter> on the binaries in
43<filename class="directory">/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do
44<emphasis>not</emphasis> use this option on libraries: they would be
45destroyed.</para>
46
47</sect1>
48
Note: See TracBrowser for help on using the repository browser.