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