Sophie

Sophie

distrib > Mandriva > 8.2 > i586 > media > contrib > by-pkgid > 211238da6d926d1ca4390483bb29f586 > files > 41

coda-doc-5.2.0-4mdk.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>Coda File System  User and System Administrators Manual: Configuring Kernels for use with Coda </TITLE>
 <LINK HREF="manual-7.html" REL=next>
 <LINK HREF="manual-5.html" REL=previous>
 <LINK HREF="manual.html#toc6" REL=contents>
</HEAD>
<BODY>
<A HREF="manual-7.html">Next</A>
<A HREF="manual-5.html">Previous</A>
<A HREF="manual.html#toc6">Contents</A>
<HR>
<H2><A NAME="s6">6. Configuring Kernels for use with Coda </A></H2>

<P>             
<A NAME="KernelsforCoda"></A> <P>
<P>Currently, Coda clients and servers are supported under Linux,
FreeBSD and NetBSD.  
<P>
<P>The Coda servers may be run on unmodified kernels.  The Coda <CODE>codasrv</CODE> 
process is user-level code that uses existing kernel services.  The Venus 
client, however, requires some Coda-specific changes be made to the kernel.   
The kernel specific changes add Coda specific definitions to
the Vnode layer in the kernel which are needed to satisfy the 
requirements of the Coda file system to the vfs layer in the kernel.
<P>
<H2><A NAME="ss6.1">6.1 VFS Interface</A>
</H2>

<P>
<P>In Unix systems, the code which translates user-generated system calls
into file system requests is called the VFS Interface.  
Coda provides a VFS Interface by providing the necessary
support for systems calls such as creat(), open(), stat(), etc.
<P>
<P>Communication between Venus and the kernel occurs through a character
device <CODE>/dev/cfs0</CODE> (part of Coda) which provides the kernel
with access to Venus for handling the vsf&lt;-&gt;vnode kernel
interface.  Please see 
<A HREF="manual-8.html#ClientInstall">Installing and Configuring a Coda Client</A> for the major and minor device numbers
specific to a supported platform.
<P>The rest of this chapter will focus on integrating the Coda code
that satisfies the Vnode interface into the kernels of supported 
platforms.
<P>
<P>
<H2><A NAME="ss6.2">6.2 Configuring a Linux kernel</A>
</H2>

<P>Coda may be configured as a module or hard-coded in a ``monolithic'' kernel.
We have a reasonably 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.
<P>To build a custom coda kernel module you need to obtain the tarball
from:
<P>
<A HREF="ftp://ftp.coda.cs.cmu.edu/pub/coda/linux/src/linux-coda-4.6.2.tgz">ftp://ftp.coda.cs.cmu.edu/pub/coda/linux/src/linux-coda-4.6.2.tgz</A><P>And follow the instructions in the rest of this file.
<P><EM>NOTE:</EM> The code here is always newer than or equal to:
<UL>
<LI> the kernel </LI>
<LI> the big Coda tarball</LI>
</UL>
<P>
<H3>To Build 2.1 kernels modules</H3>

<P>
<P>
<UL>
<LI>Patch the kernel:

For 2.1.10? kernels apply the 106patch.  This will go to Linus
shortly, so this patch may stop working.

You must type the following:
<BLOCKQUOTE><CODE>
<PRE>
make oldconfig
make dep
make your-type-of-image and modules.
</PRE>
</CODE></BLOCKQUOTE>

</LI>
<LI>In this directory build the coda.o module:

type:
<BLOCKQUOTE><CODE>
<PRE>
make config  --- answer the questions
make coda.o
su
make install
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
<P>
<H3>To Build 2.0 kernel modules</H3>

<P>
<P>
<UL>
<LI>Prep the kernel by typing:
<BLOCKQUOTE><CODE>
<PRE>
cd /usr/src/linux-for-you
make oldconfig
make dep
</PRE>
</CODE></BLOCKQUOTE>

</LI>
<LI>In this directory build the coda.o module by typing:
<BLOCKQUOTE><CODE>
<PRE>
make config  --- answer the questions
make coda.o
su
make install
</PRE>
</CODE></BLOCKQUOTE>

</LI>
</UL>
<P>
<H3>NOTES</H3>

