building a driver in /lib/modules/2.6.9-1.667/build/ - how? need src.rpm?

Carlos Puchol cpg at users.sourceforge.net
Wed Nov 17 09:59:09 UTC 2004


Arjan van de Ven wrote:
> On Tue, 2004-11-16 at 18:13 -0800, Carlos Puchol wrote:
> > hi, i have a driver, called my-driver.c here, that builds cleanly
> > on a clean, official 2.6.9 tree:
> > 
> > ...
> >   MODPOST
> >   CC      drivers/char/my-driver.mod.o
> >   LD [M]  drivers/char/my-driver.ko
> > ..
> > 
> > i made modifications to the Kconfig and Makefile, .config, etc. so that it
> > all goes well.
> 
> yikes that sounds not quite right
> 
> what you want is a Makefile that looks like
> 
> obj-m += my-driver.o
> 
> and then do
> 
> make -C /lib/modules/`uname -r`/build  SUBDIRS=$PWD modules
> 
> no need to edit anything in /lib

most excellent!

just to be perfectly clear for future searchers
(your message was sufficient, but took a couple of
tries, since it was a bit ambiguous):


[01:50:23](1)machina:driver$ pwd
/home/cpg/my-driver
[01:50:25](1)machina:driver$ cat Makefile
obj-m += my-driver.o
[01:50:28](1)machina:driver$ make -C /lib/modules/`uname -r`/build SUBDIRS=$PWD modules
make: Entering directory `/lib/modules/2.6.9-1.667/build'
  CC [M]  /home/cpg/my-driver/my-driver.o
  Building modules, stage 2.
  MODPOST
  LD [M]  /home/cpg/my-driver/my-driver.ko
make: Leaving directory `/lib/modules/2.6.9-1.667/build'
[01:50:32](1)machina:driver$

and, no, the sources are not needed.

thanks!!




More information about the fedora-test-list mailing list