I try to install a module using this command:

sudo insmod mymod.ko [arg1] [arg2] 

but I get this error while loading the module:

insmod: error inserting 'mymod.ko': -1 Invalid module format

my current kernel:

uname -r

To compile the module for my linux kernel, I downloaded linux 4.4.6 since I couldn't find any source code for 4.4.6-040506-generic. This is the information about the module:

modinfo mymod.ko
vermagic:       4.4.6 SMP mod_unload modversions

When I try to boot the kernel from the compiled source code, it fails to boot. It stuck with busybox and prompt initramfs.

Any suggestion?

  • Can you include a little bit more information? For example, what command did you use to load the module? – Wildcard Mar 31 '16 at 23:29
  • I used "sudo insmod mymod.ko [arg1] [arg2] " – Nargesoo Mar 31 '16 at 23:33
  • 1
    Great, could you edit your question to include that info? – Wildcard Mar 31 '16 at 23:35

Run that insmod command, and after getting the error you mentioned of invalid module format, run dmesg and look at the last 4 lines. Usually it describes in such a case inconsistency between version of the module and version of the running kernel. If you have trouble understanding those lines, post them here.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.