It is always exciting to add something (at least a print message) in kernel and see your own kernel image booting… Well it is not difficult task. Following few steps you can build and install kernel.
- Find proper defconfig according to your system configuration. For x86-64 bit architecture, x86_64_defconfig is used.
- Configure kernel
# make ARCH=x86 x86_64_defconfig
- Compile kernel
# make ARCH=x86
- Install Kernel
# sudo make modules_install
# sudo make install
This command automatically updates grub and adds entry for new installed kernel. TO be safer, it is recommanded that you add some delay in grub.cfg so that if newly installed kernel cannot boot due to some reason, you can get a chance to boot using other kernel. If this delay is 0, grub will boot default kernel without prompt to select kernel.
+ set timeout=5 ### END /etc/grub.d/30_os-prober ###
You can also set timeout in /etc/default/grub