* module name is KBUILD_MODNAME
@ 2004-07-20 15:36 Idan Spektor
2004-07-20 19:17 ` sam
0 siblings, 1 reply; 4+ messages in thread
From: Idan Spektor @ 2004-07-20 15:36 UTC (permalink / raw)
To: linux-kernel
Hi All,
I am migrating my loadable module to work with the 2.6 kernel.
I have actually managed to make everything working except for
one thing. When I am loading my module (using the new
modprobe), its name, as appearing in lsmod, is KBUILD_MODNAME instead
of the module's real name. What am I missing? Is there
a define for the module's name that I should add somewhere?
Kind Regards
Idan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: module name is KBUILD_MODNAME
2004-07-20 15:36 module name is KBUILD_MODNAME Idan Spektor
@ 2004-07-20 19:17 ` sam
0 siblings, 0 replies; 4+ messages in thread
From: sam @ 2004-07-20 19:17 UTC (permalink / raw)
To: Idan Spektor; +Cc: linux-kernel
On Tue, Jul 20, 2004 at 05:36:01PM +0200, Idan Spektor wrote:
> Hi All,
> I am migrating my loadable module to work with the 2.6 kernel.
> I have actually managed to make everything working except for
> one thing. When I am loading my module (using the new
> modprobe), its name, as appearing in lsmod, is KBUILD_MODNAME instead
> of the module's real name. What am I missing? Is there
> a define for the module's name that I should add somewhere?
For a start could you post the Makefile you use to build the module?
I assume you use the kbuild infrastructure?
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: module name is KBUILD_MODNAME
2004-07-21 8:05 Idan Spektor
@ 2004-07-21 19:27 ` sam
0 siblings, 0 replies; 4+ messages in thread
From: sam @ 2004-07-21 19:27 UTC (permalink / raw)
To: Idan Spektor; +Cc: sam, linux-kernel
On Wed, Jul 21, 2004 at 10:05:33AM +0200, Idan Spektor wrote:
> Here is the makefile I am using to create the .ko
> object. Please notice that I compile my objects
> by myself in a different makefile and only then
> use the kbuild infrastructure.
This may be a source of many problem in the future.
I advise you to use kbuild.
Try sending me ls -R in a clean tree,
your current Makefile or eventueally the src.
Then I will try to guide you.
> makefile:
>
> ifeq ($(KERNELRELEASE),)
>
> PWD := /home/idan/my_module
> KDIR := /usr/src/linux-$(shell uname -r)/
>
> default:
> $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
>
> else
>
> obj-m := my_module.o
> my_module-objs := my_module_main.o
>
> $(PWD)/my_module_main.o:
> echo do nothing
>
> endif
The above should not result in the error you describe.
KBUILD_MODNAME is defined to the name of the module
when compiling my_module.mod.c.
Take a look at the output when you use the V=1 option when running make.
If you do not see something like:
$> make -C ~/bk/mars O=~/o M=$PWD V=1
...
gcc -Wp,-MD,/home/sam/bk/external/sam/.sam.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Iinclude2 -I/home/sam/bk/mars/include -I/home/sam/bk/external/sam -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -pipe -msoft-float -mpreferred-stack-boundary=2 -march=pentium3 -I/home/sam/bk/mars/include/asm-i386/mach-default -Iinclude/asm-i386/mach-default -O2 -fomit-frame-pointer -Wdeclaration-after-statement -I/home/sam/bk/mars/ -I /home/sam/bk/external/sam/include -DMODULE -DKBUILD_BASENAME=sam -DKBUILD_MODNAME=sammy -c -o /home/sam/bk/external/sam/sam.o /home/sam/bk/external/sam/sam.c
...
[file is named sam.o, module is named sammy]
Then there is something wrong. You should see -DKBUILD_MODNAME=my_module
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: module name is KBUILD_MODNAME
@ 2004-07-21 8:05 Idan Spektor
2004-07-21 19:27 ` sam
0 siblings, 1 reply; 4+ messages in thread
From: Idan Spektor @ 2004-07-21 8:05 UTC (permalink / raw)
To: sam; +Cc: linux-kernel
Here is the makefile I am using to create the .ko
object. Please notice that I compile my objects
by myself in a different makefile and only then
use the kbuild infrastructure. If kbuild is
adding the name as part of the module object
and not the header object then that might be
the problem. However, it is difficult for me
to use the kbuild infrastructure for the whole
build as it contains many files in different
directories.
makefile:
ifeq ($(KERNELRELEASE),)
PWD := /home/idan/my_module
KDIR := /usr/src/linux-$(shell uname -r)/
default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
else
obj-m := my_module.o
my_module-objs := my_module_main.o
$(PWD)/my_module_main.o:
echo do nothing
endif
idan
-----Original Message-----
From: sam@ravnborg.org [mailto:sam@ravnborg.org]
Sent: Tuesday, July 20, 2004 9:17 PM
To: Idan Spektor
Cc: linux-kernel@vger.kernel.org
Subject: Re: module name is KBUILD_MODNAME
On Tue, Jul 20, 2004 at 05:36:01PM +0200, Idan Spektor wrote:
> Hi All,
> I am migrating my loadable module to work with the 2.6 kernel.
> I have actually managed to make everything working except for
> one thing. When I am loading my module (using the new
> modprobe), its name, as appearing in lsmod, is KBUILD_MODNAME instead
> of the module's real name. What am I missing? Is there
> a define for the module's name that I should add somewhere?
For a start could you post the Makefile you use to build the module?
I assume you use the kbuild infrastructure?
Sam
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-07-21 17:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-20 15:36 module name is KBUILD_MODNAME Idan Spektor
2004-07-20 19:17 ` sam
2004-07-21 8:05 Idan Spektor
2004-07-21 19:27 ` sam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®