source: chapter09/theend.xml@ 821f799

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_0 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
Last change on this file since 821f799 was 821f799, checked in by Greg Schafer <greg@…>, 21 years ago

Chapter 9: Reworked final strip command. Relocated paragraphs about directory removal from Chapter 6.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@2992 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 3.0 KB
Line 
1<sect1 id="ch09-theend">
2<title>The End</title>
3<?dbhtml filename="theend.html" dir="chapter09"?>
4
5<para>Well done! You have finished installing your LFS system. It may have
6been a long process, but we hope it was worth it. We wish you a lot of fun
7with your new shiny custom built Linux system.</para>
8
9<para>Now would be a good time to strip all debug symbols from
10the binaries on your LFS system. If you are not a programmer and don't plan
11on debugging your software, then you will be happy to know that you can
12reclaim a few tens of megs by removing debug symbols. This process causes
13no inconvenience other than not being able to debug the software fully
14anymore, 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't
17experience any problems. But do make a backup of your LFS system before
18you run this command. There's a slight chance it may backfire on you and
19render your system unusable (mostly by destroying your kernel modules
20and dynamic &amp; shared libraries). This is caused more often by typos
21than by a problem with the command used.</para>
22
23<para>Having said that, the --strip-debug option we use to strip is quite
24harmless under normal circumstances. It doesn't strip anything vital from
25the files. It also is quite safe to use --strip-all on regular programs
26(don't use that on libraries - they will be destroyed), but it's not as
27safe, and the space you gain is not all that much. But if you're tight on
28disk space every little bit helps, so decide for yourself. Please refer to
29the strip man page for other strip options you can use. The general idea
30is to not run strip on libraries (other than --strip-debug), just to be
31on the safe side.</para>
32
33<para>If you are planning to go ahead and perform the strip, special care is
34needed to ensure you're not running any binaries that are about to be stripped
35-- including the active bash shell. Therefore you'll need to exit the chroot
36environemnt and reenter it using a modified chroot command:</para>
37
38<screen><userinput>logout
39chroot $LFS /tools/bin/env -i \
40&nbsp;&nbsp;&nbsp;&nbsp;HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
41&nbsp;&nbsp;&nbsp;&nbsp;PATH=/bin:/usr/bin:/sbin:/usr/sbin \
42&nbsp;&nbsp;&nbsp;&nbsp;/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&nbsp;&nbsp;&nbsp;-exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
48
49<para>Quite a number of files will be reported as having their file format not
50recognized. Most of these are scripts instead of binaries. These warnings can
51be safely ignored.</para>
52
53<para>It's a good idea to create an /etc/lfs file. By
54having this file it is very easy for you (and for us if you are going to ask
55for help with something at some point) to find out which LFS version
56you have installed on your system. Create the /etc/lfs file by
57running the following command:</para>
58
59<screen><userinput>echo &version; > /etc/lfs</userinput></screen>
60
61</sect1>
62
Note: See TracBrowser for help on using the repository browser.