Expand description
Interface to Dynamically Loaded Linux Kernel Modules.
§Examples
Print all currently loaded system modules
let mods = LoadedModule::get_loaded().unwrap();
for m in mods {
println!("Module: {}", m.name());
}Load a module
let m = ModuleFile::from_name("MyModule").unwrap();
let loaded = m.load("my_param=1").unwrap();
println!(
"Loaded module {}. my_param={}",
loaded.name(),
std::str::from_utf8(&loaded.parameters()["my_param"]).unwrap()
);§Implementation
This uses the sysfs interface, documented here and here, and various undocumented interfaces where noted.
Structs§
- Loaded
Module - Describes a loaded Linux kernel Module
- ModInfo
- Information on a
ModuleFile - ModParam
- Module
File - A Linux Kernel Module file on disk.
Enums§
- Status
- Module Init Status
- Taint
- Kernel modules can be “tainted”, which serve as a marker for debugging purposes.
- Type
- Module type