xml-docbook-documentation-first-pass-20060915
[openafs.git] / doc / xml / QuickStartUnix / auqbg008.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <appendix id="HDRWQ163">
3   <title>Appendix A. Building AFS from Source Code</title>
4
5   <para>This chapter describes how to build AFS from source code. <indexterm>
6       <primary>storing</primary>
7
8       <secondary>AFS source in volume</secondary>
9     </indexterm> <indexterm>
10       <primary>creating</primary>
11
12       <secondary>volume</secondary>
13
14       <tertiary>for AFS source</tertiary>
15     </indexterm> <indexterm>
16       <primary>volume</primary>
17
18       <secondary>for AFS source</secondary>
19     </indexterm> <indexterm>
20       <primary>source (AFS)</primary>
21
22       <secondary>storing in AFS volume</secondary>
23     </indexterm> <indexterm>
24       <primary>files</primary>
25
26       <secondary>AFS source</secondary>
27     </indexterm></para>
28
29   <sect1 id="HDRWQ164">
30     <title>Loading the Source Files</title>
31
32     <para>Working on an AFS client machine, perform these steps to load the AFS source tree from the AFS Source Distribution.
33     <orderedlist>
34         <indexterm>
35           <primary>commands</primary>
36
37           <secondary>vos create</secondary>
38
39           <tertiary>src.afs volume</tertiary>
40         </indexterm>
41
42         <indexterm>
43           <primary>vos commands</primary>
44
45           <secondary>create</secondary>
46
47           <tertiary>src.afs volume</tertiary>
48         </indexterm>
49
50         <indexterm>
51           <primary>src.afs volume</primary>
52         </indexterm>
53
54         <indexterm>
55           <primary>volume</primary>
56
57           <secondary>creating</secondary>
58
59           <tertiary>src.afs</tertiary>
60         </indexterm>
61
62         <indexterm>
63           <primary>creating</primary>
64
65           <secondary>src.afs volume</secondary>
66         </indexterm>
67
68         <listitem>
69           <para>Create and mount a volume for housing the AFS source tree. These instructions name the volume <emphasis
70           role="bold">src.afs</emphasis> and mount it at the <emphasis
71           role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs/src</emphasis> directory.</para>
72
73           <para>Setting the <emphasis role="bold">-maxquota</emphasis> argument to <emphasis role="bold">0</emphasis> (zero) sets an
74           unlimited quota on the volume, which enables you to copy all of the files into the volume without exceeding its quota. If
75           you wish, you can set the volume's quota to a finite value after you complete the copying operation. At that point, use
76           the <emphasis role="bold">vos examine</emphasis> command to determine how much space the volume is occupying. Then issue
77           the <emphasis role="bold">fs setquota</emphasis> command to set a quota that is slightly larger.</para>
78
79           <programlisting>
80    # <emphasis role="bold">vos create</emphasis> &lt;<replaceable>machine name</replaceable>&gt; &lt;<replaceable>partition name</replaceable>&gt; <emphasis
81               role="bold">src.afs -maxquota 0</emphasis> 
82    # <emphasis role="bold">cd /afs/.</emphasis><replaceable>cellname</replaceable>
83    # <emphasis role="bold">mkdir afs</emphasis>
84    # <emphasis role="bold">fs mkmount afs/src src.afs</emphasis>
85    # <emphasis role="bold">vos release root.cell</emphasis>
86    # <emphasis role="bold">fs checkvolumes</emphasis>
87 </programlisting>
88         </listitem>
89
90         <listitem>
91           <para>On the local <emphasis role="bold">/cdrom</emphasis> directory, mount the CD-ROM that contains the AFS source files.
92           For instructions on mounting CD-ROMs (either locally or remotely via NFS), consult the operating system documentation.
93           <indexterm>
94               <primary>copying</primary>
95
96               <secondary>source files from CD-ROM</secondary>
97             </indexterm> <indexterm>
98               <primary>CD-ROM</primary>
99
100               <secondary>copying source files from</secondary>
101             </indexterm></para>
102         </listitem>
103
104         <listitem>
105           <para>Copy the source files from the CD-ROM into the newly created volume. <programlisting>
106    # <emphasis role="bold">cd /cdrom/src</emphasis>
107    # <emphasis role="bold">cp -rp  *  /afs/.</emphasis><replaceable>cellname</replaceable>/<emphasis role="bold">afs/src</emphasis>
108 </programlisting></para>
109         </listitem>
110       </orderedlist></para>
111
112     <indexterm>
113       <primary>source (AFS)</primary>
114
115       <secondary>compiling</secondary>
116     </indexterm>
117
118     <indexterm>
119       <primary>compiling AFS from source</primary>
120     </indexterm>
121
122     <indexterm>
123       <primary>building</primary>
124
125       <secondary>AFS from source</secondary>
126     </indexterm>
127   </sect1>
128
129   <sect1 id="HDRWQ165">
130     <title>Compiling AFS Binaries Using the washtool Program</title>
131
132     <para>The AFS distribution includes the <emphasis role="bold">washtool</emphasis> program for managing a hierarchy of software
133     development projects. The program builds project trees for program editing, compilation, and installation. <orderedlist>
134         <listitem>
135           <para>Create a subdirectory under the <emphasis role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis
136           role="bold">/afs</emphasis> directory for each system type for which you will build AFS binaries. Creating and mounting a
137           volume for each system type is recommended, but you can also simply use the <emphasis role="bold">mkdir</emphasis>
138           command. If you create a new volume, grant it an unlimited quota to avoid running out of space during the build process.
139           <programlisting>
140    # <emphasis role="bold">cd /afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis>    
141 </programlisting></para>
142
143           <para>If creating a new volume:</para>
144
145           <programlisting>
146    # <emphasis role="bold">vos create</emphasis> &lt;<replaceable>machine name</replaceable>&gt; &lt;<replaceable>partition name</replaceable>&gt; <replaceable>sysname</replaceable> <emphasis
147               role="bold">-maxquota 0</emphasis>
148    # <emphasis role="bold">fs mkmount</emphasis> <replaceable>sysname</replaceable> <replaceable>sysname</replaceable>    
149 </programlisting>
150
151           <para>If not creating a new volume:</para>
152
153           <programlisting>
154    # <emphasis role="bold">mkdir</emphasis> <replaceable>sysname</replaceable>
155 </programlisting>
156         </listitem>
157
158         <listitem>
159           <para>In the directory for each system type, create subdirectories called <emphasis role="bold">dest</emphasis>, <emphasis
160           role="bold">dest/bin</emphasis>, and <emphasis role="bold">obj</emphasis>. If you plan to use the
161           <emphasis>@sys</emphasis> variable in pathnames that refer to these directories, then you must use the conventional system
162           names listed in the <emphasis>IBM AFS Release Notes</emphasis>. <programlisting>
163    # <emphasis role="bold">cd</emphasis> <replaceable>sysname</replaceable>
164    # <emphasis role="bold">mkdir dest</emphasis> 
165    # <emphasis role="bold">mkdir dest/bin</emphasis> 
166    # <emphasis role="bold">mkdir obj</emphasis>
167 </programlisting></para>
168         </listitem>
169
170         <listitem>
171           <para>Create the indicated directories and symbolic links in the <emphasis
172           role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis> directory.
173           <programlisting>
174    # <emphasis role="bold">cd /afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis>
175    # <emphasis role="bold">ln -s  @sys/dest  dest</emphasis>
176    # <emphasis role="bold">ln -s  @sys/obj  obj</emphasis>
177    # <emphasis role="bold">ln -s  .  PARENT</emphasis>
178    # <emphasis role="bold">ln -s  src/Makefile  Makefile</emphasis>   
179 </programlisting></para>
180
181           <para>The following is an example directory listing for the <emphasis
182           role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis> directory after
183           completing the preceding steps. It includes two example system types.</para>
184
185           <programlisting>
186    lrwxr-xr-x admin   12 Jun 18 11:26 Makefile-&gt;src/Makefile
187    lrwxr-xr-x admin    1 Jun 18 11:26 PARENT -&gt; .
188    lrwxr-xr-x admin    9 Jun 18 11:25 dest -&gt; @sys/dest
189    lrwxr-xr-x admin    8 Jun 18 11:25 obj -&gt; @sys/obj
190    drwxrwxrwx admin 4096 Jun 18 11:24 rcs
191    drwxrwxrwx admin 2048 Jun 18 11:27 rs_aix42
192    drwxrwxrwx admin 2048 Jun 18 11:10 src
193    drwxrwxrwx admin 2048 Jun 18 11:27 sun4x_56
194 </programlisting>
195         </listitem>
196
197         <listitem>
198           <para><emphasis role="bold">(Optional)</emphasis> By default, the build procedure writes its results into a destination
199           directory for each system type called <emphasis role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis
200           role="bold">/afs/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/dest</emphasis>. To write the results
201           to a different destination directory, create a link from the <emphasis role="bold">dest</emphasis> directory to it.
202           <programlisting>
203    # <emphasis role="bold">cd /afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs/</emphasis><replaceable>sysname</replaceable>
204    # <emphasis role="bold">ln -s</emphasis> <replaceable>full_path_of_alternate_directory</replaceable> <emphasis role="bold">dest</emphasis>
205 </programlisting> <indexterm>
206               <primary>commands</primary>
207
208               <secondary>washtool</secondary>
209             </indexterm> <indexterm>
210               <primary>washtool command</primary>
211             </indexterm></para>
212         </listitem>
213
214         <listitem>
215           <para>For each system type you plan to build, copy the binary for the <emphasis role="bold">washtool</emphasis> program to
216           the directory specified in the AFS <emphasis role="bold">Makefile</emphasis>, which is <emphasis
217           role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
218           role="bold">/afs/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/dest/bin</emphasis>. If you prefer to
219           store the program in a different directory, you can use the WASHTOOL variable on the <emphasis role="bold">make</emphasis>
220           command line as described in Step <link linkend="LIWQ166">6</link>.</para>
221
222           <para>If there is a volume that houses the AFS binaries for each system type (as recommended), the conventional location
223           for the <emphasis role="bold">washtool</emphasis> binary is the <emphasis
224           role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
225           role="bold">/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/usr/afsws/bin</emphasis> directory. Use
226           the following instruction to copy it.</para>
227
228           <programlisting>
229    # <emphasis role="bold">cd  /afs/</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/</emphasis><replaceable>sysname</replaceable><emphasis
230               role="bold">/usr/afsws/bin</emphasis>
231    # <emphasis role="bold">cp  washtool</emphasis>  <emphasis role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis
232               role="bold">/afs/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/dest/bin</emphasis>   
233 </programlisting>
234
235           <para>Otherwise, mount the (binary) AFS CD-ROM for this system type on the local <emphasis role="bold">/cdrom</emphasis>
236           directory, and copy the <emphasis role="bold">washtool</emphasis> binary directly from it.</para>
237
238           <programlisting>
239    # <emphasis role="bold">cd  /cdrom/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/bin</emphasis>
240    # <emphasis role="bold">cp  washtool</emphasis>  <emphasis role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis
241               role="bold">/afs/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/dest/bin</emphasis>
242 </programlisting>
243
244           <indexterm>
245             <primary>commands</primary>
246
247             <secondary>make</secondary>
248           </indexterm>
249
250           <indexterm>
251             <primary>make command</primary>
252           </indexterm>
253
254           <indexterm>
255             <primary>variables</primary>
256
257             <secondary>WASHTOOL</secondary>
258           </indexterm>
259
260           <indexterm>
261             <primary>variables</primary>
262
263             <secondary>SYS_NAME for washtool command</secondary>
264           </indexterm>
265
266           <indexterm>
267             <primary>SYS_NAME variable for washtool command</primary>
268           </indexterm>
269
270           <indexterm>
271             <primary>WASHTOOL variable</primary>
272           </indexterm>
273         </listitem>
274
275         <listitem>
276           <para><anchor id="LIWQ166" />Working in the <emphasis
277           role="bold">/afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis> directory on a
278           machine of the system type for which you are building AFS, issue the <emphasis role="bold">make install</emphasis>
279           command. Set the SYS_NAME variable to the appropriate system type name.</para>
280
281           <para>If the <emphasis role="bold">washtool</emphasis> binary is not in the conventional directory (<emphasis
282           role="bold">/afs/</emphasis><replaceable>cellname</replaceable><emphasis
283           role="bold">/afs/</emphasis><replaceable>sysname</replaceable><emphasis role="bold">/dest/bin</emphasis>), set the
284           WASHTOOL variable to the alternate full pathname of the binary.</para>
285
286           <programlisting>
287    # <emphasis role="bold">cd /afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis>
288    # <emphasis role="bold">make SYS_NAME=</emphasis><replaceable>sysname</replaceable> [<emphasis role="bold">WASHTOOL=</emphasis><replaceable>alternate_washtool_directory</replaceable>] <emphasis
289               role="bold">install</emphasis>
290 </programlisting>
291         </listitem>
292       </orderedlist></para>
293   </sect1>
294 </appendix>