Posted: 24 Oct 2008, 20:19
Why don't you all do it yourself? This is open source you know
Here's a rough step by step on how to compile your own kernel module for NFS server support.
These are the packages that I know for sure you need to install before trying anything else:
- bzip2
- build-essential
- less (ok, so this is not really essential but will enhance your 'man' experience)
Each package is installed using:
where <pkg-name> is the package name.
And now that we are prepared, off we go:
1. Log on to your bubba using your favourite SSH client.
2. Get the linux kernel source:
EDIT: I wouldn't use this for anything like replacing the existing kernel or other important parts. There are probably patches that need to be installed to get a fully working kernel.
3. Decompress it:
Note that your bubba is much slower than your average desktop computer, so give it some time to finish the command before you decide to throw it out the window, reboot it, or what ever desperate action you may take (hey, throw it in my direction
). It is better to add a 'v' to the option list (xjf) so that you see what it is actually doing (but this will make it go even slower).
4. Enter kernel source folder:
5. Copy current kernel configuration:
6. Decompress configuration:
7. Copy to default settings:
8. Edit settings (.config) in your favourit editor:
9. Locate the NFSD part and enable it as a module:
should become
10. Compile the modules:
Note that this will take time on your bubba, I'm not kidding, make yourself a good cup of coffee and watch a good movie, paint drying or what ever your preferences are, but be prepared to wait.
EDIT: I forgot to mention that you will get some questions about parts of NFS you want support for. I chose to install all that wasn't marked as experimental.
11. Ok, so the movie has ended and the compiling as well, but what the..., an error on crtsavres.o. Fear not:
12. Being stubborn, we accept no failure. Hit it again:
(The impatiant one can break with CTRL-C when nfsd.ko, exportfs.ko and nfs_common/nfs_acl.ko modules have been built). The rest will wait (you can always continue with 'make modules' if you were to quick to cancel).
13. And now everything should be complete. We need to copy the files to the right folders. You need root privilegies for this:
14. Last and final step. Resolve all loose ends:
15. And finally install it:
16. No visual errors? Verify it is loaded:
And there you have it, kernel module in place 
All you need to do next is to install nfs-kernel-server, that should also install nfs-common. Configure the /etc/exports (man exports, for help), /etc/hosts.[deny|allow] (man hosts_access, for help) and you should be up and running. Test it by running:You should get a list where nfs is among the entries.
A faster route would probably be to install a cross-compiler on your desktop computer and compile it there, but I'll save that instruction for a rainy day. The impatient may find interesting stuff at: http://kegel.com/crosstool and http://www.google.com
Oh, and all this is a whole lot easier on a linux machine. Cross compiling linux kernel stuff on a windows machine is not for the average user, trust me...(hell, it's not even for the experienced one)
Another route is to compile only the missing module, but I haven't figured out how to do that. That is, I thought would do the trick but I got an error on the bubba that didn't appear in my cross-compiling environment. Haven't figured out why yet, but hey, it is working though it took some time 
/Johan

Here's a rough step by step on how to compile your own kernel module for NFS server support.
- First note:
So far, I haven't been able to make this work. Should you do, let the rest of us know. After all, that is what this community is all about.
EDIT:Some sleep made it all clearer and it is now working.
- Second note:
I accept no liability should your bubba go up in flames, become a brick or what ever bad thing you can think of. In other words, YOU ARE ON YOUR OWN (but you have my sympathy)!!
- Third note:
Your bubba is most likely far from as fast as your desktop computer. This means compiling will take time, and a lot of it. Remember, patience a virtue. All good things come to he who waits (yeah, right, but you get my drift, right....)
- Fourth note:
There may/will be errors during the build. I ignored/worked around them, you have to decide if you dare to.
- Fifth and last note (really, this is the last one)
I've modified my B2 so I may have packages installed that you don't, in other words, your mileage may vary. You may have to install packages I've forgotten to mention.
These are the packages that I know for sure you need to install before trying anything else:
- bzip2
- build-essential
- less (ok, so this is not really essential but will enhance your 'man' experience)
Each package is installed using:
Code: Select all
apt-get install <pkg-name>
And now that we are prepared, off we go:
1. Log on to your bubba using your favourite SSH client.
2. Get the linux kernel source:
Code: Select all
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.26.5.tar.bz2
3. Decompress it:
Code: Select all
tar xjf linux-2.6.26.5.tar.bz2

4. Enter kernel source folder:
Code: Select all
cd linux-2.6.26.5
Code: Select all
cp /proc/config.gz .
Code: Select all
gunzip config.gz
Code: Select all
cp config .config
Code: Select all
vim .config
Code: Select all
# CONFIG_NFSD is not set
Code: Select all
CONFIG_NFSD=m
Code: Select all
make modules
EDIT: I forgot to mention that you will get some questions about parts of NFS you want support for. I chose to install all that wasn't marked as experimental.
11. Ok, so the movie has ended and the compiling as well, but what the..., an error on crtsavres.o. Fear not:
Code: Select all
make arch/powerpc/lib/crtsavres.o
Code: Select all
make modules
13. And now everything should be complete. We need to copy the files to the right folders. You need root privilegies for this:
Code: Select all
mkdir /lib/module/`uname -r`/kernel/fs/nfsd
mkdir /lib/module/`uname -r`/kernel/fs/exportfs
mkdir /lib/module/`uname -r`/kernel/fs/nfsd_common
cp fs/nfsd/nfsd.ko /lib/kernel/`uname -r`/kernel/fs/nfsd
cp fs/exportfs/exportfs.ko /lib/module/`uname -r`/kernel/fs/exportfs
cp fs/nfs_common/nfs_acl.ko /lib/module/`uname -r`/kernel/fs/nfs_common
Code: Select all
depmod -a
Code: Select all
modprobe nfsd
Code: Select all
dmesg
lsmod

All you need to do next is to install nfs-kernel-server, that should also install nfs-common. Configure the /etc/exports (man exports, for help), /etc/hosts.[deny|allow] (man hosts_access, for help) and you should be up and running. Test it by running:
Code: Select all
rpcinfo -p
A faster route would probably be to install a cross-compiler on your desktop computer and compile it there, but I'll save that instruction for a rainy day. The impatient may find interesting stuff at: http://kegel.com/crosstool and http://www.google.com

Another route is to compile only the missing module, but I haven't figured out how to do that. That is, I thought
Code: Select all
make SUBDIRS=fs/nfsd modules

/Johan