jeudi 30 août 2007

Auto Re-install Nvidia Driver After Xorg update or Kernel Update

Hi !
I come back with a new very nice and smart script,
the aim of the script is Auto Re-install Nvidia Driver After Xorg update or Kernel Update.
For example, when you update/upgrade your distrib, Xorg cannot reboot correctly due to nvidia module.
Nvidia module need to be compiled with the Xorg running version AND the Kernel runing version.
- When you update from Kernel 2.6.21 to 2.6.22 nvidia module isn't in 2.6.22 modules directory, it must be compiled.
- When you update Xorg, it replace symbolic link libglx.so -> libglx.so.nvidiaversion by its own libglx.so and you must re-link libglx.so to libglx.so.nvidiaversion (or re-install nvidia driver).

My script test if a nvidia module can be load (using modinfo) and check if libglx.so is a symbolic link.
If one of this condition isn't rigth, my script launch Nvidia installation in silence mode (no asking question).

You can add a line un your rc.local to auto check at startup if your nvidia driver is right.

the script :

/sbin/modinfo nvidia > /dev/null 2>&1
NV=$?

if [[ -h "/usr/lib/xorg/modules/extensions/libglx.so" && $NV -eq 0 ]]
then
echo "NVIDIA Driver is [OK]"
else
echo "NVIDIA Driver is [NOTOK]
"
sh /root/NVIDIA-Linux-x86-100.14.09-pkg1.run -s # Where you have the NVIDIA installer
fi


WARNING : When your kernel version is updated, you NEED have kernel headers of the same version in /usr/src/linux else nvidia installer cannot compile module correctly.

Aucun commentaire:

Enregistrer un commentaire