How to build ASL driver module after a kernel update

ASL provides the following driver modules that can be used under Red Hat Enterprise Linux 4 or CentOS 4.x:

3w-9xxx

Updated driver to support 3ware Escalade 9550SX series

aacraid

Updated Adaptec RAID driver for better stability

e1000

Updated Ethernet driver to support newer Intel Gigabit controllers

forcedeth

Updated Ethernet driver to support nForce4 Gigabit controllers and provide better stability

mv_sata

New driver to support Marvell Hercules 1 and 2 SATA controllers

hptmv

New driver to support Highpoint RocketRAID 1810 and 1820 SATA RAID controllers

When a new kernel has been updated using Red Hat Network, one of the following events might occur:

  1. Linux panics on subsequent boot because the root filesystem cannot be mounted. This will occur if the root file system is stored on the Marvell or Highpoint disk(s). The reason is because these drivers are not included in the Red Hat kernel.
  2. The system stability is comprised because of the out of date drivers included in the Red Hat kernel. For example, the nForce4 Gigabit driver (forcedeth) provided by Red Hat will cause problem with the network connection.

    NETDEV WATCHDOG: eth0: transmit timed out

Event #1 will render the system useless. To avoid it, it is necessary to build a new driver module immediately after updating the kernel and before rebooting the system. This must be performed on system running with the Marvell or Highpoint SATA controller.

To build a new driver module for Red Hat Enterprise Linux 4 or CentOS 4.x, use the following steps.

  1. Install the kernel source if necessary
  2. Install the device driver source RPM from the ASL RHEL4/CentOS 4.x Device Driver CD
  3. Build the new driver
  4. Reboot the system to use the new driver

The latest ASL RHEL4/CentOS 4.x Device Driver CD can be downloaded here:

http://updates.aslab.com/isos/RHEL4

Because the kernel source is not provided in the RHEL4/CentOS 4.X CD, the package must be downloaded manually. The kernel source RPM for CentOS 4.X is available from one of its mirror sites:

http://www.centos.org/modules/tinycontent/index.php?id=13

The kernel source RPM for RHEL4 can be downloaded from Red Hat Network.

After downloading the kernel source, perform the following steps:

# rpm -ivh kernel-2.6.9-22.EL.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bp kernel-2.6.spec --target=noarch
# mv /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/ /usr/src/linux-2.6.9-22.EL
# cd /usr/src/
# ln -s linux-2.6.9-22.EL linux

Once the kernel source has been installed, a custom driver module can now be built. Here is a sample session to build a 64-bit Marvell SATA driver for RHEL4 2.6.9-22.EL kernel:

# mount -t ext2 /dev/cdrom /mnt/cdrom
# rpm -ivh /mnt/cdrom/SRPMS/marvellsata-3.4.1-2.6.9-22.EL.src.rpm
# cd /usr/src/redhat/SPECS
# /mnt/cdrom/SRPMS/builddriver.sh marvellsata.spec x86_64 2.6.9 22.EL
# new-kernel-pkg --mkinitrd --depmod --install 2.6.9-22.ELsmp
# new-kernel-pkg --mkinitrd --depmod --install 2.6.9-22.EL

Here is a sample session to build a 32-bit Marvell SATA driver for RHEL4 2.6.9-22.EL kernel:

# mount -t ext2 /dev/cdrom /mnt/cdrom
# rpm -ivh /mnt/cdrom/SRPMS/marvellsata-3.4.1-2.6.9-22.EL.src.rpm
# cd /usr/src/redhat/SPECS
# /mnt/cdrom/SRPMS/builddriver.sh marvellsata.spec i686 2.6.9 22.EL
# new-kernel-pkg --mkinitrd --depmod --install 2.6.9-22.ELsmp
# new-kernel-pkg --mkinitrd --depmod --install 2.6.9-22.EL

Note: The kernel version 2.6.9-22.EL is used solely for example purpose. When necessary, replace it with the appropriate kernel version.