The purpose of this tutorial is to help how to compile and install a new Linux kernel for x86: Configure, build, and install
Conventions used in this tutorial:
$ execution on the command line by a non-privileged user
# execution on the command line by a superuser
the actual command to be executed on the command line or code of program to be compiled
First, what needs to be done is the installation of required prerequisites
Ubuntu 10.04: Install Ubuntu 10.04 on your computer as a virtual machine or a secondary operating system
gcc upgrade to version 4.x. Check your version by follow command
#gcc -v
Update the libncurses and Grand Unifiled Bootloader, version 2(Grub2: Grub 2 is the default boot loader and manager for Ubuntu which presents a menu and waits user input or automatically transfers control to an Operating System kernel)
# apt-get install libncurses-dev
# apt-get install grub2
Step #1 Dowload he latest kernel from kernel.org
#wget http://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.1.tar.bz2
Step #2 Extract tar file into /usr/src
#tar -xjvf linux-3.0.1.tar.bz2 -C /usr/src
Step #3 Configure kernel
#cd /usr/src/linux-3.0.1
#make menuconfig
figure 1: main menuconfig
figure 2: networking option
You have to select different options as per your need. Each configuration option has HELP button associated with it so select help button to get help. This window lists that can be compile into or loaded by kernel and shows the three choices for most configuration options:
Y: Selecting y compiles the option into the new kernel
M: Selecting m causes the option to be loaded as a dynamically module by the kernel
N: Selecting n tells the kernel not use the configuration option
Step #4 Compile kernel
#make
#make modules_install
Step #5 Install kernel
So far we have compiled kernel and installed kernels modules. It is time to install kernel itself.
#make install
It will install three files into /boot directory as well as modification to your kernel grub configuration file
System.map-3.0.1
config-3.0.1
vmlimuz-3.0.1
Step #6 Create an initrd image
#update-initramfs -c -k 3.0.1
Result of step 5 and 6:
Step #7 Modify Grub configuration file
In this tutorial i want to display list kernel version on the screen when start, so i edit grub follow picture
Step #8 Reboot computer and boot into your new kernel
# vi /etc/default/grub
#update-grub
#reboot
Result: