HPlogo HP-UX Reference Volume 2 of 5 > k

kmadmin(1M)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

kmadmin — kernel module administration

SYNOPSIS

/usr/sbin/kmadmin -d directory_name |-D

/usr/sbin/kmadmin -k

/usr/sbin/kmadmin -L module_name ... | pathname ...

/usr/sbin/kmadmin -q module_id ...

/usr/sbin/kmadmin -Q module_name ...

/usr/sbin/kmadmin -s | -S

/usr/sbin/kmadmin -u module_id ...

/usr/sbin/kmadmin -U module_name ...

DESCRIPTION

kmadmin is the administrative command for static and loadable kernel modules. It performs the following functions:

  • loads a kernel module into a running system

  • unloads a kernel module from a running system

  • displays the status of kernel module(s) currently loaded or registered

  • modifies the search path for kernel modules

The loadable modules feature enables adding a module to a running system without rebooting the system or rebuilding the kernel. When the module is no longer needed, this feature also allows the module to be dynamically removed, thereby freeing system resources for other use.

Loadable modules are maintained in individual object files in the same manner as statically configured modules. Unlike static modules, loadable modules:

  • are not linked to the kernel until they are needed

  • must be configured into the system and registered with the running kernel using the config command, before they can be loaded

  • must be configured in loadable form (requires writing additional module initialization or wrapper code)

  • can be loaded and unloaded by using the kmadmin command

  • can be loaded by the kernel itself (called an auto load)

Auto-load occurs when the kernel detects a particular loadable module is required to accomplish some task, but is not currently loaded. The kernel automatically loads the module.

Options

The kmadmin options have the following meanings:

-d pathname

Prepend the pathname to the current loadable modules search path, where pathname specifies directories that should be searched:

  • for all subsequent demand loads initiated by a kmadmin command with the option -L and a named module_name,

  • for all subsequent loads performed by the kernel's auto-load mechanism (see note below),

  • prior to searching any directories already prepended to the search path by a prior kmadmin command with the -d option, and

  • prior to searching the default search path /stand/dlkm/mod.d or /stand/dlkm.current.vmunix /mod.d.

pathname must specify an absolute pathname or a list of absolute pathnames delimited by colons. The directories identified by pathname do not have to exist on the system at the time the request to modify the search path using kmadmin is made. If these directories do not exist at the time a load takes place, the load operation ignores them.

All modifications to the search path made using this option take effect immediately and affect all subsequent loads (demand and auto-load) and all users on the system.

-D

Reset the kernel modules search path to its default value. The default value can be one of two search paths depending upon the running kernel. When the running kernel is /stand/vmunix, the default value is /stand/dlkm/mod.d. When the running kernel is /stand/current.vmunix, the default value is /stand/dlkm.current.vmunix /mod.d. The reset takes effect immediately and affects all subsequent loads (demand and auto-load) and all users on the system.

-k

Print a list of all statically configured modules.

-L module_name

Load the named module(s), using the current value of the search path to locate the module's object file on disk.

This option searches for a matching file in all directories specified in the search path. The default search pathname can be one of two values. The pathname is /stand/dlkm.current.vmunix/mod.d when the running kernel is /stand/current.vmunix or pathname is /stand/dlkm/mod.d when the running kernel is /stand/vmunix.

The load operation performs all tasks associated with link editing the module to the kernel and making the module accessible to the system. If the module depends on other kernel modules (as defined in /usr/conf/master.d), and these modules are not currently loaded, kmadmin will automatically load the dependent modules during the load operation.

When loading completes, an integer module_id prints on the standard output to identify the module(s) that was loaded.

-L pathname

Same as -L module_name , except the absolute pathname, pathname, is used to locate the kernel module's object file.

-U module_name

Unload the named module(s) module_name.

The unload operation performs all tasks associated with disconnecting the module from the kernel and releasing any memory acquired by the module. When unloading completes, a message is displayed to standard output notify the user that the module(s) that has been unloaded.

If the module(s) to be unloaded are currently in use, are dependents of a loadable module that is currently loaded, or are currently being loaded or unloaded, the unload request will fail.

-u module_id

Same as -U module_name , except that module(s) to be unloaded is identified by the integer value module_id. If module_id is 0 (zero), kmadmin attempts to unload all loaded modules.

-q module_id

Print the status of loaded or registered module(s) identified by the integer value module_id. Information returned by this option includes:

  • module name

  • module identifier (module_id)

  • the module's pathname

  • module status

  • module size

  • the module's virtual load address

  • the memory size of BSS

  • the base address of BSS

  • the module's reference count

  • the module's dependent count

  • the module's unload delay value

  • the module's descriptive name

  • the type of module

Depending on the type of module, information on the module's character major number, block major number and flags may also be printed.

-Q module_name

Same as -q module_id , except the module(s) for which status information is to be reported is specified by module_name rather than module_id.

-s

Print an abbreviated status for all modules currently registered or loaded. This option returns a listing of module name, module id, status and type.

Example:

Name ID Status Type =========================================== hello 1 UNLOADED Misc misato 2 UNLOADED WSIO stape 3 UNLOADED WSIO

-S

Print the full status for all modules currently loaded. This option returns status information of the form returned by the -q options.

DIAGNOSTICS

kmadmin fails in the following cases:

kmadmin: Incorrect usage

Command line input contained one or more syntax errors. See the SYNOPSIS section for the correct usage.

kmadmin: module_id: Invalid argument

Unable to load the module corresponding to module_id because the module does not exist.

kmadmin : Device busy

Unable to load a module because the module is currently in-use.

kmadmin : Non-numeric ID string: string

Unable to unload or obtain status for a module because the module_id string specified a non-numeric value.

kmadmin: modstat: Invalid argument

Unable to obtain status for module, module_id, because the module does not exist.

kmadmin: Module: module_name, not found

Unable to obtain status for module because the module is currently not registered.

FILES

/stand/dlkm/mod.d/*

Default search path for kernel modules when /stand/vmunix is the running kernel.

/stand/dlkm.current.vmunix/mod.d/*

Default search path for kernel modules when /stand/current.vmunix is the running kernel.

© Hewlett-Packard Development Company, L.P.