2004-06-10 10:40:59 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-04-04 04:52:42 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-06-10 10:40:59 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
]>
|
|
|
|
|
2002-07-08 04:28:42 +08:00
|
|
|
<sect1 id="intro-important-unpacking">
|
2005-05-07 20:23:20 +08:00
|
|
|
<?dbhtml filename="unpacking.html"?>
|
2005-04-22 11:57:56 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<sect1info>
|
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
|
|
|
</sect1info>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<title>Notes on Building Software</title>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<para>Those people who have built an LFS system will be aware
|
2005-05-07 20:23:20 +08:00
|
|
|
of the general principles of downloading and unpacking software. We will
|
|
|
|
however repeat some of that information here for those new to building
|
|
|
|
their own software.</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<para>Each set of installation instructions contains a URL from which you
|
|
|
|
can download the package. We do however keep a selection of patches
|
|
|
|
available via http. These are referenced as needed in the installation
|
2005-05-07 20:23:20 +08:00
|
|
|
instructions.</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>While you can keep the source files anywhere you like, we
|
|
|
|
assume that you have unpacked them and unzipped any required patches
|
|
|
|
into <filename>/usr/src</filename>.</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>We can not emphasize strongly enough that you should start from a
|
|
|
|
<emphasis>clean source tree</emphasis> each time. This means that if
|
|
|
|
you have had an error, it's usually best to delete the source tree and
|
|
|
|
re-unpack it <emphasis>before</emphasis> trying again. This obviously
|
|
|
|
doesn't apply if you're an advanced user used to hacking Makefiles and C
|
|
|
|
code, but if in doubt, start from a clean tree.</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Unpacking the Software</title>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>If a file is tar'ed and compressed, it is unpacked by running one of
|
|
|
|
the following commands:</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<screen><userinput>tar -xvf filename.tar.gz
|
2005-05-07 20:23:20 +08:00
|
|
|
tar -xvf filename.tgz
|
|
|
|
tar -xvf filename.tar.Z
|
2005-05-22 18:45:25 +08:00
|
|
|
tar -xvf filename.tar.bz2</userinput></screen>
|
2005-05-07 20:23:20 +08:00
|
|
|
|
|
|
|
<para>You can also use a slightly different method:</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<screen><userinput>bzcat filename.tar.bz2 | tar -xv</userinput></screen>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>Finally, you sometimes need to be able to unpack patches which are
|
|
|
|
generally not tar'ed. The best way to do this is to copy the patch file to
|
|
|
|
<filename>/usr/src</filename> and then to run one of the following commands
|
2005-05-22 18:45:25 +08:00
|
|
|
depending on whether the file is <filename>.gz</filename> or
|
2005-05-07 20:23:20 +08:00
|
|
|
<filename>.bz2</filename>:</para>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<screen><userinput>gunzip -v patchname.gz
|
|
|
|
bunzip2 -v patchname.bz2</userinput></screen>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
</sect2>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Verifying File Integrity Using 'md5sum'</title>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>Generally, to verify that the downloaded file is genuine and complete,
|
|
|
|
most package maintainers also distribute md5sums of the files.
|
|
|
|
To verify the md5sum of the downloaded files, download both the file and the
|
|
|
|
corresponding md5sum file to the same directory (preferably from different
|
|
|
|
on-line locations), and (assuming file.md5sum is the md5sum file downloaded)
|
|
|
|
run the following command:</para>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<screen><userinput>md5sum -c file.md5sum</userinput></screen>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>If there are any errors, they will be reported.</para>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
</sect2>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Creating Log Files During Installation</title>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
<para>For larger packages, it is convenient to create log files instead of
|
|
|
|
staring at the screen hoping to catch a particular error or warning. Log files
|
|
|
|
are also useful for debugging and keeping records. The following command
|
|
|
|
allows you to create an installation log. Replace <command> with the
|
|
|
|
command you intend to execute.</para>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<screen><userinput>( <command> 2>&1 | tee compile.log && exit $PIPESTATUS )</userinput></screen>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-22 18:45:25 +08:00
|
|
|
<para><option>2>&1</option> redirects error messages to the same
|
|
|
|
location as standard output. The <command>tee</command> command allows
|
2005-05-07 20:23:20 +08:00
|
|
|
viewing of the output while logging the results to a file. The parentheses
|
|
|
|
around the command run the entire command in a subshell and finally the
|
2005-05-22 18:45:25 +08:00
|
|
|
<command>exit $PIPESTATUS</command> ensures the result of the
|
|
|
|
<command> is returned as the result and not the result of the
|
2005-05-07 20:23:20 +08:00
|
|
|
<command>tee</command> command.</para>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2005-05-07 20:23:20 +08:00
|
|
|
</sect2>
|
2004-02-20 13:16:24 +08:00
|
|
|
|
2002-07-08 04:28:42 +08:00
|
|
|
</sect1>
|