Date

So you just upgraded to 3.10 and now you can't rebuild the nvidia drivers under Gentoo?

This would look familiar :

/var/tmp/portage/x11-drivers/nvidia-drivers-325.08/work/kernel/nv-i2c.c: In function ‘nv_i2c_del_adapter’:
/var/tmp/portage/x11-drivers/nvidia-drivers-325.08/work/kernel/nv-i2c.c:252:14: error: void value not ignored as it ought to be
make[3]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-325.08/work/kernel/nv-i2c.o] Error 1

For reference hear is my kernel version and nvidia driver version :

kernel = 3.10.1-gentoo
nvidia = 325.08

There is a simple patch for this. I can't take credit for the following patch.

diff --git a/kernel/nv-i2c.c b/kernel/nv-i2c.c
index a702506..ece9c3c 100644
--- a/kernel/nv-i2c.c
+++ b/kernel/nv-i2c.c
@@ -324,13 +324,10 @@ BOOL NV_API_CALL nv_i2c_del_adapter(nv_state_t *nv, void *data)
     if (!pI2cAdapter) return FALSE;

     // attempt release with the OS
-    osstatus = i2c_del_adapter(pI2cAdapter);
+    i2c_del_adapter(pI2cAdapter);

-    if (!osstatus)
-    {
-        os_free_mem(pI2cAdapter);
-        wasReleased = TRUE;
-    }
+   os_free_mem(pI2cAdapter);
+   wasReleased = TRUE;

     return wasReleased;
 }
diff --git a/kernel/nv-procfs.c b/kernel/nv-procfs.c
index 3e05ef5..75fc7e0 100644
--- a/kernel/nv-procfs.c
+++ b/kernel/nv-procfs.c
@@ -14,6 +14,8 @@
 #include "os-interface.h"
 #include "nv-linux.h"

+#undef CONFIG_PROC_FS
+
 #if defined(CONFIG_PROC_FS)

 #include "nv_compiler.h"

This patch will do two things, It changes the way the i2c adaptor is released and disables the procfs entries for the nvidia drvier. The nvidia drivers don't make much use of procfs anyway.

Since you're reading this blog entry I would guess your also using Gentoo. This post will tell you how to patch the nvidia driver and still use the Gentoo supplied ebuild. Of course you could build/patch the nvidia driver outside of the ebuild but thats not very Gentoo!

All the steps will need to be done as root.

Firstly fetch the source :

ebuild /usr/portage/x11-drivers/nvidia-drivers/nvidia-drivers-325.08.ebuild fetch

The above won't return much output so don't worry.

Next unpack source :

ebuild /usr/portage/x11-drivers/nvidia-drivers/nvidia-drivers-325.08.ebuild unpack

This will have some output and your looking for the last line that shows you where the source was unpacked too:

>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-325.08/work

Next change directories into the above "work" directory.

Save the above patch as nvidia.patch. (or anything really) Then patch the driver :

patch -p1 < nvidia.patch 

If your patch has been saved correctly and you're in the correct directory you should see the following success message:

patching file kernel/nv-i2c.c
Hunk #1 succeeded at 249 (offset -75 lines).
patching file kernel/nv-procfs.c

Success!

Next up you need to compile the source that you have just patched. You still need to use the ebuild command as emerge command will re fetch and unpack the source, you don't want to do that.

To compile the patched source run the command :

ebuild /usr/portage/x11-drivers/nvidia-drivers/nvidia-drivers-325.08.ebuild compile

You will see the following if all has gone well :

NVIDIA: left KBUILD.
>>> Source compiled.

Compiled with the patch.

Next you need to run the "install" section of the ebuild, this will copy all the files over to a temporary location ready to be merged into your file system. Run the command :

ebuild /usr/portage/x11-drivers/nvidia-drivers/nvidia-drivers-325.08.ebuild install

This will have some output, but as long as it says :

>>> Completed installing nvidia-drivers-325.08 into /var/tmp/portage/x11-drivers/nvidia-drivers-325.08/image/

One last step.

Your fine to merge the files and run any post steps that have been outlined in the ebuild. Do to this run the command :

ebuild /usr/portage/x11-drivers/nvidia-drivers/nvidia-drivers-325.08.ebuild qmerge

The output of this will look just like the last stage of when you use the emerge command, I am sure you have seen that enough times by now.

Thats it. Your kernel module has been build and installed.


Comments

There are no comments yet. Email me and I will add your comment.