# which program is removing my kernel files?

## Joseph_sys

I don't have a need to use the latest or most current kernels so sometimes I keep an old one until I'm forced to upgrade. 

an example, I was using: 2.6.25-gentoo-r7 but since I upgraded to gcc I needed to recompile the kernel with new gcc and it turn out files:  *Quote:*   

> -rw-r--r--  1 root root     2430 Oct  9 16:13 Kbuild
> 
> -rw-r--r--  1 root root   101926 Apr  1 17:06 MAINTAINERS
> 
> -rw-r--r--  1 root root    56771 Apr  1 17:06 Makefile

 

are gone, so I had to switch to newer kernel linux-2.6.27-gentoo-r8

Any ideal which program is removing the configuration files from /usr/src/linux-kernel-in-use ?

I have tmpwatch installed but couldn't fined anything in there that would touch /use/src/ directory, or is there?

----------

## yabbadabbadont

Did you happen to run an "emerge --depclean" at some point?  If you weren't paying close attention, it would remove older kernel sources.

----------

## Joseph_sys

 *yabbadabbadont wrote:*   

> Did you happen to run an "emerge --depclean" at some point?  If you weren't paying close attention, it would remove older kernel sources.

 

I think you are correct, I remember running --depclean. 

Is there a way to protect kernel-in-use configuration files?

----------

## yabbadabbadont

Other than paying attention to what you are doing... not that I know of.   :Very Happy: 

----------

## Joseph_sys

I think statement in /etc/make.conf

```
CONFIG_PROTECT="/usr/src/linux/*"
```

should do the trick isn't it?

----------

## Hu

According to the manual page, packages listed in world are never removed by --depclean.  Use emerge --noreplace sys-kernel/gentoo-sources:my-favorite-version to add a specific slot to the world file.  That should prevent --depclean from removing it.  If you do this, you will need to explicitly emerge --unmerge that version when you upgrade.

----------

