0

I have a simple Kernel module:

void GPIO_LED(void) {
   printk(" GPIO: set PC8: '0');
   at91_set_gpio_value(AT91_PIN_PC8, 1);
}
//
int init_module(void) {
  GPIO_LED();
  return 0;
}

MODULE_LICENSE("GPL");

When using it with mdev device management. everything works just fine. But using it with a udev device management, while executing insmod

insmod /usr/modules/measurement_gpio.ko

the following message appeared:

insmod: can't insert '/usr/modules/measurement_gpio.ko': invalid module format

Another test showed that when using a device table instead of mdev/udev leads to the same Error. Every setting stayed the same (especially the kernel version) but the device management changes during this Test, so actually the module should be fine.

How can that be and how to solve it?

[Edit:] after making the kernel be able for load modules for multiple versions i receive the following message, which confuses me even more:

measurement_gpio: version magic '2.6.39 mod_unload modversions ARMv5 ' should be '2.6.39 mod_unload ARMv5

[Edit2:] The way I build my module is:

  1. with Buildroot I'm generating an Image, on the way a Linux 2.6.39 is installed.
  2. Afterwards I'm compiling the kernelmodule with the path to the Linux 2.6.39, that buildroot has downloaded.
  3. When the module is created I'm putting it into a fs-overlay directory, so it will be included into the image on next build.
  4. I hit another "make" on buildroot and i got everything together and a bootable Image.

I change nothing, that's why it confuses me even more

user3085931
  • 1,757
  • 4
  • 29
  • 55
  • please provide the exact error message and the commands you issued that led up to the problem. (and are you sure that you are using the kernel-module build for your kernel?) – umläute Feb 24 '14 at 13:08
  • please add any additional information to your question (do not abuse comments for this) – umläute Feb 24 '14 at 13:11
  • no i don't think so. It's about a kernel module, which is not working, it's actually not about the code. I'm expecting more users that are able to help me on Unix/Linux than on stack overflow with the spread topics. I assume that he problem lies in the kernel configuration which is definitely not part of stack overflow – user3085931 Feb 25 '14 at 07:45
  • Did you recompile your module after the switch to udev? Switching to udev changes the kernel configuration (e.g. udev requires inotify support). This may have made your module version incompatible with what it was before. For sure, after enabling the MODVERSIONS config options you have to recompile your module. – Arnout Feb 25 '14 at 07:51
  • yes, see at top message for the steps I did. – user3085931 Feb 25 '14 at 08:02

0 Answers0