1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
4 | %general-entities;
|
---|
5 | ]>
|
---|
6 | <chapter id="chapter-building-system" xreflabel="Chapter 6">
|
---|
7 | <?dbhtml dir="chapter06"?>
|
---|
8 | <title>Installing basic system software</title>
|
---|
9 | <?dbhtml filename="chapter06.html"?>
|
---|
10 |
|
---|
11 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
|
---|
12 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kernfs.xml"/>
|
---|
13 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chroot.xml"/>
|
---|
14 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="changingowner.xml"/>
|
---|
15 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingdirs.xml"/>
|
---|
16 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="createfiles.xml"/>
|
---|
17 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pwdgroup.xml"/>
|
---|
18 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="devices.xml"/>
|
---|
19 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
|
---|
20 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>
|
---|
21 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
|
---|
22 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>
|
---|
23 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/>
|
---|
24 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/>
|
---|
25 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>
|
---|
26 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/>
|
---|
27 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/>
|
---|
28 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iana-etc.xml"/>
|
---|
29 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/>
|
---|
30 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/>
|
---|
31 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/>
|
---|
32 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readline.xml"/>
|
---|
33 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="vim.xml"/>
|
---|
34 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/>
|
---|
35 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/>
|
---|
36 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="less.xml"/>
|
---|
37 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/>
|
---|
38 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/>
|
---|
39 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
|
---|
40 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
|
---|
41 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="net-tools.xml"/>
|
---|
42 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inetutils.xml"/>
|
---|
43 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/>
|
---|
44 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/>
|
---|
45 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="autoconf.xml"/>
|
---|
46 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="automake.xml"/>
|
---|
47 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/>
|
---|
48 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/>
|
---|
49 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/>
|
---|
50 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/>
|
---|
51 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/>
|
---|
52 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/>
|
---|
53 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/>
|
---|
54 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/>
|
---|
55 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/>
|
---|
56 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/>
|
---|
57 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hotplug.xml"/>
|
---|
58 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man.xml"/>
|
---|
59 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/>
|
---|
60 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/>
|
---|
61 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/>
|
---|
62 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procps.xml"/>
|
---|
63 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="psmisc.xml"/>
|
---|
64 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="shadow.xml"/>
|
---|
65 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
|
---|
66 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysvinit.xml"/>
|
---|
67 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.xml"/>
|
---|
68 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
|
---|
69 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/>
|
---|
70 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/>
|
---|
71 |
|
---|
72 | <sect1 id="ch-system-strippingagain">
|
---|
73 | <title>Stripping again</title>
|
---|
74 | <?dbhtml filename="strippingagain.html"?>
|
---|
75 |
|
---|
76 | <para>If you are not a programmer and don't plan to do any debugging on your
|
---|
77 | system software, you can shrink your system by about 200 MB by removing the
|
---|
78 | debugging symbols from binaries and libraries. This causes no inconvenience
|
---|
79 | other than not being able to debug the software fully any more.</para>
|
---|
80 |
|
---|
81 | <para>Most people who use the command mentioned below don't experience any
|
---|
82 | problems. But it is easy to make a typo and render your new system unusable, so
|
---|
83 | before running the strip command it is probably a good idea to make a backup of
|
---|
84 | the current situation.</para>
|
---|
85 |
|
---|
86 | <para>If you are going to perform the stripping, special care is needed to
|
---|
87 | ensure you're not running any of the binaries that are about to be stripped.
|
---|
88 | If you're not sure whether you entered chroot with the command given in
|
---|
89 | <xref linkend="ch-system-chroot"/>, then first exit from chroot:</para>
|
---|
90 |
|
---|
91 | <screen><userinput>logout</userinput></screen>
|
---|
92 |
|
---|
93 | <para>Then reenter it with:</para>
|
---|
94 |
|
---|
95 | <screen><userinput>chroot $LFS /tools/bin/env -i \
|
---|
96 | HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
|
---|
97 | PATH=/bin:/usr/bin:/sbin:/usr/sbin \
|
---|
98 | /tools/bin/bash --login</userinput></screen>
|
---|
99 |
|
---|
100 | <para>Now you can safely strip the binaries and libraries:</para>
|
---|
101 |
|
---|
102 | <screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
|
---|
103 | -exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
|
---|
104 |
|
---|
105 | <para>A large number of files will be reported as having their file format not
|
---|
106 | recognized. These warnings can be safely ignored, they just mean that those
|
---|
107 | files are scripts instead of binaries, no harm is done.</para>
|
---|
108 |
|
---|
109 | <para>If you are really tight on disk space, you may want to use
|
---|
110 | <emphasis>--strip-all</emphasis> on the binaries in
|
---|
111 | <filename>/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do
|
---|
112 | <emphasis>not</emphasis> use this option on libraries: they would be
|
---|
113 | destroyed.</para>
|
---|
114 |
|
---|
115 | </sect1>
|
---|
116 |
|
---|
117 | <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/>
|
---|
118 |
|
---|
119 | </chapter>
|
---|