# How to keep kernel .config settings through major versions

## Underdone

What I would like to be able to do is "recycle" my .config for whenever I move to a new kernel. In this case 2.6.21-gentoo-r4 to 2.6.22-gentoo-r2. I'm also using genkernel and would like to continue to use it. I have tried copying the old .config into /usr/src/linux but genkernel seems to ignore it and create a new one. Any ideas?

----------

## adsmith

I'm not sure about using genkernel... it always was more hazardous for me than the (absurdly simple) procedure of building "by hand".

For non-genkernel just copy the .config and run "make oldconfig", which will keep all settings the same but prompt you for new settings.

Then, just do "make && make modules_install && make install" and update your grub.conf.

----------

## Underdone

 *adsmith wrote:*   

> I'm not sure about using genkernel... it always was more hazardous for me than the (absurdly simple) procedure of building "by hand".

 

I will agree that building the kernel by hand is pretty easy, and I have done it before, it is just to tedious for me so I use genkernel instead.

I have tried using the --oldconfig command in genkernel and it still doens't work.

----------

## jojoyakira

 *Underdone wrote:*   

>  *adsmith wrote:*   I'm not sure about using genkernel... it always was more hazardous for me than the (absurdly simple) procedure of building "by hand". 
> 
> I will agree that building the kernel by hand is pretty easy, and I have done it before, it is just to tedious for me so I use genkernel instead.
> 
> I have tried using the --oldconfig command in genkernel and it still doens't work.

 

For using genkernel with your old configuration just do the following:

```

#mv /usr/src/linux-<oldversion>/.config /usr/share/genkernel/<processor-type>/kernel-config-2.6

#ln -sfn linux-<newversion> linux

#genkernel all (or #genkernel --menuconfig all)

```

----------

## tekknokrat

I get used to manage my kernconf with gentoo in this way:

If I know that I have an working config in /usr/src/linux/.config (because of manual done "make oldconfig / menuconfig") I do:

```
genkernel --no-clean --save-config all
```

```
eselect kernel list 
```

-> shows me the new installed kernel-sources.

If I have a newer kernel package installed I copy /etc/kernels/theoldworkingconfig to /usr/src/linux/.config and perform the same command 

but with --oldconfig.

                     ^ ^ edited to oldconfig

```
genkernel --oldconfig --no-clean --save-config all
```

Often there are only minor changes in config. Also when installing new kernels no compiler garbage is left so i have this set as default in my 

/etc/genkernel.conf:

```

CLEAN="no"

MRPROPER="no"

SAVE_CONFIG="yes"

BOOTLOADER="grub"

```

EDIT: F*** borked --oldconfig with --menuconfig

----------

## John R. Graham

I think the most correct answer is:Copy the ".config" file from the old kernel directory to the new kernel directory.

Move the symlink if it hasn't already been done by the emerge of the whatever-sources with the symlink USE flag set.

Run genkernel with the --oldconfig and --save-config (and, probably, --menuconfig) options, first time through.The --oldconfig is necessary on the first run to ensure that the config file is properly updated for the new kernel features.  After that, genkernel will manage the .config for you.

- John

----------

