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