TRIUMF Grid System Management Documentation

System Configuration

Some systems require particular configurations - this section is devoted to them.

DKMS

For those cases where we need to modify the kernel we try to use Dynamic Kernel Module Support (DKMS) to manage special kernel modules.
Here are some detailed instructions on installing and using DKMS:

Install dkms and the kernel-source

The kernel-source rpm must be installed.  Then install the dkms rpm locally located at /opt/mirror/rpms/.  The Dell GPG key is also in the same directory:
  • # yum install kernel-source
  • # cd /opt/mirror/rpms/extras/misc/
    # rpm --import DELL-RPM-GPG-KEY
    # rpm -i dkms-2.0.5-1.noarch.rpm
    If you are only using the node to build dkms tarballs then you will probably want to stop dkms from running at startup:
    # chkconfig --del dkms_autoinstaller

Building a new dkms-enabled kernel module

The source for new modules starts in the /usr/src tree.  You must create a directory that has the name of the module and its version number.  This example uses a module named 3w-9xxx with version "2.4-9.2":
  • # cd /usr/src
    # mkdir /usr/src/3w-9xxx-2.4-9.2
    # cd /usr/src/3w-9xxx-2.4-9.2
You must copy the source to this tree, untar it, move around files as appropriate so that the makefile is in the root of the new directory, and then create a dkms.conf file.  The makefile is the most difficult part - it needs to resemble the make process in the Red Hat kernel module build process:
  • # tar zxf /path/to/3w-9xxx2.4-9.2.tgz
    # ls
    driver/

    # mv driver/* .
    # rmdir driver/
    # cp -p Makefile.rh Makefile
    # edit Makefile
    # edit dkms.conf
Now you are ready to add and build the module to the dkms 'database':
  • # dkms add -m 3w-9xxx -v 2.4-9.2
    Creating symlink /var/lib/dkms/3w-9xxx/2.4-9.2/source ->
    /usr/src/3w-9xxx-2.4-9.2

    DKMS: add Completed.
  • # dkms build -m 3w-9xxx -v 2.4-9.2 -k 2.4.21-27.0.2.EL
    Preparing kernel 2.4.21-27.0.2.ELsmp for module build:
    (This is not compiling a kernel, only just preparing kernel symbols)
    Running Red Hat style preparation routine
    make clean......
    using /lib/modules/2.4.21-27.0.2.ELsmp/build/configs/kernel-2.4.21-i686-smp.config
    make oldconfig.....
    running dkms_mkkerneldoth....

    Building module:
    cleaning build area....(bad exit status: 2)
    make KERNELRELEASE=2.4.21-27.0.2.ELsmp
    -C /lib/modules/2.4.21-27.0.2.ELsmp/build
    SUBDIRS=/var/lib/dkms/3w-9xxx/2.4-9.2/build modules.......
    cleaning build area....(bad exit status: 2)

    DKMS: build Completed.
If the module built then the dkms status command will show the file in the tree.  Proceed to build other modules (ie. for other kernel models and architectures) as needed:
  • # dkms status
    3w-9xxx, 2.4-9.2, 2.4.21-27.0.2.EL, i686: built

    # ls -l /var/lib/dkms/3w-9xxx/2.4-9.2/2.4.21-27.0.2.EL/i686/module/
    total 569
    -rw-r--r-- 1 root root 578272 Mar 16 15:36 3w-9xxx.o
  • # dkms build -m 3w-9xxx -v 2.4-9.2 -k 2.4.21-27.0.2.ELsmp

    Preparing kernel 2.4.21-27.0.2.ELsmp for module build:
    ....
  • # dkms build -m 3w-9xxx -v 2.4-9.2 -k 2.4.21-27.0.2.ELsmp -a x64_64
  • # dkms status
    3w-9xxx, 2.4-9.2, 2.4.21-27.0.2.EL, i686: built
    3w-9xxx, 2.4-9.2, 2.4.21-27.0.2.ELsmp, i686: built
    3w-9xxx, 2.4-9.2, 2.4.21-27.0.2.ELsmp, x64_64: built
Create a tarball that can be imported to other dkms installations:
  • # dkms mktarball -m 3w-9xxx -v 2.4-9.2 -k 2.4.21-27.0.2.EL -a i686 -k 2.4.21-27.0.2.ELsmp -a i686 -k 2.4.21-27.0.2.ELsmp -a x64_64
    Marking modules for 2.4.21-27.0.2.EL (i686) for archiving...
    Marking modules for 2.4.21-27.0.2.ELsmp (i686) for archiving...
    Marking modules for 2.4.21-27.0.2.ELsmp (x64_64) for archiving...
    Marking /usr/src/3w-9xxx-2.4-9.2 for archiving...
    Tarball location: /var/lib/dkms/3w-9xxx/2.4-9.2/tarball/[somename]dkms.tar.gz
    DKMS: mktarball Completed.

Importing a dkms-tarball from elsewhere

  • # dkms ldtarball --archive=/tmp/3w-9xxx-2.4-9.2-kernel2.4.21-27.0.2.EL-i686.dkms.tar.gz
    
    
    Loading /usr/src/3w-9xxx-2.4-9.2... Loading /var/lib/dkms/3w-9xxx/2.4-9.2/2.4.21-27.0.2.EL/i686... Creating /var/lib/dkms/3w-9xxx/2.4-9.2/source symlink...
    DKMS: ldtarball Completed./pre>

Documentation Links