Appendix A. Building AFS from Source CodeThis chapter describes how to build AFS from source code. storingAFS source in volumecreatingvolumefor AFS sourcevolumefor AFS sourcesource (AFS)storing in AFS volumefilesAFS sourceLoading the Source FilesWorking on an AFS client machine, perform these steps to load the AFS source tree from the AFS Source Distribution.
commandsvos createsrc.afs volumevos commandscreatesrc.afs volumesrc.afs volumevolumecreatingsrc.afscreatingsrc.afs volumeCreate and mount a volume for housing the AFS source tree. These instructions name the volume src.afs and mount it at the /afs/cellname/afs/src directory.Setting the -maxquota argument to 0 (zero) sets an
unlimited quota on the volume, which enables you to copy all of the files into the volume without exceeding its quota. If
you wish, you can set the volume's quota to a finite value after you complete the copying operation. At that point, use
the vos examine command to determine how much space the volume is occupying. Then issue
the fs setquota command to set a quota that is slightly larger.
# vos create <machine name> <partition name> src.afs -maxquota 0
# cd /afs/.cellname
# mkdir afs
# fs mkmount afs/src src.afs
# vos release root.cell
# fs checkvolumesOn the local /cdrom directory, mount the CD-ROM that contains the AFS source files.
For instructions on mounting CD-ROMs (either locally or remotely via NFS), consult the operating system documentation.
copyingsource files from CD-ROMCD-ROMcopying source files fromCopy the source files from the CD-ROM into the newly created volume.
# cd /cdrom/src
# cp -rp * /afs/.cellname/afs/srcsource (AFS)compilingcompiling AFS from sourcebuildingAFS from sourceCompiling AFS Binaries Using the washtool ProgramThe AFS distribution includes the washtool program for managing a hierarchy of software
development projects. The program builds project trees for program editing, compilation, and installation. Create a subdirectory under the /afs/.cellname/afs directory for each system type for which you will build AFS binaries. Creating and mounting a
volume for each system type is recommended, but you can also simply use the mkdir
command. If you create a new volume, grant it an unlimited quota to avoid running out of space during the build process.
# cd /afs/.cellname/afsIf creating a new volume:
# vos create <machine name> <partition name> sysname-maxquota 0
# fs mkmountsysnamesysnameIf not creating a new volume:
# mkdirsysnameIn the directory for each system type, create subdirectories called dest, dest/bin, and obj. If you plan to use the
@sys variable in pathnames that refer to these directories, then you must use the conventional system
names listed in the OpenAFS Release Notes.
# cdsysname
# mkdir dest
# mkdir dest/bin
# mkdir objCreate the indicated directories and symbolic links in the /afs/.cellname/afs directory.
# cd /afs/.cellname/afs
# ln -s @sys/dest dest
# ln -s @sys/obj obj
# ln -s . PARENT
# ln -s src/Makefile MakefileThe following is an example directory listing for the /afs/.cellname/afs directory after
completing the preceding steps. It includes two example system types.
lrwxr-xr-x admin 12 Jun 18 11:26 Makefile->src/Makefile
lrwxr-xr-x admin 1 Jun 18 11:26 PARENT -> .
lrwxr-xr-x admin 9 Jun 18 11:25 dest -> @sys/dest
lrwxr-xr-x admin 8 Jun 18 11:25 obj -> @sys/obj
drwxrwxrwx admin 4096 Jun 18 11:24 rcs
drwxrwxrwx admin 2048 Jun 18 11:27 rs_aix42
drwxrwxrwx admin 2048 Jun 18 11:10 src
drwxrwxrwx admin 2048 Jun 18 11:27 sun4x_56
(Optional) By default, the build procedure writes its results into a destination
directory for each system type called /afs/.cellname/afs/sysname/dest. To write the results
to a different destination directory, create a link from the dest directory to it.
# cd /afs/.cellname/afs/sysname
# ln -sfull_path_of_alternate_directorydestcommandswashtoolwashtool commandFor each system type you plan to build, copy the binary for the washtool program to
the directory specified in the AFS Makefile, which is /afs/cellname/afs/sysname/dest/bin. If you prefer to
store the program in a different directory, you can use the WASHTOOL variable on the make
command line as described in Step 6.If there is a volume that houses the AFS binaries for each system type (as recommended), the conventional location
for the washtool binary is the /afs/cellname/sysname/usr/afsws/bin directory. Use
the following instruction to copy it.
# cd /afs/cellname/sysname/usr/afsws/bin
# cp washtool/afs/.cellname/afs/sysname/dest/binOtherwise, mount the (binary) AFS CD-ROM for this system type on the local /cdrom
directory, and copy the washtool binary directly from it.
# cd /cdrom/sysname/bin
# cp washtool/afs/.cellname/afs/sysname/dest/bincommandsmakemake commandvariablesWASHTOOLvariablesSYS_NAME for washtool commandSYS_NAME variable for washtool commandWASHTOOL variableWorking in the /afs/.cellname/afs directory on a
machine of the system type for which you are building AFS, issue the make install
command. Set the SYS_NAME variable to the appropriate system type name.If the washtool binary is not in the conventional directory (/afs/cellname/afs/sysname/dest/bin), set the
WASHTOOL variable to the alternate full pathname of the binary.
# cd /afs/.cellname/afs
# make SYS_NAME=sysname [WASHTOOL=alternate_washtool_directory] install