Re: Problem in First-Patch-Tutorial

2017-03-19 Thread SIMRAN SINGHAL
On Sun, Mar 19, 2017 at 6:53 PM, Alexander Kapshuk
 wrote:
> On Sun, Mar 19, 2017 at 10:53 AM, SIMRAN SINGHAL
>  wrote:
>> # modinfo iio_dummy_evgen.ko
>> filename:
>> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
>> license:GPL v2
>> description:IIO dummy driver
>> author: Jonathan Cameron 
>> srcversion: A8AC238EC07833E018CAF7B
>> depends:industrialio
>> intree: Y
>> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>>
>>
>> $ uname -r
>> 4.10.0-rc3+
>>
>> So, this shows that I need to compile module iio_dummy_evgen.ko for
>> kernel version 4.11.0-rc1, so for this I need to build system and
>> source tree for this version.
>>
>> So, I am trying this:-
>>  make -C /lib/modules/4.11.0-rc1+/build M=drivers/iio/dummy/ 
>> iio_dummy_evgen.ko
>>
>> But I don't know why I am getting this error:-
>> make: Entering directory '/home/simran/git/kernels/staging'
>> make[1]: *** No rule to make target 'iio_dummy_evgen.o'.  Stop.
>> Makefile:1664: recipe for target 'iio_dummy_evgen.ko' failed
>> make: *** [iio_dummy_evgen.ko] Error 2
>> make: Leaving directory '/home/simran/git/kernels/staging'
>>
>>
>> On Tue, Mar 14, 2017 at 12:19 AM,   wrote:
>>> On Mon, 13 Mar 2017 15:38:07 +0530, SIMRAN SINGHAL said:
>>>
 >> # modinfo iio_dummy_evgen.ko
 >> filename:
>>>
 >> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
 >>
 >>
 >> $ uname -r
 >> 4.10.0-rc3+
>>>
 Greg, I got that I have to build the module against the kernel I am using.
 But, How can I do this?
>>>
>>> You can do this in two different ways:
>>>
>>> 1) You're running a 4.10.0-rc3+ kernel.  Get the matching 4.10.0-rc3+ source
>>> tree and build the module against that.
>>>
>>> 2) You built the module from a 4.11.0-rc1+ tree.  Build a kernel from that 
>>> tree,
>>> boot that, and then try to load the module.
>>>
>>>
>
> You're running 4.10.0-rc3+.
> Your module is 4.11.0-rc1+.
> The command line you supplied shows you attempting to recompile your
> module for 4.11.0-rc1+. Your module is already 4.11.0-rc1+.
> As has been pointed out before, you need to either:
> (a). recompile your module for 4.10.0-rc3+.
> (b). or, install and boot into kernel 4.11.0-rc1+, and then try
> loading your module.



>
> As a side note, what kernel tree are you developing your driver
> against?

staging-testing

>The location of your staging drivers directory seems
> different from Linus' tree:
> ls -ld torvalds/drivers/staging/iio/
> drwxr-xr-x 14 sasha sasha 4096 Feb 13 21:24 torvalds/drivers/staging/iio/
>
> Finally, please do not top-post.

Sorry for this.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-19 Thread Alexander Kapshuk
On Sun, Mar 19, 2017 at 10:53 AM, SIMRAN SINGHAL
 wrote:
> # modinfo iio_dummy_evgen.ko
> filename:
> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
> license:GPL v2
> description:IIO dummy driver
> author: Jonathan Cameron 
> srcversion: A8AC238EC07833E018CAF7B
> depends:industrialio
> intree: Y
> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>
>
> $ uname -r
> 4.10.0-rc3+
>
> So, this shows that I need to compile module iio_dummy_evgen.ko for
> kernel version 4.11.0-rc1, so for this I need to build system and
> source tree for this version.
>
> So, I am trying this:-
>  make -C /lib/modules/4.11.0-rc1+/build M=drivers/iio/dummy/ 
> iio_dummy_evgen.ko
>
> But I don't know why I am getting this error:-
> make: Entering directory '/home/simran/git/kernels/staging'
> make[1]: *** No rule to make target 'iio_dummy_evgen.o'.  Stop.
> Makefile:1664: recipe for target 'iio_dummy_evgen.ko' failed
> make: *** [iio_dummy_evgen.ko] Error 2
> make: Leaving directory '/home/simran/git/kernels/staging'
>
>
> On Tue, Mar 14, 2017 at 12:19 AM,   wrote:
>> On Mon, 13 Mar 2017 15:38:07 +0530, SIMRAN SINGHAL said:
>>
>>> >> # modinfo iio_dummy_evgen.ko
>>> >> filename:
>>
>>> >> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>>> >>
>>> >>
>>> >> $ uname -r
>>> >> 4.10.0-rc3+
>>
>>> Greg, I got that I have to build the module against the kernel I am using.
>>> But, How can I do this?
>>
>> You can do this in two different ways:
>>
>> 1) You're running a 4.10.0-rc3+ kernel.  Get the matching 4.10.0-rc3+ source
>> tree and build the module against that.
>>
>> 2) You built the module from a 4.11.0-rc1+ tree.  Build a kernel from that 
>> tree,
>> boot that, and then try to load the module.
>>
>>

You're running 4.10.0-rc3+.
Your module is 4.11.0-rc1+.
The command line you supplied shows you attempting to recompile your
module for 4.11.0-rc1+. Your module is already 4.11.0-rc1+.
As has been pointed out before, you need to either:
(a). recompile your module for 4.10.0-rc3+.
(b). or, install and boot into kernel 4.11.0-rc1+, and then try
loading your module.

As a side note, what kernel tree are you developing your driver
against? The location of your staging drivers directory seems
different from Linus' tree:
ls -ld torvalds/drivers/staging/iio/
drwxr-xr-x 14 sasha sasha 4096 Feb 13 21:24 torvalds/drivers/staging/iio/

