source: chapter06/strippingagain.xml@ 3c928f1

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.0 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 3c928f1 was 3c928f1, checked in by Manuel Canales Esparcia <manuel@…>, 20 years ago

Added a separate file for the strippingagain section.
Tags correcitions.

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