Home » Linux Command Reference » UNIX/LINUX Command – insmod

UNIX/LINUX Command – insmod

NAME

insmod—Install loadable modules (aout and ELF format)

SYNOPSIS

insmod [ –fkmsxv ] [ –o internal_name ] object_file [ symbol=value … ]

DESCRIPTION

insmod installs a loadable module in the kernel.

insmod tries to load a module into the kernel, and resolves all symbols from the exported kernel symbols, with version information, if available. The module will get its name by removing the .o extension from the basename of the object file. If the .o extension is omitted, insmod will attempt to locate the module in some common default directories. If the environment contains the variable MODPATH, where all directories are separated with :, insmod will look in these directories for the module, in the specified order.

It is possible to load unversioned modules in a versioned kernel, and all combinations of these.

It is also possible to load ELF modules into an a.out kernel, and all combinations of these.

It is possible to stack modules, that is, let one module use a previously loaded module. All modules that are referenced are updated with this reference. This ensures that a module can’t be unloaded if there is another module that refers to it.

It is possible to change integer values in the module when loading it. This makes it possible to tune the module.

The options are as follows:

Options Description
–f The –f option tries to load the module even if the kernel or symbol versions differs from the version expected by the module. A warning will be issued if the module is locked to a specific kernel version that differs from the current version.
–k This option should really only be used by modprobe, to indicate that the module insertion was requested by kerneld. All modules inserted using this option will be subject to autoremoval by the kerneld utility if they have been unused for more that a minute. (The usage count is zero and no modules depend on this module.) If the kernel is not kerneldaware, the module will be rejected by the kernel. Just load it without the -k option, and all should be well.
–m The –m option will make insmod output a load map, that will make it easier to debug your modules after a kernel panic, thanks to Derek Atkins (warlord@MIT.EDU).
–o The –o option allows the module to be named to an explicit name instead of having a name derived from the name of the object file. Note that this option can also be placed after the module name, so that the syntax of insmod looks more similar to ld.
symbol=value[,value] … The values of all integer or character pointer symbols in the module can be changed at loadtime by naming a symbol and giving the new value(s). If the symbol is defined as an array of integers or character pointers, the elements in the array can be initialized by giving the values separated by commas. Specific array entries can be skipped by omitting the value, as in symbol=value1,,value2. Each integer value can be given as a decimal, octal, or hexadecimal value: 17, 021, or 0x11. If the first character in the given value is nonnumeric, the value is interpreted as a string. The symbol is assumed to be a character pointer, which will be initialized to point to the string. Extra space in the module will be allocated for the string itself. Note the syntax: no spaces are allowed around the = or , signs!
–s With this option, insmod will produce debugging information and error messages using the syslog facility. (Also used by kerneld, if you have installed it.)
–v If you want verbose information from the loading, select this option.
–x The no-export flag, which will inhibit the default insmod behavior—inserting all the module’s external symbols into the kernel symbol table. Note that the kernel will still update the references that the module makes to previously loaded modules.

Related Posts

UNIX/LINUX Command – rsync

UNIX/LINUX Command – rsync

NAME rsync – a fast, versatile, remote (and local) file-copying tool rsync Command SYNOPSIS Local: rsync [OPTION…] SRC… [DEST] Access via remote shell:Pull: rsync [OPTION…] [USER@]HOST:SRC… [DEST]Push: rsync [OPTION…] SRC… [USER@]HOST:DEST Access via rsync...

UNIX/LINUX Command – strip

UNIX/LINUX Command – strip

NAME strip—Discard symbols from object files. SYNOPSIS strip [ -Fbfdname|–target=bfdname ] [ -Ibfdname|–input-target=bfdname ] [ -Obfdname|–output-target=bfdname ] [-Rsectionname|–remove-section=sectionname ] [ -s|–strip-all ] [-S|-g|–strip-debug ][-x|–discard-all...

UNIX/LINUX Command – expand

UNIX/LINUX Command – expand

NAME expand—Convert tabs to spaces SYNOPSIS expand [–tab1[,tab2[,…]]] [–t tab1[,tab2[,…]]] [–i] [—tabs=tab1[,tab2[,…]]] [–initial] [–help] [–version] [file…] DESCRIPTION This manual page documents the GNU version of expand. expand writes the contents of each given...

UNIX/LINUX Command – uuencode

UNIX/LINUX Command – uuencode

NAME uuencode—Encode a binary fileuudecode—Decode a file created by uuencode SYNOPSIS uuencode [-m] [ file ] nameuudecode [-o outfile] [ file ]… DESCRIPTION uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other...

Follow Us

Our Communities

The Ultimate Managed Hosting Platform
Load WordPress Sites in as fast as 37ms!

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

seventeen + twelve =

Shares