Linux driver installation and the kernel sources

Issue:
What files are required before you can compile new drivers on a Linux system.

Solution:

Some of our Perle drivers are included in the kernel source tree. In order to enable these drivers you must be able to recompile the kernel or kernel modules. This will require that the kernel source tree has been installed.

If installing a Perle driver module then ensure that you have the kernel development files installed for your kernel (most distributions will have this installed).

If you are configuring a Perle driver (I/O8+, SX, and RIO host cards) that is included in the kernel sources (and not enabled) then you will need those sources on your host to be able to rebuild the kernel to enable support for those drivers.

Verify that you have matching kernel source by running "uname -r" and check to make sure the /usr/src directory has the corresponding linux- directory.

If you are running a prebuilt kernel from a packaged distribution, you must install the kernel sources from your distribution CD to your system. Then use the following commands to prepare the system for the driver installation (note the following commands are basic for all Linux kernels. Please utilize the procedures outlined in your distribution's User Guide for specific configuration especially if you are unfamiliar with customizing the kernel):

For 2.4.x kernels; Change directory to the kernel sources, then build the environment.

  1. cd to the kernel sources
  2. make mrproper (Clean up any old version files.)
  3. make oldconfig (Make a configuration file to match your running kernel.
  4. you can run make menuconfig or make xconfig to view the default kernel configuration
  5. make dep (Create the dependency and version files.)
  6. make bzImage
  7. make modules
  8. make modules_install
  9. make install

For 2.6.x kernels; Change directory to the kernel sources, then build the environment.

  1. cd to the kernel sources
  2. make oldconfig
  3. you can run make menuconfig or make xconfig to view the default kernel configuration
  4. make
  5. make modules_install
  6. make install

When building a module driver such as Ultraport or Trueport you will not need the kernel source. You will require the necessary build environment. The kernel development files are common to a number of distributions and usually are an option to install through most package management systsm.
Example: For RedHat/Fedora based distributions you will require the kernel-devel rpm. This will install all the necessary files to compile modules against the kernel.

Note: Fedora Core 3 / RedHat Enterprise 4 and higher do not use the kernel-source rpm. If you attempt the rpmbuild the build will display an error stating that the kernel-source is needed.

Related Articles:
1.) Perle driver fails RPM installation

Related Links:
1.)  http://download.fedora.redhat.com/pub/fedora/linux/core/3/i386/os/RELEASE-NOTES-en.html


Article ID:
507
Published:
9/30/2004 8:43:12 AM
Last Modified:
5/16/2007 8:26:37 AM
Issue Type:
FAQ