Este contenido no está disponible en el idioma seleccionado.
Chapter 22. General Parameters and Modules
This chapter is provided to illustrate some of the possible parameters available for common hardware device drivers[10], which under Red Hat Enterprise Linux are called kernel modules. In most cases, the default parameters do work. However, there may be times when extra module parameters are necessary for a device to function properly or to override the module's default parameters for the device.
During installation, Red Hat Enterprise Linux uses a limited subset of device drivers to create a stable installation environment. Although the installation program supports installation on many different types of hardware, some drivers (including those for SCSI adapters and network adapters) are not included in the installation kernel. Rather, they must be loaded as modules by the user at boot time.
Once installation is completed, support exists for a large number of devices through kernel modules.
Important
Red Hat provides a large number of unsupported device drivers in groups of packages called
kernel-smp-unsupported-<kernel-version>
and kernel-hugemem-unsupported-<kernel-version>
. Replace <kernel-version> with the version of the kernel installed on the system. These packages are not installed by the Red Hat Enterprise Linux installation program, and the modules provided are not supported by Red Hat, Inc.
22.1. Kernel Module Utilities Copiar enlaceEnlace copiado en el portapapeles!
Copiar enlaceEnlace copiado en el portapapeles!
A group of commands for managing kernel modules is available if the
module-init-tools
package is installed. Use these commands to determine if a module has been loaded successfully or when trying different modules for a piece of new hardware.
The command
/sbin/lsmod
displays a list of currently loaded modules. For example:
For each line, the first column is the name of the module, the second column is the size of the module, and the third column is the use count.
The
/sbin/lsmod
output is less verbose and easier to read than the output from viewing /proc/modules
.
To load a kernel module, use the
/sbin/modprobe
command followed by the kernel module name. By default, modprobe
attempts to load the module from the /lib/modules/<kernel-version>/kernel/drivers/
subdirectories. There is a subdirectory for each type of module, such as the net/
subdirectory for network interface drivers. Some kernel modules have module dependencies, meaning that other modules must be loaded first for it to load. The /sbin/modprobe
command checks for these dependencies and loads the module dependencies before loading the specified module.
For example, the command
/sbin/modprobe e100
/sbin/modprobe e100
loads any module dependencies and then the
e100
module.
To print to the screen all commands as
/sbin/modprobe
executes them, use the -v
option. For example:
/sbin/modprobe -v e100
/sbin/modprobe -v e100
Output similar to the following is displayed:
/sbin/insmod /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko Using /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko Symbol version prefix 'smp_'
/sbin/insmod /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko
Using /lib/modules/2.6.9-5.EL/kernel/drivers/net/e100.ko
Symbol version prefix 'smp_'
The
/sbin/insmod
command also exists to load kernel modules; however, it does not resolve dependencies. Thus, it is recommended that the /sbin/modprobe
command be used.
To unload kernel modules, use the
/sbin/rmmod
command followed by the module name. The rmmod
utility only unloads modules that are not in use and that are not a dependency of other modules in use.
For example, the command
/sbin/rmmod e100
/sbin/rmmod e100
unloads the
e100
kernel module.
Another useful kernel module utility is
modinfo
. Use the command /sbin/modinfo
to display information about a kernel module. The general syntax is:
/sbin/modinfo [options] <module>
/sbin/modinfo [options] <module>/sbin/modinfo [options] <module>/sbin/modinfo [options] <module>/sbin/modinfo [options] <module>
Options include
-d
, which displays a brief description of the module, and -p
, which lists the parameters the module supports. For a complete list of options, refer to the modinfo
man page (man modinfo
).
[10]
A driver is software which enables Linux to use a particular hardware device. Without a driver, the kernel cannot communicate with attached devices.