kmod/libkmod/python
2014-03-25 00:34:14 -03:00
..
COPYING python: initial checkin 2014-03-25 00:34:14 -03:00
COPYING.LESSER python: initial checkin 2014-03-25 00:34:14 -03:00
libkmod.c python: More cleanup and renaming of stuff. Add docstrings. 2014-03-25 00:34:14 -03:00
README python: Add README 2014-03-25 00:34:14 -03:00
setup.py python: Add support for listing loaded modules, modprobe, rmmod 2014-03-25 00:34:14 -03:00

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