# + kernel (3.7.10) + nvidia-drivers-96.43.23  won't build???

## aka.bugle

I've been advised to either patch nvidia-drivers  or downgrade kernel to 3.4  (can't find help on downgrading kernel?)

 I'd like to try to patch nvidia-drivers-96.43.23 to build with this current kernel ( 3.7.10 ) 

WHY OH WHY doesn't a stable driver build in a stable kernel?

 *Quote:*   

> TC2K x11-drivers # emerge -av nvidia-drivers
> 
> These are the packages that would be merged, in order:
> 
> Calculating dependencies... done!
> ...

 

I think   this is the patch to get n'd'96.43.23 to build in my current kernel... 

https://aur.archlinux.org/packages/nvidia-96xx/

or this? 

https://447566.bugs.gentoo.org/attachment.cgi?id=339470

any kind wisdom here? 

should I follow this example...? 

http://devmanual.gentoo.org/ebuild-writing/functions/src_prepare/epatch/

or this... further down... 

http://www.gentoo-wiki.info/HOWTO_Create_an_Updated_Ebuild

----------

## ppurka

You can try epatch_user. Essentially, you don't need to do anything except put the patch in the directory /etc/portage/patches/x11-drivers/nvidia-drivers/ directory. Create that directory if you don't have it.

EDIT: You might need to create /etc/portage/bashrc and put the following function in it

```
# Enable user patches for ebuilds that don't support it

# mkdir -p /etc/portage/patches/abc/xyz 

# cp 999-mypatch.patch /etc/portage/patches/abc/xyz/

post_src_prepare() { 

     epatch_user 

}
```

----------

## aka.bugle

 *ppurka wrote:*   

> You can try epatch_user. Essentially, you don't need to do anything except put the patch in the directory /etc/portage/patches/x11-drivers/nvidia-drivers/ directory. Create that directory if you don't have it.
> 
> EDIT: You might need to create /etc/portage/bashrc and put the following function in it
> 
> ```
> ...

 

Thanks ppurka... I got a little further...

heres the die...

```

* Applying user patches from /etc/portage/patches//x11-drivers/nvidia-drivers-96.43.23 ...

 *   nv-96.43.23-bugle.patch ...

 * Failed Patch: nv-96.43.23-bugle.patch !

 *  ( /etc/portage/patches//x11-drivers/nvidia-drivers-96.43.23/nv-96.43.23-bugle.patch )

 * 

 * Include in your bugreport the contents of:

 * 

 *   /var/tmp/portage/x11-drivers/nvidia-drivers-96.43.23/temp/nv-96.43.23-bugle.patch.out

 * ERROR: x11-drivers/nvidia-drivers-96.43.23 failed (prepare phase):

 *   Failed Patch: nv-96.43.23-bugle.patch!

 * 

 * Call stack:

 *     ebuild.sh, line   93:  Called post_src_prepare

 *        bashrc, line    5:  Called epatch_user

 *   environment, line 1575:  Called epatch

 *   environment, line 1548:  Called die

 * The specific snippet of code:

 *               die "Failed Patch: ${patchname}!";

 * 

 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-96.43.23'`,

 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-96.43.23'`.

 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-96.43.23/temp/build.log'.

 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-96.43.23/temp/environment'.

 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-96.43.23/work'

 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-96.43.23/work/'

>>> Failed to emerge x11-drivers/nvidia-drivers-96.43.23, Log file:

```

and here's the patch i used 

```
        

--- a/kernel/conftest.sh

+++ b/kernel/conftest.sh

@@ -160,6 +160,7 @@ build_cflags() {

     if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then

         CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"

+        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include/uapi"

         CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated"

         CFLAGS="$CFLAGS -I$OUTPUT/arch/x86/include/generated/uapi"

     elif [ "$ARCH" = "arm" ]; then

--

```

I found it here...

https://447566.bugs.gentoo.org/attachment.cgi?id=339470

----------

## Gusar

The kernel is pretty much a self-contained package, there is no "help on downgrading kernel" because it isn't needed. There's no "downgrading", merely installing a different version. And then managing the /usr/src/linux symlink with eselect.

----------

## aka.bugle

 *Gusar wrote:*   

> The kernel is pretty much a self-contained package, there is no "help on downgrading kernel" because it isn't needed. There's no "downgrading", merely installing a different version. And then managing the /usr/src/linux symlink with eselect.

 

thank you for that explanation Gusar... 

  Sooo If I can't obtain the correct patch for the stable legacy nvidia drivers... I need to emerge previous stable kernel ...sys-kernel/gentoo-sources-3.4.34  and reconfigur and compile it? then change symlink, then update grub.conf?

----------

