Indenting chapter 6, part 3

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@7325 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689
This commit is contained in:
Manuel Canales Esparcia 2006-02-02 21:03:09 +00:00
parent 92474b4514
commit 8ef83047f9
7 changed files with 1400 additions and 1140 deletions

View File

@ -1,30 +1,45 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-system-bzip2" role="wrap">
<title>Bzip2-&bzip2-version;</title>
<?dbhtml filename="bzip2.html"?>
<indexterm zone="ch-system-bzip2"><primary sortas="a-Bzip2">Bzip2</primary></indexterm>
<title>Bzip2-&bzip2-version;</title>
<indexterm zone="ch-system-bzip2">
<primary sortas="a-Bzip2">Bzip2</primary>
</indexterm>
<sect2 role="package">
<title/>
<sect2 role="package"><title/>
<para>The Bzip2 package contains programs for compressing and decompressing
files. Compressing text files with <command>bzip2</command> yields a much better
compression percentage than with the traditional <command>gzip</command>.</para>
files. Compressing text files with <command>bzip2</command> yields a much
better compression percentage than with the traditional
<command>gzip</command>.</para>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem><seg>0.1 SBU</seg><seg>3.9 MB</seg></seglistitem>
<seglistitem>
<seg>0.1 SBU</seg>
<seg>3.9 MB</seg>
</seglistitem>
</segmentedlist>
<segmentedlist>
<segtitle>&dependencies;</segtitle>
<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
GCC, Glibc, and Make</seg></seglistitem>
<seglistitem>
<seg>Bash, Binutils, Coreutils, Diffutils, GCC, Glibc, and Make</seg>
</seglistitem>
</segmentedlist>
</sect2>
<sect2 role="installation">
@ -34,10 +49,10 @@ GCC, Glibc, and Make</seg></seglistitem>
<screen><userinput>patch -Np1 -i ../&bzip2-docs-patch;</userinput></screen>
<para>The <command>bzgrep</command> command does not escape '|' and '&amp;' in
filenames passed to it. This allows arbitrary commands to be executed with the
privileges of the user running <command>bzgrep</command>. Apply the following to
address this:</para>
<para>The <command>bzgrep</command> command does not escape '|' and '&amp;'
in filenames passed to it. This allows arbitrary commands to be executed
with the privileges of the user running <command>bzgrep</command>. Apply
the following to address this:</para>
<screen><userinput>patch -Np1 -i ../&bzip2-bzgrep-patch;</userinput></screen>
@ -46,11 +61,21 @@ address this:</para>
<screen><userinput>make -f Makefile-libbz2_so
make clean</userinput></screen>
<para>The <parameter>-f</parameter> flag will cause Bzip2 to be built
using a different <filename>Makefile</filename> file, in this case the
<variablelist>
<title>The meaning of the make parameter:</title>
<varlistentry>
<term><parameter>-f Makefile-libbz2_so</parameter></term>
<listitem>
<para>This will cause Bzip2 to be built using a different
<filename>Makefile</filename> file, in this case the
<filename>Makefile-libbz2_so</filename> file, which creates a dynamic
<filename class="libraryfile">libbz2.so</filename> library and links the Bzip2
utilities against it.</para>
<filename class="libraryfile">libbz2.so</filename> library and links
the Bzip2 utilities against it.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Compile and test the package:</para>
@ -77,18 +102,22 @@ ln -sv bzip2 /bin/bzcat</userinput></screen>
</sect2>
<sect2 id="contents-bzip2" role="content"><title>Contents of Bzip2</title>
<sect2 id="contents-bzip2" role="content">
<title>Contents of Bzip2</title>
<segmentedlist>
<segtitle>Installed programs</segtitle>
<segtitle>Installed libraries</segtitle>
<seglistitem><seg>bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff,
<seglistitem>
<seg>bunzip2 (link to bzip2), bzcat (link to bzip2), bzcmp, bzdiff,
bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<seg>libbz2.[a,so]</seg></seglistitem>
<seg>libbz2.[a,so]</seg>
</seglistitem>
</segmentedlist>
<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
@ -96,7 +125,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bunzip2</command></term>
<listitem>
<para>Decompresses bzipped files</para>
<indexterm zone="ch-system-bzip2 bunzip2"><primary sortas="b-bunzip2">bunzip2</primary></indexterm>
<indexterm zone="ch-system-bzip2 bunzip2">
<primary sortas="b-bunzip2">bunzip2</primary>
</indexterm>
</listitem>
</varlistentry>
@ -104,7 +135,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bzcat</command></term>
<listitem>
<para>Decompresses to standard output</para>
<indexterm zone="ch-system-bzip2 bzcat"><primary sortas="b-bzcat">bzcat</primary></indexterm>
<indexterm zone="ch-system-bzip2 bzcat">
<primary sortas="b-bzcat">bzcat</primary>
</indexterm>
</listitem>
</varlistentry>
@ -112,7 +145,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bzcmp</command></term>
<listitem>
<para>Runs <command>cmp</command> on bzipped files</para>
<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>
</listitem>
</varlistentry>
@ -120,7 +155,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bzdiff</command></term>
<listitem>
<para>Runs <command>diff</command> on bzipped files</para>
<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>
</listitem>
</varlistentry>
@ -128,7 +165,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bzgrep</command></term>
<listitem>
<para>Runs <command>grep</command> on bzipped files</para>
<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>
</listitem>
</varlistentry>
@ -136,7 +175,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bzegrep</command></term>
<listitem>
<para>Runs <command>egrep</command> on bzipped files</para>
<indexterm zone="ch-system-bzip2 bzegrep"><primary sortas="b-bzegrep">bzegrep</primary></indexterm>
<indexterm zone="ch-system-bzip2 bzegrep">
<primary sortas="b-bzegrep">bzegrep</primary>
</indexterm>
</listitem>
</varlistentry>
@ -144,7 +185,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
<term><command>bzfgrep</command></term>
<listitem>
<para>Runs <command>fgrep</command> on bzipped files</para>
<indexterm zone="ch-system-bzip2 bzfgrep"><primary sortas="b-bzfgrep">bzfgrep</primary></indexterm>
<indexterm zone="ch-system-bzip2 bzfgrep">
<primary sortas="b-bzfgrep">bzfgrep</primary>
</indexterm>
</listitem>
</varlistentry>
@ -155,7 +198,9 @@ bzegrep, bzfgrep, bzgrep, bzip2, bzip2recover, bzless, and bzmore</seg>
compression algorithm with Huffman coding; the compression rate is
better than that achieved by more conventional compressors using
<quote>Lempel-Ziv</quote> algorithms, like <command>gzip</command></para>
<indexterm zone="ch-system-bzip2 bzip2"><primary sortas="b-bzip2">bzip2</primary></indexterm>
<indexterm zone="ch-system-bzip2 bzip2">
<primary sortas="b-bzip2">bzip2</primary>
</indexterm>
</listitem>
</varlistentry>
@ -163,7 +208,9 @@ better than that achieved by more conventional compressors using
<term><command>bzip2recover</command></term>
<listitem>
<para>Tries to recover data from damaged bzipped files</para>
<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>
</listitem>
</varlistentry>
@ -171,7 +218,9 @@ better than that achieved by more conventional compressors using
<term><command>bzless</command></term>
<listitem>
<para>Runs <command>less</command> on bzipped files</para>
<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>
</listitem>
</varlistentry>
@ -179,7 +228,9 @@ better than that achieved by more conventional compressors using
<term><command>bzmore</command></term>
<listitem>
<para>Runs <command>more</command> on bzipped files</para>
<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>
</listitem>
</varlistentry>
@ -188,12 +239,14 @@ better than that achieved by more conventional compressors using
<listitem>
<para>The library implementing lossless, block-sorting data
compression, using the Burrows-Wheeler algorithm</para>
<indexterm zone="ch-system-bzip2 libbz2"><primary sortas="c-libbz2*">libbz2*</primary></indexterm>
<indexterm zone="ch-system-bzip2 libbz2">
<primary sortas="c-libbz2*">libbz2*</primary>
</indexterm>
</listitem>
</varlistentry>
</variablelist>
</sect2>
</sect1>

View File

@ -1,31 +1,33 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-system-changingowner">
<title>Changing Ownership</title>
<?dbhtml filename="changingowner.html"?>
<para>Currently, the <filename class="directory">/tools</filename>
directory is owned by the user <emphasis>lfs</emphasis>, a user that
exists only on the host system. Although the <filename
class="directory">/tools</filename> directory can be deleted once the
LFS system has been finished, it can be retained to build additional
LFS systems. If the <filename class="directory">/tools</filename>
directory is kept as is, the files are owned by a user ID without a
corresponding account. This is dangerous because a user account
created later could get this same user ID and would own the <filename
class="directory">/tools</filename> directory and all the files
therein, thus exposing these files to possible malicious
<title>Changing Ownership</title>
<para>Currently, the <filename class="directory">/tools</filename> directory
is owned by the user <systemitem class="username">lfs</systemitem>, a user
that exists only on the host system. Although the <filename
class="directory">/tools</filename> directory can be deleted once the LFS
system has been finished, it can be retained to build additional LFS systems.
If the <filename class="directory">/tools</filename> directory is kept as is,
the files are owned by a user ID without a corresponding account. This is
dangerous because a user account created later could get this same user ID
and would own the <filename class="directory">/tools</filename> directory
and all the files therein, thus exposing these files to possible malicious
manipulation.</para>
<para>To avoid this issue, add the <emphasis>lfs</emphasis> user to
the new LFS system later when creating the
<filename>/etc/passwd</filename> file, taking care to assign it the
same user and group IDs as on the host system. Alternatively, assign
the contents of the <filename class="directory">/tools</filename>
directory to user <emphasis>root</emphasis> by running the following
<para>To avoid this issue, add the <systemitem class="username">lfs</systemitem>
user to the new LFS system later when creating the
<filename>/etc/passwd</filename> file, taking care to assign it the same user
and group IDs as on the host system. Alternatively, assign the contents of
the <filename class="directory">/tools</filename> directory to user
<systemitem class="username">root</systemitem> by running the following
command:</para>
<screen><userinput>chown -R 0:0 /tools</userinput></screen>
@ -36,4 +38,3 @@ is unable to resolve the name <quote>root</quote> until the
<filename>passwd</filename> file has been created.</para>
</sect1>

