NAME
kmadmin — kernel module administration
SYNOPSIS
/usr/sbin/kmadmin -k
/usr/sbin/kmadmin -L module_name
...
/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 ...
/usr/sbin/kmadmin -b
{1|2|i|a
} module_name... | module_id ...
DESCRIPTION
kmadmin
is the administrative command for static and loadable kernel modules.
It performs the following functions:
loads a kernel module into a running kernel
unloads a kernel module from a running kernel
modifies the configured loading phase of a kernel module registered with the running kernel
displays the status of kernel modules registered with the running kernel
displays the list of modules that are statically linked in the running kernel
The loadable modules feature enables adding a module to a
running kernel 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.
Unlike static modules, loadable modules:
must be scheduled for loadable configuration using the
kmsystem(1M)
command
must be configured into the system and registered with the running
kernel using the
config(1M)
and
kmupdate(1M)
commands, before they can be loaded
don't have to be linked to the kernel until they are needed
can be loaded and unloaded on demand by using the
kmadmin
command
can be automatically loaded on access by the kernel (auto load)
can be configured to load during system boot or init time
Not all kernel modules support dynamic loading. Not all dynamically loadable
modules support boot time loading.
Options
The
kmadmin
options have the following meanings:
- -b value
Set the configured loading phase of the currently
registered DLKM module (identified by
module_name
or
module_id
).
The module specified must already be registered with
the currently running kernel.
Specifying
value
equal to
1
(BOOT1) will cause the module to be loaded
during phase 1 of the boot sequence at next reboot.
Specifying
value
equal to
2
(BOOT2) will cause the module to be loaded
during phase 2 of the boot sequence at next reboot.
Specifying
value
equal to
i
(INIT) will cause the module to be loaded
during the init process at next reboot.
Specifying
value
equal to
a
(AUTO) will leave the module ready to load on demand or by the auto
load DLKM mechanism (load on access).
- -k
Display a list of all statically configured modules. Module name and version are displayed. All traditionally packaged modules are given default version
0.0.0;
all modularly packaged modules are given default version
0.1.0.
[See
config(1M).]
- -L module_name
Load the named modules. Any module specified for loading must have been previously registered with the running kernel. [See
kmupdate(1M)
and
kmmodreg(1M).]
The load operation performs all tasks associated with linking
the module to the kernel and making the module accessible to the system.
If the module depends on other kernel modules (as defined in
the module's master file) 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 modules that were loaded.
- -U module_name
Unload the named modules.
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 notifying the user that the module has been unloaded.
If a module to be unloaded is currently in use, is depended upon by
a module that is currently loaded, or is currently being
loaded or unloaded, the unload request will fail.
- -u module_id
Same as
-U module_name
, except that modules to be unloaded are identified by integer
values
module_id.
If
module_id
is 0 (zero),
kmadmin
attempts to unload all loaded modules.
- -q module_id
Display status information of the registered modules identified by the
integer values. Information returned by this option includes:
module version string (loadable modules are given default version 0.1.0)
module identifier
(module_id)
module load status (LOADED, UNLOADED)
the module's virtual load address
the module's reference count
the module's dependent count
the module's unload delay value
the module's descriptive name
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 for which status information is to be reported
is specified by name,
rather than
module_id.
- -s
Display abbreviated status information for all modules currently registered
with the running kernel.
This option returns a listing of module name, module version string,
module id, load status, module type and configured loading phase.
Example:
Name Version ID Status Type Phase
=================================================================
hello 0.1.0 1 UNLOADED Misc AUTO
misato 0.1.0 2 LOADED WSIO BOOT1
stape 0.1.0 3 UNLOADED WSIO INIT
- -S
Display the full status for all modules currently registered.
This option returns status information of the form returned by the
-q option.
DIAGNOSTICS
Output for queries is sent to stdout. Error messages are sent to stderr.
Messages from
kmadmin
are self explanatory.
SEE ALSO
config(1M),
kmupdate(1M),
kmmodreg(1M),
kmsystem(1M),
kmtune(1M),
modload(2),
modpath(2),
modstat(2),
moduload(2),
master(4),
system(4).