LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Kernel (https://www.linuxquestions.org/questions/linux-kernel-70/)
-   -   [SOLVED] nvidia kernel module with custom kernel (https://www.linuxquestions.org/questions/linux-kernel-70/%5Bsolved%5D-nvidia-kernel-module-with-custom-kernel-784535/)

feech 01-25-2010 02:17 AM

[SOLVED] nvidia kernel module with custom kernel
 
Hi,

I use Debian Squeeze with a custom kernel but I have a problem when I want to build the Nvidia kernel module.

I extracted Debian's linux-source to my home directory where I compiled a custom kernel-image and kernel-headers.
I used this command:
Code:

MAKEFLAGS="CC=/usr/lib/ccache/gcc-4.3" make-kpkg --rootcmd fakeroot --initrd --append-to-version=-c0.6 --revision=2.6.32 kernel-image kernel-headers
After this finished I installed the image and headers and created the Nvidia kernel module. Everything worked fine.

However, if I remove the linux-source from my home directory then I can't build the kernel module:
Code:

ERROR: Unable to find the kernel source tree for the currently running kernel.
      Please make sure you have installed the kernel source files for your
      kernel and that they are properly configured; on Red Hat Linux systems,
      for example, be sure you have the 'kernel-source' or 'kernel-devel' RPM
      installed.  If you know the correct kernel source files are installed,
      you may specify the kernel source path with the '--kernel-source-path'
      command line option.

So my question is why does this kernel module need the source I used to compile the kernel when I have the headers for that kernel installed?

business_kid 01-25-2010 04:39 AM

Never mind the error. It's a standard one. You need
1. To be running a kernel
2. To have that compiled kernel source somewhere. So when you build your kernel do not run 'make clean.' If you did, go back and run make again.
3. A symlink in /lib/modules/kernel-version/build pointing to your compiled kernel source

In the words of the fictional Capt.Luc Picquard "Make it so" and try again.

feech 01-26-2010 01:25 PM

Thanks business_kid, that comment helped.

So it turned out the symlink in /lib/modules/kernel-version/build was pointing to the compiled kernel source in my home directory instead of pointing to the kernel-headers in /usr/src/linux-headers-kernel-version. Creating the correct symlink solved my problem.


All times are GMT -5. The time now is 11:55 PM.