# Kernel makefiles missing

## Kryptonite

Hello,

I recently updated the system. In the process it had also updated my kernel source which I really didn't want. I'm currently using linux-2.6.18-gentoo-r3 kernel which I believe not supported anymore. But the problem is somehow all the kernel makefiles are now missing. I can't do revdep-rebuild because of this. I can't run make menuconfig or make either.

```

make menuconfig

make: *** No rule to make target `menuconfig'.  Stop

```

Can someone help me to get the makefiles back? I still got my .config file. Really don't want to upgrade to linux-2.6.23-gentoo-r3.

Thanks alot

----------

## eccerr0r

did you accidently emerge --unmerge gentoo-sources ?  kernels are slotted so it shouldn't unmerge old versions...

unfortunately when packages go out of date, the files related to it can be hard to obtain, in this case, the patches disappeared.  I'd suggest to just go to a newer kernel, else you may have to go use vanilla sources...

----------

## niskel

This is due to the new behavior of --depclean. Personally I don't agree with this new behavior. There is a bug for it here. --depclean is getting rid of the current Kernel sources and breaking tons of packages. Please comment on the bug so that they might look into fixing this problem. The bug is pretty flamey but as far as I am concerned if regular behavior caused breakages, this is bad.

----------

## Kryptonite

Yes I ran --depclean because I had so many orphaned files. I can't understand why it deleted the makefiles, doesn't make sense.

----------

## niskel

It depcleaned away all your sources that weren't the latest; it completely unmerged them. There is still a folder there because there are new files in the folder that are generated when you make a build. Portage unmerged all the files it put there and left the ones you generated.

Basically, depclean seems to being doing depclean /and/ prune at the same time now.

----------

## Kryptonite

I guess so but from my opinion it shouldn't do that. However finally I had to upgrade the kernel. It's not what I wanted to do but it solved the problem.

----------

## Ralphus Maximus

Added my $.02 ('Merican)

 *Quote:*   

> (In reply to comment #18 )
> 
> > Can someone WONTFIX this bug? Because it's getting completely nonsensical.
> 
> > Unmerging kernel sources breaks *nothing*. The kernel stays there, the modules
> ...

 

Cheers,

RM

----------

## Chris_Hird

I agree

I recently upgraded to a hardened Installation and screwed up more packages than I can mention!  Now it looks like I have also screwed up my kernel configuration, I tried to run make menuconfig to determine if I had configured support for a Zip Drive.  My kernel is working fine, I would like to leave the options as they were and not have to create a new kernel.

Chris...

----------

## StarDragon

Why not just download the correct sources from www.kernel.org?

But I agree, this is just a pain in the ass

----------

## IRQsRFun

Recovery of .config - if your running kernel was set up for it you should be able to copy out /proc/config.gz, gunzip it and copy it to .config in the kernel sources.

I noticed the same problem with emerge --depclean and I ended up creating an embarsingly simple and crude script using sed on the --depclean --pretend output.  There are still many problems with it, most notably it creates two files tempdepclean1 and tempdepclean2 for tempoary storage.  If this script is run, please understand what it does before running it since the logic of it depends heavily on the observed formatting of emerge --depclean --pretend.  I would also reccoment placing in a separate directory untill it is cleaned up.

Here it is with NO promises or warranty of anay kind.

```

#!/bin/bash

emerge --depclean --pretend>tempdepclean1

sed -n -e  '/^ [[:alpha:]]/p' tempdepclean1>tempdepclean2

sed -e  '/kernel/d' tempdepclean2 > tempdepclean1

while read package; do

        emerge $package --depclean

done < tempdepclean1

```

----------

