| From: |
| Andy Grover <agrover-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> |
| To: |
| linux-modules-u79uwXL29TY76Z2rM5mHXA@public.gmane.org |
| Subject: |
| Announce: python-kmod 0.1 |
| Date: |
| Tue, 13 Mar 2012 15:19:15 -0700 |
| Message-ID: |
| <4F5FC7E3.7000707@redhat.com> |
| Archive-link: |
| Article, Thread
|
Hi all, I've implemented a very basic Python wrapper for libkmod.
libkmod & python-kmod should help eliminate Python modules calling
system("modprobe foo") to load modules. (It happens.)
Feedback and contributions welcome. LGPL2.1.
From the README:
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
Regards -- Andy