Easy and generic Linux kernel compilation procedure

  1. Become root.
    su # or sudo su on ubuntu
  2. Reach a source folder.
    cd /usr/src # or /usr/local/src
  3. Get the preferred version.
    wget https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-4.6.1.tar.xz
  4. Extract the downloaded archive.
    tar xvf linux-4.6.1.tar.xz
  5. Enter the extracted folder
    and copy the preferred configuration from /boot to .config in the current folder.
    cp /boot/config-4.6.0-1-pae .config
  6. Configure the kernel compilation using menuconfig,
    libncurses is required.
    make menuconfig
  7. Launch the build.
    Add deb-pkg parameter on debian to get packages.
    I did not test rpm.
    make LOCALVERSION=-centrino -j3 # deb-pkg
  8. Install the kernel, create initrd, and configure grub.
    On debian only extract the deb packages located in ../ using dpkg -i *.deb command.
    After rebooting the new kernel should be displayed in the grub menu.
    make modules_install && make install && mkinitrd -k 4.6.1-1-pae-centrino

Tested on Ubuntu and OpenSuse.