Compiling Fedora 16/17 Kernel

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:

  1. sudo grub2-set-default 2
  2. sudo grub2-editenv list
  3. sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Blog tags: 

Comments

Virtualbox

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

Invalif format error when installing module

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,

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.