Finally, please do not top-post.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-19 Thread SIMRAN SINGHAL
# modinfo iio_dummy_evgen.ko
filename:
/home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
license:GPL v2
description:IIO dummy driver
author: Jonathan Cameron 
srcversion: A8AC238EC07833E018CAF7B
depends:industrialio
intree: Y
vermagic:   4.11.0-rc1+ SMP mod_unload modversions


$ uname -r
4.10.0-rc3+

So, this shows that I need to compile module iio_dummy_evgen.ko for
kernel version 4.11.0-rc1, so for this I need to build system and
source tree for this version.

So, I am trying this:-
 make -C /lib/modules/4.11.0-rc1+/build M=drivers/iio/dummy/ iio_dummy_evgen.ko

But I don't know why I am getting this error:-
make: Entering directory '/home/simran/git/kernels/staging'
make[1]: *** No rule to make target 'iio_dummy_evgen.o'.  Stop.
Makefile:1664: recipe for target 'iio_dummy_evgen.ko' failed
make: *** [iio_dummy_evgen.ko] Error 2
make: Leaving directory '/home/simran/git/kernels/staging'


On Tue, Mar 14, 2017 at 12:19 AM,   wrote:
> On Mon, 13 Mar 2017 15:38:07 +0530, SIMRAN SINGHAL said:
>
>> >> # modinfo iio_dummy_evgen.ko
>> >> filename:
>
>> >> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>> >>
>> >>
>> >> $ uname -r
>> >> 4.10.0-rc3+
>
>> Greg, I got that I have to build the module against the kernel I am using.
>> But, How can I do this?
>
> You can do this in two different ways:
>
> 1) You're running a 4.10.0-rc3+ kernel.  Get the matching 4.10.0-rc3+ source
> tree and build the module against that.
>
> 2) You built the module from a 4.11.0-rc1+ tree.  Build a kernel from that 
> tree,
> boot that, and then try to load the module.
>
>

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-13 Thread valdis . kletnieks
On Mon, 13 Mar 2017 15:38:07 +0530, SIMRAN SINGHAL said:

> >> # modinfo iio_dummy_evgen.ko
> >> filename:

> >> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
> >>
> >>
> >> $ uname -r
> >> 4.10.0-rc3+

> Greg, I got that I have to build the module against the kernel I am using.
> But, How can I do this?

You can do this in two different ways:

1) You're running a 4.10.0-rc3+ kernel.  Get the matching 4.10.0-rc3+ source
tree and build the module against that.

2) You built the module from a 4.11.0-rc1+ tree.  Build a kernel from that tree,
boot that, and then try to load the module.




pgp55wm8YLAJ5.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-13 Thread Anuz Pratap Singh Tomar
Seems like these tasks are all part of outreachy program and you are
supposed to be submitting it to the outreachy mailing list.:

https://kernelnewbies.org/IIO_tasks

one of the task is learning how to compile your own module, which is better
explained in

https://static.lwn.net/images/pdf/LDD3/ch02.pdf

I am not sure if compilation process has changed much. Only thing which I
think have changed in modprobe being less preferred.

Thank you
Warm Regards
Anuz
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-13 Thread Alexander Kapshuk
On Mon, Mar 13, 2017 at 12:08 PM, SIMRAN SINGHAL
 wrote:
> On Mon, Mar 13, 2017 at 1:05 PM, Greg KH  wrote:
>> On Mon, Mar 13, 2017 at 11:39:36AM +0530, SIMRAN SINGHAL wrote:
>>> On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk
>>>  wrote:
>>> > On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
>>> >  wrote:
>>> >> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>>> >>  wrote:
>>> >>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>>> >>>  wrote:
>>>  On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>>   wrote:
>>> > On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
>>> >> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>>> >>
>>> >>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
>>> >>> something of your own making, as I'm not seeing them in the kernel
>>> >>> source tree?
>>> >>>
>>> >>> The 'modules_install' make target installs drivers that have been
>>> >>> compiled as modules as opposed to those compiled into the kernel, 
>>> >>> into
>>> >>> /lib/modules/`uname -r`. For your own modules added to the kernel
>>> >>> source tree, or built out-of-tree, that would involve putting
>>> >>> appropriate entries into  Kconfig and/or Makefiles.
>>> >>>
>>> >>> Modeprobe expects your module to be found in /lib/modules/`uname 
>>> >>> -r`.
>>> >>> Otherwise, your module won't get loaded.
>>> >>
>>> >> One other thing to remember is that although 'make modules_install' 
>>> >> will
>>> >> take all the .ko files from in-tree modules and put them in their 
>>> >> proper
>>> >> place in /lib/modules/`uname-r`  and then run 'depmod', many 
>>> >> out-of-tree
>>> >> Makefiles manage to forget to do that last step.
>>> >>
>>> >> modprobe is a wrapper around insmod - and the file produced by 
>>> >> 'depmod'
>>> >> are what the wrapper uses to find the module.
>>> >
>>> > Thanks for elaborating on that.
>>> 
>>>  Still not working
>>> 
>>>  First I executed following commands:-
>>> 
>>>  $ make drivers/iio/dummy/iio_dummy_evgen.ko
>>>  $ make drivers/iio/dummy/iio_dummy.ko
>>> 
>>>  Above commands executed successfully
>>> 
>>>  Then I run following command:
>>>  $ insmod iio_dummy_evgen.ko
>>> 
>>>  Getting following error:
>>>  insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
>>>  or directory
>>> 
>>>  And, then I try executing them from driver/staging/dummy and then I
>>>  got this error:
>>>  insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
>>>  not permitted
>>> >>>
>>> >>> You have to run insmod as user root. Either specify the full path to
>>> >>> your module, or cd into the directory where the module is and run
>>> >>> insmod from there.
>>> >>
>>> >> I tried this before also but as you said I tried it again:
>>> >> # insmod iio_dummy_evgen.ko
>>> >> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid 
>>> >> module format
>>> >>
>>> >> Now, I am getting this error.
>>> >
>>> > Sounds like your kernel module has been compiled for kernel sources
>>> > whose version is different to the version of the kernel you are trying
>>> > to load your module into.
>>> >
>>> > See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details.
>>> >
>>> > In other words, the version output by 'uname -r' must match the
>>> > version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'.
>>>
>>> Hi,
>>>
>>> The problem is same you got, I have different versions of uname-r and the
>>> version output I got through vermagic.
>>>
>>> # modinfo iio_dummy_evgen.ko
>>> filename:
>>> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
>>> license:GPL v2
>>> description:IIO dummy driver
>>> author: Jonathan Cameron 
>>> srcversion: A8AC238EC07833E018CAF7B
>>> depends:industrialio
>>> intree: Y
>>> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>>>
>>>
>>> $ uname -r
>>> 4.10.0-rc3+
>>>
>>> How to deal with this?
>>
>> You did look in the kernel log when modprobe or insmod failed, right?
>> It should tell you what went wrong.
>>
>> As others pointed out, you need to build your module against the kernel
>> you are running.
>>
> Greg, I got that I have to build the module against the kernel I am using.
> But, How can I do this?
>
>> good luck!
>>
>> greg k-h

