Merge pull request #16 from Infinidat/master
[python-kmod.git] / README
1 python-kmod
2 ===========
3
4 Python bindings for kmod/libkmod
5
6 kmod is a set of tools to handle common tasks with Linux kernel modules like
7 insert, remove, list, check properties, resolve dependencies and aliases.
8
9 These tools are designed on top of libkmod, a library that is shipped with
10 kmod. It can be found at:
11
12 http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary
13
14 python-kmod is a Python wrapper module for libkmod, exposing common
15 module operations: listing installed modules, modprobe, and rmmod.
16 It is at:
17
18 https://github.com/agrover/python-kmod
19
20 Example (python invoked as root)
21 --------------------------------
22
23 ::
24
25   >>> import kmod
26   >>> km = kmod.Kmod()
27   >>> [(m.name, m.size) for m in km.loaded()]
28   [(u'nfs', 407706),
29    (u'nfs_acl', 12741)
30    ...
31    (u'virtio_blk', 17549)]
32   >>> km.modprobe("btrfs")
33   >>> km.rmmod("btrfs")
34
35 Building
36 --------
37
38 Ensure Python, Cython, and the kmod headers are installed and run::
39
40   $ python setup.py build