[4122007] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[4122007] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[f45b1953] | 8 | <sect1 id="intro-important-unpacking">
|
---|
[b92d4b3] | 9 | <?dbhtml filename="unpacking.html"?>
|
---|
[c269038] | 10 |
|
---|
[b92d4b3] | 11 | <sect1info>
|
---|
| 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
| 14 | </sect1info>
|
---|
[f45b1953] | 15 |
|
---|
[b92d4b3] | 16 | <title>Notes on Building Software</title>
|
---|
[f45b1953] | 17 |
|
---|
[b92d4b3] | 18 | <para>Those people who have built an LFS system will be aware
|
---|
| 19 | of the general principles of downloading and unpacking software. We will
|
---|
| 20 | however repeat some of that information here for those new to building
|
---|
| 21 | their own software.</para>
|
---|
[f45b1953] | 22 |
|
---|
[b92d4b3] | 23 | <para>Each set of installation instructions contains a URL from which you
|
---|
| 24 | can download the package. We do however keep a selection of patches
|
---|
| 25 | available via http. These are referenced as needed in the installation
|
---|
| 26 | instructions.</para>
|
---|
[f45b1953] | 27 |
|
---|
[b92d4b3] | 28 | <para>While you can keep the source files anywhere you like, we
|
---|
| 29 | assume that you have unpacked them and unzipped any required patches
|
---|
| 30 | into <filename>/usr/src</filename>.</para>
|
---|
[f45b1953] | 31 |
|
---|
[b92d4b3] | 32 | <para>We can not emphasize strongly enough that you should start from a
|
---|
| 33 | <emphasis>clean source tree</emphasis> each time. This means that if
|
---|
| 34 | you have had an error, it's usually best to delete the source tree and
|
---|
| 35 | re-unpack it <emphasis>before</emphasis> trying again. This obviously
|
---|
| 36 | doesn't apply if you're an advanced user used to hacking Makefiles and C
|
---|
| 37 | code, but if in doubt, start from a clean tree.</para>
|
---|
[f45b1953] | 38 |
|
---|
[b92d4b3] | 39 | <sect2>
|
---|
| 40 | <title>Unpacking the Software</title>
|
---|
[f45b1953] | 41 |
|
---|
[b92d4b3] | 42 | <para>If a file is tar'ed and compressed, it is unpacked by running one of
|
---|
| 43 | the following commands:</para>
|
---|
[f45b1953] | 44 |
|
---|
[b92d4b3] | 45 | <screen><command>tar -xvf filename.tar.gz
|
---|
| 46 | tar -xvf filename.tgz
|
---|
| 47 | tar -xvf filename.tar.Z
|
---|
| 48 | tar -xvf filename.tar.bz2</command></screen>
|
---|
| 49 |
|
---|
| 50 | <para>You can also use a slightly different method:</para>
|
---|
[f45b1953] | 51 |
|
---|
[acfc391] | 52 | <screen><command>bzcat filename.tar.bz2 | tar -xv</command></screen>
|
---|
[f45b1953] | 53 |
|
---|
[b92d4b3] | 54 | <para>Finally, you sometimes need to be able to unpack patches which are
|
---|
| 55 | generally not tar'ed. The best way to do this is to copy the patch file to
|
---|
| 56 | <filename>/usr/src</filename> and then to run one of the following commands
|
---|
| 57 | depending on whether the file is <filename>.gz</filename> or
|
---|
| 58 | <filename>.bz2</filename>:</para>
|
---|
[f45b1953] | 59 |
|
---|
[b92d4b3] | 60 | <screen><command>gunzip -v patchname.gz
|
---|
| 61 | bunzip2 -v patchname.bz2</command></screen>
|
---|
[f45b1953] | 62 |
|
---|
[b92d4b3] | 63 | </sect2>
|
---|
[f45b1953] | 64 |
|
---|
[b92d4b3] | 65 | <sect2>
|
---|
| 66 | <title>Verifying File Integrity Using 'md5sum'</title>
|
---|
[0c603671] | 67 |
|
---|
[b92d4b3] | 68 | <para>Generally, to verify that the downloaded file is genuine and complete,
|
---|
| 69 | most package maintainers also distribute md5sums of the files.
|
---|
| 70 | To verify the md5sum of the downloaded files, download both the file and the
|
---|
| 71 | corresponding md5sum file to the same directory (preferably from different
|
---|
| 72 | on-line locations), and (assuming file.md5sum is the md5sum file downloaded)
|
---|
| 73 | run the following command:</para>
|
---|
[0c603671] | 74 |
|
---|
| 75 | <screen><command>md5sum -c file.md5sum</command></screen>
|
---|
| 76 |
|
---|
[b92d4b3] | 77 | <para>If there are any errors, they will be reported.</para>
|
---|
[0c603671] | 78 |
|
---|
[b92d4b3] | 79 | </sect2>
|
---|
[0c603671] | 80 |
|
---|
[b92d4b3] | 81 | <sect2>
|
---|
| 82 | <title>Creating Log Files During Installation</title>
|
---|
[0c603671] | 83 |
|
---|
[b92d4b3] | 84 | <para>For larger packages, it is convenient to create log files instead of
|
---|
| 85 | staring at the screen hoping to catch a particular error or warning. Log files
|
---|
| 86 | are also useful for debugging and keeping records. The following command
|
---|
| 87 | allows you to create an installation log. Replace <command> with the
|
---|
| 88 | command you intend to execute.</para>
|
---|
[0c603671] | 89 |
|
---|
| 90 | <screen><command>( <command> 2>&1 | tee compile.log && exit $PIPESTATUS )</command></screen>
|
---|
| 91 |
|
---|
[b92d4b3] | 92 | <para><option>2>&1</option> redirects error messages to the same
|
---|
| 93 | location as standard output. The <command>tee</command> command allows
|
---|
| 94 | viewing of the output while logging the results to a file. The parentheses
|
---|
| 95 | around the command run the entire command in a subshell and finally the
|
---|
| 96 | <command>exit $PIPESTATUS</command> ensures the result of the
|
---|
| 97 | <command> is returned as the result and not the result of the
|
---|
| 98 | <command>tee</command> command.</para>
|
---|
[0c603671] | 99 |
|
---|
[b92d4b3] | 100 | </sect2>
|
---|
[0c603671] | 101 |
|
---|
[f45b1953] | 102 | </sect1>
|
---|