Giter VIP home page Giter VIP logo

kmodpy's Introduction

kmodpy

The libkmod2 is a library that provides an API for insertion, removal, configuration and listing of kernel modules.

kmodpy is a Python ctypes wrapper module for libkmod, exposing common module operations: listing of installed modules, modprobe, modinfo, show_depends and rmmod.

Follows an example executed as root:

>>> import kmodpy
>>> km = kmodpy.Kmod()
>>> [m for m in km.list()]
    [(u'nfs', 407706),
     (u'nfs_acl', 12741)
     ...
     (u'virtio_blk', 17549)]
>>> km.modprobe("loop", extra_options="max_loop=8")
>>> km.rmmod("loop")
>>> list(km.modinfo("loop"))
    [('alias', 'char-major-10-237'), ('alias', 'block-major-7-*'),
     ('license', 'GPL'), ('parm', 'max_part:Maximum number of
     partitions per loop device'), ('parmtype', 'max_part:int'),
     ('parm', 'max_loop:Maximum number of loop
     devices'), ('parmtype', 'max_loop:int'), ('depends', ''),
     ('intree', 'Y'), ('vermagic', '3.12-1-amd64 SMP mod_unload
     modversions '), ('alias', 'devname:loop-control')]
>>> list(km.show_depends("ext4"))
    ['mbcache', 'crc16', 'jbd2']

kmodpy's People

Contributors

cnanakos avatar sundarnagarajan avatar tincho9 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.