3ware module refuses to load with xen kernel
Today I encountered a problem with the 3ware module.
The fresh installed CentOs 5, on a machine with a 3ware 9500 card, booted without any problems, but this wasn’t the case when booting with the xen enabled kernel. During boot of the xen kernel, which ended in a kernel panic, it showed something about ioremap. When googling about the problem I found a patch which solved the problem.
Here is a step-by-step guide how I’ve applied the patch and solved the problem…
Ideal you download the src rpm of the kernel, apply the patch and rebuild the kernel. This rebuild will take some time, but you can easily download the 3ware module and rebuild only that module. Therefore I’ve used the module provided on the 3ware website.
1. Install the needed packages to be able to build the module
# yum install kernel-xen-devel gcc
2. Create a link pointing to the source directory of the kernel (This is the kernel where you want to rebuild the module for). This is not needed if you want to rebuild for the current kernel.
# cd /usr/src/ # ln -snf /lib/modules/2.6.18-53.1.4.el5xen/source linux
3. Download and unpack the downloaded module
# tar -zxvf 3w-9xxx-2.6.18kernel_9.5.0.tgz # cd build
4. Apply the patch (see http://firstname.lastname@example.org/msg10302.html)
5. Build the module
6. Overwrite the old 3ware module with the one you just have build
# cp 3w-9xxx.ko /lib/modules/2.6.18-53.1.4.el5xen/kernel/drivers/scsi/3w-9xxx.ko
7. Rebuild the initrd
# mkinitrd -v -f /boot/initrd-2.6.18-53.1.4.el5xen.img 2.6.18-53.1.4.el5xen