This ticket is just a reminder on how to upgrade my old kernel 4.4.36 to kernel 4.4.53 using incrementals patches. [more]
  • Go to the sources folder and clean up its content using make mrproper
    cd /opt/Sources/linux-4.4
    make mrproper
  • Create a temporary folder tmp_sources for all patches
    cd /opt/Sources/linux-4.4
    mkdir tmp_patches
    cd tmp_patches
  • Download patches
    for((inc=36;inc<=52;inc++));
    do 
    wget https://cdn.kernel.org/pub/linux/kernel/v4.x/incr/patch-4.4.${inc}-$(expr ${inc} + 1).xz -O - | xz -d > patch-4.4.${inc}-$(expr ${inc} + 1);
    done
  • Content of the current folder is
    /opt/Sources/linux-4.4/tmp_patch# ls
    patch-4.4.36-37  patch-4.4.38-39  patch-4.4.40-41  patch-4.4.42-43  patch-4.4.44-45  patch-4.4.46-47  patch-4.4.48-49  patch-4.4.50-51  patch-4.4.52-53
    patch-4.4.37-38  patch-4.4.39-40  patch-4.4.41-42  patch-4.4.43-44  patch-4.4.45-46  patch-4.4.47-48  patch-4.4.49-50  patch-4.4.51-52
    
  • Apply these patches
    cd ..
    for((inc=36;inc<=52;inc++));
    do 
    patch -p1 < tmp_patch/patch-4.4.${inc}-$(expr ${inc} + 1);
    done
Time to buidl the kernel
  • Configure the kernel
    make menuconfig
  • Build everything
    make -j4 bzImage modules
    Notice: If you have a DVD or a film to watch then enjoy it! Above commands should take a while to be executed.

    On my PC with CPU=i5-4430, it took 30 minutes.

  • Install
    make -j4 INSTALL_MOD_STRIP=1 modules_install
    make -j4 INSTALL_MOD_STRIP=1 install
    make -j4 INSTALL_MOD_STRIP=1 headers_install
    
    Notice: INSTALL_MOD_STRIP=1 is pretty useful. This flag helps to install binaries with a smaller size :)