Googling for how to configure and build a custom kernel, should return
ample results.
One such resource is the Linux Kernel in a Nutshell available here:
http://www.kroah.com/lkn/

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org

Re: Problem in First-Patch-Tutorial

2017-03-13 Thread SIMRAN SINGHAL
On Mon, Mar 13, 2017 at 1:05 PM, Greg KH  wrote:
> On Mon, Mar 13, 2017 at 11:39:36AM +0530, SIMRAN SINGHAL wrote:
>> On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk
>>  wrote:
>> > On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
>> >  wrote:
>> >> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>> >>  wrote:
>> >>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>> >>>  wrote:
>>  On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>   wrote:
>> > On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
>> >> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>> >>
>> >>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
>> >>> something of your own making, as I'm not seeing them in the kernel
>> >>> source tree?
>> >>>
>> >>> The 'modules_install' make target installs drivers that have been
>> >>> compiled as modules as opposed to those compiled into the kernel, 
>> >>> into
>> >>> /lib/modules/`uname -r`. For your own modules added to the kernel
>> >>> source tree, or built out-of-tree, that would involve putting
>> >>> appropriate entries into  Kconfig and/or Makefiles.
>> >>>
>> >>> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
>> >>> Otherwise, your module won't get loaded.
>> >>
>> >> One other thing to remember is that although 'make modules_install' 
>> >> will
>> >> take all the .ko files from in-tree modules and put them in their 
>> >> proper
>> >> place in /lib/modules/`uname-r`  and then run 'depmod', many 
>> >> out-of-tree
>> >> Makefiles manage to forget to do that last step.
>> >>
>> >> modprobe is a wrapper around insmod - and the file produced by 
>> >> 'depmod'
>> >> are what the wrapper uses to find the module.
>> >
>> > Thanks for elaborating on that.
>> 
>>  Still not working
>> 
>>  First I executed following commands:-
>> 
>>  $ make drivers/iio/dummy/iio_dummy_evgen.ko
>>  $ make drivers/iio/dummy/iio_dummy.ko
>> 
>>  Above commands executed successfully
>> 
>>  Then I run following command:
>>  $ insmod iio_dummy_evgen.ko
>> 
>>  Getting following error:
>>  insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
>>  or directory
>> 
>>  And, then I try executing them from driver/staging/dummy and then I
>>  got this error:
>>  insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
>>  not permitted
>> >>>
>> >>> You have to run insmod as user root. Either specify the full path to
>> >>> your module, or cd into the directory where the module is and run
>> >>> insmod from there.
>> >>
>> >> I tried this before also but as you said I tried it again:
>> >> # insmod iio_dummy_evgen.ko
>> >> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module 
>> >> format
>> >>
>> >> Now, I am getting this error.
>> >
>> > Sounds like your kernel module has been compiled for kernel sources
>> > whose version is different to the version of the kernel you are trying
>> > to load your module into.
>> >
>> > See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details.
>> >
>> > In other words, the version output by 'uname -r' must match the
>> > version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'.
>>
>> Hi,
>>
>> The problem is same you got, I have different versions of uname-r and the
>> version output I got through vermagic.
>>
>> # modinfo iio_dummy_evgen.ko
>> filename:
>> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
>> license:GPL v2
>> description:IIO dummy driver
>> author: Jonathan Cameron 
>> srcversion: A8AC238EC07833E018CAF7B
>> depends:industrialio
>> intree: Y
>> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>>
>>
>> $ uname -r
>> 4.10.0-rc3+
>>
>> How to deal with this?
>
> You did look in the kernel log when modprobe or insmod failed, right?
> It should tell you what went wrong.
>
> As others pointed out, you need to build your module against the kernel
> you are running.
>
Greg, I got that I have to build the module against the kernel I am using.
But, How can I do this?

