Building Intel Embedded Server RAID Technology II RAID binary driver under RHEL4

(using the kernel-devel package)

Wasn't entirely clear to me how to do this so have put it here in case I need it again.

As a normal user retrieve ESRT2_Linux_v.11.02.0626.2008_2.zip from the intel server site (or as updated.)

Unzip it. Amongst other files there is a shim directory which contains two subdirectories
viz
library and open_source

under library there are further subdirectories for various distributions and 32/64 bit (eg rhel4-64)
There should be two files Makefile and megasr-lib.a in each of these directories.
From these and the source files in ../../open_source/ the module is built.

Determine the kernel version to which you are updating.
eg
kernel-smp-2.6.9-78.0.8.EL

Install (as root) the corresponding kernel-smp-devel package
eg
kernel-smp-devel-2.6.9-78.0.8.EL

This will create the /lib/modules/2.6.9-78.0.8.ELsmp/updates directory as well as installing the kernel headers in /usr/src/kernels
eg
/usr/src/kernels/2.6.9-78.0.8.EL-smp-x86_64

To build the module (as a normal user)

	cd shim/library/rhel4-64
	make -C/usr/src/kernels/2.6.9-78.0.8.EL-smp-x86_64 M=`pwd` modules

should create a number of files but the megasr.ko is the module file.
Copy this to /lib/modules/2.6.9-78.0.8.ELsmp/updates

	sudo cp megasr.ko /lib/modules/2.6.9-78.0.8.ELsmp/updates

Then install the new kernel package

	sudo rpm -i kernel-smp-2.6.9-78.0.8.EL.rpm

/sbin/mkinitrd should locate megasr.ko in /lib/modules/2.6.9-78.0.8.ELsmp/updates
and add it to lib/ directory on the initrd image in /boot/initrd-2.6.9-78.0.8.ELsmp.img
or will complain about not finding megasr. (Incidentally will also strip -g megasr.ko)

I imagine should work for Fedora if the corresponding kernel versions match

rhel4 - 2.6.9
rhel5 - 2.6.18