source: introduction/important/unpacking.xml@ bccbdaea

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since bccbdaea was bccbdaea, checked in by Manuel Canales Esparcia <manuel@…>, 18 years ago

Trailing spaces clean-up. Basicnet, book, and general parts.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@5327 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 7.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3 "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6]>
7
8<sect1 id="intro-important-unpacking">
9 <?dbhtml filename="unpacking.html"?>
10
11 <sect1info>
12 <othername>$LastChangedBy$</othername>
13 <date>$Date$</date>
14 </sect1info>
15
16 <title>Notes on Building Software</title>
17
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>
22
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>
27
28 <para>While you can keep the source files anywhere you like, we assume that
29 you have unpacked the package and changed into the directory created by the
30 unpacking process (the 'build' directory). We also assume you have
31 uncompressed any required patches and they are in the directory immediately
32 above the 'build' directory.</para>
33
34 <para>We can not emphasize strongly enough that you should start from a
35 <emphasis>clean source tree</emphasis> each time. This means that if
36 you have had an error, it's usually best to delete the source tree and
37 re-unpack it <emphasis>before</emphasis> trying again. This obviously
38 doesn't apply if you're an advanced user used to hacking
39 <filename>Makefile</filename>s and C code, but if in doubt, start from a
40 clean tree.</para>
41
42 <sect2>
43 <title>Building Software as an Unprivileged (non-root) User</title>
44
45 <para>The golden rule of Unix System Administration is to use your
46 superpowers only when necessary. Hence, BLFS recommends that you
47 build software as an unprivileged user and only become the
48 <systemitem class='username'>root</systemitem> user when installing the
49 software. This philosophy is followed in all the packages in this book.
50 Unless otherwise specified, all instructions should be executed as an
51 unprivileged user. The book will advise you on instructions that need
52 <systemitem class='username'>root</systemitem> privileges.</para>
53
54 </sect2>
55
56 <sect2>
57 <title>Unpacking the Software</title>
58
59 <para>If a file is in <filename class='extension'>.tar</filename> format
60 and compressed, it is unpacked by running one of the following
61 commands:</para>
62
63<screen><userinput>tar -xvf filename.tar.gz
64tar -xvf filename.tgz
65tar -xvf filename.tar.Z
66tar -xvf filename.tar.bz2</userinput></screen>
67
68 <note>
69 <para>You may omit using the <option>v</option> parameter in the commands
70 shown above and below if you wish to suppress the verbose listing of all
71 the files in the archive as they are extracted. This can help speed up the
72 extraction as well as make any errors produced during the extraction
73 more obvious to you.</para>
74 </note>
75
76 <para>You can also use a slightly different method:</para>
77
78<screen><userinput>bzcat filename.tar.bz2 | tar -xv</userinput></screen>
79
80 <para>Finally, you sometimes need to be able to unpack patches which are
81 generally not in <filename class='extension'>.tar</filename> format. The
82 best way to do this is to copy the patch file to parent of the 'build'
83 directory and then run one of the following commands depending on whether
84 the file is a <filename class='extension'>.gz</filename> or <filename
85 class='extension'>.bz2</filename> file:</para>
86
87<screen><userinput>gunzip -v patchname.gz
88bunzip2 -v patchname.bz2</userinput></screen>
89
90 </sect2>
91
92 <sect2>
93 <title>Verifying File Integrity Using 'md5sum'</title>
94
95 <para>Generally, to verify that the downloaded file is genuine and complete,
96 many package maintainers also distribute md5sums of the files. To verify the
97 md5sum of the downloaded files, download both the file and the
98 corresponding md5sum file to the same directory (preferably from different
99 on-line locations), and (assuming <filename>file.md5sum</filename> is the
100 md5sum file downloaded) run the following command:</para>
101
102<screen><userinput>md5sum -c file.md5sum</userinput></screen>
103
104 <para>If there are any errors, they will be reported. Note that the BLFS
105 book includes md5sums for all the source files also. To use the BLFS
106 supplied md5sums, you can create a <filename>file.md5sum</filename> (place
107 the md5sum data and the exact name of the downloaded file on the same
108 line of a file, separated by white space) and run the command shown above.
109 Alternately, simply run the command shown below and compare the output
110 to the md5sum data shown in the BLFS book.</para>
111
112<screen><userinput>md5sum <replaceable>[name_of_downloaded_file]</replaceable></userinput></screen>
113
114 </sect2>
115
116 <sect2>
117 <title>Creating Log Files During Installation</title>
118
119 <para>For larger packages, it is convenient to create log files instead of
120 staring at the screen hoping to catch a particular error or warning. Log
121 files are also useful for debugging and keeping records. The following
122 command allows you to create an installation log. Replace
123 <replaceable>[command]</replaceable> with the command you intend to execute.</para>
124
125<screen><userinput>( <replaceable>[command]</replaceable> 2&gt;&amp;1 | tee compile.log &amp;&amp; exit $PIPESTATUS )</userinput></screen>
126
127 <para><option>2&gt;&amp;1</option> redirects error messages to the same
128 location as standard output. The <command>tee</command> command allows
129 viewing of the output while logging the results to a file. The parentheses
130 around the command run the entire command in a subshell and finally the
131 <command>exit $PIPESTATUS</command> command ensures the result of the
132 <replaceable>[command]</replaceable> is returned as the result and not the
133 result of the <command>tee</command> command.</para>
134
135 </sect2>
136
137 <sect2>
138 <title>Dependencies</title>
139
140 <para>For each package described, BLFS lists the known dependencies.
141 These are listed under several headings, whose meaning is as follows:</para>
142
143 <itemizedlist>
144 <listitem>
145 <para><emphasis>Required</emphasis> means
146 that the target package cannot be correctly built without
147 the dependency having first been installed.</para>
148 </listitem>
149 <listitem>
150 <para><emphasis>Recommended</emphasis> means that BLFS strongly suggests this package is
151 installed first for a clean and trouble-free build, that won't have
152 issues either during the build process, or at run-time.</para>
153 </listitem>
154 <listitem>
155 <para><emphasis>Optional</emphasis> means that this package might be installed for added
156 functionality. Often BLFS will qualify the dependency to explain the
157 added functionality that will result.</para>
158 </listitem>
159 </itemizedlist>
160
161 </sect2>
162
163</sect1>
Note: See TracBrowser for help on using the repository browser.