Here in this post, I will explain how to compile and install Linux Kernel 3.1.1 in Fedora 16. I have also used the exact same procedure for compiling the kernel for fedora 17 - kernel 3.5.1.
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:
For gcc
$ 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:
wget kernel.org/pub/linux/kernel/v3.x/linux-3.1.1.tar.gz
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 Configure
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
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-set-default 2
-
sudo grub2-editenv list
-
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Comments
A good step by step recipe
Submitted by Anonymous (not verified) on
Thank you
cygnus
Submitted by Anonymous (not verified) on
Thank you so much! Very helpful.
Uncompressed Kernel
Submitted by Aurabindo (not verified) on
How can i create an uncompressed kernel image? And i dont want to install it in my machine, its for another board with an atom processor.
Good question
Submitted by admin on
I have only done this for embedded platforms - is this for a resource limited board? If so, I'm not sure that using Fedora is the correct choice.
Do you have any more information for me that you wish to divulge?
very helpful
Submitted by prasad (not verified) on
thank you very much
Virtualbox
Submitted by najmi (not verified) on
Hi,
After you compiled your kernel, do you know how to enable Virtualbox support?
Since it's related with DKMS,vboxdrv and stuffs. Still cannot find the solution.
Thanks
Virtualization support is
Submitted by admin on
Virtualization support is usually included in the default options. You may have to enable a sysconfig switch, but I don't think you have to for this.
Invalif format error when installing module
Submitted by Peter (not verified) on
I download kernel 3.6.11 for Fedora 17, compile and install the modules according to your instructions. When I tried to install a module with insmod, the command came back with error. "Module cant be inserted, invalid module format...". The module is found by insmod, but not in the right format insmod expects, I guess.
Do you know what may have happen? and how to correct this situation?
Thanks,
Well, one of the reasons you
Submitted by admin on
Well, one of the reasons you can get that message is that you had something remaining from a previous build or its a bug. Which module is it you were trying to compile and build?
I'm on Fedora 18 now, so unfortunately I don't have the same build environment, but I can build this kernel.
Add new comment