|
Manpages INSMODSection: Linux Module Support (8)Updated: January 30, 2002 Index Return to Main Contents NAMEinsmod - install loadable kernel moduleSYNOPSISinsmod [-fhkLmnpqrsSvVxXyY] [-e persist_name] [-o module_name] [-O blob_name] [-P prefix] module [ symbol=value ... ]DESCRIPTIONinsmod installs a loadable module in the running kernel.insmod tries to link a module into the running kernel by resolving all symbols from the kernel's exported symbol table. If the module file name is given without directories or extension, insmod will search for the module in some common default directories. The environment variable MODPATH can be used to override this default. If a module configuration file such as /etc/modules.conf exists, it will override the paths defined in MODPATH. The environment variable MODULECONF can also be used to select a different configuration file from the default /etc/modules.conf (or /etc/conf.modules (deprecated)). This environment variable will override all the definitions above. OPTIONS
MODULE PARAMETERSSome modules accept load-time parameters to customize their operation. These parameters are often I/O port and IRQ numbers that vary from machine to machine and cannot be determined from the hardware.In modules built for 2.0 series kernels, any integer or character pointer symbol may be treated as a parameter and modified. Beginning in the 2.1 series kernels, symbols are explicitly marked as parameters so that only specific values may be changed. Furthermore type information is provided for checking the values provided at load time. In the case of integers, all values may be in decimal, octal or hexadecimal a la C: 17, 021 or 0x11. Array elements are specified sequence separated by commas. Elements can be skipped by omitting the value. In 2.0 series modules, values that do not begin with a number are considered strings. Beginning in 2.1, the parameter's type information indicates whether to interpret the value as a string. If the value begins with double-quotes ("), the string is interpreted as in C, escape sequences and all. Do note that from the shell prompt, the quotes themselves may need to be protected from shell interpretation. GPL LICENSED MODULES AND SYMBOLSStarting with kernel 2.4.10, modules should have a license string, defined using MODULE_LICENSE(). Several strings are recognised as being GPL compatible; any other license string or no license at all means that the module is treated as proprietary. See include/linux/module.h for a list of GPL compatible license strings.If the kernel supports the /proc/sys/kernel/tainted flag then insmod will OR the tainted flag with '1' when loading a module without a GPL license. A warning is issued if the kernel supports tainting and a module is loaded without a license. A warning is always issued for modules which have a MODULE_LICENSE() that is not GPL compatible, even on older kernels that do not support tainting. This minimizes warnings when a new modutils is used on older kernels. insmod -f (force) mode will OR the tainted flag with '2' on kernels that support tainting. It always issues a warning. Some kernel developers require that symbols exported by their code must only be used by modules with a GPL compatible license. These symbols are exported by EXPORT_SYMBOL_GPL instead of the normal EXPORT_SYMBOL. GPL-only symbols exported by the kernel and by other modules are only visible to modules with a GPL-compatible license, these symbols appear in /proc/ksyms with a prefix of 'GPLONLY_'. insmod ignores the GPLONLY_ prefix on symbols while loading a GPL licensed module so the module just refers to the normal symbol name, without the prefix. GPL only symbols are not made available to modules without a GPL compatible license, this includes modules with no license at all. KSYMOOPS ASSISTANCETo assist with debugging of kernel Oops when using modules, insmod defaults to adding some symbols to ksyms, see the -Y option. These symbols start with __insmod_modulename_. The modulename is required to make the symbols unique. It is legal to load the same object more than once under different module names. Currently defined symbols are:
The other problem with debugging kernel Oops in modules is that the contents of /proc/ksyms and /proc/modules can change between the Oops and when you process the log file. To help overcome this problem, if the directory /var/log/ksymoops exists then insmod and rmmod will automatically copy /proc/ksyms and /proc/modules to /var/log/ksymoops with a prefix of `date +%Y%m%d%H%M%S`. The system administrator can tell ksymoops which snapshot files to use when debugging an Oops. There is no switch to disable this automatic copy. If you do not want it to occur, do not create /var/log/ksymoops. If that directory exists, it should be owned by root and be mode 644 or 600 and you should run this script every day or so. The script below is installed as insmod_ksymoops_clean.
#!/bin/sh
# Delete saved ksyms and modules not accessed in 2 days
if [ -d /var/log/ksymoops ]
then
set -e
# Make sure there is always at least one version
d=`date +%Y%m%d%H%M%S`
cp -a /proc/ksyms /var/log/ksymoops/${d}.ksyms
cp -a /proc/modules /var/log/ksymoops/${d}.modules
find /var/log/ksymoops -type f -atime +2 -exec rm {} \;
fi
SEE ALSOrmmod(8), modprobe(8), depmod(8), lsmod(8), ksyms(8), modules(2), genksyms(8), kerneld(8), ksymoops(kernel).BUGSinsmod [-V | --version] should display version information and then exit immediately. Instead, it prints the version information and behaves as if no options were given.HISTORYModule support was first conceived by AnonymousInitial Linux version by Bas Laarhoven <bas@vimec.nl> Version 0.99.14 by Jon Tombs <jon@gtex02.us.es> Extended by Bjorn Ekwall <bj0rn@blox.se> Original ELF help from Eric Youngdale <eric@aib.com> Rewritten for 2.1.17 by Richard Henderson <rth@tamu.edu> Extended by Bjorn Ekwall <bj0rn@blox.se> for modutils-2.2.*, March 1999 Assistance for ksymoops by Keith Owens <kaos@ocs.com.au>, May 1999 Maintainer: Keith Owens <kaos@ocs.com.au>.
IndexThis document was created by man2html, using the manual pages. Time: 13:49:25 GMT, November 05, 2025 |