Then we are going to make a clean package using the current configuration of the current kernel since it already figured everything out for you.

sudo make-kpkg clean
sudo cp /boot/config-`uname -r` ./.config

Make any changes you want to the kernel here:

sudo make menuconfig

sudo fakeroot make-kpkg --initrd --append-to-version=-lml kernel_image kernel_headers[NOTE]: “–append-to-version” will append a string to the version number; here I am using my initials “lml”. You’re going to want to do this to distinguish your kernel builds apart.

This will give us the header and image output in /usr/src. Issuing these commands will install your new custom kernel: