Compiling The Linux Kernel

The Little Guide on how to compile the Linux Kernel

This works for Debian/Ubuntu and other distros with minor tweaks.

apt install build-essential fakeroot libncurses5-dev
tar xf linux-4.10.2.tar.xz
cd linux-4.10.2/
cp /boot/config-`uname -r` .config
make olddefconfig
make nconfig # tweak any settings, modules, etc (safe to skip)
nice fakeroot make -j5 bindeb-pkg

After these steps you will have the kernel ready to install in a deb package.

For other distros like Fedora/OpenSUSE it is pretty much the same, you just have to install the corresponding required packages with dnf/zypper and the final make target would be binrpm-pkg.

Comments !