wiki:CodaHOWTO/Building
close Warning:

Building Coda

As a file system, Coda has several major components that need to be built:

  • Kernel code on the client
  • LWP threading library
  • The cache manager Venus on the client
  • The fileserver
  • Utilities for client and server administration.

Building on Linux

Building the kernel module

We now have a reaonably flexible method to build kernel modules. You can build the module for a kernel which you are not running at the time of the build.

First of all get the linux-coda-?.?.?.tgz archive from ftp://ftp.coda.cs.cmu.edu/pub/coda/src/ . You can unpack this anywhere on your target system.

Prepare the kernel tree

You do need to have the headers for your kernel image installed to give the module header information.

make
make install

Building the LWP threading library

Get the lwp-x.x.tar.gz sources and untar them. Then run ./configure --prefix=/usr ; make ; make install Building the userlevel code

Coda builds most easily on glibc systems. We do not actively maintain the libc variant anymore. You will need several libraries to link the Coda binaries, and include files from some of the lib???-devel packages. Readline and termcap are probably the most important ones.

To build:

tar -xzf coda-x.x.x.tar.gz
cd coda-x.x.x
./configure --prefix=/usr
make
make client-install
make server-install

Building on FreeBSD

Building a Whole Kernel

The Coda kernel files are in the FreeBSD -current kernel sources. All you need to do to get a Coda capable kernel is to build a configuration that includes Coda. The lines to enable Coda are not in the GENERIC. There are several Coda lines in the LINT file that you need to copy. In the i386/conf directory type:

grep -i coda LINT

It currently gives:

# Coda stuff:
options         CODA                    #CODA filesystem.
pseudo-device   vcoda   4               #coda minicache <-> venus comm.

Add these lines (or whatever the grep yields) to the GENERIC kernel configuration or your standard personal configuration. You might also want to turn on DDB and BPF.

I'll assume you call the new config file CODA. You type:

config CODA

Then cd to the build area and do a make :

cd ../../compile/CODA
make

Finally, as root install the kernel with:

make install

Building an LKM

Alternatively, you could just build an lkm for Coda and insert it into the kernel. To do that you:

cd /usr/lkm/coda

and type:

make
make install

This will build coda_mod.o and copy it to /lkm. You load it by typing:

modload -v -e coda_mod -o /var/run/lkm.coda /lkm/coda_mod.o

Remember, when using an lkm:

  • You must boot /kernel not /kernel.old or /kernel. < something >
  • There are no symbols available for debugging.

Building Coda: The Package Way

cd /usr/ports/net/coda_client
make install
cd /usr/ports/net/coda_server
make install

NOTE: The client and server each need about 85Meg for the work area and another 15Meg to install. They are compiled -g for debugging.

Building the LWP threading library

Get the lwp-x.x.tar.gz sources and untar them. Then run ./configure --prefix=/usr/local ; make ; make install

Building Coda: The Bleeding Edge Way

First, you need several external packages to build coda: gnu make, gdbm, readline, and perl.

You can grab any of our (latest) sources from ftp://ftp.coda.cs.cmu.edu/pub/coda/src . For this example, I'll assume that you have obtained sources for Coda release 4.6.6. NOTE: On our ftp site there are also beta, alpha, and less stable source releases available for the daring.

Untar the source into your favorite build area. (I am assuming this is /usr/coda .)

tar zxfv coda-4.6.6.tgz -C /usr/coda
cd /usr/coda
mkdir obj

This is where we will build the binaries.

cd obj
../coda-4.6.6/configure

This will use the gnu configure system to configure and to shadow the sources that were installed in /usr/coda/coda-4.6.6.

Finally, assuming you named the gnu make, gmake , type:

gmake coda

To install the client suite type:

gmake client-install

To install the server suite type:

gmake server-install

Building on NetBSD

Building a Whole Kernel

The Coda kernel files are in the NetBSD -current kernel sources. All you need to do to get a Coda capable kernel is to build a configuration that includes Coda. The lines to enable Coda may not be in your configuration. They should be in GENERIC, though they may be turned off. Enable them and/or copy them to your configuration file. They should look like.

file-system     CODA                     # Coda File System
pseudo-device   vcoda            4       # coda minicache <-> venus comm.

But whatever is in GENERIC will be more up to date.

I'll assume you call the new config file CODA. You type:

config CODA

Then cd to the build area and do a make

cd ../compile/CODA
make

Then just copy netbsd to root.

Building an LKM

Alternatively, you could just build an lkm for Coda and insert it into the kernel. To do that you:

cd /usr/sys/lkm/vfs/coda
make
make install

This will build coda.o and copy it to /usr/lkm. You load it by typing:

modload -v -e coda_lkmentry -o /var/run/lkm.coda /usr/lkm/coda.o

Remember, when using an lkm:

  • You must boot /netbsd not /netbsd.old or /netbsd. < something >
  • There are no symbols available for debugging.

