insmod tries to link a module into the running kernel by resolving all symbols from the kernel's exported symbol table.
Questions tagged [insmod]
81 questions
57
votes
10 answers
How to determine if a specific module is loaded in linux kernel
I am just curious is there any way to determine if a particular module is loaded/installed.
$ lsmod lists all modules (device driver loaded).
Is there any way to check or a command that returns true/false boolean output if a module name is polled.…

Dennis Ninj
- 829
- 2
- 8
- 15
55
votes
4 answers
How do I configure modprobe to find my module?
I'm trying to get a kernel module to load at boot.
If I run insmod /path/to/module.ko, it works fine. But this has to be repeated every time I reboot.
If I run modprobe /path/to/module.ko, it can't find the module.
I know modprobe uses a…

sep332
- 1,039
- 2
- 13
- 24
19
votes
3 answers
insmod fails with "Unknown symbol in module" for a symbol defined in another module
I am working in Ubuntu. I am trying to make two kernel modules which uses each other functions. My problem is that I got modules properly compiled, but the symbol is not resolved for one of them.
To make things simple, let's call these modules as…
user5485048
12
votes
1 answer
Error using insmod "Could not insert module hello_world.ko: Invalid module format"
I'm trying to make a hello_world kernel module using C and Bash on a Raspberry Pi.
I successfully used the make command to generate a hello_world.ko file.
However, when I try to use the insmod hello_world.ko command, I get the following…

user3204332
- 151
- 1
- 1
- 4
12
votes
4 answers
Not able to remove a loadable kernel module
I'm writing a loadable kernel module and trying to test it. After inserting it I was trying to remove it using rmmod xxx command, but I get an error saying module xxx is in use and the module gets stuck and I can't remove it. Any idea how to remove…

Varda Elentári
- 2,242
- 6
- 35
- 55
11
votes
1 answer
Warning: modules_install: missing 'System.map' file. Skipping depmod
I am trying to insert a kernel module using depmod and modprobe utilities in-order to resolve any dependencies. When I build the module it throws "Warning: modules_install: missing 'System.map' file. Skipping depmod."
And later when I try to…

user11875340
- 113
- 1
- 1
- 6
7
votes
1 answer
EXPORT_SYMBOL in kernel module | undefined symbol during insmod
I have a exported functions foo() and foo1() from a.ko (a kernel module), foo1() takes input parameter, a function pointer.
I invoke foo1() from b.ko, and pass foo() as the input parameter.
I see a insmod failure for b.ko (unknown symbol foo ), even…

user2501484
- 73
- 1
- 3
7
votes
2 answers
init_module '/path/to/module.ko' failed
I am trying to initiate a driver module by
insmod path/to/module.ko
and I am getting following error
> init_module 'path/to/module.ko' failed
I am trying to understand if it means that the module is already up and running or is it…

Steve H
- 461
- 2
- 10
- 18
6
votes
1 answer
add_disk() hangs on insmod
I am writing a Linux block device driver and I have a lot of the initialisation stuff working. However, when I finally call add_disk(), the module hangs during insmod.
The offending snippet is here:
set_capacity(gendisk,…

Inductiveload
- 6,094
- 4
- 29
- 55
5
votes
1 answer
Driver code in kernel module doesn't execute?
Why this kernel module doesn't do anything when i load it?
#include
#include
#include
#define DEVICE_NAME "hello-1.00.a"
#define DRIVER_NAME "hello"
MODULE_LICENSE("Dual BSD/GPL");
static…

Luca
- 1,270
- 1
- 18
- 34
5
votes
2 answers
Porting module to newer Linux kernel: Cannot allocate memory
I have a quite big driver module that I am trying to compile for a recent Linux kernel (3.4.4). I can successfully compile and insmod the same module with a 2.6.27.25 kernel.
GCC version are also different, 4.7.0 vs 4.3.0. Note that this module is…

calandoa
- 5,668
- 2
- 28
- 25
4
votes
2 answers
How do I make sure insmod fails on error?
I developed a peripheral driver for Linux. The .probe function performs the usual error checks like memory allocation failures, and also attempts to communicate with the hardware and in any type of error, deallocates any memory and returns an error…

Atilla Filiz
- 2,383
- 8
- 29
- 47
3
votes
0 answers
insmod: ERROR: could not insert module xline.ko: Invalid module format
I am trying to build a driver for a Heber X10i I/O controller on my Fedora 34 but I fail to insert the module into kernel, says "Invalid module format".
I followed all available tutorials/hints/Q&As but still no luck getting this running, am I…

Wayde Walker
- 53
- 6
3
votes
0 answers
docker [Errno 2] ip6tables v1.6.1: can't initialize ip6tables table `filter': Table does not exist (do you need to insmod?)
I am running a docker image in ubuntu with following command
sudo docker run --cap-add=NET_ADMIN -it --rm -v $(pwd):/root :ver1.0
I get following error
docker [Errno 2] ip6tables v1.6.1: can't initialize ip6tables table
`filter':…

Kanhaiya P. Baranwal
- 91
- 1
- 5
3
votes
1 answer
Linux Kernel : Not able to load simple linux kernel module with workqueues
I'm having an issue with using the workqueues in my linux kernel module.
My modules compiles without giving any error but at the time of loading it fails.
I'm not able to load the following module and getting following error in…

royy walls
- 31
- 1