diff options
author | Manuel Canales Esparcia <manuel@linuxfromscratch.org> | 2004-06-13 12:58:23 +0000 |
---|---|---|
committer | Manuel Canales Esparcia <manuel@linuxfromscratch.org> | 2004-06-13 12:58:23 +0000 |
commit | 3c928f1c576bdc82b3dab964a575ba5bd56b15bf (patch) | |
tree | 433ea1f68a3f6ee78feba4a3ff73cd754f5fba47 /chapter06/strippingagain.xml | |
parent | 7db6ac519b0b42317dd9f0c4e163ba200dfd35ee (diff) |
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
Diffstat (limited to 'chapter06/strippingagain.xml')
-rw-r--r-- | chapter06/strippingagain.xml | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/chapter06/strippingagain.xml b/chapter06/strippingagain.xml new file mode 100644 index 000000000..1630cd2af --- /dev/null +++ b/chapter06/strippingagain.xml @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"> +<sect1 id="ch-system-strippingagain"> +<title>Stripping again</title> +<?dbhtml filename="strippingagain.html"?> + +<para>If you are not a programmer and don't plan to do any debugging on your +system software, you can shrink your system by about 200 MB by removing the +debugging symbols from binaries and libraries. This causes no inconvenience +other than not being able to debug the software fully any more.</para> + +<para>Most people who use the command mentioned below don't experience any +problems. But it is easy to make a typo and render your new system unusable, so +before running the strip command it is probably a good idea to make a backup of +the current situation.</para> + +<para>If you are going to perform the stripping, special care is needed to +ensure you're not running any of the binaries that are about to be stripped. +If you're not sure whether you entered chroot with the command given in +<xref linkend="ch-system-chroot"/>, then first exit from chroot:</para> + +<screen><userinput>logout</userinput></screen> + +<para>Then reenter it with:</para> + +<screen><userinput>chroot $LFS /tools/bin/env -i \ + HOME=/root TERM=$TERM PS1='\u:\w\$ ' \ + PATH=/bin:/usr/bin:/sbin:/usr/sbin \ + /tools/bin/bash --login</userinput></screen> + +<para>Now you can safely strip the binaries and libraries:</para> + +<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \ + -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen> + +<para>A large number of files will be reported as having their file format not +recognized. These warnings can be safely ignored, they just mean that those +files are scripts instead of binaries, no harm is done.</para> + +<para>If you are really tight on disk space, you may want to use +<parameter>--strip-all</parameter> on the binaries in +<filename class="directory">/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do +<emphasis>not</emphasis> use this option on libraries: they would be +destroyed.</para> + +</sect1> + |