> good luck!
>
> greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-13 Thread Greg KH
On Mon, Mar 13, 2017 at 11:39:36AM +0530, SIMRAN SINGHAL wrote:
> On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk
>  wrote:
> > On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
> >  wrote:
> >> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
> >>  wrote:
> >>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
> >>>  wrote:
>  On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>   wrote:
> > On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
> >> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
> >>
> >>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
> >>> something of your own making, as I'm not seeing them in the kernel
> >>> source tree?
> >>>
> >>> The 'modules_install' make target installs drivers that have been
> >>> compiled as modules as opposed to those compiled into the kernel, into
> >>> /lib/modules/`uname -r`. For your own modules added to the kernel
> >>> source tree, or built out-of-tree, that would involve putting
> >>> appropriate entries into  Kconfig and/or Makefiles.
> >>>
> >>> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
> >>> Otherwise, your module won't get loaded.
> >>
> >> One other thing to remember is that although 'make modules_install' 
> >> will
> >> take all the .ko files from in-tree modules and put them in their 
> >> proper
> >> place in /lib/modules/`uname-r`  and then run 'depmod', many 
> >> out-of-tree
> >> Makefiles manage to forget to do that last step.
> >>
> >> modprobe is a wrapper around insmod - and the file produced by 'depmod'
> >> are what the wrapper uses to find the module.
> >
> > Thanks for elaborating on that.
> 
>  Still not working
> 
>  First I executed following commands:-
> 
>  $ make drivers/iio/dummy/iio_dummy_evgen.ko
>  $ make drivers/iio/dummy/iio_dummy.ko
> 
>  Above commands executed successfully
> 
>  Then I run following command:
>  $ insmod iio_dummy_evgen.ko
> 
>  Getting following error:
>  insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
>  or directory
> 
>  And, then I try executing them from driver/staging/dummy and then I
>  got this error:
>  insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
>  not permitted
> >>>
> >>> You have to run insmod as user root. Either specify the full path to
> >>> your module, or cd into the directory where the module is and run
> >>> insmod from there.
> >>
> >> I tried this before also but as you said I tried it again:
> >> # insmod iio_dummy_evgen.ko
> >> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module 
> >> format
> >>
> >> Now, I am getting this error.
> >
> > Sounds like your kernel module has been compiled for kernel sources
> > whose version is different to the version of the kernel you are trying
> > to load your module into.
> >
> > See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details.
> >
> > In other words, the version output by 'uname -r' must match the
> > version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'.
> 
> Hi,
> 
> The problem is same you got, I have different versions of uname-r and the
> version output I got through vermagic.
> 
> # modinfo iio_dummy_evgen.ko
> filename:
> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
> license:GPL v2
> description:IIO dummy driver
> author: Jonathan Cameron 
> srcversion: A8AC238EC07833E018CAF7B
> depends:industrialio
> intree: Y
> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
> 
> 
> $ uname -r
> 4.10.0-rc3+
> 
> How to deal with this?

You did look in the kernel log when modprobe or insmod failed, right?
It should tell you what went wrong.

As others pointed out, you need to build your module against the kernel
you are running.

good luck!

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-13 Thread Alexander Kapshuk
On Mon, Mar 13, 2017 at 8:09 AM, SIMRAN SINGHAL
 wrote:
> On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk
>  wrote:
>> On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
>>  wrote:
>>> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>>>  wrote:
 On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
  wrote:
> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>  wrote:
>> On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
>>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>>>
 Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
 something of your own making, as I'm not seeing them in the kernel
 source tree?

 The 'modules_install' make target installs drivers that have been
 compiled as modules as opposed to those compiled into the kernel, into
 /lib/modules/`uname -r`. For your own modules added to the kernel
 source tree, or built out-of-tree, that would involve putting
 appropriate entries into  Kconfig and/or Makefiles.

 Modeprobe expects your module to be found in /lib/modules/`uname -r`.
 Otherwise, your module won't get loaded.
>>>
>>> One other thing to remember is that although 'make modules_install' will
>>> take all the .ko files from in-tree modules and put them in their proper
>>> place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
>>> Makefiles manage to forget to do that last step.
>>>
>>> modprobe is a wrapper around insmod - and the file produced by 'depmod'
>>> are what the wrapper uses to find the module.
>>
>> Thanks for elaborating on that.
>
> Still not working
>
> First I executed following commands:-
>
> $ make drivers/iio/dummy/iio_dummy_evgen.ko
> $ make drivers/iio/dummy/iio_dummy.ko
>
> Above commands executed successfully
>
> Then I run following command:
> $ insmod iio_dummy_evgen.ko
>
> Getting following error:
> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
> or directory
>
> And, then I try executing them from driver/staging/dummy and then I
> got this error:
> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
> not permitted

 You have to run insmod as user root. Either specify the full path to
 your module, or cd into the directory where the module is and run
 insmod from there.
>>>
>>> I tried this before also but as you said I tried it again:
>>> # insmod iio_dummy_evgen.ko
>>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module 
>>> format
>>>
>>> Now, I am getting this error.
>>
>> Sounds like your kernel module has been compiled for kernel sources
>> whose version is different to the version of the kernel you are trying
>> to load your module into.
>>
>> See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details.
>>
>> In other words, the version output by 'uname -r' must match the
>> version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'.
>
> Hi,
>
> The problem is same you got, I have different versions of uname-r and the
> version output I got through vermagic.
>
> # modinfo iio_dummy_evgen.ko
> filename:
> /home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
> license:GPL v2
> description:IIO dummy driver
> author: Jonathan Cameron 
> srcversion: A8AC238EC07833E018CAF7B
> depends:industrialio
> intree: Y
> vermagic:   4.11.0-rc1+ SMP mod_unload modversions
>
>
> $ uname -r
> 4.10.0-rc3+
>
> How to deal with this?

Your kernel version is 4.10.0-rc3, while your module was built for
kernel version 4.11.0-rc1, which is why it wouldn't load.
You have to either download the sources for kernel version 4.10.0-rc3,
and build your module against that, or build a new kernel using the
sources for version 4.11.0-rc1, build your module against that, reboot
into 4.11.0-rc1, and then load your module.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-13 Thread SIMRAN SINGHAL
On Mon, Mar 13, 2017 at 10:42 AM, Alexander Kapshuk
 wrote:
> On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
>  wrote:
>> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>>  wrote:
>>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>>>  wrote:
 On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
  wrote:
> On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>>
>>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
>>> something of your own making, as I'm not seeing them in the kernel
>>> source tree?
>>>
>>> The 'modules_install' make target installs drivers that have been
>>> compiled as modules as opposed to those compiled into the kernel, into
>>> /lib/modules/`uname -r`. For your own modules added to the kernel
>>> source tree, or built out-of-tree, that would involve putting
>>> appropriate entries into  Kconfig and/or Makefiles.
>>>
>>> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
>>> Otherwise, your module won't get loaded.
>>
>> One other thing to remember is that although 'make modules_install' will
>> take all the .ko files from in-tree modules and put them in their proper
>> place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
>> Makefiles manage to forget to do that last step.
>>
>> modprobe is a wrapper around insmod - and the file produced by 'depmod'
>> are what the wrapper uses to find the module.
>
> Thanks for elaborating on that.

 Still not working

 First I executed following commands:-

 $ make drivers/iio/dummy/iio_dummy_evgen.ko
 $ make drivers/iio/dummy/iio_dummy.ko

 Above commands executed successfully

 Then I run following command:
 $ insmod iio_dummy_evgen.ko

 Getting following error:
 insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
 or directory

 And, then I try executing them from driver/staging/dummy and then I
 got this error:
 insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
 not permitted
