|
|
#1 | ||
|
Registered User
Join Date: Dec 2008
Posts: 55
|
I call it "nDrivia" it is a _very_ simple shell/bash/terminal script.
Code:
# sudo chvt 1 # echo 'NOTE: BY RUNNING THIS SHELL/BASH/TERMINAL SCRIPT, YOU AGREE THAT WE ARE NOT RESPONSIBLE FOR ANY DAMAGES, YOU AGREE THAT YOU ARE RUNNING THIS AT YOUR OWN RISK! This shell/bash/terminal script only runs the necessary commands, in their necessary order, to install nVidia Linux video card drivers, then restart GDM and the GUI (Graphical User Interface.)'; echo sleep 8 sudo /etc/init.d/gdm stop /etc/init.d/gdm stop clear cd ~/Desktop/ sudo ./NVIDIA-Linux-*-*-pkg*.run clear echo "Hope that did the trick for you! Let's see..."; echo echo Restarting the Graphical User Interface! sleep 4 /etc/init.d/gdm start sudo /etc/init.d/gdm start exit Here's what'll happen. If you place it in /usr/bin. You have to have/download only ONE nVidia driver .run files on/to your Desktop. You have to press Ctrl+Alt+F1, it'll ask for your password, then type "sudo ndrivia" It'll ask for your password. Then It'll display this for 8 seconds... Quote:
Quote:
NOTE: You might have to modify the code slightly, for example, to stop KDM, or for other KDE or Fedora/etc. things. This script is designed for GNU/Linux. And you should only have ONE nVidia driver .run file on your Desktop when running this script. |
||
|
|
|
|
|
#2 | |
|
Registered Fox
Join Date: Oct 2007
Location: Confoederatio Helvetica
Posts: 530
|
Sorry, but this is a rather bad idea from so many different point of views ...
(List is not complete, but these are probably the worst issues) First of all, the script is not dynamic at all. As you say by yourself, it is only for gdm, plus for distributions that have a /etc/init.d/gdm Then: You are using sudo in the file, even though a) sudo is not available on all distributions b) sudo probably prompts for a password for most of the actions You say that you run this script already with sudo, so all the sudos used are nonsense anyway. It is a security risk, as you assume that the right binaries are the first ones taken from $PATH, and you are using too much wildcards in my opinion. You have no shebang line, so you have to tell the script which interpreter it has to use. There are errors in the script, you start gdm twice in the worst case. (Which, depending on gdm, will even work, but create something the user doesn't want) And, most of all: Installing the driver that way fails on the most popular distributions. Even worse, it will break up the system at least on *Ubuntu, SuSE and Fedora, as there are additional steps are necessary. Fuchs Last edited by NvFuchs; 04-29-09 at 02:40 PM. |
|
|
|
|
|
|
#3 |
|
Registered User
Join Date: Jun 2006
Posts: 678
|
1) Stopping GDM doesn't mean that your X session will be terminated automatically.
2) There's no need for 'exit' at the end of the script. 3) You'd better add #! /bin/bash to the beginning, as ****s said. 4) I don't really understand why you stop and start gdm twice. Normal users are not allowed to stop/start system services, as such "/etc/init.d/gdm stop|start" will not work and are unnecessary. 5) I won't recommend using this script to anyone who uses already mentioned distros (or better say any distros which have an ability of automatic updates and packet managers), because Xorg-server or/and Mesa updates will render system unstable/unusable. NVIDIA drivers do mess up with some system libraries (and there's a reason for that). |
|
|
|
|
|
#4 | |
|
Registered User
Join Date: Dec 2008
Posts: 55
|
Well... FIX IT, IMPROVE IT. So we can all have a really easy way to install the latest nVidia drivers. I'm a free software advocate. Maybe the final script will be incorporated into the drivers themselves.
I'll also point out "If you can't say anything nice, don't say anything at all." |
|
|
|
|
|
|
#5 | |||
|
Registered Fox
Join Date: Oct 2007
Location: Confoederatio Helvetica
Posts: 530
|
The idea behind it is broken, not only the script. And this is something we can't fix.
Quote:
If a distribution package manager does not think that the latest driver is ready for being included in the standard distribution, then he is probably right. Normal users, who would be the targeted audience for such a script, should never install it then. If you want to help, then create packages of the latest driver. This is the correct way of handling such things. It is almost impossible to write a bash script for that. There are hundreds of distributions out there, which handle init scripts, configurations, modules, xdm|gdm|kdm, X, ... completely different. You would have to write a one for all script, which will be almost impossible to maintain. That's why there are packages, they take care of distribution specific stuff. Quote:
As said, the bash script would be unmaintainable, huge and still a bad idea. Quote:
Fuchs |
|||
|
|
|
|
|
#6 | |
|
Registered User
Join Date: Dec 2008
Posts: 55
|
Quote:
Two: With the video card I have now, if I wanted to play games and/or run Compiz on Ubuntu, CentOS, Damn Small Linux, Debian, Elive, FaunOS, Fedora, Foresight, Gentoo, GoblinX, gOS, Knoppix, Linspire, Freespire, Linpus, Mint, Mandriva, openSUSE, Openwall, Paldo, Pardus, Parsix, PC/OS, PCLinuxOS, Puppy, Red Hat, Sabayon, Sidux, SimplyMEPIS, Slackware, Slax, Yoper, Zenwalk, etc., etc., I couldn't because the latest stable nVidia drivers aren't in the repositories. And having the user do without drivers ISN'T an option. Three: The terminology behind "If you can't say anything nice, don't say anything at all" is "Only products that receive positive review are worthy of existence" so, not enough positive opinions or attention at all, the product or in this case feature isn't included. |
|
|
|
|
|
|
#7 | |||
|
Registered Fox
Join Date: Oct 2007
Location: Confoederatio Helvetica
Posts: 530
|
Quote:
I can give you at least 3 popular distributions where it won't work, plus mine (which is Gentoo, I don't count it as too popular) Let's see what has to be adapted only for gentoo: sudo is not part of a "normal" gentoo installation (if such a thing even exists). Neither /etc/init.d/gdm nor /etc/init.d/kdm exist. The manual installation might screw up the libraries, as usually with gentoo you have them in a special place, and by using eselect you can choose which ones to use. Now just multiply those changes (because the amount of work needed is probably +/- the same) by distributions available, and you see the problem. Quote:
If you have too much time at hand, just install half of the distributions you just mentioned in virtual machines and look at the adaptions needed for your script. Then you might see the problem. Quote:
Fuchs |
|||
|
|
|
|
|
#8 | ||
|
Registered User
Join Date: Dec 2008
Posts: 55
|
Quote:
Quote:
|
||
|
|
|
|
|
#9 |
|
Registered User
Join Date: Oct 2008
Posts: 114
|
This script won't work for me (using openSuSE).
"/etc/init.d/gdm" doesn't exist. Would work probably with "/etc/init.d/xdm", but then it would kick the user from the graphical interface, which is bad. "~/Desktop" is not where my desktop is, it's in "~/Escritorio". I rename every English directory in my "/home" to Spanish to match the rest of my desktop language. Then I change the default location in KDE4 SystemSettings. Also, I don't put my downloaded files in the desktop, as I find more convenient to put them in "~/Documents/Downloads" (translated to Spanish, of course). And I'm not sure if this line would install one or all the downloaded NVIDIA drivers in the directory. I usually have plenty of them to compare between versions. "sudo ./NVIDIA-Linux-*-*-pkg*.run" The ideal example of installation would be this:
Anything more complicated than this (for the users) is not worth the effort, as distros usually have an easy way to install the NVIDIA driver. The drivers listed in the forum are all beta drivers anyway (even the "stable" ones). |
|
|
|
|
|
#10 | |
|
NVIDIA Corporation
Join Date: Mar 2005
Posts: 2,487
|
Quote:
That said, I'm considering relaxing that restriction and allowing nvidia-installer to run while X is running if it can successfully unload the nvidia.ko kernel module, for example, if you're using the nv or vesa drivers and there are no OpenGL or CUDA applications running. If you'd like to give that a try, you can pass the --no-x-check option to the installer. Please note that it will fail if it can't unload the kernel module, so if the driver is still in use, that's expected. Distribution-provided packages have an advantage here because they know that their kernel modules will work with the installed kernel. nvidia-installer doesn't have that luxury and must test-load the module to make sure it works. If installing the nvidia driver while X is running with a different driver proves reliable, then I'll look at what it would take to add a graphical installer front-end. |
|
|
|
|
|
|
#11 |
|
Registered User
Join Date: May 2006
Posts: 477
|
AaronP,
Could you build something into the nvidia module that allows temporary suspension of resources of the module? It could "suspend" the X session long enough to allow access to the card resources required by the new module, load/unload the new module, then let the old module resume the session. This is done without unloading the original nvidia.ko from the kernel. I imagine the screen would go black for 1-2 seconds during this process. |
|
|
|
|
|
#12 | |
|
NVIDIA Corporation
Join Date: Mar 2005
Posts: 2,487
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Graphics driver installation problem (your comments will be highly appreciated) | apuurboo | NVIDIA GeForce 400/500 Series | 0 | 06-16-12 07:35 AM |
| Graphics driver installation problem (your comments will be highly appreciated) | apuurboo | NVIDIA GeForce 400/500 Series | 0 | 06-13-12 07:58 AM |
| Stubborn screen res problem | Alpsoandso | NVIDIA Linux | 6 | 05-03-12 06:00 PM |
| Redhat 8.0 NVIDIA works - INSTRUCTIONS | STEEL1 | NVIDIA Linux | 267 | 04-15-03 06:48 PM |
| Unofficial nVidia HOWTO [RPM version] | Rob C. | NVIDIA Linux | 78 | 04-09-03 07:44 AM |