Here in this post, I will explain how to compile and install Linux Kernel for any version of fedora 16 and upwards from Vanilla source available from Kernel.org
To compile Linux Kernel the following are required to be installed:
- gcc latest version,
- ncurses development package
- and system packages should be up-to date
To install the dependencies run the following commands:
$ sudo yum install gcc
For ncurses development package
$ sudo yum install ncurses-devel
After installing the above
$ sudo yum update
Next download the linux kernel version you want to compile from: http://www.kernel.org/pub/linux/kernel/v3.x/ In this howto, I used 3.1.1 and ran the command:
Once the download is complete move to the directory where you have downloaded the kernel package “linux-3.1.1.tar.gz“.
Now extract the tar file to the location “/usr/src/“. To extract the tar file run the following command.
sudo tar -xvf linux-3.1.1.tar.gz -C /usr/src/
Now move to the directory where the extracted file is, or copy and paste the below command in terminal.
To use a default configuration file from the previous installed Kernel - you may copy the one from /boot/ - For example, config-3.11.6-201.fc19.x86_64 and copy it into your directory with the name .config
sudo make menuconfig
The above command is used to configure the Linux kernel. Once you execute the command, you will get a pop up window with the list of menus and you can select the items for the new configuration. If your unfamiliar with the configuration just check for the file systems menu and check whether ext4 is chosen or not, if not select it and save the configuration.
Now run the following:
sudo make modules
sudo make install
sudo make modules_install install
Now reboot and choose the kernel version you just installed. Note that if it is not first in the list, and perhaps it is the second option then you can run the following commands:
sudo grub2-editenv list
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
To remove your custom kernel, as sudo or root (provided it is not the kernel you are using); remove the following for your kernel:
sudo rm -rf /boot/initramfs-3.12.0custom.img
sudo rm -rf /boot/System.map-3.12.0custom
sudo rm -rf /boot/vmlinuz-3.12.0custom
If you receive and error when bootinf about not being able to sync fs root or a kernel image is not installed - please try running the make install commands again... PLEASE.