Overall System Status:
In these steps you will use RPM to build the kernel module for RHEL4, OpenAFS 1.4.1. This method is the slower of two ways to build the required kernel module and install AFS client, but it seems to be more reliable.
$ARCH = hardware architecture (`uname -m`) e.g. i686
$VERS = OpenAFS version, e.g. 1.4.1
$KERNEL = full kernel revision string (e.g. 2.6.9_42.0.2.ELsmp_2)
$OS = Linux distribution this is built for e.g. rhel4.2
To ensure that you have the kernel-devel package installed, check your kernel RPMs.
You also need to have a working gcc and all standard include files installed If appropriate, you also need the kernel-smp and kernel-smp-devel packages; e.g.
# rpm -qa | grep kernel
To build the kernel module, you need the complete source RPM. Save it to disk, but do not install it with "rpm -i"
-rw-rw-r-- 1 richard richard 15445560 Sep 11 15:18 openafs-1.4.1-rhel4.2.src.rpm
Move the source RPM to /usr/src/redhat/SRPMS/, then run rpmbuild:
mv openafs-$VERS-$OS.src.rpm /usr/src/redhat/SRPMS
rpmbuild --rebuild --target=`uname -m` SRPMS/openafs-$VERS-$OS.src.rpm
rpm -iv RPMS/$ARCH/openafs-kernel-$VERS-$KERNEL.$ARCH.rpm
rpm -iv RPMS/i686/openafs-kernel-smp-1.4.1-2.6.9_42.0.2.ELsmp_2.i686.rpm
This takes a while, and essentially builds all of the AFS software, then discards most of it. It results in an installable RPM file /usr/src/redhat/RPMS/$ARCH/openafs-kernel-$VERS-$KERNEL.$ARCH.rpm, which you then install as for any other package. It contains only a single file - the kernel module for the client cache manager. (/lib/modules/$KERNEL/kernel/fs/openafs/openafs.o). It will build against the currently running kernel, if you have more than one kernel installed.
Leave the Source RPM in place. If you upgrade the kernel to a new version, you will need to repeat only this step.
If you install a new kernel RPM (via up2date or yum, for example) and wish to build the OpenAFS module for it before you reboot into the new kernel, just follow the previous step but add an additional argument to rpmbuild:
rpmbuild --rebuild --target=`uname -m` --define "kernvers $KERNEL" SRPMS/openafs-$VERS-$OS.src.rpm
Be sure to get the kernel version string correct. It is easiest to cut and paste it from the output on rpm -qa | grep kernel. With RHEL, append smp to the kernel version for SMP systems.
rpmbuild --rebuild --target=`uname -m` --define "kernvers 2.6.17-1.2187_FC5" \
Last Updated: 12/8/09