Wednesday, January 23, 2013

Missing modprobe list. A workaround

Frustratingly a very useful feature of modprobe has been removed, the ability to list all unloaded kernel modules in a simple command no longer exists. When I last worked with modprobe it was possible to list all unloaded kernel modules with "modprobe -l". Very useful for a newbie when learning how to create kernel modules, especially when cross-compiling and you don't want to keep rebuilding the kernel but would rather load kernel modules by hand.

So just add this to the bottom of your bashrc file and you can list unloaded modules as before be calling fmod.
function fmod() { 

[ "$1" = '' ] && find /lib/modules/$(uname -r) -iname *.ko -print | awk -F $(uname -r)/ '{print $NF}' 

[ "$1" != '' ] && find /lib/modules/$(uname -r) -iname "$1".ko -print | awk -F $(uname -r)/ '{print $NF}' 

Courtesy of gentoo forums

No comments:

Post a Comment