Added a separate file for the strippingagain section.

Tags correcitions.


git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3780 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Manuel Canales Esparcia 2004-06-13 12:58:23 +00:00
parent 7db6ac519b
commit 3c928f1c57
12 changed files with 102 additions and 91 deletions

View File

@ -8,7 +8,7 @@
<?dbhtml filename="aboutdebug.html"?> <?dbhtml filename="aboutdebug.html"?>
<para>Most programs and libraries are, by default, compiled with debugging <para>Most programs and libraries are, by default, compiled with debugging
symbols included (with <command>gcc</command>'s <emphasis>-g</emphasis> symbols included (with <command>gcc</command>'s <parameter>-g</parameter>
option). This means that, when debugging a program or library that was compiled option). This means that, when debugging a program or library that was compiled
with debugging information included, the debugger can give you not only memory with debugging information included, the debugger can give you not only memory
addresses but also the names of the routines and variables.</para> addresses but also the names of the routines and variables.</para>
@ -25,7 +25,8 @@ with debugging symbols: 1200 KB</para></listitem>
<listitem><para>a bash binary <listitem><para>a bash binary
without debugging symbols: 480 KB</para></listitem> without debugging symbols: 480 KB</para></listitem>
<listitem><para>Glibc and GCC files (/lib and /usr/lib) <listitem><para>Glibc and GCC files (<filename class="directory">/lib</filename>
and <filename class="directory">/usr/lib</filename>)
with debugging symbols: 87 MB</para></listitem> with debugging symbols: 87 MB</para></listitem>
<listitem><para>Glibc and GCC files <listitem><para>Glibc and GCC files

View File

@ -184,7 +184,7 @@ missing GNU programs during an installation.</para>
<term><command>ylwrap</command></term> <term><command>ylwrap</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-automake ylwrap"><primary sortas="b-ylwrap">ylwrap</primary></indexterm> <indexterm zone="ch-system-automake ylwrap"><primary sortas="b-ylwrap">ylwrap</primary></indexterm>
<para>is a wrapper for lex and yacc.</para> <para>is a wrapper for <command>lex</command> and <command>yacc</command>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>

View File