<P>
<UL>
<LI>If you build for a running kernel, you must still have a source 
tree for that Linux release, otherwise the headers cannot be found.
However, that source tree doesn't need modversions.h etc.
</LI>
<LI>We don't actively maintain 2.0 code anymore.  The 2.1 code is
preferred, but not yet perfect.  
</LI>
</UL>
<P>
<H2><A NAME="ss6.3">6.3 Configuring a FreeBSD kernel</A>
</H2>

<P>
<P>Currently, Coda works with the 2.2.x-STABLE kernels.  Since a loadable
module for Coda is not available, Venus support is compiled into the
kernel.  The Coda Development Group releases a pre-built GENERIC
FreeBSD kernel with Coda Venus support.  The only differences between
the GENERIC FreeBSD kernel and the GENERIC Coda kernel is the addition
of Coda Filesystem and the enabling of the kernel debugger.
<P>
<P>For those who wish to compile their own kernel, go to:
<P>
<A HREF="ftp://ftp.coda.cs.cmu.edu/pub/coda/freebsd">ftp://ftp.coda.cs.cmu.edu/pub/coda/freebsd</A>/&lt;OS-VERSION&gt;/i386/">
<P>and get the Coda kernel patches:
<P><CODE>kernel-patch.cfs-4.4.1.gz</CODE>.
<P>If you are patching a release earlier than 2.2.6, you will also need:
<P><CODE>kernel-patch.FreeBSD-4.4.0-2.2.5.gz</CODE>.  
<P>You should obtain the FreeBSD 2.x kernel sources and apply the
<CODE>kernel-patch.cfs-4.4.1.gz</CODE> kernel patch.  Suppose that the kernel source is in 
<CODE>/home/me/mysrc/sys</CODE> and the patch files,
<CODE>kernel-patch.cfs-4.4.1.gz</CODE> and <CODE>kernel-patch.FreeBSD-4.4.0-2.2.5.gz</CODE>, 
are in <CODE>/home/me/mysrc</CODE>.  Go to <CODE>/home/me/mysrc</CODE> and extract the 
Coda patch by typing:
<P>
<BLOCKQUOTE><CODE>
<PRE>
zcat kernel-patch.cfs-4.4.1.gz | patch -p4
</PRE>
</CODE></BLOCKQUOTE>
<P>The -p4 is really necessary.  If you are patching FreeBSD Release
2.2.5 or earlier, you also need to extract the "glue" code for Coda.  Type:
<P>
<BLOCKQUOTE><CODE>
<PRE>
zcat kernel-patch.FreeBSD-4.4.0-2.2.5.gz | patch -p6
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>At this point, the easiest thing to do is copy the GENERIC kernel
configuration and modify it to include Coda: 
<P>
<BLOCKQUOTE><CODE>
<PRE>
        cd .../conf
        cp GENERIC Coda
</PRE>
</CODE></BLOCKQUOTE>
<P>The two lines that need to be added to the Coda configuration will look something like:  
<P>
<BLOCKQUOTE><CODE>
<PRE>
options               CFS     #Coda File System
pseudo-device vcfs    4       # coda minicache &lt;-> venus comm.
</PRE>
</CODE></BLOCKQUOTE>
<P>Look at the LINT file in the configuration directory to find the most
current version of these lines and copy them into the Coda
configuration.
You should also copy the line
from LINT that enables the ddb debugger into the Coda configuration.
<P>
<P>Now, all that you need to do is to <CODE>config</CODE> Coda and build it.
<P>
<BLOCKQUOTE><CODE>
<PRE>
        config Coda
        make
</PRE>
</CODE></BLOCKQUOTE>
<P>Finally, you should install this new kernel by becoming root and typing:
<P>
<BLOCKQUOTE><CODE>
<PRE>
        make install
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>
<H3>Epilog</H3>

<P>If you are looking for the above Generic Coda kernel, you can find it in the
FreeBSD area on the Coda site.  It is named <CODE>kernel.gz</CODE>
<P>If you do not want to apply the Coda patch (above) and you are at
FreeBSD release 2.2.6 or better, you can simply copy the <CODE>cfs/</CODE>
directory from the Coda source tree to <CODE>/home/me/mysrc/sys</CODE>
<P>
<BLOCKQUOTE><CODE>
<PRE>
cd &lt;coda sources-coda_release>/kernel-src/vfs/bsd44/
cp -rp cfs /home/me/mysrc/sys
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>Don't forget to check <CODE>INSTALL</CODE> and <CODE>README</CODE>
in the Coda FreeBSD ftp area
for any last minute changes that may not have found their way into the Coda
manual.  Also, remember you only need a modified kernel for the client
side of Coda, not the server side.
<P>
<H2><A NAME="ss6.4">6.4 Configuring a NetBSD kernel</A>
</H2>