Building Coda: The Package Way

cd /usr/pkgsrc/net/coda_client
make install
cd /usr/pkgsrc/net/coda_server
make install

NOTE: The client and server each need about 85Meg for the work area and another 15Meg to install. They are compiled -g for debugging.

Building the LWP threading library

Get the lwp-x.x.tar.gz sources and untar them. Then run ./configure --prefix=/usr/local ; make ; make install

Building Coda: The Bleeding Edge Way

First, you need several external packages to build coda: gnu make , gdbm , readline , and perl .

You can grab any of our (latest) sources from ftp://ftp.coda.cs.cmu.edu/pub/coda/src . For this example, I'll assume that you have obtained sources for Coda release 4.6.6. NOTE: On our ftp site there are also beta, alpha, and less stable source releases available for the daring.

Untar the source into your favorite build area. (I am assuming this is /usr/coda .)

tar zxfv coda-4.6.6.tgz -C /usr/coda
cd /usr/coda
mkdir obj

This is where we will build the binaries.

cd obj
../coda-4.6.6/configure

This will use the gnu configure system to configure and to shadow the sources that were installed in /usr/coda/coda-4.6.6.

Finally, assuming you named the gnu make, gmake , type:

gmake coda

To install the client suite type:

gmake client-install

To install the server suite type:

gmake server-install

Building and installing a Coda Server for Windows NT/XP

Note: At present there is no client kernel source code available yet. We will release some very experimental binaries soon. When are a little further with it, we will release the sources, of course.

You can however build a Venus (which you can with the supplied kernel Coda FSD for NT) and you can build a server.

Coda has alpha support for Coda servers running on NT and Windows 95. The Win32 binaries are constructed using the Cygnus Win32 kit, which effectively translates Unix system calls to Win32 calls.

We build the Win32 binaries on Linux workstations using a cross compiler, just for our convenience. At the moment this is not for the faint of heart, since quite a few things have to be done by hand. Of course we encourage playing and will try to help and fix bugs. The build process

You will need:

  1. Get the cross compiling kit: ftp://ftp.coda.cs.cmu.edu/pub/tools/win32/cygwin-b20_glibc-3.i386.rpm.
  2. ftp://ftp.coda.cs.cmu.edu/pub/tools/win32/libgdbm-nt-1.7.3-3.i386.rpm. (These are rpms for RedHat? 5.0. Sources are available of course.).
  3. Get the coda-?.?.? tar ball ftp://ftp.coda.cs.cmu.edu/pub/coda/src.
  4. Unpack & build
    ./configure --target=nt
    make coda
    
  5. drink coffee, ignore or, better even, fix the compiler warnings.

Native building should be possible; you'll have to make a few changes to configs/coda.m4 and create a new configs/Makeconfig.ntnative file; then run autoconf and get cracking. But don't you dare send us patches with M characters made by Windoze machines!

Manual configuration after building

  1. Install into an area for NT binaries on your Linux box still (drink coffee, ignore or better even fix the compiler warnings) Put the binaries in a suitable place using: make BINDIR=TARGET/bin SBINDIR=TARGET/bin server-install
  2. get samba running on that RH machine and export the build area for Coda.
  3. replace C:\cygwin\cygwin-b20\H-i586-cygwin32\bin\cygwin1.dll with the one from: ftp://ftp.coda.cs.cmu.edu/pub/coda/support/nt-patches or directly from cygnus. The version of cygwin1.dll must be from 01/15/99 or newer.
  4. get bash going. It can be started from the "Start" menu.
  5. organise your mountpoints for Cywin. You will find the root volume mounted on c:\ . Change this to c:\coda by typing:
    umount /
    mount -b C:\coda  /
    
    The -b, for binary mounting is vital.
  6. For your convenience add the entry SET HOME=C:\Coda in the file cygnus.bat somewhere in the Cygwin path. You can also create the file .bashrc in the c:\coda directory which gets called, when the Cygwin shell gets started. We set the export path (described below) and cd to the home directory that way.
  7. Create some directories, create /bin/sh and export the path by typing:
    mkdir /bin /vice /rvm /vicepa /tmp
    touch /rvm/LOG
    touch /rvm/DATA
    cp //c/cygwin/cygwin-b20/H-i586-cygwin32/bin/bash /bin/sh
    export PATH=/bin:$PATH
    
  8. Install your Coda stuff build as described above. Suppose the coda-?.?.? area is a mapped drive on the NT machine with drive letter H: type in bash:
    cd //H/
    cp * /bin
    
    or use the Windows Explorer. The binary files might not have the extension .exe . In that case just change the name, but distinguish between bash shell scripts and binaries.

You are now at the point where the installer would have left you.

Last modified 11 years ago Last modified on Feb 8, 2007, 2:49:56 PM