Re: Fwd: Problem inserting module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi...

> Makefile :
>
> obj-m += hello-1.o
> all:
>         make -C /lib/modules/$(shell uname -r)/build M=$(PWD)
> EXTRA_CFLAGS="-g" modules

This is what I use when I create kernel module:
-------------------------------------------------------------------------
KERNELSOURCE=/home/mulyadi/kernel-ck/linux-2.6.11.1/
obj-m += newbies.o

default:
        make -C ${KERNELSOURCE}  SUBDIRS=`pwd` modules
-------------------------------------------------------------------------

I am not sure what "M" means, so try to replace it with "SUBDIRS". 
SUBDIRS should be pointed to the directory which contains your kernel 
module's source code.

Another thing is, are you sure "/lib/modules/$(shell uname -r)/build" 
contains the correct kernel source and it is compiled 100% identical 
with current running kernel. You must remember, even though it points 
to correct subdirectory name, that doesn't neccessarily means the 
kernel source configured inside the "./build" directory is 100% 
identical with the running kernel. So please re-check it.

As always, there is -f (force) option to force the module loading... but 
fixing the problem's root should be your #1 priority.

Good luck...

regards

Mulyadi

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux