0% found this document useful (0 votes)
64 views2 pages

Ex - No.1: Kernel Configuration, Compilation and Installation: Description

This document provides instructions for compiling and installing a custom Linux kernel from source on a system. It outlines downloading the latest kernel source, installing necessary tools, cleaning old kernels, configuring and compiling the new kernel, installing it to the boot partition, and updating the boot loader to allow booting into the new kernel. Key steps include using make menuconfig to configure the kernel, make and make install to build and install it, and editing grub configuration to set the new kernel as the default boot option.

Uploaded by

pricifelix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
64 views2 pages

Ex - No.1: Kernel Configuration, Compilation and Installation: Description

This document provides instructions for compiling and installing a custom Linux kernel from source on a system. It outlines downloading the latest kernel source, installing necessary tools, cleaning old kernels, configuring and compiling the new kernel, installing it to the boot partition, and updating the boot loader to allow booting into the new kernel. Key steps include using make menuconfig to configure the kernel, make and make install to build and install it, and editing grub configuration to set the new kernel as the default boot option.

Uploaded by

pricifelix
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Ex.no.

1: Kernel configuration, compilation and installation


Description:
The Linux kernel in the distributions are configured to work correctly in a wide variety of
hardware and there is usually no need to use any other kernel.In this exercise, a custom kernel
has to be compiled using the new kernel source and the system has to be booted using the newly
compiled kernel.

Pre-Requisite

Latest kernel source(2.6.39.1.tar.bz2)


2. To ensure that all tools required for compiling the kernel are installed.
[root@localhost student]#rpm qa kernel-devel
If not installed
[root@localhost student]#yum install kernel-devel
This command will ensure that all packages required to compile the current running kernel will
be installed.
3. Remove traces of old kernel source if they exist.
# rm -rf /usr/src/linux/
# rm -rf /usr/src/linux-2.6/
4. The kernel source is usually kept under /usr/src. Copy the downloaded kernel source to
/usr/src.
# cp linux-2.6.39.1.tar.bz2 /usr/src
# cd /usr/src/
# tar -xjvf linux-2.6.39.1.tar.bz2
# cd linux-2.6.39.1
5. Create two symlinks to the kernel tree.
# ln -s /usr/src/linux-2.6.39.1 /usr/src/linux
# ln -s /usr/src/linux-2.6.39.1 /usr/src/linux-2.6
6. Clean out all previous configurations and reset the source directory to a pristine state.
The main reason for doing this is that some files do not automatically get rebuilt, which can lead
to failed builds, or at worst, a buggy kernel
# make mrproper
7. Configure the kernel.
# make menuconfig
8. Save and exit the prompt.
9. Build the kernel.
# make clean
# make all
10. Once the compilation is completed we can install the kernel and its modules.
# make modules_install
# make install
11. The newly created kernel will be in /boot.To check that the install process has configured the
boot loader to point to the new kernel.
# vi /boot/grub/menu.lst
12. The new kernel will have an entry at the top of the kernel list. It can be identified by the
kernel version number.

Change the lines containing default, timeout to the values shown and comment out the
hiddenmenu entry.
default=0
timeout=5
#hiddenmenu
13. Now reboot the computer and the computer will boot into the new kernel.
14. To check the version of the running kernel, use the uname command.
# uname -r
2.6.39.1

You might also like