# Kernel makefile dissappeared {Solved}

## markisthejob

Hi all.

A recent compile of ati-drivers failed with

 *Quote:*   

> Could not find a Makefile in the kernel source directory.
> 
>  Please ensure that /usr/src/linux points to a complete set of Linux sources

 

I havnt changed anything with my kernel since I originally set it up but sure enough the makefile is missing:

 *Quote:*   

> localhost linux # ls
> 
> Module.markers  System.map  block   drivers   fs       init  kernel  mm             net      security  usr      vmlinux.o
> 
> Module.symvers  arch        crypto  firmware  include  ipc   lib     modules.order  scripts  sound     vmlinux

 

Ive emerged gentoo-sources again but It doesnt give me a makefile.

I also downloaded the kernel 2.26 from kernel.org but I would prefer to keep gentoo-sources.

Any Ideas

edit: I also tried the --fetchonly option with the intention of compiling myself but there was no gentoo-sources in /usr/portage/distfiles afterwardsLast edited by markisthejob on Thu May 28, 2009 7:01 pm; edited 1 time in total

----------

## DONAHUE

```
emerge --depclean
```

 seems to like to remove kernel makefiles.

 *Quote:*   

>  /usr/portage/distfiles 

 

does not exist here, but 

 *Quote:*   

>  /usr/portage/sys-kernel/gentoo-sources 

 

does and contains numerous ebuilds including 2.6.26-gentoo-r4.

run 

```

eselect kernel list # emerge gentoolkit if you get command not found

ls -l /usr/src
```

and post the results here.

```
emerge gentoo-sources
```

 should have produced something resembling 

 *Quote:*   

> drwxr-xr-x 23 root root 1736 May 23 17:32 linux-2.6.28-gentoo-r5

 

as the directory containing the current stable kernel source.

as you were interested in kernel 2.26, I would venture to guess that you have a symbolic link in /usr/src that looks something like 

 *Quote:*   

> lrwxrwxrwx  1 root root   22 May 24 17:25 linux -> linux-2.6.26-gentoo-{something}

 

If you want to replace the makefile in the old 2.6.26 kernel you need to emerge a "package atom" as in:

```
emerge =syskernel/gentoo-sources-2.6.26-{something} # substitute appropriate value for {something}
```

else you can select the current kernel source

```
eselect kernel set linux-2.6.28-gentoo-r5
```

and reconfigure, recompile, and install an up to date kernel

----------

## markisthejob

Sorry It was late, and I downloaded the wrong tarball from kernel.org last night.

It wasnt supposed to be 2.26 as I mentioned My current installed version is 2.6.29-r5.

Also I did use --depclean recently, Anyway:

```
ls -l /usr/src

total 8

lrwxrwxrwx  1 root root   22 May  7 00:20 linux -> linux-2.6.29-gentoo-r3

drwxr-xr-x 20 root root 4096 May 28 04:10 linux-2.6.29-gentoo-r3

drwxr-xr-x 22 root root 4096 May 28 04:43 linux-2.6.29-gentoo-r5
```

```
mark@localhost / $ eselect kernel list

Available kernel symlink targets:

  [1]   linux-2.6.29-gentoo-r3 *

  [2]   linux-2.6.29-gentoo-r5
```

Running 

```
eselect kernel set linux-2.6.29-gentoo-r5
```

and recompiling gentoo-sources worked perfectly.Thanks for your help

----------

