Kernel

Kernel.

-abstract the hardware from the software and provide a running environment for application software through system calls

Finding the kernel source code on www.kernel.org. Stable kernel release will be with increments of version to the third digit. These are commonly reffered to as stable point releases. So 4.0.0, 4.02 are stable version.

Installing and compiling the kernel

-make clean - This target does not as through a job as the mrproper target. It deletes only most generated files. It              does not delete .config
 * 1) wget http://www.kernel.org/pub/linux/kernel/v4.x/linux-4.2.tar.xz
 * 2) cp linux-4.*.tar.xz  /usr/src && tar xvjF linux-4.*tar.xz
 * 3) - make mrproper - This target cleans up the build env of any stale files and dependencies that might have been left over from a previous kernel build. All previous kernel configuration will be cleaned.

-make menuconfig - This target invokes a text based editor interface with menus,option list for configuring kernel

-make xconfig | gconfig- This XWindows configuration tool

-make olddefconfig- This target uses the existing .config file in current working directory,update dependencies                  and  sets new symbols to their default values.

-make help - Shows all the other possible make targets

4.  cd linux-4.*

5.  make mrproper

6.  cp /boot/config-'uname- r' .config

7.  make menuconfig ( optional dnf -y install ncurses-devel)

8.  sed -i 's/^EXTRAVERSION.*/EXTRAVERSION = -custom-Kamil/' Makefile

9.  make kernelversion

10. make -j 4

11. make modules_installl

12. cp arch/x86/boot/bzImage /boot/vmlinuz-4.2.0-custom-Kamil

13. cp -v System.map /boot/System.map-4.2.0-custom-Kamil

14. new-kernel-pkg --mkinitrd --dracut --depmod --install 4.2.0-custom-Kamil or mkinitramfs

Patching the kernel.

If you want to update linux kernel to for example version linux-4.23, we need to go three patches, patch-4.21, 4.22, 4.23
 * 1) Download all patches and /usr/src
 * 2) cd /usr/src/linux-4.2/
 * 3) xz -dc ../patch-4.2.5.xz | patch -p1 --dry-run
 * 4) xz -dc ../patch-4.2.5.xz | patch -p1