Go Back   Cloud Computing > Support > Linux Server Hosting
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 01-20-07, 06:49
BOD Member
 
Join Date: Nov 2006
Posts: 271
Default Recompiling Linux Kernel

How to recompile Linux Kernel?

There are three types of levels of Configurations -

Pre-configurations -

a) Pre-Configuration

> visit the official kernel.org sites and download the latest kernel
> Copy to /home/USERNAME
> Uncompress Kernel
> bunzip2 linux-2.6.12.tar.bz2 if have the bzipped format
> bunzip2 linux-2.6.12.tar.bz2 if have the bzipped format
> tar –xvf linux-2.6.12.tar
> Change to Linux Directory: cd linux-2.6.12
> Through mrproper remove any old configuration / object files
> If older configuration file needs to be used, copy to .config.
> If a referance configuration file required then use config file in the right subdirectory of ~/linux-2.6.12/arch.
> If no such actions take place, reference config file is read from the right arch directory.
> Make the following Commands -
1)make oldconfig - add new options as yes/no/module
2)make menuconfig - Uses terminal which is indifferent from bios screen
3)make Xconfig - Uses GUI
4)make config - edit .config then run this command

b) Post Configuration

> Check Dependancies (./Documents/changes.txt file)
> Following the Running of make config method and saving .config file, make Kernel (make), takes long time depending upon the system.
> Switch to root (su), copy image to /boot directory ( for e.g. - cp /home/USERNAME/linux-2.6.12/arch/i386/boot/bzImage /boot/vmlinuz-2.6.12 - If any other architecture than i386, replace i386 with the right architecture)
> Installation of modules (make modules_install)
> Copy system map to /boot directory (cp /home/USERNAME/linux-2.6.12/System.map/boot/System.map-2.6.12)
> Change to /boot/grub directory (cd /boot/grub)
> Edit grun.conf and following changes should be made 0
title KingKrool’s Linux kernel 2.6.12 (title)
root (hdx, y) (drives on which grub is installed)
kernel /boot/vmlinuz-2.6.12 ro root=/dev/hdpn (Kernel Location)
> If compiled support for filesystem of the root partition as a module then add the following line at the end -
initrd (/boot)/initrd-2.6.12.img
(/boot is used when boot and root partitions are same)
(file intrd-2.6.12.img has to be made by the following command /sbin/mkinitrd /boot/intird-2.6.12.img)
> Save the file and exit>reboot and the Kernel is ready to use.

c) Configuration

> Use "modprobe" tool to add/remove Kernel Modules
> In menuconfig, press M to compile as a module, as in the xconfig click multiple times
Reply With Quote
  #2 (permalink)  
Old 01-20-07, 11:49
BOD Member
 
Join Date: Oct 2005
Posts: 66
Send a message via MSN to Bambino
Default

The kernel modules that is not needed can be removed without editing a single code of line and it is not necessary to recompile the kernel module regularly.
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 20:35.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.