LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices

Reply
 
Search this Thread
Old 09-17-2008, 10:01 AM   #1
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Rep: Reputation: 99
Question Diff between Kernel Compilation and Kernel Configuration ??


Hi all,

What is the diff between Kernel Compilation and Kernel Configuration ??

I am little confused about it.
Regards,
VIKAS
 
Old 09-17-2008, 11:00 AM   #2
w3bd3vil
Senior Member
 
Registered: Jun 2006
Location: Hyderabad, India
Distribution: Fedora
Posts: 1,189

Rep: Reputation: 49
After you configure the various Kernel options you compile the kernel.
 
Old 09-17-2008, 11:31 PM   #3
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Can someone please elaborate a bit.

Thanks,
VIKAS
 
Old 09-18-2008, 12:06 AM   #4
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
Configuring the kernel just sets the options it will be compiled with when you next compile it - which drivers are installed, which filesystems are supported etc. You still need to compile it then copy it across to your boot directory (and edit your bootloader conf).
 
Old 09-18-2008, 02:07 AM   #5
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Arrow

Quote:
Originally Posted by elprawn View Post
Configuring the kernel just sets the options it will be compiled with when you next compile it - which drivers are installed, which filesystems are supported etc. You still need to compile it then copy it across to your boot directory (and edit your bootloader conf).

hmm, got an idea. Do you have some links from where I can get detail information.
 
Old 09-18-2008, 02:36 AM   #6
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
Probably a good place to start.
 
Old 09-19-2008, 05:43 AM   #7
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Smile Thanks.

Quote:
Originally Posted by elprawn View Post
Thanks, I was looking for something like this.
I will go through it and then catch you helpful people back.

Regards,
VIKAS
 
Old 09-19-2008, 08:29 AM   #8
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,378

Rep: Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108Reputation: 1108
If you have the source-code to your Linux kernel, you will find a hidden file (name begins with a ".") such as:
/usr/src/linux/.config

This file contains a very large number of "options"...
Code:
# CONFIG_64BIT is not set
CONFIG_X86_32=y
# CONFIG_X86_64 is not set
CONFIG_X86=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_CLOCKSOURCE_WATCHDOG=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y
etc...
When you compile the kernel, using the make command, many intermediate-files are built which are used during the compilation process. These files determine exactly which source-files will be compiled, and exactly what source-code will be included in them.

For instance, in the configuration above, we see a comment that advises us that the option CONFIG_X86_64 is not set. Therefore (because "the option is not set," not due to the human-readable comment to that effect...), any and all code in the Linux source-tree that pertains (in this case...) to "Intel x86 64-bit architectures" will not be included when I compile my kernel.

But code to handle "GENERIC_CLOCKEVENTS_BROADCAST" will be. (Exactly what does that consist of? Dunno... "use the source, Luke.")

You don't have to remember what all of these options are: your distro writer might do it for you, or make menuconfig (et al...) will walk you through the setup process graphically and give you an explanation of each one.

So... this process allows the kernel developers to support many different possible configurations while writing only a single source-file (or set of related files). You include and omit whatever you need.

For instance, my system is a 32-bit x86 box with embarrassingly-small amounts of memory, so I don't need 64-bit support or "huge memory" support. Therefore, when I compile a kernel for my box, that support literally isn't there. But you could take the same kernel-source, provide different options, and build from the same kernel source tree an entirely-different setup ... for your "IBM honkin-big-mainframe with 400 -abytes of RAM." The only difference is the configuration-options that you used.

Quote:
P.S.:
".config" is an ordinary file and you would be well-advised to keep distinct backup-copies of each version of it, say in a subdirectory of"/root" and/or on a thumb-drive. It is priceless to be able to answer the question of "exactly what changed between this configuration and that one" using nothing more than the diff command...

Last edited by sundialsvcs; 09-19-2008 at 08:32 AM.
 
Old 09-20-2008, 01:01 AM   #9
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian, OS X
Posts: 1,266

Original Poster
Rep: Reputation: 99
Thanks a ton sundialsvcs, this was really helpful.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
NO /usr/src/kernel directory & Kernel Compilation PankajDS Linux - Kernel 5 01-24-2008 01:48 AM
Kernel Compilation configuration bangoram Linux - General 5 08-20-2006 11:04 AM
kernel compilation configuration arunachalam Linux - General 3 12-14-2005 05:51 AM
Kernel compilation problems, distorted video and kernel panic shamrock_uk Linux - Laptop and Netbook 5 08-12-2005 10:53 PM
does kernel-source installs with the compilation cum installtion of a new kernel? luqman Linux - General 18 03-04-2005 07:33 AM


All times are GMT -5. The time now is 08:01 AM.

Main Menu
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