2012-03-13 22:00:37 +00:00
|
|
|
python-kmod
|
|
|
|
===========
|
|
|
|
|
2012-03-13 22:06:37 +00:00
|
|
|
Python bindings for kmod/libkmod
|
2012-03-13 22:00:37 +00:00
|
|
|
|
2012-03-13 22:06:37 +00:00
|
|
|
kmod is a set of tools to handle common tasks with Linux kernel modules like
|
|
|
|
insert, remove, list, check properties, resolve dependencies and aliases.
|
|
|
|
|
|
|
|
These tools are designed on top of libkmod, a library that is shipped with
|
|
|
|
kmod. It can be found at:
|
2012-03-13 22:00:37 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|