Compiling modules without compiling kernel

Compiling modules without compiling kernel

Post by Joseph Advoc » Wed, 30 Jan 2002 06:44:29



Hello All,

Is there a way I can compile a module without compiling the kernel?

To be more specific, I'm trying to use ppp on the system and the admin
didn't compile the module when he compiled the kernel.  I want this to
be a loadable module.  

Also I want to be able to compile any module in the future so if there
is a generic way, I like to know.

The command I used (with no luck) is the following:

gcc -I/usr/src/linux-2.2.18/include/  -DMODULE -D__KERNEL__ -O6 -c
ppp.c

I'm getting the following error:

ppp.c:176: parse error before `EXPORT_SYMTAB_not_defined'
ppp.c:176: warning: data definition has no type or storage class
ppp.c:177: parse error before `EXPORT_SYMTAB_not_defined'
ppp.c:177: warning: data definition has no type or storage class
ppp.c:264: parse error before `EXPORT_SYMTAB_not_defined'
ppp.c:264: warning: data definition has no type or storage class

Any help would be great.  Thank you in advance for your help.

Joseph

 
 
 

Compiling modules without compiling kernel

Post by Peter T. Breue » Wed, 30 Jan 2002 06:53:26



> Is there a way I can compile a module without compiling the kernel?

Sure. Nothing stops you.

Peter

 
 
 

Compiling modules without compiling kernel

Post by Joseph Advoc » Wed, 30 Jan 2002 07:10:11


Peter,

If you don't have nothing to say besides trying to be wise, please
don't waste my time.

On Mon, 28 Jan 2002 22:53:26 +0100, "Peter T. Breuer"



>> Is there a way I can compile a module without compiling the kernel?

>Sure. Nothing stops you.

>Peter

 
 
 

Compiling modules without compiling kernel

Post by nord » Wed, 30 Jan 2002 07:14:56



> To be more specific, I'm trying to use ppp on the system and the admin
> didn't compile the module when he compiled the kernel.  I want this to
> be a loadable module.

But if you don't have admin privs, you cannot load the module. So there
would be no reason to compile it.

nordi

 
 
 

Compiling modules without compiling kernel

Post by Joseph Advoc » Wed, 30 Jan 2002 07:43:23


It's ok, the admin will allow me to load it through sudo, I just need
to know how to compile a module.  This is for my own information to.
I run my own server and it's nice to know how to do this.


>> To be more specific, I'm trying to use ppp on the system and the admin
>> didn't compile the module when he compiled the kernel.  I want this to
>> be a loadable module.

>But if you don't have admin privs, you cannot load the module. So there
>would be no reason to compile it.

>nordi

 
 
 

Compiling modules without compiling kernel

Post by Peter T. Breue » Wed, 30 Jan 2002 08:12:08


[in the wrong place - shifted]

> On Mon, 28 Jan 2002 22:53:26 +0100, "Peter T. Breuer"


>>> Is there a way I can compile a module without compiling the kernel?
>>Sure. Nothing stops you.
> If you don't have nothing to say besides trying to be wise, please
> don't waste my time.

What is your question! Nothing stops you compiling the modules.
This is like asking "is there a way I can tie one shoelace, instead of
two". Just tie one.

Can you be more specific about what your difficulty might be? I can't
imagine it. The module should have a compile command at the end of the
file, and nothing stops you typing "make modules", or running "gcc -c
-O2 -c -D__KERNEL__ -DMODULE foo.c", or whatever else that you observe
the kernel makefile wants to do with your source code.

Peter

 
 
 

Compiling modules without compiling kernel

Post by Nico Kadel-Garci » Wed, 30 Jan 2002 15:26:20



> Peter,

> If you don't have nothing to say besides trying to be wise, please
> don't waste my time.

> On Mon, 28 Jan 2002 22:53:26 +0100, "Peter T. Breuer"


> >> Is there a way I can compile a module without compiling the kernel?

> >Sure. Nothing stops you.

> >Peter

Pot. Kettle. Black.

Now, to compile the module, you do need to make sure that you have the
associated kernel headers, and the source for the module. The source for
most modules is part of the kernel source tree, and is enabled by a specific
kernel .config option. So it's usually a lot easier to just compile with the
whole kernel, and safer, since setting it in the .config file will also make
sure that any other required modules are also available. But you can also
poke around in the source directory and set things by hand.

I just normally don't recommend it.

 
 
 

Compiling modules without compiling kernel

Post by Nico Kadel-Garci » Wed, 30 Jan 2002 15:27:39



> It's ok, the admin will allow me to load it through sudo, I just need
> to know how to compile a module.  This is for my own information to.
> I run my own server and it's nice to know how to do this.



> >> To be more specific, I'm trying to use ppp on the system and the admin
> >> didn't compile the module when he compiled the kernel.  I want this to
> >> be a loadable module.

> >But if you don't have admin privs, you cannot load the module. So there
> >would be no reason to compile it.

> >nordi

Ahh. That is good additional information. You may also be able to audo-load
it, or get the admin to put it in conf.modules for you. What is the module,
and what is the kernel you need to work with?