LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Blogs > johnynixon
User Name
Password

Notices

Rate this Entry

Embedded linux, Linux customization , linux configuring

Posted 01-07-2008 at 10:32 AM by johnynixon

configuring linux kernel

These are the steps which i followed when i configured my linux.
I downloaded Linux Kernel “linux-2.6.22.14.tar.gz”
To configure a Linux Kernel you need to have the following tools

*Compiler
*Linker
*Make

then the next thing you need is the Linux Kernel Source. You can get it in
www.kernel.org . The file which you download will be in .tar format.

Create a folder and extract the source file in it.

$mkdir john
$john/ tar -xzvf linux-2.6.22.14.tar.gz
$john/ ls
linux-2.6.22.14.tar.gz
linux-2.6.22.14/

To configure the kernel from scratch

$ cd linux-2.6.22.14
$ linux-2.6.22.14/ make menuconfig

Here we can add or remove the modules. make menuconfig is the way of of configuring a kernel , that offers a many way to move around the kernel configuration using the arrow keys on the keyboard. menuconfig is a terminal based interactive kernel configuration tool.

you can also use gconfig instead of menuconfig. gconfig is a graphical based interactive kernel configuration tool, but provided you should have GTK or
GTK+ libraries installed in your system.

you can also use xconfig. xconfig is also is a GUI based interative kernel configuration tool. for xconfig you should install Qt in your system.
here in the menu you can add or remove the modules you want.
Save the configuration file while you exit.

then build the kernel

$ linux-2.6.22.14/ make dep /* It will referesh the dependecies*/
$ linux-2.6.22.14/ make bzImage /* It builds the kernel and creates Image*/
$ linux-2.6.22.14/ make -j4
/*(optional ) This will build the kernel in a multithreaded way . A machine with four processors use the above command*/

To compile the modules use the following command:

$ linux-2.6.22.14/ make modules

To Install the modules
$ linux-2.6.22.14/ sudo make modules install

After the modules have been successfully installed, the main kernel image must be installed.
$ linux-2.6.22.14/ make install

To build only a portion of the kernel

$ linux-2.6.22.14/ make M=drivers/usb/serial
if you do this you should do the make again
$ linux-2.6.22.14/ make

then you have to follow the modules install , install.

then you have to configure the boot loader

go in to the boot folder in the root , then there will be a folder called GRUB or LILO.




If you have GRUB then you will find the menu.lst file , you should edit that file.
If you have LILO then you will find the lilo.conf file.

before editing the grub or lilo. first copy the compiled image to boot folder.
for example if you have intel based arhitechture then
$ linux-2.6.22.14/ cp arch/i386/boot/bzImage /boot/john

then edit the grub or lilo add the following

For GRUB

title linux-2.6.22.14
root (hd0,0)
kernel /boot/john

For LILO

image=/boot/john
label= linux-2.6.22.14
read-only
root=/dev/hda2


Save it and now you reboot. Now your system has your newly configured Linux.
If you have stucked up at any point please feel free to query me..

Enjoy !!!!
Johny Nixon
johnynixon@gmail.com
johnynixon.blogspot.com

from
INDIA


If you want to Apply patches to your kernel query me i will send you through mail. this will be uploaded in my blog soon.......
Posted in Uncategorized
Views 732 Comments 0
« Prev     Main     Next »

  



All times are GMT -5. The time now is 06:38 AM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration