Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Mercy Corps

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
Copyright Info
Terms of Use
Privacy Info
Masthead / Impressum
Your Account

Private Messages

News Archive
Submit News
User Articles
Web Links


The Web

Who's Online
There are currently, 92 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here




       insmod       [-fhkLmnpqrsSvVxXyYN]       [-e persist_name]
       [-o module_name]   [-O blob_name]    [-P prefix]    module
       [ symbol=value ... ]


       insmod 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

       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.

       When environment variable UNAME_MACHINE is  set,  modutils
       will  use  its value instead of the machine field from the
       uname() syscall.  This is  mainly  of  use  when  you  are
       compiling  64  bit  modules  in  32 bit user space or vice
       versa, set UNAME_MACHINE  to  the  type  of  the  modules.
       Current  modutils  does  not support full cross build mode
       for modules, it is limited to choosing between 32  and  64
       bit versions of the host architecture.

       -e persist_name, --persist=persist_name
              Specifies  where any persistent data for the module
              is read from on  load  and  written  to  when  this
              instantiantion  of  the  module  is unloaded.  This
              option is silently ignored if  the  module  has  no
              persistent  data.   Persistent data is only read by
              insmod if this option is present, by default insmod
              does not process persistent data.

              As  a  shorthand  form,  -e "" (an empty string) is
              interpreted by insmod as the value of persistdir as
              defined  in  modules.conf, followed by the filename
              of the module relative to the module search path it
              was  found  in,  minus  any trailing ".gz", ".o" or
              ".mod".  If modules.conf  specifies  "persistdir ="
              (i.e.  persistdir  is  an  empty  field)  then this
              shorthand   form   is   silently   ignored.    (See

       -k, --autoclean
              Set the auto-clean flag on the module.   This  flag
              will  be  used by kerneld(8) to remove modules that
              have not been  used  in  some  period  of  time  --
              usually one minute.

       -L, --lock
              Use  flock(2)  to prevent simultaneous loads of the
              same module.

       -m, --map
              Output a load map on stdout, making  it  easier  to
              debug the module in the event of a kernel panic.

       -n, --noload
              Dummy  run,  do  everything  except load the module
              into the kernel.  If requested by an -m or -O,  the
              run  will  produce  a  map or blob file.  Since the
              module is not loaded, the real kernel load  address
              is unknown so the map and blob file are based on an
              arbitrary load address of 0x12340000.

       -o module_name, --name=module_name
              Explicitly name the module,  rather  than  deriving
              the  name  from  the base name of the source object

       -O blob_name, --blob=blob_name
              Save the binary object in blob_name.  The result is
              a binary blob (no ELF headers) showing exactly what
              is   loaded   into   the   kernel   after   section
              manipulation   and   relocation.    Option   -m  is
              recommended to get a map of the object.

       -p, --probe
              Probe the module to see if it could be successfully
              loaded.   This includes locating the object file in
              the module  path,  checking  version  numbers,  and
              resolving   symbols.    It   does   not  check  the
              relocations nor does it produce a map or blob file.

       -P prefix, --prefix=prefix
              This  option can be used with versioned modules for
              an SMP or bigmem kernel, since such modules have an
              extra  prefix  added in their symbol names.  If the
              kernel was built with symbol versions  then  insmod
              will  automatically  extract  the  prefix  from the
              definition      of      "get_module_symbol"      or
              "inter_module_get",  one of which must exist in any
              kernel that supports modules.  If the kernel has no
              symbol  versions  but  the  module  was  built with
              symbol versions then the user must supply -P.
              and  use  this  exposure  to  bootstrap  up to root

              By default, modutils will reject attempts to use  a
              module  that  is  not owned by root.  Specifying -r
              will toggle  the  check  and  allow  root  to  load
              modules  that  are  not  owned  by root.  Note: the
              default value for root check can  be  changed  when
              modutils is configured.

              Use  of  -r to disable root checking or setting the
              default to "no root check" at configuration time is
              a major security exposure and is not recommended.

       -s, --syslog
              Output  everything  to  syslog(3)  instead  of  the

       -S, --kallsyms
              Force the loaded module to have kallsyms data, even
              if  the kernel does not support it.  This option is
              for  small  systems  where  the  kernel  is  loaded
              without  kallsyms  data  but  selected modules need
              kallsyms for debugging.

       -v, --verbose
              Be verbose.

       -V, --version
              Display the version of insmod.

       -X, --export; -x, --noexport
              Do and do not export all of the  module's  external
              symbols,  respectively.   The  default  is  for the
              symbols to be exported, unless the architecture has
              function   descriptors.    This   option   is  only
              effective if the module does not explicitly  export
              its  own  controlled  symbol  table,  and  thus  is
              deprecated.  It is  unsafe  on  architectures  with
              function descriptors and has been disabled for such

       -Y, --ksymoops; -y, --noksymoops
              Do and do not add ksymoops symbols to ksyms.  These
              symbols  are  used  by  ksymoops  to provide better
              debugging if there is an Oops in this module.   The
              default  is for the ksymoops symbols to be defined.
              This option is independent of the -X/-x options.

              ksymoops symbols add approximately  260  bytes  per
              loaded  module.   Unless  you  are  really short on
              kernel space and are trying to reduce ksyms to  its

       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.

       Starting 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

       insmod -f (force) mode will OR the tainted flag  with  '2'
       on  kernels  that  support  tainting.   It always issues a

       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
       more  than  once  under different module names.  Currently
       defined symbols are:

              objectfile is the name of the file that the  object
              was  loaded  from.   This ensures that ksymoops can
              match the code to the correct object.  mtime is the
              last  modified  timestamp on that file in hex, zero
              if stat failed.  version is the kernel version that
              the  module  was  compiled for, -1 if no version is
              available.   The  _O  symbol  has  the  same  start
              address as the module header.

              This  symbol  appears  at the start of selected ELF
              sections, currently .text, .rodata, .data, .bss and
              .sbss.   It  only appears if the section has a non-
              zero size.  sectionname is  the  name  of  the  ELF
              section,  length  is  the  length of the section in
              decimal.  These symbols help ksymoops map addresses
              to sections when no symbols are available.

              Only  created  by  insmod  if the module has one or
              more parameters that are marked as persistent  data
              and  a  filename  to  save persistent data (see -e,
              above) is available.

       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.

         # Delete saved ksyms and modules not accessed in 2 days
         if [ -d /var/log/ksymoops ]
              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

       distributions and scripts that run modutils and expect the
       current behaviour, any change of behaviour is unacceptable
       in 2.4.  Don't bother sending patches  for  this  bug,  it
       will not be fixed in 2.4, it should be fixed in 2.5.


       Module support was first conceived by Anonymous
       Initial 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>.

Linux                     March 23, 2003                INSMOD(8)

Looking for a "printer friendly" version?



Security Code
Security Code
Type Security Code

Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!

Amazon Wish List

Did You Know?
The Linux Tutorial welcomes your suggestions and ideas.


Tell a Friend About Us

Bookmark and Share

Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.10 Seconds