All of lore.kernel.org
 help / color / mirror / Atom feed
* Dependant modules question
@ 2004-07-02 12:36 Vladislav Bolkhovitin
  2004-07-02 14:01 ` Richard B. Johnson
  0 siblings, 1 reply; 4+ messages in thread
From: Vladislav Bolkhovitin @ 2004-07-02 12:36 UTC (permalink / raw)
  To: linux-kernel

Hello,

I need some assistance with the kernel build system. It looks like this 
topic is not covered anywhere, at least I didn't find anything.

I have two modules, A and B, where B is dependant from A, i.e. uses some 
exported from it symbols. Both modules are built outside of the kernel 
tree.

With A everything is fine, it's compiled and installed with other kernel 
modules in /lib/modules/2.6.7/extra.

Then module B is built. Here I have a problem. Module A is not listed as 
the module from which B depends in .mod.c file, therefore there are 
"Undefined symbols" warnings and it is impossible to load B, even though 
A is loaded.

So, the question is: what should I do to make A be seen as exporting 
some symbols by the kernel and its build system?

The kernel is 2.4.7, EXPORT_SYMBOL() used in A as required.

Thanks,
Vlad

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

* Re: Dependant modules question
  2004-07-02 12:36 Dependant modules question Vladislav Bolkhovitin
@ 2004-07-02 14:01 ` Richard B. Johnson
  2004-07-02 14:17   ` Vladislav Bolkhovitin
  0 siblings, 1 reply; 4+ messages in thread
From: Richard B. Johnson @ 2004-07-02 14:01 UTC (permalink / raw)
  To: Vladislav Bolkhovitin; +Cc: linux-kernel

On Fri, 2 Jul 2004, Vladislav Bolkhovitin wrote:

> Hello,
>
> I need some assistance with the kernel build system. It looks like this
> topic is not covered anywhere, at least I didn't find anything.
>
> I have two modules, A and B, where B is dependant from A, i.e. uses some
> exported from it symbols. Both modules are built outside of the kernel
> tree.
>
> With A everything is fine, it's compiled and installed with other kernel
> modules in /lib/modules/2.6.7/extra.
>
> Then module B is built. Here I have a problem. Module A is not listed as
> the module from which B depends in .mod.c file, therefore there are
> "Undefined symbols" warnings and it is impossible to load B, even though
> A is loaded.
>
> So, the question is: what should I do to make A be seen as exporting
> some symbols by the kernel and its build system?
>
> The kernel is 2.4.7, EXPORT_SYMBOL() used in A as required.
>
> Thanks,
> Vlad

Did you execute `depmod -a` after putting your modules into the
default  directories and their information into /etc/modules.conf ?

Example:
/etc/modules.conf
alias char-major-177  module-a		# First to load
alias char-major-177  module-b		# Second to load
alias char-major-177  off		# All done


# cp module-a.o /lib/modules/`uname -r`/kernel/drivers/char
# cp module-b.o /lib/modules/`uname -r`/kernel/drivers/char
# depmod -a

The first time anybody tries to access a device with the major
number of 177, its modules will be loaded in the correct order
by modprobe.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
            Note 96.31% of all statistics are fiction.



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

* Re: Dependant modules question
  2004-07-02 14:01 ` Richard B. Johnson
@ 2004-07-02 14:17   ` Vladislav Bolkhovitin
  2004-07-02 15:34     ` Randy.Dunlap
  0 siblings, 1 reply; 4+ messages in thread
From: Vladislav Bolkhovitin @ 2004-07-02 14:17 UTC (permalink / raw)
  To: root; +Cc: linux-kernel

Richard B. Johnson wrote:
> Did you execute `depmod -a` after putting your modules into the
> default  directories and their information into /etc/modules.conf ?
 >
> Example:
> /etc/modules.conf
> alias char-major-177  module-a		# First to load
> alias char-major-177  module-b		# Second to load
> alias char-major-177  off		# All done
> 
> 
> # cp module-a.o /lib/modules/`uname -r`/kernel/drivers/char
> # cp module-b.o /lib/modules/`uname -r`/kernel/drivers/char
> # depmod -a
> 
> The first time anybody tries to access a device with the major
> number of 177, its modules will be loaded in the correct order
> by modprobe.
> 
> Cheers,
> Dick Johnson
> Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
>             Note 96.31% of all statistics are fiction.

Sure, I did. That works fine if A is built in the kernel tree (i.e. the 
sources of A stays there), not when both A and B are external modules.

Actually, the problem is a bit different: compiled B know nothing about 
A and doesn't reffer to it, so depmod and friends can't help. Ever if A 
already loaded, B refused to load (can't find the symbols). I suspect, I 
need to add something in the Makefile of A/B/both. But what?

Thanks,
Vlad


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

* Re: Dependant modules question
  2004-07-02 14:17   ` Vladislav Bolkhovitin
@ 2004-07-02 15:34     ` Randy.Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy.Dunlap @ 2004-07-02 15:34 UTC (permalink / raw)
  To: Vladislav Bolkhovitin; +Cc: root, linux-kernel

On Fri, 02 Jul 2004 18:17:58 +0400 Vladislav Bolkhovitin wrote:

| Richard B. Johnson wrote:
| > Did you execute `depmod -a` after putting your modules into the
| > default  directories and their information into /etc/modules.conf ?
|  >
| > Example:
| > /etc/modules.conf
| > alias char-major-177  module-a		# First to load
| > alias char-major-177  module-b		# Second to load
| > alias char-major-177  off		# All done
| > 
| > 
| > # cp module-a.o /lib/modules/`uname -r`/kernel/drivers/char
| > # cp module-b.o /lib/modules/`uname -r`/kernel/drivers/char
| > # depmod -a
| > 
| > The first time anybody tries to access a device with the major
| > number of 177, its modules will be loaded in the correct order
| > by modprobe.
| > 
| > Cheers,
| > Dick Johnson
| > Penguin : Linux version 2.4.26 on an i686 machine (5570.56 BogoMips).
| >             Note 96.31% of all statistics are fiction.
| 
| Sure, I did. That works fine if A is built in the kernel tree (i.e. the 
| sources of A stays there), not when both A and B are external modules.
| 
| Actually, the problem is a bit different: compiled B know nothing about 
| A and doesn't reffer to it, so depmod and friends can't help. Ever if A 
| already loaded, B refused to load (can't find the symbols). I suspect, I 
| need to add something in the Makefile of A/B/both. But what?

Rusty's module testsuite has a sample/test that might help you.
Look in http://www.kernel.org/pub/linux/kernel/people/rusty/modules/
for module-init-tools-testsuite-3.0.tar.gz  (or bz2).

--
~Randy

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

end of thread, other threads:[~2004-07-02 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-02 12:36 Dependant modules question Vladislav Bolkhovitin
2004-07-02 14:01 ` Richard B. Johnson
2004-07-02 14:17   ` Vladislav Bolkhovitin
2004-07-02 15:34     ` Randy.Dunlap

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.