blob: f03147667782d2aa40ca9e58accf91fd7d2fd4a4 [file] [log] [blame]
Andy Grover3aa27ba2012-03-13 15:00:37 -07001python-kmod
2===========
3
Andy Grover31aa6832012-03-13 15:06:37 -07004Python bindings for kmod/libkmod
Andy Grover3aa27ba2012-03-13 15:00:37 -07005
Andy Grover31aa6832012-03-13 15:06:37 -07006kmod is a set of tools to handle common tasks with Linux kernel modules like
7insert, remove, list, check properties, resolve dependencies and aliases.
8
9These tools are designed on top of libkmod, a library that is shipped with
10kmod. It can be found at:
Andy Grover3aa27ba2012-03-13 15:00:37 -070011
12http://git.kernel.org/?p=utils/kernel/kmod/kmod.git;a=summary
13
14python-kmod is a Python wrapper module for libkmod, exposing common
15module operations: listing installed modules, modprobe, and rmmod.
16It is at:
17
18https://github.com/agrover/python-kmod
19
20Example (python invoked as root)
21--------------------------------
22
W. Trevor King028fc122012-10-19 00:10:20 -040023::
Andy Grover3aa27ba2012-03-13 15:00:37 -070024
W. Trevor King028fc122012-10-19 00:10:20 -040025 >>> import kmod
26 >>> km = kmod.Kmod()
Andy Grover9ebfb9c2012-12-14 09:27:36 -080027 >>> [(m.name, m.size) for m in km.loaded()]
28 [(u'nfs', 407706),
29 (u'nfs_acl', 12741)
W. Trevor King028fc122012-10-19 00:10:20 -040030 ...
Andy Grover9ebfb9c2012-12-14 09:27:36 -080031 (u'virtio_blk', 17549)]
W. Trevor King028fc122012-10-19 00:10:20 -040032 >>> km.modprobe("btrfs")
33 >>> km.rmmod("btrfs")
Andy Grover3aa27ba2012-03-13 15:00:37 -070034
35Building
36--------
37
W. Trevor King161576d2012-10-19 00:11:17 -040038Ensure Python, Cython, and the kmod headers are installed and run::
Andy Grover3aa27ba2012-03-13 15:00:37 -070039
W. Trevor King028fc122012-10-19 00:10:20 -040040 $ python setup.py build