6.49. Kmod-5

The Kmod package contains libraries and utilities for loading kernel modules

Approximate build time: less than 0.1 SBU
Required disk space: 16.0 MB

6.49.1. Installation of Kmod

Prepare Kmod for compilation:

liblzma_CFLAGS="-I/usr/include" \
liblzma_LIBS="-L/lib -llzma"    \
zlib_CFLAGS="-I/usr/include"    \
zlib_LIBS="-L/lib -lz"          \
./configure --prefix=/usr --bindir=/bin --libdir=/lib --sysconfdir=/etc \
            --with-xz     --with-zlib

The meaning of the configure options:

lib* and --with-*

These options enable Kmod to handle compressed kernel modules. The shell variables are required in order for the xz and zlib headers and libraries to be found in the absence of pkg-config.

Compile the package:

make

To test the results, issue:

make check

Install the package, and create symlinks for compatibility with Module-Init-Tools, the package that previously handled Linux kernel modules:

make pkgconfigdir=/usr/lib/pkgconfig install
for target in depmod insmod modinfo modprobe rmmod; do
  ln -sv ../bin/kmod /sbin/$target
done
ln -sv kmod /bin/lsmod

6.49.2. Contents of Kmod

Installed programs: depmod (link to kmod), insmod (link to kmod), kmod, kmod-nolib, lsmod (link to kmod), modinfo (link to kmod), modprobe (link to kmod), and rmmod (link to kmod)
Installed libraries: /lib/kmod.so

Short Descriptions

depmod

Creates a dependency file based on the symbols it finds in the existing set of modules; this dependency file is used by modprobe to automatically load the required modules

insmod

Installs a loadable module in the running kernel

kmod

Loads and unloads kernel modules

libkmod

This library is used by other programs to load and unload kernel modules

lsmod

Lists currently loaded modules

modinfo

Examines an object file associated with a kernel module and displays any information that it can glean

modprobe

Uses a dependency file, created by depmod, to automatically load relevant modules

rmmod

Unloads modules from the running kernel