Saturday, August 25, 2007

Nvidia driver installation on Debian Lenny 2.6.21-2

Using the Nvidia driver installer you get the error:

   FATAL: modpost: GPL-incompatible module nvidia.ko uses GPL-only symbol 'para

This basically means Linux people don't like you compiling non-GPL code against the kernel. I guess that's fair I blame Nvidia. Anyway from what I understand it's all being put back so we can install evil code nice an easily in 2.6.22. But for now you need to patch some of the kernel build scripts. Here's a list of instructions for Debian, bastardised from the Redhat version at:

apt-get source linux-image-
cd linux-2.6-2.6.21/
cd scripts
cd mod
vi modpost.c

# delete the lines reading:
#if (!mod->gpl_compatible)
# check_for_gpl_usage(exp->export, basename, exp->name);

make mk_elfconfig
make empty.o
cat empty.o | ./mk_elfconfig FORCE > elfconfig.h
gcc modpost.c file2alias.c sumversion.c -o
cp /usr/src/linux-headers-2.6.21-2-686/scripts/mod/
mv /usr/src/linux-headers-2.6.21-2-686/scripts/mod/modpost /usr/src/linux-headers-2.6.21-2-686/scripts/mod/modpost.old
mv /usr/src/linux-headers-2.6.21-2-686/scripts/mod/ /usr/src/linux-headers-2.6.21-2-686/scripts/mod/modpost

sh --extract-only
cd NVIDIA-Linux-x86-100.14.11-pkg1
cd usr/src/nv
make module
PARAVIRT_OPS=`grep "D paravirt_ops" /boot/ | colrm 9`
ld -m elf_i386 --defsym paravirt_ops=0x$PARAVIRT_OPS -r -o nvidia.ko nvidia.o nvidia.mod.o
cp nvidia.ko /lib/modules/2.6.21-2-686/kernel/drivers/video/
modprobe nvidia
dpkg-reconfiugre xserver-xorg

You will also need to install the X11 nvidia driver the easiest way to do this is to run the nvidia installer with the "--no-kernel-module" flag ie:

./nvidia-installer --no-kernel-module

Then update your xorg.conf (you can use nvidia-xconfig to do this for you). It appears to be working... but I'm now trying to get it configured to do TV Out...

1 comment:

new said...

all working fine in 2.6.22 (debian)