# What does make oldconfig actually do?

## tkhobbes

Hi folks

I have a probably very silly question - but I am on my way to understand Linux completely, so please forgive me.  :Embarassed: 

When I upgrade from, let's say, kernel 2.6.2 to 2.6.11 (or whatever), what EXACTLY do I need to do?

I usually copy the .config file from the old kernel's source directory to the new one and launch a "make oldconfig" and then a "make menuconfig" - but somehow, I suspect that this is wrong, because I had at least once a situation where a kernel setting I did was not correctly migrated.

So: What does "make oldconfig" exactly do?

And: How is the correct and clean procedure to upgrade from one kernel to another?

Finally: When upgrading a kernel, I need also to upgrade the nvidia module; however, this works only *after* I have rebooted into the new kernel - meaning that any graphical login would not work this first time of booting into the new kernel, because the nvidia module is not working...  :Confused: 

thomas

----------

## NeddySeagoon

tkhobbes,

make oldconfig compares the entries in the config file (the old) one with the entries that the new kernel expects to be present.

When the (old) config file contains an entry that the new kernel expects, its retained in the output. When an entry is read that does not apply to the new kernel (becase a feature has been removed) it is thrown awy. When a new configure item is encountered, make oldconfig stops and asks how it should be set. At the end of the process, you have a legal config file for your new kernel.

Provided you didn't make any errors answering the make oldconfig questions, you can go ahead and build the new kernel.

The nvidia modules is not distrubuted with the kernel, it builds against whatever kernel is running (by defualt) but it can be made to build agaist the kernel pointed to by /usr/src/linux. Since I don't use a graphical login, I rebuild it after the first boot of the new kernel.

Since you have a GUI, try out make xconfig and/or make gconfig in place of make menuconfig next time you play with your kernel.

----------

## tkhobbes

OK - and where does make oldconfig takes the old config file from?

----------

## nbensa

 *tkhobbes wrote:*   

> OK - and where does make oldconfig takes the old config file from?

 

.config

----------

## tkhobbes

So when copying an old .config file into the new kernel's directory, that's the right way?

----------

## dtor

Yes, just make sure that you do "make oldconfig" afterwards so if there are new dependencies proper entries will be selected for you.

----------

## tkhobbes

OK - now only the nvidia question remains:

I want to have gdm started at boot.

However, when I upgrade to a new kernel version, I need to re-compile the nvidia-module in order for the graphical environment to work; but I can't do this until I rebooted into the new kernel version for the module to compile against it - how do I solve this problem?

thomas

----------

## dtor

Use "nv" driver  :Smile: 

----------

## NeddySeagoon

tkhobbes,

The nvidia provided package allows you to build agains any installed kernel, not just the running one.

However, the ebuild shields you from the the ./configure options. It must be possible but I'm not sure how you tell emerge what you want to do.

----------

## dgaffuri

As far as I know

```
emerge nvidia-kernel
```

compiles and installs the nvidia module againt the kernel actaully pointed to by /usr/src/linux. At least, yesterday I upgraded my kernel and it worked this way.

----------

## tkhobbes

Aha - I'll try it.  :Smile: 

----------

## Penguin of Wonder

 *nbensa wrote:*   

>  *tkhobbes wrote:*   OK - and where does make oldconfig takes the old config file from? 
> 
> .config

 

Could someone please give a better explaination of this to me? Where is .config?

----------

## Mad Merlin

 *Penguin of Wonder wrote:*   

>  *nbensa wrote:*    *tkhobbes wrote:*   OK - and where does make oldconfig takes the old config file from? 
> 
> .config 
> 
> Could someone please give a better explaination of this to me? Where is .config?

 

/usr/src/linux/.config usually, or if your symlink isn't set up yet, /usr/src/linux-`uname -r`/.config. Side note: there's also /proc/config.gz which holds a gzipped version of the config for the currently running kernel if you've enabled that feature.

----------

## sundialsvc4

The kernel configuration file is in the hidden file /usr/src/linux/.config.  (The preceding "." in the name makes it hidden ... see ls -a.)

I make it a practice to regularly copy this file to a directory which I place under /root, naming the file appropriately.  (e.g. cp .config /root/myKernelConfigs/27feb2006-v2.02)  In this way I can always get it back, and I can diff one file against another.

Even when I am just updating the kernel, not doing anything at all, I'll still make another copy of the configuration just for reference.  So, if I am trying to diagnose a problem, "this ain't no thinkin' thing."   :Smile:   (Oops, sorry.  I listened to a really-crappy country station on the way in.)

Usually what I do is make oldconfig then make menuconfig ... maybe there's an easier way ... but what I am trying to do is to first let "oldconfig" do its filtering, then use "menuconfig" to see what I came up with.  (The first "make" I consider to be a throw-away.)  I'll also use diff to see just what the differences turned out to be.

----------

## Penguin of Wonder

Thanks for the help guys, that helped alot. I have a working kernel in my Ubuntu install and I'm trying to copy the configuration over to my Gentoo install, so I can get it running, and after she's up and running, i'll stream line her to suit my needs! Thanks again!

----------

