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,72 +1,97 @@
<?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"?>
<?dbhtml filename="bzip2.html"?>
<indexterm zone="ch-system-bzip2"><primary sortas="a-Bzip2">Bzip2</primary></indexterm>
<title>Bzip2-&bzip2-version;</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>
<indexterm zone="ch-system-bzip2">
<primary sortas="a-Bzip2">Bzip2</primary>
</indexterm>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<seglistitem><seg>0.1 SBU</seg><seg>3.9 MB</seg></seglistitem>
</segmentedlist>
<sect2 role="package">
<title/>
<segmentedlist>
<segtitle>&dependencies;</segtitle>
<seglistitem><seg>Bash, Binutils, Coreutils, Diffutils,
GCC, Glibc, and Make</seg></seglistitem>
</segmentedlist>
</sect2>
<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>
<sect2 role="installation">
<title>Installation of Bzip2</title>
<segmentedlist>
<segtitle>&buildtime;</segtitle>
<segtitle>&diskspace;</segtitle>
<para>Apply a patch to install the documentation for this package:</para>
<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>
</segmentedlist>
</sect2>
<sect2 role="installation">
<title>Installation of Bzip2</title>
<para>Apply a patch to install the documentation for this package:</para>
<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>
<para>Prepare Bzip2 for compilation with:</para>
<para>Prepare Bzip2 for compilation with:</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
<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>
<variablelist>
<title>The meaning of the make parameter:</title>
<para>Compile and test the package:</para>
<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>
</listitem>
</varlistentry>
</variablelist>
<para>Compile and test the package:</para>
<screen><userinput>make</userinput></screen>
<para>If reinstalling Bzip2, perform
<userinput>rm -vf /usr/bin/bz*</userinput> first, otherwise the following
<command>make install</command> will fail.</para>
<para>If reinstalling Bzip2, perform
<userinput>rm -vf /usr/bin/bz*</userinput> first, otherwise the following
<command>make install</command> will fail.</para>
<para>Install the programs:</para>
<para>Install the programs:</para>
<screen><userinput>make install</userinput></screen>
<para>Install the shared <command>bzip2</command> binary into the
<filename class="directory">/bin</filename> directory, make
some necessary symbolic links, and clean up:</para>
<para>Install the shared <command>bzip2</command> binary into the
<filename class="directory">/bin</filename> directory, make
some necessary symbolic links, and clean up:</para>
<screen><userinput>cp -v bzip2-shared /bin/bzip2
cp -av libbz2.so* /lib
@ -75,125 +100,153 @@ rm -v /usr/bin/{bunzip2,bzcat,bzip2}
ln -sv bzip2 /bin/bunzip2
ln -sv bzip2 /bin/bzcat</userinput></screen>
</sect2>
</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>
<segmentedlist>
<segtitle>Installed programs</segtitle>
<segtitle>Installed libraries</segtitle>
<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>
</segmentedlist>
<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>
</segmentedlist>
<variablelist><bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<variablelist>
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
<?dbfo list-presentation="list"?>
<?dbhtml list-presentation="table"?>
<varlistentry id="bunzip2">
<term><command>bunzip2</command></term>
<listitem>
<para>Decompresses bzipped files</para>
<indexterm zone="ch-system-bzip2 bunzip2"><primary sortas="b-bunzip2">bunzip2</primary></indexterm>
</listitem>
</varlistentry>
<varlistentry id="bunzip2">
<term><command>bunzip2</command></term>
<listitem>
<para>Decompresses bzipped files</para>
<indexterm zone="ch-system-bzip2 bunzip2">
<primary sortas="b-bunzip2">bunzip2</primary>
</indexterm>
</listitem>
</varlistentry>
<varlistentry id="bzcat">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzcat">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzcmp">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzcmp">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzdiff">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzdiff">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzgrep">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzgrep">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzegrep">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzegrep">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzfgrep">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzfgrep">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzip2">
<term><command>bzip2</command></term>
<listitem>
<para>Compresses files using the Burrows-Wheeler block sorting text
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>
</listitem>
</varlistentry>
<varlistentry id="bzip2">
<term><command>bzip2</command></term>
<listitem>
<para>Compresses files using the Burrows-Wheeler block sorting text
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>
</listitem>
</varlistentry>
<varlistentry id="bzip2recover">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzip2recover">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzless">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzless">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzmore">
<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>
</listitem>
</varlistentry>
<varlistentry id="bzmore">
<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>
</listitem>
</varlistentry>
<varlistentry id="libbz2">
<term><filename class="libraryfile">libbz2*</filename></term>
<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>
</listitem>
</varlistentry>
</variablelist>
<varlistentry id="libbz2">
<term><filename class="libraryfile">libbz2*</filename></term>
<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>
</listitem>
</varlistentry>
</sect2>
</variablelist>
</sect2>
</sect1>

