0% found this document useful (0 votes)
35 views

Ubuntux 86 Steps

The document provides instructions for compiling a new kernel on Ubuntu. It outlines downloading the kernel source code, configuring the kernel with make menuconfig/xconfig/gconfig, building the kernel with "make", installing the new kernel and modules with make install, updating initramfs and grub to use the new kernel, and rebooting for the changes to take effect. The process takes approximately four hours to build the kernel. For Ubuntu specifically, editing the grub config file is also recommended to show the grub menu on reboot.

Uploaded by

Balaji Krishnan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Ubuntux 86 Steps

The document provides instructions for compiling a new kernel on Ubuntu. It outlines downloading the kernel source code, configuring the kernel with make menuconfig/xconfig/gconfig, building the kernel with "make", installing the new kernel and modules with make install, updating initramfs and grub to use the new kernel, and rebooting for the changes to take effect. The process takes approximately four hours to build the kernel. For Ubuntu specifically, editing the grub config file is also recommended to show the grub menu on reboot.

Uploaded by

Balaji Krishnan
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Compile New Kernel on Ubuntu

For get the new kernel, please free go to http://www.kernel.org and choose the newest stable.
Usually, the newest stable kernel source is on top the homepage.

Getting The Source Kernel:


Get the newest stable kernel source code from www.kernel.org
Save this in home directory.
Extract the linux-x.x.x.tar.bz2 using the command tar jxf linux-x.x.x.tar.bz2
(here x.x.x means version no).

It creates a folder named linux-x.x.x

What are the parts to a bootable kernel, anyway?

If you’re unfamiliar with this, it’s worth seeing the parts that relate to a bootable kernel,
since it’s a good sanity check after you configure, build and install to verify that you’ve created all
those new parts. Mostly, all that’s under /boot, so here’s an abbreviated list of things that are
currently necessary to boot a kernel:
ls -l /boot
total 88776
-rw-r--r-- 1 root root 634929 2010-04-16 07:32 abi-2.6.32-21-generic
-rw-r--r-- 1 root root 110365 2010-04-16 07:32 config-2.6.32-21-generic
drwxr-xr-x 3 root root 4096 2010-05-11 10:25 grub
-rw-r--r-- 1 root root 8323533 2010-05-06 18:47 initrd.img-2.6.32-21-generic
-rw-r--r-- 1 root root 160280 2010-03-23 05:40 memtest86+.bin
-rw-r--r-- 1 root root 2152657 2010-04-16 07:32 System.map-2.6.32-21-generic
-rw-r--r-- 1 root root 1336 2010-04-16 07:35 vmcoreinfo-2.6.32-21-generic
-rw-r--r-- 1 root root 4037888 2010-04-16 07:32 vmlinuz-2.6.32-21-generic

note:here specified versions are with respect to my host,it varies for every system.use your
own versions while entering commands.

Configuring your new kernel:

Since you have your new kernel source directory from above (in my case, version 2.6.34), cd into
that directory and configure your kernel source appropriately,(i.e)change the directory to the current
source directory. The safest approach is to use the current config file (/boot/config-2.6.32-21-
generic), as a starting point, so just:
$ cp /boot/config-2.6.32-21-generic .config

$ yes '' | make oldconfig

(OR)

Now you can start kernel configuration by typing any one of the command:
 $ make menuconfig - Text based color menus, radiolists & dialogs. This option also useful
on remote server if you wanna compile kernel remotely.
 $ make xconfig - X windows (Qt) based configuration tool, works best under KDE desktop

 $ make gconfig - X windows (Gtk) based configuration tool, works best under Gnome
Dekstop.

Build:

make

This commands will take a long time. Make sure you set off the screen saver and you can hangout
with friends than wait the compile complete. In my computers, ran this command take
approximately four hours.

Installing the new kernel and modules, and updating GRUB:


If the build works (and we have no reason to believe it won’t because that’s the kind of perfect
universe I live in), install all of that and update GRUB to recognize the new kernel and initrd image:
$ sudo make modules_install
$ sudo make install
$ sudo update-initramfs -c -k 2.6.34

$ sudo update-grub

Only for UBUNTU:

If you compile this source from an Ubuntu platform,to see the menu do the
below step.

$ gedit /etc/default/grub (make sure you are the root user)

Put a # before GRUB_HIDDEN_TIMEOUT=0 as #GRUB_HIDDEN_TIMEOUT=0

upgrade the grub after save,reboot the system it will show the grub menu to select ur kernel.

Rebooting:

After complete this command, your Ubuntu will run with newer kernel. Happy compiling !!!

You might also like