Problem in First-Patch-Tutorial

SIMRAN SINGHAL singhalsimran0 at gmail.com
Sun Mar 19 04:53:43 EDT 2017


# 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 <jic23 at kernel.org>
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,  <valdis.kletnieks at vt.edu> 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.
>
>



More information about the Kernelnewbies mailing list