<P>
<P>Currently, Coda only works with the 1.3/1.3.x kernels.  Since
a loadable module for Coda is not available, Venus support is compiled
into the kernel.  The Coda Development Group releases a pre-built
GENERIC NetBSD kernel with Coda Venus support.  The only difference
between the GENERIC NetBSD kernel and the Coda kernel is the addition
of Coda Filesystem.
<P>
<P>For those who wish to compile their own kernel, go to:
<P>
<P>
<A HREF="ftp://ftp.coda.cs.cmu.edu/pub/coda/NetBSD/">ftp://ftp.coda.cs.cmu.edu/pub/coda/NetBSD</A>/&lt;OS-VERSION&gt;/i386/">
<P>
<P>and get the Coda kernel patches:
<P>
<BLOCKQUOTE><CODE>
<PRE>
kernel-patch.cfs-4.4.0.gz
kernel-patch.NetBSD-4.4.0-&lt;OS-VERSION>.gz
</PRE>
</CODE></BLOCKQUOTE>
  
<P>You should obtain the NetBSD 1.3/1.32 kernel sources and apply the
coda patches.  Suppose that the kernel source are in 
<CODE>/home/me/mysrc/sys</CODE> and the patch files, <CODE>kernel-patch.cfs-4.4.0.gz</CODE>
and <CODE>kernel-patch.NetBSD-4.4.0-&lt;OS-VERSION&gt;.gz</CODE>, are in 
<CODE>/home/me/mysrc</CODE>. Go to <CODE>/home/me/mysrc</CODE> and extract the 
Coda patch by typing:
<P>
<BLOCKQUOTE><CODE>
<PRE>
        zcat kernel-patch.cfs-4.4.0.gz | patch -p4
</PRE>
</CODE></BLOCKQUOTE>
<P>The -p4 is really necessary.  You also need to extract the "glue" code for Coda.  Type:
<P>
<BLOCKQUOTE><CODE>
<PRE>
zcat kernel-patch.NetBSD-4.4.0-&lt;OS-VERSION>.gz | patch -p6
</PRE>
</CODE></BLOCKQUOTE>
<P>
<P>At this point, the easiest thing to do is to copy the GENERIC kernel
configuration and modify it to include Coda, i.e. 
<BLOCKQUOTE><CODE>
<PRE>
cd .../conf
cp GENERIC Coda
</PRE>
</CODE></BLOCKQUOTE>
<P>The two lines that are need for to the Coda configuration will look something like:  
<P>
<BLOCKQUOTE><CODE>
<PRE>
options               CFS     #Coda File System
pseudo-device vcfs    4       # coda minicache &lt;-> venus comm.
</PRE>
</CODE></BLOCKQUOTE>
<P>These should have been added to the GENERIC file by the above patches.
Please verify that they went in correctly.
<P>Now, all that you need to do is to <CODE>config</CODE> Coda and build it.
<P>
<BLOCKQUOTE><CODE>
<PRE>
        config Coda
        make
</PRE>
</CODE></BLOCKQUOTE>
<P>Finally, copy the <CODE>netbsd</CODE> to <CODE>/</CODE> and reboot.
<P>
<H3>Epilog</H3>

<P>If you are looking for the above Generic Coda kernel, you can find it in the
NetBSD area on the Coda site.  It is named <CODE>netbsd-&lt;RELEASE&gt;.gz</CODE>
<P>Don't forget to check <CODE>INSTALL</CODE> and <CODE>README</CODE> in the
Coda NetBSD ftp site
for any last minute changes that may not have found their way into the Coda
manual.  Also, remember you only need a modified kernel for the client
side of Coda, not the server side.
<HR>
<A HREF="manual-7.html">Next</A>
<A HREF="manual-5.html">Previous</A>
<A HREF="manual.html#toc6">Contents</A>
</BODY>
</HTML>