source: chapter06/strippingagain.xml@ e6ab4b5

Last change on this file since e6ab4b5 was e6ab4b5, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Ported r7294 to r7325 from trunk to alphabetical branch.

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

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