close Warning:

Changes between Initial Version and Version 1 of CodaHOWTO/Building


Ignore:
Timestamp:
Feb 8, 2007, 2:40:44 PM (11 years ago)
Author:
jaharkes
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodaHOWTO/Building

    v1 v1  
     1[[TracNav(CodaHOWTO)]]
     2
     3= Building Coda =
     4
     5As a file system, Coda has several major components that need to be built:
     6
     7 * Kernel code on the client
     8 * LWP threading library
     9 * The cache manager Venus on the client
     10 * The fileserver
     11 * Utilities for client and server administration.
     12
     13== Building on Linux == #LinuxBuild
     14
     15=== Building the kernel module ===
     16
     17We 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.
     18
     19First 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.
     20
     21==== Prepare the kernel tree ====
     22 
     23You do need to have the headers for your kernel image installed to give the module header information.
     24{{{
     25make
     26make install
     27}}}
     28
     29=== Building the LWP threading library ===
     30
     31Get the lwp-x.x.tar.gz sources and untar them. Then run ./configure --prefix=/usr ; make ; make install
     32Building the userlevel code
     33
     34Coda 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.
     35
     36To build:
     37{{{
     38tar -xzf coda-x.x.x.tar.gz
     39cd coda-x.x.x
     40./configure --prefix=/usr
     41make
     42make client-install
     43make server-install
     44}}}
     45
     46== Building on FreeBSD == #FreeBSDBuild
     47
     48=== Building a Whole Kernel ===
     49
     50The 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:
     51{{{
     52grep -i coda LINT
     53}}}
     54It currently gives:
     55{{{
     56# Coda stuff:
     57options         CODA                    #CODA filesystem.
     58pseudo-device   vcoda   4               #coda minicache <-> venus comm.
     59}}}
     60Add 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.
     61
     62I'll assume you call the new config file CODA. You type:
     63{{{
     64config CODA
     65}}}
     66Then cd to the build area and do a make :
     67{{{
     68cd ../../compile/CODA
     69make
     70}}}
     71Finally, as root install the kernel with:
     72{{{
     73make install
     74}}}
     75
     76=== Building an LKM ===
     77
     78Alternatively, you could just build an lkm for Coda and insert it into the kernel. To do that you:
     79{{{
     80cd /usr/lkm/coda
     81}}}
     82and type:
     83{{{
     84make
     85make install
     86}}}
     87This will build coda_mod.o and copy it to /lkm. You load it by typing:
     88{{{
     89modload -v -e coda_mod -o /var/run/lkm.coda /lkm/coda_mod.o
     90}}}
     91
     92Remember, when using an lkm:
     93
     94 * You must boot /kernel not /kernel.old or /kernel. < something >
     95 * There are no symbols available for debugging.
     96
     97=== Building Coda: The Package Way ===
     98
     99{{{
     100cd /usr/ports/net/coda_client
     101make install
     102cd /usr/ports/net/coda_server
     103make install
     104}}}
     105NOTE: The client and server each need about 85Meg for the work area and another 15Meg to install. They are compiled -g for debugging.
     106
     107=== Building the LWP threading library ===
     108
     109Get the lwp-x.x.tar.gz sources and untar them. Then run ./configure --prefix=/usr/local ; make ; make install
     110
     111=== Building Coda: The Bleeding Edge Way
     112
     113First, you need several external packages to build coda: gnu make, gdbm, readline, and perl.
     114
     115You 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.
     116
     117Untar the source into your favorite build area. (I am assuming this is /usr/coda .)
     118{{{
     119tar zxfv coda-4.6.6.tgz -C /usr/coda
     120cd /usr/coda
     121mkdir obj
     122}}}
     123This is where we will build the binaries.
     124{{{
     125cd obj
     126../coda-4.6.6/configure
     127}}}
     128This will use the gnu configure system to configure and to shadow the sources that were installed in /usr/coda/coda-4.6.6.
     129
     130Finally, assuming you named the gnu make, gmake , type:
     131{{{
     132gmake coda
     133}}}
     134
     135To install the client suite type:
     136{{{
     137gmake client-install
     138}}}
     139
     140To install the server suite type:
     141{{{
     142gmake server-install
     143}}}
     144
     145== Building on NetBSD == #NetBSDBuild
     146
     147=== Building a Whole Kernel ===
     148
     149The 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.
     150{{{
     151file-system     CODA                     # Coda File System
     152pseudo-device   vcoda            4       # coda minicache <-> venus comm.
     153}}}
     154But whatever is in GENERIC will be more up to date.
     155
     156I'll assume you call the new config file CODA. You type:
     157{{{
     158config CODA
     159}}}
     160
     161Then cd to the build area and do a make
     162{{{
     163cd ../compile/CODA
     164make
     165}}}
     166
     167Then just copy netbsd to root.
     168
     169=== Building an LKM ===
     170
     171Alternatively, you could just build an lkm for Coda and insert it into the kernel. To do that you:
     172{{{
     173cd /usr/sys/lkm/vfs/coda
     174make
     175make install
     176}}}
     177
     178This will build coda.o and copy it to /usr/lkm. You load it by typing:
     179{{{
     180modload -v -e coda_lkmentry -o /var/run/lkm.coda /usr/lkm/coda.o
     181}}}
     182
     183Remember, when using an lkm:
     184 * You must boot /netbsd not /netbsd.old or /netbsd. < something >
     185 * There are no symbols available for debugging.
     186
     187=== Building Coda: The Package Way ===
     188
     189{{{
     190cd /usr/pkgsrc/net/coda_client
     191make install
     192cd /usr/pkgsrc/net/coda_server
     193make install
     194}}}
     195NOTE: The client and server each need about 85Meg for the work area and another 15Meg to install. They are compiled -g for debugging.
     196
     197=== Building the LWP threading library ===
     198
     199Get the lwp-x.x.tar.gz sources and untar them. Then run ./configure --prefix=/usr/local ; make ; make install
     200
     201=== Building Coda: The Bleeding Edge Way ===
     202
     203First, you need several external packages to build coda: gnu make , gdbm , readline , and perl .
     204
     205You 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.
     206
     207Untar the source into your favorite build area. (I am assuming this is /usr/coda .)
     208{{{
     209tar zxfv coda-4.6.6.tgz -C /usr/coda
     210cd /usr/coda
     211mkdir obj
     212}}}
     213This is where we will build the binaries.
     214{{{
     215cd obj
     216../coda-4.6.6/configure
     217}}}
     218
     219This will use the gnu configure system to configure and to shadow the sources that were installed in /usr/coda/coda-4.6.6.
     220
     221Finally, assuming you named the gnu make, gmake , type:
     222{{{
     223gmake coda
     224}}}
     225
     226To install the client suite type:
     227{{{
     228gmake client-install
     229}}}
     230
     231To install the server suite type:
     232{{{
     233gmake server-install
     234}}}
     235
     236== Building and installing a Coda Server for NT == #WinNTBuild
     237
     238Note: 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.
     239
     240You can however build a Venus (which you can with the supplied kernel Coda FSD for NT) and you can build a server.
     241
     242Coda 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.
     243
     244We 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.
     245The build process
     246
     247You will need:
     248 1. Get the cross compiling kit: ftp://ftp.coda.cs.cmu.edu/pub/tools/win32/cygwin-b20_glibc-3.i386.rpm.
     249 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.).
     250 3. Get the coda-?.?.? tar ball ftp://ftp.coda.cs.cmu.edu/pub/coda/src.
     251 4. Unpack & build
     252{{{
     253./configure --target=nt
     254make coda
     255}}}
     256 5. drink coffee, ignore or, better even, fix the compiler warnings.
     257
     258Native 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!
     259
     260=== Manual configuration after building ===
     261
     262 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
     263 2. get samba running on that RH machine and export the build area for Coda.
     264 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.
     265 4. get bash going. It can be started from the "Start" menu.
     266 5. organise your mountpoints for Cywin. You will find the root volume mounted on c:\ . Change this to c:\coda by typing:
     267{{{
     268umount /
     269mount -b C:\coda  /
     270}}}
     271    The -b, for binary mounting is vital.
     272 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.
     273 7. Create some directories, create /bin/sh and export the path by typing:
     274{{{
     275mkdir /bin /vice /rvm /vicepa /tmp
     276touch /rvm/LOG
     277touch /rvm/DATA
     278cp //c/cygwin/cygwin-b20/H-i586-cygwin32/bin/bash /bin/sh
     279export PATH=/bin:$PATH
     280}}}
     281 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:
     282{{{
     283cd //H/
     284cp * /bin
     285}}}
     286    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.
     287
     288You are now at the point where the installer would have left you.