How can I quickly recompile the kernel after changing the configuration?

I'm trying to fix a suspend problem on my Dell Inspiron 600m. I think the problem is that the video driver modules aren't being reloaded properly. So, I'm going to try to compile the video drivers into the kernel proper rather than keeping them as external modules. I just want to know if I can get away from running:

fakeroot debian/rules clean

before building the kernel with:

skipabi=true skipmodule=true fakeroot debian/rules binary-core2

where core2 is my custom configured kernel. This will work and I get a clean kernel package that I can compile, but compilation can take up to 3 hours on my machine so I'd like to only rebuild what I need to and try to keep some of the *.o files around so I can just link them rather than recompile them.

Thanks


Solution 1:

Yes, you can remove the special stamp files debian/stamps/stamp-build-* before starting the next build (instead of the using the "clean" target). With certain changes, you may need to remove the debian/stamps/stamp-prepare-* files, too.

When these stamp files do not exist, the build will attempt to reprocess those portions of the build for that stamp that is defined in the debian/rules file.

If you have multiple processors on your system, you can also parallelize your build by starting your command line with DEB_BUILD_OPTIONS=parallel=N where N is the number of CPUs you have. (Some people suggest using the number of cpus plus 1.) Quick way to find number of CPUs (without counting them in /proc/cpufino) is to run the command getconf _NPROCESSORS_ONLN.

For example:

DEB_BUILD_OPTIONS=parallel=$(getconf _NPROCESSORS_ONLN) skipabi=true skipmodule=true fakeroot debian/rules binary-core2