In my continuing saga to live better through bash scripting, I present my next time saver script for those who like to load the nVidia driver the hard way, but would prefer it be just a little easier. To that end I present LNVHW - Load NVIDIA (driver the) Hard Way from runlevel 3. For this script to work for you, it must be located in the /root/bin folder, marked executable as always.
In KDE, you could start kwrite as:
kdesu kwrite /root/bin/lnvhw
Copy and past the code into your text editor (as root) and save the file.
#!/bin/bash
#: Title : LNVHW - Load NVIDIA the Hard Way
#: Date Created: Thu Dec 23 21:05:40 CST 2010
#: Last Edit : Thu Dec 23 21:39:00 CST 2010
#: Author : J. McDaniel
#: Version : 1.00
#: Description : Install nVidia Driver the Hard Way
#: Options : None
#
# Written for the openSUSE forums on Thursday December 23, 2010
#
#
# Copy and Paste the text of this script into a text editor and save
# it as the file lnvhw root area bin folder (/root/bin).
# You must be a root user to do this function
# This script must be marked executable to be used. Please run
# the following Terminal command: sudo chmod +x /root/bin/lnvhw
# To use lnvhw, you must be in runlevel 3 mode
# When you start your computer, enter a 3 as a kernel option and press enter
# Once your kernel has loaded, log in as root and type the command: lnvhw
#
#
# Please Make Sure this name is correct - Do not include a "/" at the end...
#
nVidia_folder=/home/james/Downloads
# Check to make sure lnvhw was started as Root
if $UID != 0 ] ; then
echo "You Must Be A Root User to Run $0"
exit 1
fi
# Make sure we are in Runlevel 3
RL=$( runlevel )
NUM={#RL}
LEVEL="${RL:2:1}"
if "$LEVEL" != "3" ]] ; then
echo "You are not using Runlevel 3 to load the nVidia Driver!"
exit 1
fi
tput clear
echo "Load nVidia the Hard Way Selection Menu"
echo
# Determine if the nVidia_folder Exists
if -d "$nVidia_folder" ]] ; then
declare -a drivers
cd "$nVidia_folder"
# Find and display all files that start with linux and end with .bz2
for i in NVIDIA-* ; do
let counter=counter+1
drivers$counter]=$i
echo "$counter) ${drivers$counter]}"
done
echo
echo -n "Please Select the nVidia Driver You wish to use: "
read CHOICE
sh ./"${drivers$CHOICE]}"
exit 0
else
echo "Folder $nVidia_folder does not exist"
exit 1
fi
exit 0
# End Of Script
Then mark it executable with the command:
sudo chmod +x /root/bin/lnvhw
To use lnvhw, download the latest nVidia proprietary video driver from:
Welcome to NVIDIA - World Leader in Visual Computing Technologies
Restart your PC and when you select the openSUSE kernel to load, enter a 3 as a kernel load option and press enter. Once you get to the login prompt, enter root and then the password and finally, type in lnvhw and select the nvidia driver you wish to load. Let me know if you have any questions about using lnvhw.
Thank You,