source: chapter06/strippingagain.xml@ 81fd230

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 81fd230 was 81fd230, checked in by Gerard Beekmans <gerard@…>, 19 years ago

Trunk is now identical to Testing

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@4648 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 current situation.</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><userinput>logout</userinput></screen>
29
30<para>Then reenter it with:</para>
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
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.