LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (http://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   Diff between Kernel Compilation and Kernel Configuration ?? (http://www.linuxquestions.org/questions/linux-enterprise-47/diff-between-kernel-compilation-and-kernel-configuration-670534/)

vikas027 09-17-2008 10:01 AM

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

w3bd3vil 09-17-2008 11:00 AM

After you configure the various Kernel options you compile the kernel.

vikas027 09-17-2008 11:31 PM

Can someone please elaborate a bit.

Thanks,
VIKAS

elprawn 09-18-2008 12:06 AM

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).

vikas027 09-18-2008 02:07 AM

Quote:

Originally Posted by elprawn (Post 3283972)
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.

elprawn 09-18-2008 02:36 AM

Probably a good place to start.

vikas027 09-19-2008 05:43 AM

Thanks.
 
Quote:

Originally Posted by elprawn (Post 3284129)

Thanks, I was looking for something like this.
I will go through it and then catch you helpful people back.

Regards,
VIKAS

sundialsvcs 09-19-2008 08:29 AM

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 :eek:-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...

vikas027 09-20-2008 01:01 AM

Thanks a ton sundialsvcs, this was really helpful.


All times are GMT -5. The time now is 12:32 AM.