>>>
>>> You have to run insmod as user root. Either specify the full path to
>>> your module, or cd into the directory where the module is and run
>>> insmod from there.
>>
>> I tried this before also but as you said I tried it again:
>> # insmod iio_dummy_evgen.ko
>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module 
>> format
>>
>> Now, I am getting this error.
>
> Sounds like your kernel module has been compiled for kernel sources
> whose version is different to the version of the kernel you are trying
> to load your module into.
>
> See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details.
>
> In other words, the version output by 'uname -r' must match the
> version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'.

Hi,

The problem is same you got, I have different versions of uname-r and the
version output I got through vermagic.

# modinfo iio_dummy_evgen.ko
filename:
/home/simran/git/kernels/staging/drivers/iio/dummy/iio_dummy_evgen.ko
license:GPL v2
description:IIO dummy driver
author: Jonathan Cameron 
srcversion: A8AC238EC07833E018CAF7B
depends:industrialio
intree: Y
vermagic:   4.11.0-rc1+ SMP mod_unload modversions


$ uname -r
4.10.0-rc3+

How to deal with this?

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread Alexander Kapshuk
On Mon, Mar 13, 2017 at 6:18 AM, SIMRAN SINGHAL
 wrote:
> On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
>  wrote:
>> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>>  wrote:
>>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>>  wrote:
 On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>
>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
>> something of your own making, as I'm not seeing them in the kernel
>> source tree?
>>
>> The 'modules_install' make target installs drivers that have been
>> compiled as modules as opposed to those compiled into the kernel, into
>> /lib/modules/`uname -r`. For your own modules added to the kernel
>> source tree, or built out-of-tree, that would involve putting
>> appropriate entries into  Kconfig and/or Makefiles.
>>
>> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
>> Otherwise, your module won't get loaded.
>
> One other thing to remember is that although 'make modules_install' will
> take all the .ko files from in-tree modules and put them in their proper
> place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
> Makefiles manage to forget to do that last step.
>
> modprobe is a wrapper around insmod - and the file produced by 'depmod'
> are what the wrapper uses to find the module.

 Thanks for elaborating on that.
>>>
>>> Still not working
>>>
>>> First I executed following commands:-
>>>
>>> $ make drivers/iio/dummy/iio_dummy_evgen.ko
>>> $ make drivers/iio/dummy/iio_dummy.ko
>>>
>>> Above commands executed successfully
>>>
>>> Then I run following command:
>>> $ insmod iio_dummy_evgen.ko
>>>
>>> Getting following error:
>>> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
>>> or directory
>>>
>>> And, then I try executing them from driver/staging/dummy and then I
>>> got this error:
>>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
>>> not permitted
>>
>> You have to run insmod as user root. Either specify the full path to
>> your module, or cd into the directory where the module is and run
>> insmod from there.
>
> I tried this before also but as you said I tried it again:
> # insmod iio_dummy_evgen.ko
> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module 
> format
>
> Now, I am getting this error.

Sounds like your kernel module has been compiled for kernel sources
whose version is different to the version of the kernel you are trying
to load your module into.

See http://www.tldp.org/LDP/lkmpg/2.6/html/x380.html for details.

In other words, the version output by 'uname -r' must match the
version output by 'modinfo iio_dummy_evgen.ko | grep vermagic'.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread SIMRAN SINGHAL
On Mon, Mar 13, 2017 at 12:05 AM, Alexander Kapshuk
 wrote:
> On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
>  wrote:
>> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>>  wrote:
>>> On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
 On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:

> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
> something of your own making, as I'm not seeing them in the kernel
> source tree?
>
> The 'modules_install' make target installs drivers that have been
> compiled as modules as opposed to those compiled into the kernel, into
> /lib/modules/`uname -r`. For your own modules added to the kernel
> source tree, or built out-of-tree, that would involve putting
> appropriate entries into  Kconfig and/or Makefiles.
>
> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
> Otherwise, your module won't get loaded.

 One other thing to remember is that although 'make modules_install' will
 take all the .ko files from in-tree modules and put them in their proper
 place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
 Makefiles manage to forget to do that last step.

 modprobe is a wrapper around insmod - and the file produced by 'depmod'
 are what the wrapper uses to find the module.
>>>
>>> Thanks for elaborating on that.
>>
>> Still not working
>>
>> First I executed following commands:-
>>
>> $ make drivers/iio/dummy/iio_dummy_evgen.ko
>> $ make drivers/iio/dummy/iio_dummy.ko
>>
>> Above commands executed successfully
>>
>> Then I run following command:
>> $ insmod iio_dummy_evgen.ko
>>
>> Getting following error:
>> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
>> or directory
>>
>> And, then I try executing them from driver/staging/dummy and then I
>> got this error:
>> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
>> not permitted
>
> You have to run insmod as user root. Either specify the full path to
> your module, or cd into the directory where the module is and run
> insmod from there.

I tried this before also but as you said I tried it again:
# insmod iio_dummy_evgen.ko
insmod: ERROR: could not insert module iio_dummy_evgen.ko: Invalid module format

Now, I am getting this error.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread Alexander Kapshuk
On Sun, Mar 12, 2017 at 8:20 PM, SIMRAN SINGHAL
 wrote:
> On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
>  wrote:
>> On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
>>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>>>
 Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
 something of your own making, as I'm not seeing them in the kernel
 source tree?

 The 'modules_install' make target installs drivers that have been
 compiled as modules as opposed to those compiled into the kernel, into
 /lib/modules/`uname -r`. For your own modules added to the kernel
 source tree, or built out-of-tree, that would involve putting
 appropriate entries into  Kconfig and/or Makefiles.

 Modeprobe expects your module to be found in /lib/modules/`uname -r`.
 Otherwise, your module won't get loaded.
>>>
>>> One other thing to remember is that although 'make modules_install' will
>>> take all the .ko files from in-tree modules and put them in their proper
>>> place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
>>> Makefiles manage to forget to do that last step.
>>>
>>> modprobe is a wrapper around insmod - and the file produced by 'depmod'
>>> are what the wrapper uses to find the module.
>>
>> Thanks for elaborating on that.
>
> Still not working
>
> First I executed following commands:-
>
> $ make drivers/iio/dummy/iio_dummy_evgen.ko
> $ make drivers/iio/dummy/iio_dummy.ko
>
> Above commands executed successfully
>
> Then I run following command:
> $ insmod iio_dummy_evgen.ko
>
> Getting following error:
> insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
> or directory
>
> And, then I try executing them from driver/staging/dummy and then I
> got this error:
> insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
> not permitted

You have to run insmod as user root. Either specify the full path to
your module, or cd into the directory where the module is and run
insmod from there.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread SIMRAN SINGHAL
On Sun, Mar 12, 2017 at 10:15 PM, Alexander Kapshuk
 wrote:
> On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
>> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>>
>>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
>>> something of your own making, as I'm not seeing them in the kernel
>>> source tree?
>>>
>>> The 'modules_install' make target installs drivers that have been
>>> compiled as modules as opposed to those compiled into the kernel, into
>>> /lib/modules/`uname -r`. For your own modules added to the kernel
>>> source tree, or built out-of-tree, that would involve putting
>>> appropriate entries into  Kconfig and/or Makefiles.
>>>
>>> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
>>> Otherwise, your module won't get loaded.
>>
>> One other thing to remember is that although 'make modules_install' will
>> take all the .ko files from in-tree modules and put them in their proper
>> place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
>> Makefiles manage to forget to do that last step.
>>
>> modprobe is a wrapper around insmod - and the file produced by 'depmod'
>> are what the wrapper uses to find the module.
>
> Thanks for elaborating on that.

Still not working

First I executed following commands:-

$ make drivers/iio/dummy/iio_dummy_evgen.ko
$ make drivers/iio/dummy/iio_dummy.ko

Above commands executed successfully

Then I run following command:
$ insmod iio_dummy_evgen.ko

Getting following error:
insmod: ERROR: could not load module iio_dummy_evgen.ko: No such file
or directory

And, then I try executing them from driver/staging/dummy and then I
got this error:
insmod: ERROR: could not insert module iio_dummy_evgen.ko: Operation
not permitted

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread Alexander Kapshuk
On Sun, Mar 12, 2017 at 5:34 PM,   wrote:
> On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:
>
>> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
>> something of your own making, as I'm not seeing them in the kernel
>> source tree?
>>
>> The 'modules_install' make target installs drivers that have been
>> compiled as modules as opposed to those compiled into the kernel, into
>> /lib/modules/`uname -r`. For your own modules added to the kernel
>> source tree, or built out-of-tree, that would involve putting
>> appropriate entries into  Kconfig and/or Makefiles.
>>
>> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
>> Otherwise, your module won't get loaded.
>
> One other thing to remember is that although 'make modules_install' will
> take all the .ko files from in-tree modules and put them in their proper
> place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
> Makefiles manage to forget to do that last step.
>
> modprobe is a wrapper around insmod - and the file produced by 'depmod'
> are what the wrapper uses to find the module.

Thanks for elaborating on that.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread valdis . kletnieks
On Sun, 12 Mar 2017 15:49:31 +0200, Alexander Kapshuk said:

> Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
> something of your own making, as I'm not seeing them in the kernel
> source tree?
>
> The 'modules_install' make target installs drivers that have been
> compiled as modules as opposed to those compiled into the kernel, into
> /lib/modules/`uname -r`. For your own modules added to the kernel
> source tree, or built out-of-tree, that would involve putting
> appropriate entries into  Kconfig and/or Makefiles.
>
> Modeprobe expects your module to be found in /lib/modules/`uname -r`.
> Otherwise, your module won't get loaded.

One other thing to remember is that although 'make modules_install' will
take all the .ko files from in-tree modules and put them in their proper
place in /lib/modules/`uname-r`  and then run 'depmod', many out-of-tree
Makefiles manage to forget to do that last step.

modprobe is a wrapper around insmod - and the file produced by 'depmod'
are what the wrapper uses to find the module.


pgp8YSrq4yM7I.pgp
Description: PGP signature
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread Alexander Kapshuk
On Sun, Mar 12, 2017 at 12:00 PM, SIMRAN SINGHAL
 wrote:
> Reloading Modules
>
> make -j2 && sudo make modules_install
> sudo modprobe -r 
> sudo modprobe 
>
> In Reloading Modules I tried the first command it works fine for me.
>
> git/kernels/staging$ ls drivers/iio/dummy/*.ko
> drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko
>
> Then I tried to run second-command
>
> git/kernels/staging$ sudo modprobe -r iio_dummy_evgen
>
> I got the following error:-
> modprobe: FATAL: Module iio_dummy_evgen not found.
>
> I am not getting what is wrong with this.
>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Are these drivers, drivers/iio/dummy/{iio_dummy_evgen,iio_dummy}.ko,
something of your own making, as I'm not seeing them in the kernel
source tree?

The 'modules_install' make target installs drivers that have been
compiled as modules as opposed to those compiled into the kernel, into
/lib/modules/`uname -r`. For your own modules added to the kernel
source tree, or built out-of-tree, that would involve putting
appropriate entries into  Kconfig and/or Makefiles.

Modeprobe expects your module to be found in /lib/modules/`uname -r`.
Otherwise, your module won't get loaded.

To load a module from a directory other than /lib/modules/`uname -r`,
you want to use insmod and to remove it, rmmod.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread mhornung . linux
Hi,
On Sun, 12. Mar 17:58, SIMRAN SINGHAL wrote:
> On Sun, Mar 12, 2017 at 5:57 PM, SIMRAN SINGHAL
>  wrote:
> > On Sun, Mar 12, 2017 at 5:55 PM, Lino Sanfilippo  
> > wrote:
> >> Hi,
> >>
> >> On 12.03.2017 13:15, SIMRAN SINGHAL wrote:
> >>> On Sun, Mar 12, 2017 at 4:04 PM, Varsha Rao  wrote:
>  Hello Simran,
> 
> > In Reloading Modules I tried the first command it works fine for me.
> >
> > git/kernels/staging$ ls drivers/iio/dummy/*.ko
> > drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko
> >
> > Then I tried to run second-command
> >
> > git/kernels/staging$ sudo modprobe -r iio_dummy_evgen
> >
> > I got the following error:-
> > modprobe: FATAL: Module iio_dummy_evgen not found.
> 
>    Maybe as iio_dummy_evgen is not loaded it causes this error.
> 
> > I am not getting what is wrong with this.
> 
>  You need to execute commands in following order
> 
>  make drivers/iio/dummy/iio_dummy_evgen.ko
>  make drivers/iio/dummy/iio_dummy.ko
> 
>  sudo modprobe iio_dummy_evgen
>  sudo modprobe iio_dummy
> 
>  Check if they are loaded successfully with lsmod | grep "iio".
> 
>  Thanks,
>  Varsha
> >>>
> >>> This is also not working. I am getting this error now:
> >>> modprobe: FATAL: Module iio_dummy_evgen not found in directory
> >>> /lib/modules/4.10.0-rc3+
> >>>
> >>> I am basically trying to do the Task1 of IIO. Here is the link:-
> >>> https://kernelnewbies.org/IIO_tasks
> >>>
> >>> In this task they have asked to use this:
> >>> $ insmod iio_dummy_evgen.ko
> >>>
> >>> As this was not working, so I tried modprobe.
> >>>
> >>
> >>
> >> modprobe is just a wrapper around insmod. So if insmod does not work, 
> >> modprobe wont either.
> >> Could it be that the kernel you build the module for is not the kernel 
> >> that you are currently
> >> running?
> >>
> >> Regards,
> >> Lino
> >>
> > Thanks Lino,
> > My kernel is up-to-date.
> >
> 
> But its still not working.

Please try the following (as root):

# insmod ./iio_dummy_evgen.ko

The "./" does the trick. Please make sure to be inside the same directory as 
the module when you enter the command.

With best regards

Michael
> 
> >>
> >> ___
> >> Kernelnewbies mailing list
> >> Kernelnewbies@kernelnewbies.org
> >> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> 
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread SIMRAN SINGHAL
On Sun, Mar 12, 2017 at 5:57 PM, SIMRAN SINGHAL
 wrote:
> On Sun, Mar 12, 2017 at 5:55 PM, Lino Sanfilippo  
> wrote:
>> Hi,
>>
>> On 12.03.2017 13:15, SIMRAN SINGHAL wrote:
>>> On Sun, Mar 12, 2017 at 4:04 PM, Varsha Rao  wrote:
 Hello Simran,

> In Reloading Modules I tried the first command it works fine for me.
>
> git/kernels/staging$ ls drivers/iio/dummy/*.ko
> drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko
>
> Then I tried to run second-command
>
> git/kernels/staging$ sudo modprobe -r iio_dummy_evgen
>
> I got the following error:-
> modprobe: FATAL: Module iio_dummy_evgen not found.

   Maybe as iio_dummy_evgen is not loaded it causes this error.

> I am not getting what is wrong with this.

 You need to execute commands in following order

 make drivers/iio/dummy/iio_dummy_evgen.ko
 make drivers/iio/dummy/iio_dummy.ko

 sudo modprobe iio_dummy_evgen
 sudo modprobe iio_dummy

 Check if they are loaded successfully with lsmod | grep "iio".

 Thanks,
 Varsha
>>>
>>> This is also not working. I am getting this error now:
>>> modprobe: FATAL: Module iio_dummy_evgen not found in directory
>>> /lib/modules/4.10.0-rc3+
>>>
>>> I am basically trying to do the Task1 of IIO. Here is the link:-
>>> https://kernelnewbies.org/IIO_tasks
>>>
>>> In this task they have asked to use this:
>>> $ insmod iio_dummy_evgen.ko
>>>
>>> As this was not working, so I tried modprobe.
>>>
>>
>>
>> modprobe is just a wrapper around insmod. So if insmod does not work, 
>> modprobe wont either.
>> Could it be that the kernel you build the module for is not the kernel that 
>> you are currently
>> running?
>>
>> Regards,
>> Lino
>>
> Thanks Lino,
> My kernel is up-to-date.
>

But its still not working.

>>
>> ___
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread SIMRAN SINGHAL
On Sun, Mar 12, 2017 at 5:55 PM, Lino Sanfilippo  wrote:
> Hi,
>
> On 12.03.2017 13:15, SIMRAN SINGHAL wrote:
>> On Sun, Mar 12, 2017 at 4:04 PM, Varsha Rao  wrote:
>>> Hello Simran,
>>>
 In Reloading Modules I tried the first command it works fine for me.

 git/kernels/staging$ ls drivers/iio/dummy/*.ko
 drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko

 Then I tried to run second-command

 git/kernels/staging$ sudo modprobe -r iio_dummy_evgen

 I got the following error:-
 modprobe: FATAL: Module iio_dummy_evgen not found.
>>>
>>>   Maybe as iio_dummy_evgen is not loaded it causes this error.
>>>
 I am not getting what is wrong with this.
>>>
>>> You need to execute commands in following order
>>>
>>> make drivers/iio/dummy/iio_dummy_evgen.ko
>>> make drivers/iio/dummy/iio_dummy.ko
>>>
>>> sudo modprobe iio_dummy_evgen
>>> sudo modprobe iio_dummy
>>>
>>> Check if they are loaded successfully with lsmod | grep "iio".
>>>
>>> Thanks,
>>> Varsha
>>
>> This is also not working. I am getting this error now:
>> modprobe: FATAL: Module iio_dummy_evgen not found in directory
>> /lib/modules/4.10.0-rc3+
>>
>> I am basically trying to do the Task1 of IIO. Here is the link:-
>> https://kernelnewbies.org/IIO_tasks
>>
>> In this task they have asked to use this:
>> $ insmod iio_dummy_evgen.ko
>>
>> As this was not working, so I tried modprobe.
>>
>
>
> modprobe is just a wrapper around insmod. So if insmod does not work, 
> modprobe wont either.
> Could it be that the kernel you build the module for is not the kernel that 
> you are currently
> running?
>
> Regards,
> Lino
>
Thanks Lino,
My kernel is up-to-date.

>
> ___
> Kernelnewbies mailing list
> Kernelnewbies@kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread Lino Sanfilippo
Hi,

On 12.03.2017 13:15, SIMRAN SINGHAL wrote:
> On Sun, Mar 12, 2017 at 4:04 PM, Varsha Rao  wrote:
>> Hello Simran,
>>
>>> In Reloading Modules I tried the first command it works fine for me.
>>>
>>> git/kernels/staging$ ls drivers/iio/dummy/*.ko
>>> drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko
>>>
>>> Then I tried to run second-command
>>>
>>> git/kernels/staging$ sudo modprobe -r iio_dummy_evgen
>>>
>>> I got the following error:-
>>> modprobe: FATAL: Module iio_dummy_evgen not found.
>>
>>   Maybe as iio_dummy_evgen is not loaded it causes this error.
>>
>>> I am not getting what is wrong with this.
>>
>> You need to execute commands in following order
>>
>> make drivers/iio/dummy/iio_dummy_evgen.ko
>> make drivers/iio/dummy/iio_dummy.ko
>>
>> sudo modprobe iio_dummy_evgen
>> sudo modprobe iio_dummy
>>
>> Check if they are loaded successfully with lsmod | grep "iio".
>>
>> Thanks,
>> Varsha
> 
> This is also not working. I am getting this error now:
> modprobe: FATAL: Module iio_dummy_evgen not found in directory
> /lib/modules/4.10.0-rc3+
> 
> I am basically trying to do the Task1 of IIO. Here is the link:-
> https://kernelnewbies.org/IIO_tasks
> 
> In this task they have asked to use this:
> $ insmod iio_dummy_evgen.ko
> 
> As this was not working, so I tried modprobe.
> 


modprobe is just a wrapper around insmod. So if insmod does not work, modprobe 
wont either.
Could it be that the kernel you build the module for is not the kernel that you 
are currently
running? 

Regards,
Lino


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread SIMRAN SINGHAL
On Sun, Mar 12, 2017 at 4:04 PM, Varsha Rao  wrote:
> Hello Simran,
>
>> In Reloading Modules I tried the first command it works fine for me.
>>
>> git/kernels/staging$ ls drivers/iio/dummy/*.ko
>> drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko
>>
>> Then I tried to run second-command
>>
>> git/kernels/staging$ sudo modprobe -r iio_dummy_evgen
>>
>> I got the following error:-
>> modprobe: FATAL: Module iio_dummy_evgen not found.
>
>   Maybe as iio_dummy_evgen is not loaded it causes this error.
>
>> I am not getting what is wrong with this.
>
> You need to execute commands in following order
>
> make drivers/iio/dummy/iio_dummy_evgen.ko
> make drivers/iio/dummy/iio_dummy.ko
>
> sudo modprobe iio_dummy_evgen
> sudo modprobe iio_dummy
>
> Check if they are loaded successfully with lsmod | grep "iio".
>
> Thanks,
> Varsha

This is also not working. I am getting this error now:
modprobe: FATAL: Module iio_dummy_evgen not found in directory
/lib/modules/4.10.0-rc3+

I am basically trying to do the Task1 of IIO. Here is the link:-
https://kernelnewbies.org/IIO_tasks

In this task they have asked to use this:
$ insmod iio_dummy_evgen.ko

As this was not working, so I tried modprobe.

Thanks!
Simran

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Problem in First-Patch-Tutorial

2017-03-12 Thread Varsha Rao
Hello Simran,

> In Reloading Modules I tried the first command it works fine for me.
>
> git/kernels/staging$ ls drivers/iio/dummy/*.ko
> drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko
>
> Then I tried to run second-command
>
> git/kernels/staging$ sudo modprobe -r iio_dummy_evgen
>
> I got the following error:-
> modprobe: FATAL: Module iio_dummy_evgen not found.

  Maybe as iio_dummy_evgen is not loaded it causes this error.

> I am not getting what is wrong with this.

You need to execute commands in following order

make drivers/iio/dummy/iio_dummy_evgen.ko
make drivers/iio/dummy/iio_dummy.ko

sudo modprobe iio_dummy_evgen
sudo modprobe iio_dummy

Check if they are loaded successfully with lsmod | grep "iio".

Thanks,
Varsha

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Problem in First-Patch-Tutorial

2017-03-12 Thread SIMRAN SINGHAL
Reloading Modules

make -j2 && sudo make modules_install
sudo modprobe -r 
sudo modprobe 

In Reloading Modules I tried the first command it works fine for me.

git/kernels/staging$ ls drivers/iio/dummy/*.ko
drivers/iio/dummy/iio_dummy_evgen.ko  drivers/iio/dummy/iio_dummy.ko

Then I tried to run second-command

git/kernels/staging$ sudo modprobe -r iio_dummy_evgen

I got the following error:-
modprobe: FATAL: Module iio_dummy_evgen not found.

I am not getting what is wrong with this.

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies