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

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

 



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!!


[Index of Archives]     [Fedora Desktop]     [Fedora SELinux]     [Photo Sharing]     [Yosemite Forum]     [KDE Users]