summaryrefslogtreecommitdiff
path: root/libkmod/python/README
blob: 9498ba070ef3b2fdc8c5f1a79ec37248de714b37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
python-kmod
===========

Python bindings for libkmod

libkmod is a C library to make inserting, removing, and listing
Linux kernel modules easier. It can be found at:

http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary

python-kmod is a Python wrapper module for libkmod, exposing common
module operations: listing installed modules, modprobe, and rmmod.
It is at:

https://github.com/agrover/python-kmod

Example (python invoked as root)
--------------------------------

>>>import kmod

>>>km = kmod.Kmod()

>>>km.loaded_modules()

[('nfs', 407706),
 ('nfs_acl', 12741)

...

 ('virtio_blk', 17549)]

>>>km.modprobe("btrfs")

>>>km.rmmod("btrfs")

Building
--------

Ensure Python and kmod headers are installed and run:

python setup.py build