UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Technical Support > Tutorials / How to?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 22-08-2008, 22:25
eUK-Martin's Avatar
Windows System Administrator
 
Join Date: Nov 2005
Location: Earth
Posts: 457
Default Manually Compile a Linux Kernel

Hello,

Normally we prefer to just use the RPM method to install a Linux kernel on a server, which is definitely easy and cause less trouble to get the server working. However if you are comfortable with Linux structure and what to have a customized Linux Kernel on your server with the Modules of your choice then here are the steps for you. These steps can be used for Valina as well as standard kernels.

How to compile kernel manually?
There are two ways to compile a kernel:
1. Install a RPM package.
2. An orthodox method of doing it manually.

This tutorial will show you the orthodox method.

*** Steps to compile a kernel on Linux server. ***
(Estimated time is 45-60 mins)

The Pre-Compilation Stage.

1. Login as root into the server.

2. Copy the current modules listed in lsmod command in a notepad.
Code:
lsmod
3. Check the CPU configuration of the system.
Code:
cat /proc/cpuinfo
4. Copy the grub.cong file in a notepad.
Code:
cat /boot/grub/grub.conf
5. Goto /usr/src/
Code:
cd /usr/src/
6. Download kernel you require from kernel.org
Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-x.x.x.x.tar.gz
(Where x.x.x.x is the make of the kernel)

7. untar the zipped file.
Code:
tar zxf linux-2.6.15.4.tar.gz
8. Goto in the folder extracted
Code:
cd linux-2.6.15.4/
Compilations Stage.

You have a number of ways of going through the possible modules to include.

-- make config: A sequential text-based selection method. Takes a loooooong time.
-- make menuconfig: uses a text-terminal pseudo-graphic interface.
-- make xconfig: A version of menuconfig for X Window if you have it running. You need to have X server running to use this step.

But we will use the oldconfig method since we do not want to make any major changes which might end up being a complete mess.

Before we fire the oldconfig command we will have to copy the old configuration in the new Linux kernel.
And to do that we will have to check the current version kernel installed on the system.
Code:
uname -a
which will show something like :
Code:
Linux 'hostname' 2.6.9-11.ELsmp #1 SMP Wed Jun 8 17:54:20 CDT 2005 i686 athlon i386 GNU/Linux
9. Now copy the config file of 2.6.9-11.ELsmp into new kernel as .config
Code:
cp /boot/config-2.6.9-11.ELsmp /usr/src/linux-2.6.15.4/.config
10. Then
Code:
make clean
11. And
Code:
make mrproper
12. And now we hit the oldconfig
Code:
make oldconfig
You will get a list of information and then it will ask you to confirm the modules.
You can just keep on hitting Enter key to set them to default BUT be carefull that you donot pass the CPU selection.
YOU WILL NEED TO SELECT THE CORRECT CPU ON YOUR SYSTEM INFORMATION WILL BE AVAILABLE IN THE /proc/cpuinfo FILE.

And also select 1 i.e : "(No Forced Preemption (server))" in the very next opition and then keep on hitting Enter again.

14. Create an Image
Code:
make bzImage
15. Unpack the modules.
Code:
make modules
16. Install the modules .
Code:
make modules_install
17. Now installing the kernel.
Code:
make install
OK.. we have finished with the intallation, now it is time to configure GRUB to pickup the new Linux kernel on reboot. Since there are always chances for kernel to fail we would set GRUP take it only once and then go back to old so that incase any thing has gone wrong we can simply reboot again to get back on the old Linux kernel.

18. So this is how we do the trick:
Code:
grub
above command will take you to grub prompt
then
Code:
grub > savedefault --default=0 --once
grub > quit
19. And finally reboot.
Code:
reboot
If every thing has gone fine then check the modules with lsmod command and confirm that they are present specially iptables.

20. Now make change in /boot/grub/grub.conf to set the new kernel as default.
Code:
pico /boot/grub/grub.conf
change
Code:
default=1
to
Code:
default=0
THATS IT... WE ARE DONE WITH KERNEL COMPILATION ON A LINUX MACHINE.

Additional Information:
------------------------

What is Kernel ?
A.
1. Today's operating systems are built in "layers." Each layer has different functions such as serial port access, disk access, memory management, and the

user interface itself. The base layer, or the foundation of the operating system, is called the kernel. The kernel provides the most basic "low-level"

services, such as the hardware-software interaction and memory management. The more efficient the kernel is, the more efficiently the operating system will run.

2. It is important for the kernel to be as small as possible while still providing all the essential services required by other parts of the operating system and applications.

Why do we need customized Linux Kernel ?
A.
It depends on exactly what does your system require and is it supported by our current kernel or not ? However you need to be a guru in Linux to have your own kernel.
What we do here is use a kernel that is already tested by others and have come up with most of the bugs in the older version and install it with the old configuration. So that keeps us on minimum risk of server getting crashed.
__________________
Martin
Windows System Admin.


Windows VPS Hosting - Windows Dedicated Server - Web Hosting Tutorials

Email :: windows @ eUKhost.com AND support @ eUKhost.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
commands, compilation, compiling, complie, cutomize, easy, hardware-software, how to, kernel, kernel.org, linux, manually, menuconfig, orthodox method, own kernel, rpm, simple, steps



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 17:35.

 

Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

VPS Hosting
VPS Hosting plans

Dedicated Server Hosting
Dedicated Server plans

Business Web Hosting
100% uptime Hosting

Cpanel Hosting
cPanel Shared Hosting

Reseller Hosting
Reseller Web Hosting

Windows Hosting
Windows Shared Hosting

Windows VPS

Windows VPS Hosting

Semi Dedicated Servers
Semi-Dedicated Hosting

Dedicated Server Mirroring
Dedicated Server Mirroring

Webhosting Knowledgebase
Frequently asked Questions

Web Hosting Blog
eUKhost Blog

Web Hosting Support
Support Helpdesk

UK Data Center
eUKhost Datacenter

Web Hosting Forum
eUKhost Forum

Support Tutorials
Online Flash Tutorials

Offsite Back-up Plans
Remote Backup Service

Customer Testimonials
eUK Customer Testimonials


knowledgebase articles

eUKhost.com Services

Pre-Sales Questions
Pre-sales FAQ's

Domain Names
Domain registration FAQ's

cPanel Hosting
cPanel Hosting FAQ's

Windows Web Hosting
Plesk Control Panel

Reseller Hosting
Reseller Hosting FAQ's

VPS Hosting
Virtual Private Server

Semi-Dedicated Servers
Semi-Dedicated FAQ's

Dedicated Servers
Dedicated Server Hosting


popular blog categories


Web Hosting
Website Hosting articles

UK Web Hosting
UK Hosting articles

Dedicated Server Hosting
Dedicated Server guidelines

VPS Hosting
VPS hosting articles

cPanel Hosting
cPanel Hosting articles

Linux Operating System
Linux Operating techniques

Windows Web Hosting
Windows plesk articles

Web Hosting
Web Hosting Service