Manage/Query kernel and kernel modules at runtime (201.5)

Candidates should be able to manage and/or query a 2.6.x kernel and its loadable modules.

Key Knowledge Areas:

The following is a partial list of used files, terms, and utilities:

insmod

insmod is a trivial program to insert a module into the kernel. usage: insmod [filename] [module options ...]

modprobe

modprobe inserts or removes a module and all of it's dependencies into the kernel.

lsmod

lsmod is a trivial program which nicely formats the contents of the /proc/modules, showing what kernel modules are currently loaded.

rmmod

rmmod is a trivial program to remove a module from the kernel.

modinfo

modinfo extracts information from the Linux Kernel modules given on the command line. If the module name is not a filename, then the /lib/modules/version directory is searched.

modinfo by default lists each attribute of the module in form fieldname : value, for easy reading. The filename is listed the same way (although it's not really an attribute).

usage: modinfo [-0] [-F field] [modulename|filename ...]

uname

uname prints system information. Parameters:

-a, --all				print all information, in the following order, except omit -p and -i if unknown:
-s, --kernel-name		print the kernel name
-n, --nodename			print the network node hostname
-r, --kernel-release	print the kernel release
-v, --kernel-version	print the kernel version
-m, --machine			print the machine hardware name
-p, --processor			print the processor type or "unknown"
-i, --hardware-platform	print the hardware platform or "unknown"
-o, --operating-system	print the operating system
			

Module dependencies

The /lib/modules/kernel-version/modules.depfile contains a list of module dependencies. It is generated by the depmod command. This file appears in every kernel version directory. The modprobe command uses this file to determine the order in which modules are (un)loaded in the kernel. Modules are loaded from right to left and are removed from left to right.

Module configuration

Module configration is handled in the file /etc/modules.conf. If this file does not exist the modprobe utility will try to read the /etc/conf.modules instead.

Copyright Snow B.V. The Netherlands