some scripting to upgrade ATI Catalyst from 10.6 (repo) to 10.8 (run)

I have to do it on several machines, so I wrote a script. You don’t have to reboot but you must exit X. Use it at your own risk :expressionless:


#! /bin/bash

# --------------------------------------------------------------
# What it does :
# - unload fglrx if needed
# - make a copy of /etc/X11/xorg.conf (if any)
# - download ATI Catalyst 10.8 for your architecture
# - deinstall the repo driver (x11-video-fglrxG02 ) if it was previously installed
# - run the ATI installer  
#
# as always ... you're using it at your own risk.
# $ Agnelo de la Crotche - 31.08.2010
# --------------------------------------------------------------

mach=`uname -m`

# define x86_64 and i686  installer
x86_64=https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/ati-driver-installer-10-8-x86.x86_64.run
i686=https://a248.e.akamai.net/f/674/9206/0/www2.ati.com/drivers/linux/ati-driver-installer-10-8-x86.x86_64.run

# don't run in X
[ "$DISPLAY" ] && exec echo "this script cannot be run in X"

# unload fglrx 
lsmod | grep -q fglrx && modprobe -r fglrx

# exit if fglrx is still loaded 
lsmod | grep -q fglrx && exec echo "fglrx is still loaded"

# save /etc/X11/xorg.conf (just in case)
[ -f /etc/X11/xorg.conf ] && cp /etc/X11/xorg.conf{,.pta}

# make sure wget is installed
which wget > /dev/null 2>&1 || zypper in wget

# get the ATI installer for your architecture (i686 or x86_64)
wget ${!mach}

# look for the ATI installer in the current directory
ati_install=(`find . -name "ati-driver*$mach.run"`)

# cancel script if 0 or more than 1 installer found
if [ ${#ati_install[li]} -gt 1 ] ; then
[/li]	exec echo "several versions of the ATI installer found. Script aborted."
elif [ ${#ati_install[li]} -eq 0 ] ; then
[/li]	exec echo "no ATI installer found. Script aborted."
fi

# let's doublecheck ! :-)
AtiInstall=`basename ${ati_install[0]}`
[ -f ./$AtiInstall ] || exec echo "no ATI installer found. Script aborted."

# uninstall x11-video-fglrxG02
rpm -qa | grep -q x11-video-fglrxG02 && zypper rm x11-video-fglrxG02

# run ATI installer if x11-video-fglrxG02 successfully removed
rpm -qa | grep -q x11-video-fglrxG02 || sh ./$AtiInstall

Just a thought - You may get more response by posting this here:
Programming/Scripting

Interesting - which thus suggests it may be possible to use your script on a PC (with LOTS of RAM) that is running from a liveCD , in order to test the proprietary driver compatibility without actually installing openSUSE. :slight_smile: Presumeably first one needs to install (in RAM) kernel-source, gcc, and make.

… or is having 10.6 initially installed a pre-requisite ?

No. The script will only uninstall any x11-video-fglrxG02 if it’s installed.
rpm -qa | grep -q x11-video-fglrxG02 && zypper rm x11-video-fglrxG02