# nvidia-drivers: kernel not prepared

## einbisschen

hallo all!

I need to install the closed source nvidia-drivers but my PC gets stuck when detecting the kernel:

```
Determining the location of the kernel source code

Found kernel source directory:

    /usr/src/linux

Found kernel object directory:

    /lib/modules/2.6.30-gentoo-r4/build

Found sources for kernel version:

    2.6.30-gentoo-r4

These sources have not yet been prepared.

We cannot build against an unprepared tree.

To resolve this, please type the following:

# cd /usr/src/linux

# make oldconfig

# make modules_prepare

Then please try merging this module again.

ERROR: x11-drivers/nvidia-drivers-180.60 failed.

Call stack:

                     ebuild.sh, line   49:  Called pkg_setup

  nvidia-drivers-180.60.ebuild, line  173:  Called linux-mod_pkg_setup

              linux-mod.eclass, line  581:  Called check_kernel_built

             linux-info.eclass, line  599:  Called die

The specific snippet of code:

        die "Kernel sources need compiling first"

 The die message:

  Kernel sources need compiling first
```

I definitly compiled a kernel via genkernel:

```
$ ls /boot

boot

grub

initramfs-genkernel-x86_64-2.6.30-gentoo-r4

kernel-genkernel-x86_64-2.6.30-gentoo-r4

lost+found

System.map-genkernel-x86_64-2.6.30-gentoo-r4
```

I have googled on this problem, but did not find any solution.

Thank you for answers.   :Smile: 

----------

## d2_racing

Hi, can you post this :

```

# cd /usr/src/

# ls -la

```

----------

## einbisschen

here you are:

```
$ ls -la

insgesamt 12

drwxr-xr-x  3 root root 4096  3. Sep 19:01 .

drwxr-xr-x 15 root root 4096 11. Sep 19:06 ..

-rw-r--r--  1 root root    0 27. Aug 03:32 .keep

lrwxrwxrwx  1 root root   22  3. Sep 19:01 linux -> linux-2.6.30-gentoo-r4

drwxr-xr-x 22 root root 4096 11. Sep 17:18 linux-2.6.30-gentoo-r4
```

the link is not broken

----------

## dmpogo

 *einbisschen wrote:*   

> here you are:
> 
> ```
> $ ls -la
> 
> ...

 

what is inside  linux-2.6.30-gentoo-r4 ? Do you have .config file there ?  Otherwise do what was suggested  :Smile: 

----------

## einbisschen

no, there is no .config-file in there.

I think the reason for this is, that I used genkernel to compile.

OK, now I will copy the .config of genkernel and recompile it manually.

----------

## einbisschen

and in /usr/src/linux/arch/ there is no amd64 directory; thats the arch I am using.

----------

## dmpogo

 *einbisschen wrote:*   

> and in /usr/src/linux/arch/ there is no amd64 directory; thats the arch I am using.

 

it is x86_64 for the kernel, but it does not contain anything interesting (at the end of the day - symlink to files in x86)

----------

## einbisschen

x86_64 does not exist either...

----------

## dmpogo

 *einbisschen wrote:*   

> x86_64 does not exist either...

 

don't worry, the only file it contains is a symlink

x86_64/boot/bzImage -> ../../x86/boot/bzImage

which is probably generated when you compile the kernel

----------

