# New kernel and old config file?

## Paapaa

I just emerged the new gentoo-sources (2.6.14-r2). I updated the symbol link (/usr/src/linux) and ran "make menuconfig". I saw all my previous settings there - which is good. But, is it supposed to find my previous config settings and apply it on its own without my intervention? I didn't manually copy the old config file nor did I run "make oldconfig" etc. How does it know where to search the config settings?

----------

## dwblas

It does not know what you have without a .config file.  Some of your options may be there but if you save the make menuconfig file and compare it with your existing one you will find differences, unless you made the kernel with the generic options from make menuconfig in the first place.

----------

## thewally

Search your old .config file in your old-version kernel sources or gunzip from /proc/config.gz (if you've enabled this option on your current kernel - you can get here your current kernel's config)

----------

## syg00

You need to copy over your old .config each time you change the symbolic. Then run "make oldconfig" to enable you to check each of the new options then run the menuconfig.

If I were you I'd run "make rmproper" to clean everything up in your new source tree, then proceed as above. Won't take long, and I find it "best practice".

----------

## Paapaa

 *dwblas wrote:*   

> It does not know what you have without a .config file.  Some of your options may be there but if you save the make menuconfig file and compare it with your existing one you will find differences, unless you made the kernel with the generic options from make menuconfig in the first place.

 