View File

@ -1,13 +1,16 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<chapter id="chapter-building-system" xreflabel="Chapter 6">
<?dbhtml dir="chapter06"?>
<title>Installing Basic System Software</title>
<?dbhtml filename="chapter06.html"?>
<title>Installing Basic System Software</title>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="introduction.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pkgmgt.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kernfs.xml"/>

View File

@ -1,40 +1,40 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-system-chroot">
<title>Entering the Chroot Environment</title>
<?dbhtml filename="chroot.html"?>
<para>It is time to enter the chroot environment to begin
building and installing the final LFS system. As user
<emphasis>root</emphasis>, run the following command to enter the
realm that is, at the moment, populated with only the temporary
tools:</para>
<title>Entering the Chroot Environment</title>
<para>It is time to enter the chroot environment to begin building and
installing the final LFS system. As user <systemitem
class="username">root</systemitem>, run the following command to enter the
realm that is, at the moment, populated with only the temporary tools:</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 \
/tools/bin/bash --login +h</userinput></screen>
<para>The <parameter>-i</parameter> option given to the
<command>env</command> command will clear all variables of the chroot
environment. After that, only the <envar>HOME</envar>,
<envar>TERM</envar>, <envar>PS1</envar>, and
<para>The <parameter>-i</parameter> option given to the <command>env</command>
command will clear all variables of the chroot environment. After that, only
the <envar>HOME</envar>, <envar>TERM</envar>, <envar>PS1</envar>, and
<envar>PATH</envar> variables are set again. The
<parameter>TERM=$TERM</parameter> construct will set the
<envar>TERM</envar> variable inside chroot to the same value as
outside chroot. This variable is needed for programs like
<command>vim</command> and <command>less</command> to operate
properly. If other variables are needed, such as
<envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is
a good place to set them again.</para>
<parameter>TERM=$TERM</parameter> construct will set the <envar>TERM</envar>
variable inside chroot to the same value as outside chroot. This variable is
needed for programs like <command>vim</command> and <command>less</command>
to operate properly. If other variables are needed, such as
<envar>CFLAGS</envar> or <envar>CXXFLAGS</envar>, this is a good place to set
them again.</para>
<para>From this point on, there is no need to use the
<envar>LFS</envar> variable anymore, because all work will be
restricted to the LFS file system. This is because the Bash shell is
told that <filename class="directory">$LFS</filename> is now the root
<envar>LFS</envar> variable anymore, because all work will be restricted
to the LFS file system. This is because the Bash shell is told that
<filename class="directory">$LFS</filename> is now the root
(<filename class="directory">/</filename>) directory.</para>
<para>Notice that <filename class="directory">/tools/bin</filename> comes last
@ -44,13 +44,12 @@ used once its final version is installed. This occurs when the shell does not
reason, hashing is switched off by passing the <parameter>+h</parameter> option
to <command>bash</command>.</para>
<para>It is important that all the commands throughout the remainder
of this chapter and the following chapters are run from within the
chroot environment. If you leave this environment for any reason
(rebooting for example), remember to first mount the <systemitem
class="filesystem">proc</systemitem> and <systemitem
class="filesystem">devpts</systemitem> file systems (discussed in the
previous section) and enter chroot again before continuing with the
<para>It is important that all the commands throughout the remainder of this
chapter and the following chapters are run from within the chroot environment.
If you leave this environment for any reason (rebooting for example), remember
to first mount the <systemitem class="filesystem">proc</systemitem> and
<systemitem class="filesystem">devpts</systemitem> file systems (discussed
in the previous section) and enter chroot again before continuing with the
installations.</para>
<para>Note that the <command>bash</command> prompt will say
@ -58,4 +57,3 @@ installations.</para>
<filename>/etc/passwd</filename> file has not been created yet.</para>
</sect1>

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-system-createfiles">
<title>Creating Essential Symlinks</title>
<?dbhtml filename="createfiles.html"?>
<title>Creating Essential Symlinks</title>
<para>Some programs use hard-wired paths to programs which do not exist yet. In
order to satisfy these programs, create a number of symbolic links which will be
replaced by real files throughout the course of this chapter after the software
@ -18,4 +21,3 @@ ln -sv /tools/lib/libgcc_s.so{,.1} /usr/lib
ln -sv bash /bin/sh</userinput></screen>
</sect1>

