# Kernel 3.10.7 and nvidia-drivers-173.14.37

## evoweiss

Hi all,

I recently tried to upgrade my machine to the latest available kernel. Unfortunately, it looks like there's a problem with nvidia. I did some searching around and tried to use epatch_user, but was not successful. If anybody could help me resolve this, I would really appreciate it.

First, here is the failure output of running emerge nvidia-drivers:

```

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

>>>  '/var/tmp/portage/x11-drivers/nvidia-drivers-173.14.37/temp/build.log'

 * Messages for package x11-drivers/nvidia-drivers-173.14.37:

 * Gentoo supports kernels which are supported by NVIDIA

 * which are limited to the following kernels:

 * <sys-kernel/gentoo-sources-3.9

 * <sys-kernel/vanilla-sources-3.9

 * 

 * You are free to utilize epatch_user to provide whatever

 * support you feel is appropriate, but will not receive

 * support as a result of those changes.

 * 

 * Do not file a bug report about this.

 * ERROR: x11-drivers/nvidia-drivers-173.14.37 failed (compile phase):

 *   emake failed

 * 

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

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

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

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

 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-173.14.37/work/usr/src/nv'

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

```

This is what I got after creating the directory /etc/portage/pathes/x11-drivers/nvidia-drivers

In this directory I placed the file nvidia-drivers-173.14.37.diff, which is as follows:

```

Index: x11/nvidia-driver/Makefile

===================================================================

--- x11/nvidia-driver/Makefile  (revision 317139)

+++ x11/nvidia-driver/Makefile  (working copy)

@@ -70,6 +70,10 @@

 EXTRA_PATCHES+=        ${FILESDIR}/security-patch-CVE-2012-4225

 .endif

+.if ${NVVERSION} == 1731435

+EXTRA_PATCHES+=        ${FILESDIR}/build-patch-nv_api_call

+.endif

+

 OPTIONS_DEFINE=        FREEBSD_AGP ACPI_PM LINUX DOCS

 OPTIONS_DEFAULT=       LINUX

Index: x11/nvidia-driver/files/build-patch-nv_api_call

===================================================================

--- x11/nvidia-driver/files/build-patch-nv_api_call     (revision 0)

+++ x11/nvidia-driver/files/build-patch-nv_api_call     (working copy)

@@ -0,0 +1,13 @@

+--- src/nv-freebsd.h.orig      2013-05-06 13:13:49.000000000 +0200

++++ src/nv-freebsd.h   2013-05-06 13:16:38.000000000 +0200

+@@ -142,8 +142,8 @@

+

+ MALLOC_DECLARE(M_NVIDIA);

+

+-RM_STATUS os_alloc_contig_pages(void **, U032);

+-void os_free_contig_pages(void *, U032);

++RM_STATUS NV_API_CALL os_alloc_contig_pages(void **, U032);

++void NV_API_CALL os_free_contig_pages(void *, U032);

+

+ /*

+  * Enable/Disable support for FreeBSD's AGP GART driver. Please note that

```

I also placed the following in /etc/portage/bashrc:

```

# 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

}

```

Anyway, help would be appreciated.

Best,

AlexLast edited by evoweiss on Sat Aug 24, 2013 3:50 am; edited 1 time in total

----------

## ulenrich

If the ebuild calls epatch_user then just put your patch into

/etc/portage/patches/x11-drivers/nvidia-drivers-173.14.37/

nothing more!

If your user patch doesn't go through the emerge dies ...

----------

## mv

You got the wrong patch. The working patch is about 20k, but I forgot where I found it.

----------

## Soultaker

The patch by Alberto Milone which I found on AUR seems to work, except the file paths need to be changed a little so it can be applied to the base working directory (instead of the usr/src/nv subdirectory).

In short: put this file in /etc/portage/patches/x11-drivers/nvidia-drivers-173.14.37/ and emerge the driver.

By the way, the version in the topic title is wrong; it says "nvidia-drivers-137" instead of "nvidia-drivers-173". That's annoying because it makes the topic unnecessarily hard to search for.

----------

