First, need to install some necessary package there.
apt-get install fakeroot kernel-package
Second, get the source
apt-get source linux
Third, uncompress it and get in the folder
# tar -xvJf linux-3.12.tar.xz & cd Linux-3.12
Four, copy /boot/config.* to current .config and make menuconfig
Rember to install libcnurse before menuconfig.
# apt-get install libncurses5-dev # make menuconfig
Five, do package clean
# make-kpkg clean
Six, and final, ready to go
# export CONCURRENCY_LEVEL=3 # fakeroot make-kpkg --append-to-version "-customkernel" --revision "1" \ --initrd kernel_image kernel_headers
Above will get the deb file in the parent level, then you can install or remove it by DPKG
dpkg -i linux-image-3.12.0-customkernel_1_i386.deb linux-headers-3.12.0-customkernel_1_i386.deb
# sudo apt-get remove linux-image-(non-working-kernel)