Files
master/chapter06/strippingagain.html
2015-05-23 18:50:06 +08:00

129 lines
4.5 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content=
"application/xhtml+xml; charset=utf-8" />
<title>
6.71.&nbsp;Stripping Again
</title>
<link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
<link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css"
media="print" />
</head>
<body class="lfs" id="lfs-7.7-systemd">
<div class="navheader">
<h4>
Linux From Scratch - Version 7.7-systemd
</h4>
<h3>
Chapter&nbsp;6.&nbsp;Installing Basic System Software
</h3>
<ul>
<li class="prev">
<a accesskey="p" href="aboutdebug.html" title=
"About Debugging Symbols">Prev</a>
<p>
About Debugging Symbols
</p>
</li>
<li class="next">
<a accesskey="n" href="revisedchroot.html" title=
"Cleaning Up">Next</a>
<p>
Cleaning Up
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title=
"Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">Home</a>
</li>
</ul>
</div>
<div class="sect1" lang="en" xml:lang="en">
<h1 class="sect1">
<a id="ch-system-strippingagain" name=
"ch-system-strippingagain"></a>6.71. Stripping Again
</h1>
<p>
If the intended user is not a programmer and does not plan to do any
debugging on the system software, the system size can be decreased by
about 90 MB by removing the debugging symbols from binaries and
libraries. This causes no inconvenience other than not being able to
debug the software fully anymore.
</p>
<p>
Most people who use the command mentioned below do not experience any
difficulties. However, it is easy to make a typo and render the new
system unusable, so before running the <span class=
"command"><strong>strip</strong></span> command, it is a good idea to
make a backup of the LFS system in its current state.
</p>
<p>
Before performing the stripping, take special care to ensure that
none of the binaries that are about to be stripped are running. If
unsure whether the user entered chroot with the command given in
<a class="xref" href="chroot.html" title=
"6.4.&nbsp;Entering the Chroot Environment">Section&nbsp;6.4,
&ldquo;Entering the Chroot Environment,&rdquo;</a> first exit from
chroot:
</p>
<pre class="userinput">
<kbd class="command">logout</kbd>
</pre>
<p>
Then reenter it with:
</p>
<pre class="userinput">
<kbd class="command">chroot $LFS /tools/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/tools/bin/bash --login</kbd>
</pre>
<p>
Now the binaries and libraries can be safely stripped:
</p>
<pre class="userinput">
<kbd class="command">/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
-exec /tools/bin/strip --strip-debug '{}' ';'</kbd>
</pre>
<p>
A large number of files will be reported as having their file format
not recognized. These warnings can be safely ignored. These warnings
indicate that those files are scripts instead of binaries.
</p>
</div>
<div class="navfooter">
<ul>
<li class="prev">
<a accesskey="p" href="aboutdebug.html" title=
"About Debugging Symbols">Prev</a>
<p>
About Debugging Symbols
</p>
</li>
<li class="next">
<a accesskey="n" href="revisedchroot.html" title=
"Cleaning Up">Next</a>
<p>
Cleaning Up
</p>
</li>
<li class="up">
<a accesskey="u" href="chapter06.html" title=
"Chapter&nbsp;6.&nbsp;Installing Basic System Software">Up</a>
</li>
<li class="home">
<a accesskey="h" href="../index.html" title=
"Linux From Scratch - Version 7.7-systemd">Home</a>
</li>
</ul>
</div>
</body>
</html>