View File

@ -1,12 +1,15 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect1 id="ch-system-creatingdirs">
<title>Creating Directories</title>
<?dbhtml filename="creatingdirs.html"?>
<title>Creating Directories</title>
<para>It is time to create some structure in the LFS file system. Create a
standard directory tree by issuing the following commands:</para>
@ -30,42 +33,42 @@ install -dv /var/{opt,cache,lib/{misc,locate},local}
install -dv /opt/{bin,doc,include,info}
install -dv /opt/{lib,man/man{1,2,3,4,5,6,7,8}}</userinput></screen>
<para>Directories are, by default, created with permission mode 755,
but this is not desirable for all directories. In the commands above,
two changes are made&mdash;one to the home directory of user
<emphasis>root</emphasis>, and another to the directories for
<para>Directories are, by default, created with permission mode 755, but
this is not desirable for all directories. In the commands above, two
changes are made&mdash;one to the home directory of user <systemitem
class="username">root</systemitem>, and another to the directories for
temporary files.</para>
<para>The first mode change ensures that not just anybody can enter
the <filename class="directory">/root</filename> directory&mdash;the same
as a normal user would do with his or her home directory. The second
mode change makes sure that any user can write to the <filename
class="directory">/tmp</filename> and <filename
the <filename class="directory">/root</filename> directory&mdash;the
same as a normal user would do with his or her home directory. The
second mode change makes sure that any user can write to the
<filename class="directory">/tmp</filename> and <filename
class="directory">/var/tmp</filename> directories, but cannot remove
another user's files from them. The latter is prohibited by the
so-called <quote>sticky bit,</quote> the highest bit (1) in the 1777
bit mask.</para>
another user's files from them. The latter is prohibited by the so-called
<quote>sticky bit,</quote> the highest bit (1) in the 1777 bit mask.</para>
<note><para>Notice the two different constructions above for creating multiple
<note>
<para>Notice the two different constructions above for creating multiple
man directories: <command>install -d /usr/share/man/man{1..8}</command> and
<command>install -d /usr/local/share/man/man{1,2,3,4,5,6,7,8}</command>. The
first one is new since Bash 3.0. This new feature will help make repetitive
commands easier to type.</para></note>
commands easier to type.</para>
</note>
<sect2>
<title>FHS Compliance Note</title>
<para>The directory tree is based on the Filesystem Hierarchy Standard (FHS)
(available at <ulink url="http://www.pathname.com/fhs/"/>). In addition
to the tree created above, this standard stipulates the existence of <filename
class="directory">/usr/local/games</filename> and <filename
class="directory">/usr/share/games</filename>. The FHS is not precise as to the
structure of the <filename class="directory">/usr/local/share</filename>
subdirectory, so we create only the directories that are needed. However, feel
free to create these directories if you prefer to conform more strictly to the
FHS.</para>
<para>The directory tree is based on the Filesystem Hierarchy Standard
(FHS) (available at <ulink url="http://www.pathname.com/fhs/"/>). In
addition to the tree created above, this standard stipulates the existence
of <filename class="directory">/usr/local/games</filename> and <filename
class="directory">/usr/share/games</filename>. The FHS is not precise as to
the structure of the <filename class="directory">/usr/local/share</filename>
subdirectory, so we create only the directories that are needed. However,
feel free to create these directories if you prefer to conform more strictly
to the FHS.</para>
</sect2>
</sect1>