I will make a few assumptions:

1- You want a Knoppix that loads always the accelerated nvidia driver instead of "nv", and behaves normally for other types of video cards.

2- You are remastering knoppix following the Knoppix Remastering Howto of knoppix.net

3- You are familiar with a text editor of your choice (in a terminal). I will use vi.

4- You've already booted knoppix, and have one root shell with the chrooted environment.

5- You have avaliable in the chroot linux-kernel-headers and gcc-2.95


First, create a temporary directory somewhere. I used /temporary:

root@tty1[/]# mkdir temporary
root@tty1[/]# cd temporary

Now, download the .run file from nvidia:

root@tty1[temporary]# wget http://download.nvidia.com/XFree86/L...-5336-pkg1.run

Extract it:

root@tty1[temporary]# sh NVIDIA-Linux-x86-1.0-5336-pkg1.run --extract-only
root@tty1[temporary]# cd NVIDIA-Linux-x86-1.0-5336-pkg1

Now there's a little thing we have to tweak. /usr/bin/gcc is a symlink that points to gcc-3.3, but the kernel was compiled with gcc-2.95. I've never had any problems compiling it with 3.3, but just to be on the safe side, let's modify the link (we'll fix it again later):

root@tty1[NVIDIA-Linux-x86-1.0-5336-pkg1]# ln -sf /usr/bin/gcc-2.95 /usr/bin/gcc

We are ready to install. Let's bypass some checks:

root@tty1[NVIDIA-Linux-x86-1.0-5336-pkg1]# ./nvidia-installer --accept-license --no-runlevel-check --no-precompiled-interface

If all went well, the driver is installed. Now let's modify the mkxf86config script:

root@tty1[NVIDIA-Linux-x86-1.0-5336-pkg1]# cd /usr/sbin
root@tty1[sbin]# vi mkxf86config

Look for the sed command that creates /etc/X11/XF86Config-4. You can look for the string "nv", the sed command is a few lines below (there's another 'sed' line above this, don't touch that)

Then, add this before the sed:

if [ "$XMODULE" = "nv" ]; then
XMODULE="nvidia"
fi

sed -e 's|@@PROTOCOL@@|'......

Save the file and exit.

And the moment you've all been waiting for!! Let's tidy up the room first...

root@tty1[NVIDIA-Linux-x86-1.0-5336-pkg1]# cd /
root@tty1[/]# ln -sf /usr/bin/gcc-3.3 /usr/bin/gcc
root@tty1[/]# rm -rf /temporary

Now repack it, and enjoy!