@ -54,11 +54,12 @@ patch:</para>
<screen><userinput>exec /bin/bash --login +h</userinput></screen> <screen><userinput>exec /bin/bash --login +h</userinput></screen>
<para>Note that the parameters used make it an interactive login instance <note><para>The parameters used make it an interactive login instance
(so /etc/profile is read, if it exists, and the first found (so <filename>/etc/profile</filename> is read, if it exists, and the first found
~/.bash_profile, ~/.bash_login or and ~/.profile) and continue to <filename>~/.bash_profile</filename>, <filename>~/.bash_login</filename> or
and <filename>~/.profile</filename>) and continue to
disable hashing so that new programs are found as they become disable hashing so that new programs are found as they become
available.</para> available.</para></note>
</sect2> </sect2>
@ -87,7 +88,7 @@ before executing it, thus making this interpreter a powerful tool.</para>
<listitem> <listitem>
<indexterm zone="ch-system-bash bashbug"><primary sortas="b-bashbug">bashbug</primary></indexterm> <indexterm zone="ch-system-bash bashbug"><primary sortas="b-bashbug">bashbug</primary></indexterm>
<para>is a shell script to help the user <para>is a shell script to help the user
compose and mail bug reports concerning bash in a standard format.</para> compose and mail bug reports concerning <command>bash</command> in a standard format.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -96,7 +97,8 @@ compose and mail bug reports concerning bash in a standard format.</para>
<listitem> <listitem>
<indexterm zone="ch-system-bash sh"><primary sortas="b-sh">sh</primary></indexterm> <indexterm zone="ch-system-bash sh"><primary sortas="b-sh">sh</primary></indexterm>
<para>is a symlink to the bash program. When invoked <para>is a symlink to the bash program. When invoked
as sh, bash tries to mimic the startup behavior of historical versions of sh as as <command>sh</command>, <command>bash</command> tries to mimic the
startup behavior of historical versions of <command>sh</command> as
closely as possible, while conforming to the POSIX standard as well.</para> closely as possible, while conforming to the POSIX standard as well.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -37,14 +37,14 @@ everything is set up correctly by performing a simple test:</para>
<para>If you receive the message:</para> <para>If you receive the message:</para>
<blockquote><screen>The system has no more ptys. Ask your system administrator to create more.</screen></blockquote> <screen><computeroutput>The system has no more ptys. Ask your system administrator to create more.</computeroutput></screen>
<para>Your chroot environment is not set up for proper PTY operation. In this <para>Your chroot environment is not set up for proper PTY operation. In this
case there is no point in running the test suites for Binutils and GCC until you case there is no point in running the test suites for Binutils and GCC until you
are able to resolve the issue.</para> are able to resolve the issue.</para>
<para>This package is known to behave badly when you have changed its <para>This package is known to behave badly when you have changed its
default optimization flags (including the -march and -mcpu options). default optimization flags (including the <parameter>-march</parameter> and <parameter>-mcpu</parameter> options).
Therefore, if you have defined any environment variables that override Therefore, if you have defined any environment variables that override
default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting default optimizations, such as CFLAGS and CXXFLAGS, we recommend un-setting
or modifying them when building Binutils.</para> or modifying them when building Binutils.</para>
@ -65,9 +65,9 @@ cd ../binutils-build</userinput></screen>
<para>Normally, the <emphasis>tooldir</emphasis> (the directory where the <para>Normally, the <emphasis>tooldir</emphasis> (the directory where the
executables end up) is set to $(exec_prefix)/$(target_alias), which expands executables end up) is set to $(exec_prefix)/$(target_alias), which expands
into, for example, <filename>/usr/i686-pc-linux-gnu</filename>. Since we only into, for example, <filename class="directory">/usr/i686-pc-linux-gnu</filename>. Since we only
build for our own system, we don't need this target specific directory in build for our own system, we don't need this target specific directory in
<filename>/usr</filename>. That setup would be used if the system was used to <filename class="directory">/usr</filename>. That setup would be used if the system was used to
cross-compile (for example compiling a package on an Intel machine that cross-compile (for example compiling a package on an Intel machine that
generates code that can be executed on PowerPC machines).</para> generates code that can be executed on PowerPC machines).</para>
@ -87,7 +87,7 @@ doubts.</para>
<screen><userinput>make tooldir=/usr install</userinput></screen> <screen><userinput>make tooldir=/usr install</userinput></screen>
<para>Install the <emphasis>libiberty</emphasis> header file that is needed by <para>Install the <filename class="headerfile">libiberty</filename> header file that is needed by
some packages:</para> some packages:</para>
<screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen> <screen><userinput>cp ../binutils-&binutils-version;/include/libiberty.h /usr/include</userinput></screen>
@ -133,7 +133,7 @@ the archive).</para>
<term><command>as</command></term> <term><command>as</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm> <indexterm zone="ch-system-binutils as"><primary sortas="b-as">as</primary></indexterm>
<para>is an assembler. It assembles the output of gcc into object files.</para> <para>is an assembler. It assembles the output of <command>gcc</command> into object files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -61,7 +61,7 @@ GCC, Gettext, Glibc, Grep, M4, Make, Sed</seg></seglistitem>
<listitem> <listitem>
<indexterm zone="ch-system-bison bison"><primary sortas="b-bison">bison</primary></indexterm> <indexterm zone="ch-system-bison bison"><primary sortas="b-bison">bison</primary></indexterm>
<para>generates, from a series of rules, a program <para>generates, from a series of rules, a program
for analyzing the structure of text files. Bison is a replacement for yacc for analyzing the structure of text files. <command>bison</command> is a replacement for <command>yacc</command>
(Yet Another Compiler Compiler).</para> (Yet Another Compiler Compiler).</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -70,8 +70,9 @@ for analyzing the structure of text files. Bison is a replacement for yacc
<term><command>yacc</command></term> <term><command>yacc</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bison yacc"><primary sortas="b-yacc">yacc</primary></indexterm> <indexterm zone="ch-system-bison yacc"><primary sortas="b-yacc">yacc</primary></indexterm>
<para>is a wrapper for bison, meant for programs <para>is a wrapper for <command>bison</command>, meant for programs
that still call yacc instead of bison. It calls bison with the -y option.</para> that still call <command>yacc</command> instead of <command>bison</command>.
It calls <command>bison</command> with the <parameter>-y</parameter> option.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -35,10 +35,10 @@ GCC, Glibc, Make</seg></seglistitem>
<screen><userinput>make -f Makefile-libbz2_so <screen><userinput>make -f Makefile-libbz2_so
make clean</userinput></screen> make clean</userinput></screen>
<para>The <emphasis>-f</emphasis> flag will cause Bzip2 to be built <para>The <parameter>-f</parameter> flag will cause Bzip2 to be built
using a different <filename>Makefile</filename> file, in this case the using a different <filename>Makefile</filename> file, in this case the
<filename>Makefile-libbz2_so</filename> file, which creates a dynamic <filename>Makefile-libbz2_so</filename> file, which creates a dynamic
<filename>libbz2.so</filename> library and links the Bzip2 utilities <filename class="libraryfile">libbz2.so</filename> library and links the Bzip2 utilities
against it.</para> against it.</para>
<para>Compile the package:</para> <para>Compile the package:</para>
@ -100,7 +100,7 @@ libbz2.so.&bzip2-version;) and libbz2.so.&bzip2-version;</seg></seglistitem>
<term><command>bzcmp</command></term> <term><command>bzcmp</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bzip2 bzcmp"><primary sortas="b-bzcmp">bzcmp</primary></indexterm> <indexterm zone="ch-system-bzip2 bzcmp"><primary sortas="b-bzcmp">bzcmp</primary></indexterm>
<para>runs cmp on bzipped files.</para> <para>runs <command>cmp</command> on bzipped files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -108,7 +108,7 @@ libbz2.so.&bzip2-version;) and libbz2.so.&bzip2-version;</seg></seglistitem>
<term><command>bzdiff</command></term> <term><command>bzdiff</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bzip2 bzdiff"><primary sortas="b-bzdiff">bzdiff</primary></indexterm> <indexterm zone="ch-system-bzip2 bzdiff"><primary sortas="b-bzdiff">bzdiff</primary></indexterm>
<para>runs diff on bzipped files.</para> <para>runs <command>diff</command> on bzipped files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -116,7 +116,7 @@ libbz2.so.&bzip2-version;) and libbz2.so.&bzip2-version;</seg></seglistitem>
<term><command>bzgrep</command></term> <term><command>bzgrep</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bzip2 bzgrep"><primary sortas="b-bzgrep">bzgrep</primary></indexterm> <indexterm zone="ch-system-bzip2 bzgrep"><primary sortas="b-bzgrep">bzgrep</primary></indexterm>
<para>and friends run grep on bzipped files.</para> <para>and friends run <command>grep</command> on bzipped files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -135,7 +135,7 @@ compressors using LZ77/LZ78, like <command>gzip</command>.</para>
<term><command>bzip2recover</command></term> <term><command>bzip2recover</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bzip2 bzip2recover"><primary sortas="b-bzip2recover">bzip2recover</primary></indexterm> <indexterm zone="ch-system-bzip2 bzip2recover"><primary sortas="b-bzip2recover">bzip2recover</primary></indexterm>
<para>tries to recover data from damaged bzip2 files.</para> <para>tries to recover data from damaged bzipped files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -143,7 +143,7 @@ compressors using LZ77/LZ78, like <command>gzip</command>.</para>
<term><command>bzless</command></term> <term><command>bzless</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bzip2 bzless"><primary sortas="b-bzless">bzless</primary></indexterm> <indexterm zone="ch-system-bzip2 bzless"><primary sortas="b-bzless">bzless</primary></indexterm>
<para>runs less on bzipped files.</para> <para>runs <command>less</command> on bzipped files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -151,7 +151,7 @@ compressors using LZ77/LZ78, like <command>gzip</command>.</para>
<term><command>bzmore</command></term> <term><command>bzmore</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-bzip2 bzmore"><primary sortas="b-bzmore">bzmore</primary></indexterm> <indexterm zone="ch-system-bzip2 bzmore"><primary sortas="b-bzmore">bzmore</primary></indexterm>
<para>runs more on bzipped files.</para> <para>runs <command>more</command> on bzipped files.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>

