In: Computer Science
Kernel Compilation full step by step explanation.
Kernel compilation by the generic way:
1. Compile the Kernel and its modules by making use of the make command and after ths command your computer might take 1 - 2 hourse based on your system configuration and than it compile the kernel and store the kernel in binary form to arch/x86/boot/bzImage file then based on kernel headers it will compile the kernel modules.
2.Install Kernel modules : using the command make modules_install will copy the all kernel modules (*.ko) to /lib/modules/<version>/kernel/ folder in root directory .
3.Install Kernel : by using the command make install we will copy the the kenel from arch/x86/boot/bzImage to /boot folder and copy the .config file to /boot/config-<latest-ver> and generate the System.map file. and after this there is only one step
4. Creating the initramfs files : as we ned to orepare the bootloader and its upporting files for the new kernel so we need to do this by updating the initramfs files by using the command update-initramfs -c -k <latest-version>
5. updation of GRUB bootloader : using the command update-grub , the system automatically probe the kernels in /boot folder and add the entries in its configuration file, grub.cfg and the kernel compilation is done here as all the required parts are updated.