# Automatically use previous kernel configuration

## Mike81

Hi,

I am compiling my kernels with genkernel.

Genkernel saves my configuration to /etc/kernels.

When there is a new kernel version (e.g. 3.1.0 to 3.1.0-r1 and now 3.1.1) I always have to go into /etc/kernels and to copy the kernel configuration file, to represent the new version, e.g. 

```
cp kernel-config-x86-3.1.0-gentoo kernel-config-x86-3.1.0-gentoo-r1

cp kernel-config-x86-3.1.0-gentoo-r1 kernel-config-x86-3.1.1-gentoo
```

Is there a way to tell genkernel, that I always want to re-use the latest kernel configuration?

----------

## John R. Graham

Sorry; short answer is, "No." I presume you've got

```
OLDCONFIG="yes"

CLEAN="no"

MRPROPER="no"
```

 in your /etc/genkernel.conf file? In any case, what you're doing is about the least work method there is.

- John

----------

## djinnZ

 *commands and comments wrote:*   

> cd /usr/src/linux
> 
> cp /etc/kernels/kernel-config-x86-3.1.0-gentoo-r1 .config
> 
> make listnewconfig | less (or > newlist on on another shell ...)to see what is changed
> ...

 or

```
cp /etc/kernels/kernel-config-x86-3.1.0-gentoo-r1 /usr/src/linux/.config ; genkernel --no-clean --menuconfig all
```

--no-clean implies --no-mrproper

----------

## depontius

I use genkernel to build kernels/modules/initrd, but manage my own configs, which I keep in /usr/src with names like "20111114-311.config".  (That would be for gentoo-sources-3.1.1, which came out today, assuming I build it later this morning.)  Once in genkernel, first thing I do is grab the previous kernel config, tweak it if needed for the new kernel revision, save it for kernel build use, then save it under it's new name, then let the build run.  With that naming convention the latest configuration automatically sorts to the bottom of the list, easy to find.  I've found in more recent releases of genkernel the "save as" feature doesn't work, so I have to do it manually after the kernel build.

This scheme is also nice because I have a trail of kernel configs, matched to kernel versions, going back as far as I care - I see one for Jun 2005 on another machine.

----------

## Mike81

Thank you all for your replies.

 *John R. Graham wrote:*   

> Sorry; short answer is, "No." I presume you've got
> 
> ```
> OLDCONFIG="yes"
> 
> ...

 No, I have

```
OLDCONFIG="yes"

CLEAN="yes"

MRPROPER="yes"
```

set.

----------

