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 -> by its own and you must re-link to (or re-install nvidia driver).

My script test if a nvidia module can be load (using modinfo) and check if 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

if [[ -h "/usr/lib/xorg/modules/extensions/" && $NV -eq 0 ]]
echo "NVIDIA Driver is [OK]"
echo "NVIDIA Driver is [NOTOK]
sh /root/ -s # Where you have the NVIDIA installer

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