View File

@ -1,39 +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-changingowner">
<title>Changing Ownership</title>
<?dbhtml filename="changingowner.html"?>
<?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
manipulation.</para>
<title>Changing Ownership</title>
<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
command:</para>
<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 <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>
<para>The command uses <parameter>0:0</parameter> instead of
<parameter>root:root</parameter>, because <command>chown</command>
is unable to resolve the name <quote>root</quote> until the
<filename>passwd</filename> file has been created.</para>
<para>The command uses <parameter>0:0</parameter> instead of
<parameter>root:root</parameter>, because <command>chown</command>
is unable to resolve the name <quote>root</quote> until the
<filename>passwd</filename> file has been created.</para>
</sect1>

View File

@ -1,76 +1,79 @@
<?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"?>
<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"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chroot.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="changingowner.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingdirs.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="createfiles.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pwdgroup.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="devices.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iana-etc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readline.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="vim.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="less.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="db.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inetutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iproute2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="autoconf.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="automake.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hotplug.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-db.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procps.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="psmisc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="shadow.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysvinit.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.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="aboutdebug.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="strippingagain.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/>
<chapter id="chapter-building-system" xreflabel="Chapter 6">
<?dbhtml dir="chapter06"?>
<?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"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="chroot.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="changingowner.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="creatingdirs.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="createfiles.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="pwdgroup.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="devices.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="linux-libc-headers.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-pages.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="glibc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readjusting.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="binutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gcc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="coreutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="zlib.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="mktemp.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iana-etc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="findutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gawk.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="ncurses.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="readline.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="vim.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="m4.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bison.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="less.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="db.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="groff.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sed.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="flex.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gettext.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="inetutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="iproute2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="perl.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="texinfo.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="autoconf.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="automake.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bash.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="file.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grep.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="libtool.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="bzip2.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="diffutils.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="kbd.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="e2fsprogs.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="grub.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="gzip.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="hotplug.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="man-db.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="make.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="module-init-tools.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="patch.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="procps.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="psmisc.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="shadow.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysklogd.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="sysvinit.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="tar.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="aboutdebug.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="strippingagain.xml"/>
<xi:include xmlns:xi="http://www.w3.org/2003/XInclude" href="revisedchroot.xml"/>
</chapter>

View File

@ -1,61 +1,59 @@
<?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>
<sect1 id="ch-system-chroot">
<?dbhtml filename="chroot.html"?>
<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
<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>
<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>
<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
(<filename class="directory">/</filename>) directory.</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
(<filename class="directory">/</filename>) directory.</para>
<para>Notice that <filename class="directory">/tools/bin</filename> comes last
in the <envar>PATH</envar>. This means that a temporary tool will no longer be
used once its final version is installed. This occurs when the shell does not
<quote>remember</quote> the locations of executed binaries&mdash;for this
reason, hashing is switched off by passing the <parameter>+h</parameter> option
to <command>bash</command>.</para>
<para>Notice that <filename class="directory">/tools/bin</filename> comes last
in the <envar>PATH</envar>. This means that a temporary tool will no longer be
used once its final version is installed. This occurs when the shell does not
<quote>remember</quote> the locations of executed binaries&mdash;for this
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
installations.</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
installations.</para>
<para>Note that the <command>bash</command> prompt will say
<computeroutput>I have no name!</computeroutput> This is normal because the
<filename>/etc/passwd</filename> file has not been created yet.</para>
<para>Note that the <command>bash</command> prompt will say
<computeroutput>I have no name!</computeroutput> This is normal because the
<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,16 +1,19 @@
<?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"?>
<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
has been installed.</para>
<sect1 id="ch-system-createfiles">
<?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
has been installed.</para>
<screen><userinput>ln -sv /tools/bin/{bash,cat,pwd,stty} /bin
ln -sv /tools/bin/perl /usr/bin
@ -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,15 +1,18 @@
<?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"?>
<para>It is time to create some structure in the LFS file system. Create a
standard directory tree by issuing the following commands:</para>
<sect1 id="ch-system-creatingdirs">
<?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>
<screen><userinput>install -dv /{bin,boot,dev,etc/opt,home,lib,mnt}
install -dv /{sbin,srv,usr/local,var,opt}
install -dv /root -m 0750
@ -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
temporary files.</para>
<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
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>
<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
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>
<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>
<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>
<sect2>
<title>FHS Compliance Note</title>
<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>
</sect2>
</sect1>