source: chapter06/strippingagain.xml@ 7566baf

6.0
Last change on this file since 7566baf was c17fc85, checked in by Gerard Beekmans <gerard@…>, 20 years ago

Punctuation edits

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

  • Property mode set to 100644
File size: 2.1 KB
Line 
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
7<para>If the intended user is not a programmer and does not plan to do
8any debugging on the system software, the system size can be decreased
9by about 200 MB by removing the debugging symbols from binaries and
10libraries. This causes no inconvenience other than not being able to
11debug the software fully anymore.</para>
12
13<para>Most people who use the command mentioned below do not
14experience any difficulties. However, it is easy to make a typo and
15render the new system unusable, so before running the strip command,
16it is a good idea to make a backup of the current
17situation.</para>
18
19<para>Before performing the stripping, take special care to ensure that
20none of the binaries that are about to be stripped are running. If
21unsure whether the user entered chroot with the command given in
22<xref linkend="ch-system-chroot" role=","/> first exit from
23chroot:</para>
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
34<para>Now the binaries and libraries can be safely stripped:</para>
35
36<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
37 -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
38
39<para>A large number of files will be reported as having their file
40format not recognized. These warnings can be safely ignored. These
41warnings indicate that those files are scripts instead of
42binaries.</para>
43
44<para>If disk space is very tight, the
45<parameter>--strip-all</parameter> options can be used on the binaries
46in <filename class="directory">/{,usr/}{bin,sbin}</filename> to gain
47several more megabytes. Do not use this option on libraries&mdash;they will
48be destroyed.</para>
49
50</sect1>
51
Note: See TracBrowser for help on using the repository browser.