linux-modules.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Linux kernel module is not running anymore when switching from mdev to udev
@ 2014-03-05  8:49 Frank Ihle
  2014-03-07  4:08 ` Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Frank Ihle @ 2014-03-05  8:49 UTC (permalink / raw)
  To: linux-modules

Hi everyone,

there is this problem, that I searched the Internet 
for its solution but without success. Here's what it's about, I hope 
someone can give me a hint:



        I'm using Buildroot 2013.10 to generate my Linux 2.6.39 Images, with the following 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



Every setting stayed the same (especially the kernel version) but the
 device management changes during this test, so actually the module 
should be fine. Building the kernel to be able for loading modules for 
multiple versions didn't solve it, neither the option "force module 
loading"


The way I build my module is:


with Buildroot I'm generating an Image, on the way a Linux 2.6.39 is installed.Afterwards I'm compiling the kernel module with the path to the Linux 2.6.39, that Buildroot has downloaded.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.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


How can this be and how to solve it?

Kind Regards,
Frank

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Linux kernel module is not running anymore when switching from mdev to udev
  2014-03-05  8:49 Linux kernel module is not running anymore when switching from mdev to udev Frank Ihle
@ 2014-03-07  4:08 ` Lucas De Marchi
  2014-03-07  8:15   ` [Buildroot] " Thomas Petazzoni
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2014-03-07  4:08 UTC (permalink / raw)
  To: Frank Ihle; +Cc: linux-modules, buildroot

Hi Frank,

On Wed, Mar 5, 2014 at 5:49 AM, Frank Ihle <frank.ihle@hs-offenburg.de> wro=
te:
> Hi everyone,
>
> there is this problem, that I searched the Internet
> for its solution but without success. Here's what it's about, I hope
> someone can give me a hint:
>
>
>
>         I'm using Buildroot 2013.10 to generate my Linux 2.6.39 Images, w=
ith the following 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

I don't see how udev could be related to your problem. Maybe just how
the dependencies were chosen...


>
>
>
>   insmod /usr/modules/measurement_gpio.ko
>
>
>
> the following message appeared:
>
>
>
>   insmod: can't insert '/usr/modules/measurement_gpio.ko': invalid
>   module format
>
>
>
> Every setting stayed the same (especially the kernel version) but the
>  device management changes during this test, so actually the module
> should be fine. Building the kernel to be able for loading modules for
> multiple versions didn't solve it, neither the option "force module
> loading"
>
>
> The way I build my module is:
>
>
> with Buildroot I'm generating an Image, on the way a Linux 2.6.39 is inst=
alled.Afterwards I'm compiling the kernel module with the path to the Linux=
 2.6.39, that Buildroot has downloaded.When the module is created I'm putti=
ng it into a fs-overlay directory, so it will be included into the image on=
 next build.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
>
>
> How can this be and how to solve it?

I successfully built an image with buildroot using systemd/udev/kmod
some days ago. And inserting modules work fine. If it was a more
recent kernel I'd say it's because you enabled module signature and
your out-of-tree module isn't signed.  But it doesn't look like this.

CC'ing buildroot's ML to see if they have a clue.

>
> Kind Regards,
> Frank
> --
> To unsubscribe from this list: send the line "unsubscribe linux-modules" =
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



--=20

Lucas De Marchi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] Linux kernel module is not running anymore when switching from mdev to udev
  2014-03-07  4:08 ` Lucas De Marchi
@ 2014-03-07  8:15   ` Thomas Petazzoni
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2014-03-07  8:15 UTC (permalink / raw)
  To: Frank Ihle; +Cc: Lucas De Marchi, buildroot, linux-modules

Frank,

On Fri, 7 Mar 2014 01:08:36 -0300, Lucas De Marchi wrote:

> > there is this problem, that I searched the Internet
> > for its solution but without success. Here's what it's about, I hope
> > someone can give me a hint:
> >
> >
> >
> >         I'm using Buildroot 2013.10 to generate my Linux 2.6.39 Images, with the following 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
> 
> I don't see how udev could be related to your problem. Maybe just how
> the dependencies were chosen...

I agree: the kernel module shown by Frank only toggle a GPIO, and does
not expose any device in /dev or anything that would involve udev or
mdev.

> > the following message appeared:
> >
> >   insmod: can't insert '/usr/modules/measurement_gpio.ko': invalid
> >   module format

Are you sure you have built your module correctly, against the right
version of the kernel headers that match the kernel you're running?

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-07  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-05  8:49 Linux kernel module is not running anymore when switching from mdev to udev Frank Ihle
2014-03-07  4:08 ` Lucas De Marchi
2014-03-07  8:15   ` [Buildroot] " Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).