View File

@ -29,7 +29,7 @@ user <emphasis>root</emphasis> by running the following command:</para>
<screen><userinput>chown -R 0:0 /tools</userinput></screen> <screen><userinput>chown -R 0:0 /tools</userinput></screen>
<para>The command uses <quote>0:0</quote> instead of <quote>root:root</quote>, <para>The command uses <parameter>0:0</parameter> instead of <parameter>root:root</parameter>,
because <userinput>chown</userinput> is unable to resolve the name because <userinput>chown</userinput> is unable to resolve the name
<quote>root</quote> until the password file has been created.</para> <quote>root</quote> until the password file has been created.</para>

View File

@ -68,52 +68,7 @@
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="udev.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="util-linux.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="aboutdebug.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="strippingagain.xml"/>
<sect1 id="ch-system-strippingagain">
<title>Stripping again</title>
<?dbhtml filename="strippingagain.html"?>
<para>If you are not a programmer and don't plan to do any debugging on your
system software, you can shrink your system 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 any more.</para>
<para>Most people who use the command mentioned below don't experience any
problems. But it is easy to make a typo and render your new system unusable, so
before running the strip command it is probably a good idea to make a backup of
the current situation.</para>
<para>If you are going to perform the stripping, special care is needed to
ensure you're not running any of the binaries that are about to be stripped.
If you're not sure whether you entered chroot with the command given in
<xref linkend="ch-system-chroot"/>, then first exit from chroot:</para>
<screen><userinput>logout</userinput></screen>
<para>Then reenter it with:</para>
<screen><userinput>chroot $LFS /tools/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/tools/bin/bash --login</userinput></screen>
<para>Now you can safely strip the binaries and libraries:</para>
<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
-exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
<para>A large number of files will be reported as having their file format not
recognized. These warnings can be safely ignored, they just mean that those
files are scripts instead of binaries, no harm is done.</para>
<para>If you are really tight on disk space, you may want to use
<emphasis>--strip-all</emphasis> on the binaries in
<filename>/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do
<emphasis>not</emphasis> use this option on libraries: they would be
destroyed.</para>
</sect1>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/> <xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/>
</chapter> </chapter>

