1. Download
the latest stable kernel from
https://www.kernel.org/
or
clone from git repository
[root@localhost
linux]# cd /usr/src
2.
Move to the cloned repository if you cloned using git
[root@localhost
linux]# cd /usr/src/linux
or
extract the tar ball if you have downloaded from kernel.org
[root@localhost
linux]# tar -xf linux-3.15-rc1.tar.xz -C /usr/src
3.
Install the Development tools
[root@localhost
linux]# yum install gcc ncurses-devel
4.
Configure the kernel
before
compiling the kernel you need to configure the kernel with different
tools xconfig,gconfig,menuconfig,nconfig.
menuconfig
and nconfig needs ncurses-devel to be installed.
[root@localhost
linux]# make menuconfig
select
the configurations based on your hardware and save.It will create
.config file in current directory.
5.
open the Make file and add your name in EXTRAVERSION field and
save the file.
6.
Compile the kernel and modules
[root@localhost
linux]# make -j4
j4
will launch 4 jobs simultaneously for compiling kernel modules.
7.
Copy the compiled modules into
/lib/modules/
[root@localhost
linux]# make modules_install
8.
Install the kernel image
[root@localhost
linux]# make install
T
his
will copy the bootable image to boot and creates system.map and
copies the .config file for this version of the kernel and updates
the grub.
9.
Now reboot the system and execute below command
[root@localhost
linux]# uname -a
Linux
surendra 3.15.0-Surendra+ #1 SMP Tue Apr 15 21:28:50 PDT 2014 x86_64
x86_64 x86_64 GNU/Linux
Hurrayyyy
you built the kernel with your name :-) Lets Party :-)
Note
- these steps are tried and verified on Ubuntu 12.4 version.
Comments