# detaching a kernel driver from the kernel

## DaggyStyle

ok, I've decided to start learning linux driver development, my first decision is to try and fix my webcam  driver which is gspca_pac207.

now this might be a dumb question but I don't want to constantly recompile the kernel or parts of it when I'm testing my changes so I want to know how can I detach that code from the kernel so I can work on it?

thanks for not bashing some chairs on my head  :Smile: 

----------

## ssteinberg

You can run gcc on a single .c source file.

Running make will just recompile what was changed. As long as you don't modify headers only the driver will be recompiled.

----------

## DaggyStyle

 *ssteinberg wrote:*   

> You can run gcc on a single .c source file.
> 
> Running make will just recompile what was changed. As long as you don't modify headers only the driver will be recompiled.

 

I don't want to make the changes inside the kernel tree

----------

## maxime1986

why ??

As ssteinberg says it while not recompile your overall kernel each time you run make.

you can also run "make drivers/.../your_driver.ko" if you want to be sure to compile just your module...

You can copy your kernel tree somewhere else if you fear to break your current config...

----------

## Raptor85

Even easier, just flag it as a module in the .config file, and install that kernel as such before you start messing with it, then copy your source directory to a new one for your working copy. On your working copy just "make modules && make modules_install" every time to compile and install the new version.  This is pretty much what i do for tweaks to my orinoco & mach64 drivers.

----------

## DaggyStyle

 *Raptor85 wrote:*   

> Even easier, just flag it as a module in the .config file, and install that kernel as such before you start messing with it, then copy your source directory to a new one for your working copy. On your working copy just "make modules && make modules_install" every time to compile and install the new version.  This is pretty much what i do for tweaks to my orinoco & mach64 drivers.

 

ok, will try

----------