View File

@ -17,10 +17,10 @@ populated with only the temporary tools:</para>
PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \
/tools/bin/bash --login +h</userinput></screen> /tools/bin/bash --login +h</userinput></screen>
<para>The <emphasis>-i</emphasis> option given to the <para>The <parameter>-i</parameter> option given to the
<command>env</command> command will clear all variables of the chroot <command>env</command> command will clear all variables of the chroot
environment. After that, only the HOME, TERM, PS1 and PATH variables are environment. After that, only the HOME, TERM, PS1 and PATH variables are
set again. The TERM=$TERM construct will set the TERM variable inside chroot set again. The <parameter>TERM=$TERM</parameter> construct will set the TERM variable inside chroot
to the same value as outside chroot; this variable is needed for programs to the same value as outside chroot; this variable is needed for programs
like <command>vim</command> and <command>less</command> to operate like <command>vim</command> and <command>less</command> to operate
properly. If you need other variables present, such as CFLAGS or CXXFLAGS, properly. If you need other variables present, such as CFLAGS or CXXFLAGS,
@ -36,17 +36,19 @@ the chroot command.</para>
last in the PATH. This means that a temporary tool will not be used any more last in the PATH. This means that a temporary tool will not be used any more
as soon as its final version is installed. Well, at least when the shell as soon as its final version is installed. Well, at least when the shell
doesn't remember the locations of executed binaries -- for this reason hashing doesn't remember the locations of executed binaries -- for this reason hashing
is switched off by passing the <emphasis>+h</emphasis> option to is switched off by passing the <parameter>+h</parameter> option to
<command>bash</command>.</para> <command>bash</command>.</para>
<para>You have to make sure all the commands in the rest of this chapter and <para>You have to make sure all the commands in the rest of this chapter and
in the following chapters are run from within the chroot environment. in the following chapters are run from within the chroot environment.
If you ever leave this environment for any reason (rebooting for example), If you ever leave this environment for any reason (rebooting for example),
you must remember to first mount the proc and devpts file systems (discussed you must remember to first mount the <systemitem class="filesystem">proc</systemitem>
and <systemitem class="filesystem">devpts</systemitem> file systems (discussed
in the previous section) <emphasis>and</emphasis> enter chroot again before in the previous section) <emphasis>and</emphasis> enter chroot again before
continuing with the installations.</para> continuing with the installations.</para>
<para>Note that the bash prompt will say <quote>I have no name!</quote> This is <para>Note that the <command>bash</command> prompt will say
<computeroutput>I have no name!</computeroutput> This is
normal, as the <filename>/etc/passwd</filename> file has not been created yet. normal, as the <filename>/etc/passwd</filename> file has not been created yet.
</para> </para>

