1 <?xml version="1.0" encoding="UTF-8"?>
2 <appendix id="HDRWQ163">
3 <title>Appendix A. Building AFS from Source Code</title>
5 <para>This chapter describes how to build AFS from source code. <indexterm>
6 <primary>storing</primary>
8 <secondary>AFS source in volume</secondary>
9 </indexterm> <indexterm>
10 <primary>creating</primary>
12 <secondary>volume</secondary>
14 <tertiary>for AFS source</tertiary>
15 </indexterm> <indexterm>
16 <primary>volume</primary>
18 <secondary>for AFS source</secondary>
19 </indexterm> <indexterm>
20 <primary>source (AFS)</primary>
22 <secondary>storing in AFS volume</secondary>
23 </indexterm> <indexterm>
24 <primary>files</primary>
26 <secondary>AFS source</secondary>
30 <title>Loading the Source Files</title>
32 <para>Working on an AFS client machine, perform these steps to load the AFS source tree from the AFS Source Distribution.
35 <primary>commands</primary>
37 <secondary>vos create</secondary>
39 <tertiary>src.afs volume</tertiary>
43 <primary>vos commands</primary>
45 <secondary>create</secondary>
47 <tertiary>src.afs volume</tertiary>
51 <primary>src.afs volume</primary>
55 <primary>volume</primary>
57 <secondary>creating</secondary>
59 <tertiary>src.afs</tertiary>
63 <primary>creating</primary>
65 <secondary>src.afs volume</secondary>
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>
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>
80 # <emphasis role="bold">vos create</emphasis> <<replaceable>machine name</replaceable>> <<replaceable>partition name</replaceable>> <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>
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.
94 <primary>copying</primary>
96 <secondary>source files from CD-ROM</secondary>
97 </indexterm> <indexterm>
98 <primary>CD-ROM</primary>
100 <secondary>copying source files from</secondary>
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>
110 </orderedlist></para>
113 <primary>source (AFS)</primary>
115 <secondary>compiling</secondary>
119 <primary>compiling AFS from source</primary>
123 <primary>building</primary>
125 <secondary>AFS from source</secondary>
129 <sect1 id="HDRWQ165">
130 <title>Compiling AFS Binaries Using the washtool Program</title>
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>
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.
140 # <emphasis role="bold">cd /afs/.</emphasis><replaceable>cellname</replaceable><emphasis role="bold">/afs</emphasis>
141 </programlisting></para>
143 <para>If creating a new volume:</para>
146 # <emphasis role="bold">vos create</emphasis> <<replaceable>machine name</replaceable>> <<replaceable>partition name</replaceable>> <replaceable>sysname</replaceable> <emphasis
147 role="bold">-maxquota 0</emphasis>
148 # <emphasis role="bold">fs mkmount</emphasis> <replaceable>sysname</replaceable> <replaceable>sysname</replaceable>
151 <para>If not creating a new volume:</para>
154 # <emphasis role="bold">mkdir</emphasis> <replaceable>sysname</replaceable>
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>
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.
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>
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>
186 lrwxr-xr-x admin 12 Jun 18 11:26 Makefile->src/Makefile
187 lrwxr-xr-x admin 1 Jun 18 11:26 PARENT -> .
188 lrwxr-xr-x admin 9 Jun 18 11:25 dest -> @sys/dest
189 lrwxr-xr-x admin 8 Jun 18 11:25 obj -> @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
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.
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>
208 <secondary>washtool</secondary>
209 </indexterm> <indexterm>
210 <primary>washtool command</primary>
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>
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>
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>
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>
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>
245 <primary>commands</primary>
247 <secondary>make</secondary>
251 <primary>make command</primary>
255 <primary>variables</primary>
257 <secondary>WASHTOOL</secondary>
261 <primary>variables</primary>
263 <secondary>SYS_NAME for washtool command</secondary>
267 <primary>SYS_NAME variable for washtool command</primary>
271 <primary>WASHTOOL variable</primary>
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>
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>
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>
292 </orderedlist></para>