Prashanth Chandra Prashanth Chandra - 1 year ago 68
Linux Question

How to view information about a newly loaded external Linux kernel module?

I have a simple Hello World kernel module from

I added a few lines with

, and

It builds successfully, I'm able to insert it with
into the current kernel, view logs with
, check that the module exists with

However, I want to be able to view the module's info with
but it doesn't work.

I get
modinfo: ERROR: Module hello not found.

I tried running
depmod -A
but they didn't make a difference.

Is there any way to make
"reload" so that I can view info for newly added modules?

Answer Source

From the man page:

modinfo extracts information from the Linux Kernel modules given on the command line. If the module name is not a filename, then the /lib/modules/version directory is searched, as is also done by modprobe(8) when loading kernel modules.

So it looks like this command just uses the kernel module files to get this information, so you can either run:

modinfo hello.ko

or you could put your kernel module in the /lib/modules/version/ directory

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download