View File

@ -30,8 +30,8 @@ Gettext, Glibc, Grep, Make, Perl, Sed</seg></seglistitem>
<title>Installation of Coreutils</title> <title>Installation of Coreutils</title>
<para>Normally the functionality of <command>uname</command> is somewhat <para>Normally the functionality of <command>uname</command> is somewhat
broken, in that the <emphasis>-p</emphasis> switch always returns broken, in that the <parameter>-p</parameter> switch always returns
<quote>unknown</quote>. The following patch fixes this behavior for Intel <computeroutput>unknown</computeroutput>. The following patch fixes this behavior for Intel
architectures:</para> architectures:</para>
<screen><userinput>patch -Np1 -i ../coreutils-&coreutils-version;-uname-2.patch</userinput></screen> <screen><userinput>patch -Np1 -i ../coreutils-&coreutils-version;-uname-2.patch</userinput></screen>
@ -160,7 +160,7 @@ each given file to the given user:group pair.</para>
<listitem> <listitem>
<indexterm zone="ch-system-coreutils chroot"><primary sortas="b-chroot">chroot</primary></indexterm> <indexterm zone="ch-system-coreutils chroot"><primary sortas="b-chroot">chroot</primary></indexterm>
<para>runs a given command with the specified directory as the <para>runs a given command with the specified directory as the
<filename>/</filename> directory. The given command can be an interactive shell. <filename class="directory">/</filename> directory. The given command can be an interactive shell.
On most systems only <emphasis>root</emphasis> can do this.</para> On most systems only <emphasis>root</emphasis> can do this.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -241,7 +241,7 @@ given files.</para>
<term><command>dir</command></term> <term><command>dir</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-coreutils dir"><primary sortas="b-dir">dir</primary></indexterm> <indexterm zone="ch-system-coreutils dir"><primary sortas="b-dir">dir</primary></indexterm>
<para>is the same as ls.</para> <para>is the same as <command>ls</command>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -250,7 +250,7 @@ given files.</para>
<listitem> <listitem>
<indexterm zone="ch-system-coreutils dircolors"><primary sortas="b-dircolors">dircolors</primary></indexterm> <indexterm zone="ch-system-coreutils dircolors"><primary sortas="b-dircolors">dircolors</primary></indexterm>
<para>outputs commands to set the LS_COLOR <para>outputs commands to set the LS_COLOR
environment variable, to change the color scheme used by ls.</para> environment variable, to change the color scheme used by <command>ls</command>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -448,7 +448,7 @@ By default it orders the files and subdirectories alphabetically.</para>
<term><command>mkfifo</command></term> <term><command>mkfifo</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-coreutils mkfifo"><primary sortas="b-mkfifo">mkfifo</primary></indexterm> <indexterm zone="ch-system-coreutils mkfifo"><primary sortas="b-mkfifo">mkfifo</primary></indexterm>
<para>creates FIFOs (First-In, First-Out, a "named pipe" in UNIX parlance) with <para>creates FIFOs (First-In, First-Out, a <quote>named pipe</quote> in UNIX parlance) with
the given names.</para> the given names.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -808,7 +808,7 @@ running, how many users are logged on, and the system load averages.</para>
<term><command>vdir</command></term> <term><command>vdir</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-coreutils vdir"><primary sortas="b-vdir">vdir</primary></indexterm> <indexterm zone="ch-system-coreutils vdir"><primary sortas="b-vdir">vdir</primary></indexterm>
<para>is the same as ls -l.</para> <para>is the same as <command>ls -l</command>.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
@ -841,7 +841,7 @@ for each given file, and a total line when more than one file is given.</para>
<term><command>yes</command></term> <term><command>yes</command></term>
<listitem> <listitem>
<indexterm zone="ch-system-coreutils yes"><primary sortas="b-yes">yes</primary></indexterm> <indexterm zone="ch-system-coreutils yes"><primary sortas="b-yes">yes</primary></indexterm>
<para>outputs 'y' or a given string repeatedly, until killed.</para> <para>outputs <quote>y</quote> or a given string repeatedly, until killed.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>

View File

@ -7,13 +7,14 @@
<title>Populating /dev with device nodes</title> <title>Populating /dev with device nodes</title>
<?dbhtml filename="devices.html"?> <?dbhtml filename="devices.html"?>
<indexterm zone="ch-system-devices"><primary sortas="a-Devices">Devices</primary></indexterm> <indexterm zone="ch-system-devices"><primary sortas="e-Devices">Devices</primary></indexterm>
<sect2> <sect2>
<title>Creating initial device nodes</title> <title>Creating initial device nodes</title>
<para>When the kernel boots the system, it requires the presence of a few device <para>When the kernel boots the system, it requires the presence of a few device
nodes, in particular the console and null devices:</para> nodes, in particular the <filename class="devicefile">console</filename> and
<filename class="devicefile">null</filename> devices:</para>
<screen><userinput>mknod -m 600 /dev/console c 5 1 <screen><userinput>mknod -m 600 /dev/console c 5 1
mknod -m 666 /dev/null c 1 3</userinput></screen> mknod -m 666 /dev/null c 1 3</userinput></screen>
@ -22,15 +23,17 @@ mknod -m 666 /dev/null c 1 3</userinput></screen>
<sect2> <sect2>
<title>Mounting ramfs and populating /dev</title> <title>Mounting ramfs and populating /dev</title>
<para>The ideal way to populate /dev is to mount a ramfs onto /dev (like tmpfs, but it <para>The ideal way to populate <filename class="directory">/dev</filename> is
to mount a <systemitem class="filesystem">ramfs</systemitem> onto <filename class="directory">/dev </filename>
like <systemitem class="filesystem">tmpfs</systemitem>, but it
cannot be swapped) and create the devices on there during each bootup. Since we haven't cannot be swapped) and create the devices on there during each bootup. Since we haven't
booted the system, we have to do what the bootscripts would otherwise do for us, and booted the system, we have to do what the bootscripts would otherwise do for us, and
populate /dev ourselves. Begin by mounting /dev:</para> populate <filename class="directory">/dev</filename> ourselves. Begin by mounting <filename class="directory">/dev</filename>:</para>
<screen><userinput>mount -n -t ramfs none /dev</userinput></screen> <screen><userinput>mount -n -t ramfs none /dev</userinput></screen>
<para>Now use the provided udevstart utility to create the initial devices based on <para>Now use the provided udevstart utility to create the initial devices based on
all the information in /sys:</para> all the information in <filename class="directory">/sys</filename>:</para>
<screen><userinput>/tools/sbin/udevstart</userinput></screen> <screen><userinput>/tools/sbin/udevstart</userinput></screen>

View File

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
<sect1 id="ch-system-strippingagain">
<title>Stripping again</title>
<?dbhtml filename="strippingagain.html"?>
<para>If you are not a programmer and don't plan to do any debugging on your
system software, you can shrink your system 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 any more.</para>
<para>Most people who use the command mentioned below don't experience any
problems. But it is easy to make a typo and render your new system unusable, so
before running the strip command it is probably a good idea to make a backup of
the current situation.</para>
<para>If you are going to perform the stripping, special care is needed to
ensure you're not running any of the binaries that are about to be stripped.
If you're not sure whether you entered chroot with the command given in
<xref linkend="ch-system-chroot"/>, then first exit from chroot:</para>
<screen><userinput>logout</userinput></screen>
<para>Then reenter it with:</para>
<screen><userinput>chroot $LFS /tools/bin/env -i \
HOME=/root TERM=$TERM PS1='\u:\w\$ ' \
PATH=/bin:/usr/bin:/sbin:/usr/sbin \
/tools/bin/bash --login</userinput></screen>
<para>Now you can safely strip the binaries and libraries:</para>
<screen><userinput>/tools/bin/find /{,usr/}{bin,lib,sbin} -type f \
-exec /tools/bin/strip --strip-debug '{}' ';'</userinput></screen>
<para>A large number of files will be reported as having their file format not
recognized. These warnings can be safely ignored, they just mean that those
files are scripts instead of binaries, no harm is done.</para>
<para>If you are really tight on disk space, you may want to use
<parameter>--strip-all</parameter> on the binaries in
<filename class="directory">/{,usr/}{bin,sbin}</filename> to gain several more megabytes. But do
<emphasis>not</emphasis> use this option on libraries: they would be
destroyed.</para>
</sect1>