LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 12-10-2008, 05:43 PM   #1
oxblood
Member
 
Registered: Jan 2004
Location: Atlanta, GA
Distribution: Slackware 12.2
Posts: 82

Rep: Reputation: 17
Compiling Kernel with Old Settings


Hi,

I was wondering where there is a mechanism that would allow me to compile the kernel with old features "set" rather than me going through every single lines and enable the old settings in the new kernel configuration. Let's say I have the following directories:

/usr/src/kernel-2.6.1
/usr/src/kernel-2.6.30


Kernel 2.6.1 is the old kernel with its .config and all. If I use `oldconfig' switch while I am in `/usr/src/kernel-2.6.30', how does it know that it should load the settings from `/usr/src/kernel-2.6.1/.config'? Or does it fetch the currently compiled kernel's settings from somewhere else?



Sincerely
 
Old 12-10-2008, 07:01 PM   #2
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
If you have a .config file then it will use that. If you don't, then I believe it will fetch the config file for the running kernel from /boot/config-`uname -r` and create a new .config.
 
Old 12-10-2008, 10:17 PM   #3
oxblood
Member
 
Registered: Jan 2004
Location: Atlanta, GA
Distribution: Slackware 12.2
Posts: 82

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by Quakeboy02 View Post
If you have a .config file then it will use that. If you don't, then I believe it will fetch the config file for the running kernel from /boot/config-`uname -r` and create a new .config.
Thank you for the reply. So let me get this straight; if I copy .config from some old kernel (i.e. `/usr/src/kernel-2.6.1/.config) in to my latest kernel directory, it loads that .config with all the old options set... but does it also include the new features in the latest kernel as well? Or by copying the old .config file into the new kernel's src directly, it would simply use the old features and introduces "no" new features for configuration? Or the `make' process somehow uses the old settings and incorporates the new features into this old .config file that I have migrated to the new kernel's src directory?


P.S. Obviously, here, I am referring to the same major versions (i.e. 2.6.1 with say 2.6.12 and NOT 2.4.19 with 2.6.19, or does it really matter?).


Sincerely,
 
Old 12-10-2008, 10:20 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
If you copy in your old .config file and run make oldconfig it will use your old settings and prompt you for the settings that apply to the new version. The README file with the kernel sources has some variations on oldconfig that you could also use.
 
Old 12-10-2008, 10:46 PM   #5
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
You can also use /proc/config.gz as a source of a .config file for your currently running kernel. There is also usually a copy in the /boot directory.
 
Old 12-10-2008, 10:46 PM   #6
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
What gilead said, but I believe that "make oldconfig" will be run for you if you don't run it. It makes for quite a nuisance to have your make paused asking you for the values of new flags. Just run it and be done with it.
 
Old 12-10-2008, 11:32 PM   #7
oxblood
Member
 
Registered: Jan 2004
Location: Atlanta, GA
Distribution: Slackware 12.2
Posts: 82

Original Poster
Rep: Reputation: 17
Ok, so if `make oldconfig' is executed "without" any existing .config in the src directory, you might as well compiling a kernel from the scratch -- no old settings are used. But if there is an old .config copied from somewhere, then as gilead said, the new features are asked consecutively which is tedious. I would rather just simply copy the old .config into the src directory, then run `make menuconfig' and browse around although not a smart way to dish out new features.

jschiwal mentioned that there is a .config file from the last kernel compilation under `/proc' which I don't seem to be having unless it is one of those features that you must enable in the kernel configuration during compilation. Frankly, I copy one to `/boot' just in case.

Also Quakeboy02 is right about the `make oldconfig' as being the "default" make command -- it runs that option, if you may call it that, automatically by default.


Sincerely,
 
  


Reply



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
Compiling nvidia-settings on Zenwalk (missing Xxf86) POW R TOC H Linux - Software 1 10-14-2008 09:58 AM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
How to restore out-of-box kernel settings if my kernel compile fails? brgr88 Slackware 8 04-18-2006 06:51 AM
Kernel modifications, settings, compiling, how? phsythax Linux - Software 2 03-17-2006 08:41 AM
Kernel compiling, how to get current settings? pit-peng Linux - Newbie 4 04-23-2005 01:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 11:53 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
Open Source Consulting | Domain Registration