Changeset b157558 for chapter09/theend.xml
- Timestamp:
- 02/22/2004 10:32:27 PM (20 years ago)
- Branches:
- 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, v5_1, v5_1_1, 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
- Children:
- f89de33
- Parents:
- cd0c92d6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
chapter09/theend.xml
rcd0c92d6 rb157558 6 6 been a long process, but we hope it was worth it. We wish you a lot of fun 7 7 with your new shiny custom built Linux system.</para> 8 9 <para>Now would be a good time to strip all debug symbols from10 the binaries on your LFS system. If you are not a programmer and don't plan11 on debugging your software, then you will be happy to know that you can12 reclaim a few tens of megs by removing debug symbols. This process causes13 no inconvenience other than not being able to debug the software fully14 anymore, which is not an issue if you don't know how to debug.</para>15 16 <para>Disclaimer: 98% of the people who use the command mentioned below don't17 experience any problems. But do make a backup of your LFS system before18 you run this command. There's a slight chance it may backfire on you and19 render your system unusable (mostly by destroying your kernel modules20 and dynamic & shared libraries). This is caused more often by typos21 than by a problem with the command used.</para>22 23 <para>Having said that, the --strip-debug option we use to strip is quite24 harmless under normal circumstances. It doesn't strip anything vital from25 the files. It also is quite safe to use --strip-all on regular programs26 (don't use that on libraries - they will be destroyed), but it's not as27 safe, and the space you gain is not all that much. But if you're tight on28 disk space every little bit helps, so decide for yourself. Please refer to29 the strip man page for other strip options you can use. The general idea30 is to not run strip on libraries (other than --strip-debug), just to be31 on the safe side.</para>32 33 <para>If you are planning to go ahead and perform the strip, special care is34 needed to ensure you're not running any binaries that are about to be stripped35 -- including the active bash shell. Therefore you'll need to exit the chroot36 environment and reenter it using a modified chroot command:</para>37 38 <screen><userinput>logout39 chroot $LFS /tools/bin/env -i \40 HOME=/root TERM=$TERM PS1='\u:\w\$ ' \41 PATH=/bin:/usr/bin:/sbin:/usr/sbin \42 /tools/bin/bash --login</userinput></screen>43 44 <para>Now run the following command:</para>45 46 <screen><userinput>/tools/bin/find /{,usr/,usr/local/}{bin,sbin,lib} -type f \47 -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>48 49 <para>Quite a number of files will be reported as having their file format not50 recognized. Most of these are scripts instead of binaries. These warnings can51 be safely ignored.</para>52 8 53 9 <para>It may be a good idea to create an <filename>/etc/lfs-release</filename>
Note:
See TracChangeset
for help on using the changeset viewer.