How to build Debian kernel using multiple cores

7 02 2013

The base problem is a question – how to use make-kpkg with multiple cores support while building Debian kernel?
When you are build kernel manually it is not a problem because you can use -j parameter to make command.

eg.

make -j 5

but how to use it with make-kpkg?

First we need to have kernel-package installed

apt-get install kernel-package

next we need to add line CONCURRENCY_LEVEL to /etc/kernel-pkg.conf

echo "CONCURRENCY_LEVEL= num_of_cores+1" >> /etc/kernel-pkg.conf
eg.
echo "CONCURRENCY_LEVEL= 5" >> /etc/kernel-pkg.conf

then we can build kernel using make-kpkg with 5 threads

make-kpkg --initrd kernel_image kernel_headers

Voila!