Managing Modules


When you are using a modular kernel, you need to load and unload the modules, automatically whenever possible. You may need to pass parameters on to modules when you load them, such as memory addresses or interrupt codes. In this section, you'll learn about the tools Linux offers to manage your kernel modules.

Use any of these module management tools to get your kernel to bend to your will. All of them have man pages to help out, if necessary.

  • lsmod As ls provides a list of files and directories, so lsmod gives you a list of loaded kernel modules. This is usually a long list, so you should develop the habit of piping the command through less, the GNU pager.

  • insmod Load (insert) a specified module into the kernel. If the module you want to load is installed in a directory other than under /lib/modules, be sure to specify the full path when running this command. Several options are offered for this command; the most useful is -f, which forces the module to be loaded.

  • rmmod Unload (remove) a specified module (or more than one) from the running kernel.

  • depmod Creates a dependency file (/lib/modules/<kernelversion>/modules.dep) for individual modules. Many kernel modules need other modules to load first; that is, they are dependent on another module to work. During the system boot, depmod -A is run very soon after the kernel starts up to sort out the order in which modules load. The -A switch is there so a new dependency file is created only when there is a change in modules.

  • modprobe Perhaps the most used module tool, modprobe combines insmod and rmmod. modprobe uses the dependency file created by another tool, depmod, to automatically load or unload (with the -f switch) a module.

  • modinfo Get a module's name, author, license type, and perhaps other information from a module's object file that is, if the author included any information in the object file. Modules contributed by SUSE engineers include information on whether the module is officially supported.

  • /etc/modprobe.conf Not a command, but a file that contains module variables. These variables control how modprobe and depmod behave.



SUSE Linux 10 Unleashed
SUSE Linux 10.0 Unleashed
ISBN: 0672327260
EAN: 2147483647
Year: 2003
Pages: 332

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net