Tuesday, March 9, 2010

Mod Utils

Package name : module-init-tools
sudo apt-get install module-init-tools

Use :-
lsmod
modprobe
depmod
rmmod


Modprobe : Intelligent enough to figure out the dependencies.
                   [it is just a depmod -a combined with insmod of the necessary modules]

Default location of the modules :
   /lib/modules/`uname -r`

Module dependency
 File : /lib/modules/`uname -r`/modules.dep

e.g from the modules.dep file :-
 -------------x--------------------------x---------------------------x--------------------------------

kernel/fs/freevxfs/freevxfs.ko:
kernel/fs/nfs/nfs.ko: kernel/fs/lockd/lockd.ko kernel/fs/nfs_common/nfs_acl.ko kernel/net/sunrpc/auth_gss/auth_rpcgss.ko kernel/net/sunrpc/sunrpc.ko
kernel/fs/exportfs/exportfs.ko:
kernel/fs/nfsd/nfsd.ko: kernel/fs/lockd/lockd.ko kernel/fs/nfs_common/nfs_acl.ko kernel/net/sunrpc/auth_gss/auth_rpcgss.ko kernel/net/sunrpc/sunrpc.ko kernel/fs/exportfs/exp
ortfs.ko
kernel/fs/lockd/lockd.ko: kernel/net/sunrpc/sunrpc.ko
-------------x--------------------------x---------------------------x--------------------------------

Therefore, nfs.ko requires nfs_acl.ko to be already installed. This dependency is build by depmod -a

No comments: