Expand description

liblmod - Library for loading Linux kernel modules

Features:

  • Loading modules (modprobe)
  • Unloading modules (rmmod)

Example code:

extern crate liblmod;

fn main() -> std::io::Result<()> {
    println!("Unloading module kvm");
    liblmod::rmmod("kvm".to_string(), liblmod::Flags::Force)?;

    println!("Loading module kvm");
    liblmod::modprobe("kvm".to_string(), "".to_string(), liblmod::Selection::Current)
}

Modules

Enums

Flags for rmmod
Enum for modprobe function

Functions

Loads module by path
Loads module for selected or current running kernel
Removes kernel module from current running kernel