I think I was not clear enough. It seems that it DOES know all my configs eventhough I did not copy the .config from the old directory to the new one. I just emerged gentoo-sources, altered the symbol link and ran "make menuconfig". The settings were precisely (didn't check every single one) what I had in my previous kernel version. And I have a very minimal config there, only the modules I need - i'm not using a generic config. So somehow it copies the old .config automatically to the new directory??

----------

## nemo_fish

re there. I must say: I did the same as well. I installed the 2.6.14-r1 (before had 2.6.13-r5), and _did not_ copy the config file to the new kernel. I looked if there is one, but the new kernel-source-directory _had no_ config file inside. I ran make menuconfig, and there were the same settings set as in my 2.6.13-r5 kernel, even the alsa-settings, wireless etc...And I really did not copy anything into that new source directory. And no, I don't use the in-kernel .config option.

Well, it's a good thing, but...I don't know how this works  :Smile: 

regards

----------

## PaulBredbury

 *nemo_fish wrote:*   

> I installed the 2.6.14-r1 (before had 2.6.13-r5), and _did not_ copy the config file to the new kernel. I looked if there is one, but the new kernel-source-directory _had no_ config file inside. I ran make menuconfig, and there were the same settings set as in my 2.6.13-r5 kernel, even the alsa-settings, wireless etc...And I really did not copy anything into that new source directory. And no, I don't use the in-kernel .config option.

 

You're confusing the kernel's default settings (i.e. when no .config file is present) with your own.

----------

## Paapaa

 *nemo_fish wrote:*   

> You're confusing the kernel's default settings (i.e. when no .config file is present) with your own.

 

No no, that is not what is happening! I have removed almost every module from the config and after emerging the new sources I still see the same minimalistic config after running "make menuconfig". I see only selections I have made when configuring the previous kernel. That can't be any "default" config. 

The kernel is indeed copying the old settings from somewhere without my intervetion but I'd like to know why and where from. And also the documentation doesn't mention this behaviour. Very confusing.

----------

## PaulBredbury

Post the commands that you are using. The kernel config is /usr/src/linux/.config

----------

## Paapaa

 *PaulBredbury wrote:*   

> Post the commands that you are using. The kernel config is /usr/src/linux/.config

 

Here is the case.

1. First I'm using 2.6.13-r5 configured myself using "make menuconfig". Most modules/settings are disabled. I build everything I need inside the kernel and remove the support from the rest. I even don't have module support at all. The size of the kernel image is about 1,6MB.

2. "emerge -uD word" installs new gentoo-sources. (2.6.14-r2).

3. I go to /usr/src/ and update the symbol link using "ln -sfn linux-2.6.14-gentoo-r2 linux"

4. I go to /usr/src/linux/

5. There is NO .config file present.

6. I run "make menuconfig". 

7. What I now see is my previous config: only my devices listed, no modules support etc. These are definitely settings made by me, not some default settings. 

8. I don't have to do any changes as my settings are already there and I can simply issue "make" to build the new kernel image (about 1,6MB again).

So why is this happening? And isn't this happening with everyone?

----------

## PaulBredbury

Try this:

```
cd /usr/src/linux

mv .config .config-backup

make menuconfig

ls .config
```

Do you find that your old configuration file magically reappears? If so, I think we have the first recorded case of possession of an electrical device by a playful, benevolent demon-spirit  :Smile: 

----------

## Paapaa

 *PaulBredbury wrote:*   

> Try this:
> 
> ```
> cd /usr/src/linux
> 
> ...

 

Actually it did reappear:  after running "make menuconfig", pressing exit and answering save. The resulting .config is identical to .config-backup. So it is reading the settings from somewhere. Or am I nuts??

What is autoconf and could it have anything to do with this?

----------

## PChaos

It indeed seems to autocopy and oldconfig som .config file from previous kernel.

emerged kernel 2-6-14-r2 freschly, did nothing except make menuconfig, old config was there.

removed .config file, changed some really exotic settings in old kernels .config, did make menuconfig again. Hello here I am, changed settings reappeared.

----------

## syg00

mmmm .... kconfig (presumably) must be growing some smarts.

Gotta be worth some investigation.

----------

## Paapaa

Thanks for verifying my observations. I'm not crazy after all  :Smile: 

1. The document at http://www.gentoo.org/doc/en/kernel-upgrade.xml should be updated if needed. Now it gives specific instructions what do do if you want to use your old .config when configuring the new one. It seems that this is not needed as the old .config is apparently reused automagically.

2. I'd like to know where the copy of .config is stored so that it can be reused by the new kernel. And is there any way to disallow this behaviour: how do you reset to the default .config?

----------

## Fabiolla

Hmm, 

same situation here that make menuconfig automatically takes the values from the old config.

I'm not 100 % sure, but I think I've seen some output in bash that menuconfig reads the config values from the old config file in boot directory

(I store my kernel-configs in /boot).

----------

## bdz

Same thing for me. Here is what menuconfig outputs before displaying the menu:

```
#

# using defaults found in /boot/config-2.6.14-gentoo-r1-bdz-r2

#
```

----------

## Paapaa

 *bdz wrote:*   

> Same thing for me. Here is what menuconfig outputs before displaying the menu:
> 
> ```
> #
> 
> ...

 

BINGO! That was it!

I renamed the /boot/config-2.6.14-gentoo-r2 to /boot/config-2.6.14-gentoo-r2.bak and it finally did start using some default set and didn't find my settings.

This REALLY should be mentioned in the documentation. In the Gentoo Handbook it is adviced to copy .config to /boot with the above naming scheme. This, however, is not mentioned in the Kernel Upgrade Guide for some reason. If people followed the advice, there would be no need using "oldconfig" at all as the old .config would be allways found in the right place. Where should I propose these modifications to the Kernel Upgrade docs?

----------

## Fabiolla

Hi

 *Quote:*   

> 
> 
> Where should I propose these modifications to the Kernel Upgrade docs?
> 
> 

 

I think the best way is to create a bug-report.

From http://www.gentoo.org/doc/en/index.xml

 *Quote:*   

> 
> 
> If you find bugs in our documentation or have proposals, please use our Bugtracking System and fill in a bug report for "Docs-developer" or "Docs-user". These bug reports will then be handled by the Gentoo Documentation Project.
> 
> 

 

greetings

----------

## ens_leader

I just downloaded the latest kernel from kernel.org and gunzipped it.

I ran a make menuconfig and as am looking through it, It seems to know everything from my previous kernel config!

How the hell is this happening? Theres no .config file in the kernel base directory. Where is it reading from this mystery .config file?

----------

## syscrash

There is a kernel option that stores the current config in /proc/config.gz.

It might be picking that up.

----------

## PaulBredbury

See thread.

----------

## think4urs11

merged the last three posts here; thx PaulBredbury

----------

