📄 stripping.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=iso-8859-1" /> <title> 10.58. Stripping </title> <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" /> <meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /> <link rel="stylesheet" href="../stylesheets/lfs-print.css" type= "text/css" media="print" /> </head> <body id="lfs" class="CLFS-SVN-20060417-MIPS"> <div class="navheader"> <div class="headertitles"> <h4> Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS </h4> <h3> Chapter 10. Installing Basic System Software </h3> </div> <ul class="headerlinks"> <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="../bootscripts/chapter.html" title= "Setting Up System Bootscripts">Next</a> <p> Setting Up System Bootscripts </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 10. Installing Basic System Software">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a> </li> </ul> </div> <div class="sect1" lang="en" xml:lang="en"> <div class="titlepage"> <h1 class="sect1"> 10.58. Stripping </h1> </div> <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 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 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><strong class= "command">strip</strong></span> command, it is a good idea to make a backup of the current situation. </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 href="../chroot/chapter.html">If You Are Going to Chroot</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> <p> If disk space is very tight, the <tt class="option">--strip-all</tt> option can be used on the binaries in <tt class= "filename">/{,usr/}{bin,sbin}</tt> to gain several more megabytes. Do not use this option on libraries—they will be destroyed. </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="../bootscripts/chapter.html" title= "Setting Up System Bootscripts">Next</a> <p> Setting Up System Bootscripts </p> </li> <li class="up"> <a accesskey="u" href="chapter.html" title= "Chapter 10. Installing Basic System Software">Up</a>. </li> <li class="home"> <a accesskey="h" href="../index.html" title= "Cross-Compiled Linux From Scratch - Version CLFS-SVN-20060417-MIPS"> Home</a>. </li> </ul> </div> </body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -