Learner έγραψε:Απ' ότι καταλαβαίνω από την περιγραφή, κάνει το ίδιο πράγμα με αυτό που κάνει ο Sotos21 στον οδηγό του.
Learner έγραψε:Ο πηγαίος κώδικας που βρίσκεται ; Δεν κατάφερα να τον εντοπίσω (τουλάχιστον όσο εύκολα περίμενα).
#!/bin/sh
#
# Ubuntu AMD Catalyst Install
#
# Version : 3.3 beta
#
# By The Fan Club 2013
# http://www.thefanclub.co.za
#
echo
echo "*** Ubuntu AMD Catalyst Driver install by The Fan Club"
echo
echo "* NOTE: This program downloads, creates DEB packages and installs the latest"
echo " AMD Catalyst™ Proprietary Display Drivers for Ubuntu 32bit/64bit"
echo
echo "* NOTE: Before you will be able to run this script you will need to"
echo " make it executable : sudo chmod +x /path/to/script/ubuntu-amd-catalyst-install"
echo "* NOTE: Run this script as root with: sudo sh /path/to/script/ubuntu-amd-catalyst-install"
echo
echo "* DISCLAIMER: This script is provided purely for testing use. Use at own risk."
echo
# Functions
## Firt letter capitalise
FCAPS() {
first=`echo "$*" | cut -c1 | tr [a-z] [A-Z]`
rest="`echo "$*" | cut -c2-`"
echo "$first$rest"
}
# Local Variables
tfcName="Ubuntu AMD Catalyst Install"
tfcVersion="v3.3 beta"
# Set English as Shell output language
LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
userName=$(eval echo $SUDO_USER)
userHome=$(eval echo ~${SUDO_USER})
installDir="/opt/thefanclub/ubuntu-amd-catalyst-install"
logDay=$(date '+%Y-%m-%d')
logTime=$(date '+%Y-%m-%d %H:%M:%S')
logFile=/var/log/ubuntu-amd-catalyst-install.log
ubuntuVerT=$(cat /etc/lsb-release | awk 'BEGIN {FS="DISTRIB_CODENAME="} {print $2;}')
ubuntuVer=$(echo $ubuntuVerT)
ubuntuVerU=$(FCAPS $ubuntuVer)
ubuntuVerNumT=$(cat /etc/lsb-release | awk 'BEGIN {FS="DISTRIB_RELEASE="} {print $2;}')
ubuntuVerNum=$(echo $ubuntuVerNumT)
kernelVer=$(uname -r | cut -d"." -f1,2)
xServerVer=$(dpkg -l xserver-xorg-core | grep "^ii" |sed -n 's/.*:\([0-9.-]*\).*/\1/p' | cut -d"." -f1,2 )
legacyMaxKernel="3.4"
legacyMaxXserver="1.12"
#amdRelNotes="http://support.amd.com/us/kbarticles/Pages/amdcatalyst13-4linreleasenotes.aspx"
# Temp fix for missing rel notes page
amdRelNotes="http://support.amd.com/en-us/kb-articles/Pages/Latest-LINUX-Beta-Driver.aspx"
amdRelBetaNotes="http://support.amd.com/en-us/kb-articles/Pages/Latest-LINUX-Beta-Driver.aspx"
amdLinuxLatestPageUrl="http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64"
amdLinuxLegacyPageUrl="http://support.amd.com/en-us/download/desktop/legacy?product=Legacy2&os=Linux"
amdCopyrightFile="$installDir/copyright-amd"
zenButton="Next"
# Start of main Zenity code ##
(
echo "$logTime [UACI] *** $tfcName $tfcVersion - Installation started." >> $logFile
## Check installed graphics card model and vendor
echo "5"; sleep 1
echo "# Detecting AMD Graphics Controller Hardware ..."
echo "$logTime [UACI] Detecting AMD Graphics Controller Hardware..." >> $logFile
#amdVgaCon=$(lspci -vvnn | grep "VGA controller" | cut -d":" -f3)
amdVgaConOld=$(LC_ALL=C lspci -vvnn | grep -i "VGA controller" )
amdVgaCon=$(LC_ALL=C lshw -C display)
echo "$logTime [UACI] [lshw] $amdVgaCon" >> $logFile
echo "$logTime [UACI] [lspci] $amdVgaConOld" >> $logFile
# Check if ATI or AMD card is detected
amdVgaConIsAmd=$(echo $amdVgaCon | grep -i -w "ati\|amd\|radeon")
if [ ! "$amdVgaConIsAmd" ]
then
zenity --warning --no-wrap --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>No AMD / ATi Graphics Display Controller detected</b></big>\n\nThis application will now close."
exit
fi
# Extract driver vendor and model number parts
#amdVgaVen=$(echo $amdVgaCon | cut -d"[" -f2 | cut -d"]" -f1)
amdVgaVen=$(echo $amdVgaCon | awk 'BEGIN {FS="vendor:"} {print $2;}' | cut -d"[" -f2 | cut -d"]" -f1 )
#amdVgaMod=$(echo $amdVgaCon | cut -d"[" -f3 | cut -d"]" -f1)
amdVgaMod=$(echo $amdVgaCon | awk 'BEGIN {FS="product:"} {print $2;}' | cut -d"[" -f2 | cut -d"]" -f1 )
# Check if second [ ] is blank in driver string returned
if [ ! "$amdVgaMod" ] && [ "$amdVgaVen" ]
then
# older cards report model first and no vendor
amdVgaMod="$amdVgaVen"
# get vendor from text as AMD / ATi must be present in string at this point
amdVgaVen=$(echo $amdVgaCon | grep -i -w -o -s "ati\|amd" | tr '\n' ' ' | cut -d" " -f1 )
fi
# Check for non AMD/Ati vendors using radeon technology
nonAmdVendor=$( echo $amdVgaVen | grep -i -w -o -s "amd\|ati" )
if [ ! "$nonAmdVendor" ]
then
amdVgaVen=$(echo $amdVgaVen | awk 'BEGIN {FS="physical"} {print $1;}' )
fi
# If nothing is found in string rather quit
if [ ! "$amdVgaMod" ] && [ ! "$amdVgaVen" ]
then
zenity --warning --no-wrap --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>No AMD/ATi Graphics Display Controller information found</b></big>\n\nThis application will now close." --no-wrap
# Log
echo "$logTime [UACI] [Error] No AMD/ATi Graphics Display Controller information found." >> $logFile
exit
fi
#amdVgaMod="Radeon x1950"
# Get only the model number part (7500)
amdVgaModNum=$(echo $amdVgaMod | grep -o '[0-9]*')
# Get base of model series (75)
amdVgaModBaseNum=$(echo $amdVgaModNum | awk '{print substr($amdVgaModNum,1,2)}')
# Get last digit from model num (D)
amdVgaModBaseNumA=$(echo $amdVgaMod | grep -o '[0-9][0-9][0-9][0-9][a-zA-Z]' | cut -c5 )
echo "10"; sleep 1
echo "# Checking AMD Graphics driver compatiblity ..."
# Check if old legacy controller - model number below 2000
if [ "$amdVgaModNum" -lt "2000" ]
then
amdVgaSupFlag="Your graphic card is very old and not supported"
zenButton="Done"
fi
# Check if legacy controller - model number below 5000 but higher than 2000
if [ "$amdVgaModNum" -ge "2000" ] && [ "$amdVgaModNum" -lt "5000" ]
then
# Check kernel version and X server version compatibility
# Use BC to do floating point calcs
if [ $(echo "$kernelVer <= $legacyMaxKernel" | bc ) -eq 1 ] && [ $(echo "$xServerVer <= $legacyMaxXserver" | bc) -eq 1 ]
then
amdVgaSupFlag="Your system is supported by the Legacy driver"
amdLegacyFlag="yes"
else
amdVgaSupFlag="Your system is not supported by this driver"
zenButton="Done"
fi
fi
# Check if new controller - model number above 5000 then check release notes
if [ "$amdVgaModNum" -ge "5000" ]
then
# Check if installed graphics card is supported on the AMD release notes page
# Read page and check and get list of model series supported
amdVgaSup=$(wget -O - $amdRelNotes | grep -o "$amdVgaModBaseNum[0-9][0-9]$amdVgaModBaseNumA")
# Check to see if we get any results back and series we assume is supported. not the best way
if [ ! "$amdVgaSup" ]
then
amdVgaSupFlag="Your graphic card is not supported"
zenButton="Done"
else
# Check results of supported cards with our card to see if it is directly mentioned and supported
amdVgaModCombo="$amdVgaModNum$amdVgaModBaseNumA"
amdVgaSupCheck=$(echo $amdVgaSup | grep "$amdVgaModCombo")
if [ "$amdVgaSupCheck" ]
then
amdVgaSupFlag="Your system is fully supported"
else
amdVgaSupFlag="Your graphic card series is supported"
fi
fi
fi
# Log results
echo "$logTime [UACI] Detected Vendor: $amdVgaVen" >> $logFile
echo "$logTime [UACI] Detected Hardware: $amdVgaMod" >> $logFile
echo "$logTime [UACI] Ubuntu Version: $ubuntuVerNum" >> $logFile
echo "$logTime [UACI] Linux Kernel: $kernelVer" >> $logFile
echo "$logTime [UACI] X-Server version: $xServerVer" >> $logFile
echo "$logTime [UACI] Compatibility : $amdVgaSupFlag" >> $logFile
# Display detected display controller
amdVgaCard=$(zenity --question --text "Detected graphics controller:\n\n<big>$amdVgaVen $amdVgaMod</big>\n\nUbuntu $ubuntuVerNum \nLinux Kernel: $kernelVer\nX-Server version: $xServerVer\n\n\n<b>$amdVgaSupFlag</b>" --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500 --ok-label="$zenButton" --cancel-label="Cancel" --no-wrap )
# Check if Cancel was pressed
if [ "$?" -eq "1" ]
then
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] Driver installation cancelled" >> $logFile
exit
fi
# Check incompatiblity
if [ "$zenButton" = "Done" ]
then
zenity --warning --text="<b>No compatible hardware found</b>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] No compatible hardware found" >> $logFile
exit
fi
## Download and install driver from AMD Linux Driver site
echo "15"; sleep 1
echo "# Select driver download URL"
# select download page URL
if [ "$amdLegacyFlag" = "yes" ]
then
amdLinuxPageUrl="$amdLinuxLegacyPageUrl"
else
amdLinuxPageUrl="$amdLinuxLatestPageUrl"
fi
# Get list of latest Catalyst Drivers from AMD website
echo "20"; sleep 1
echo "# Getting list of drivers from AMD download page"
#latestDriverFiles=$(wget -O - $amdLinuxPageUrl | grep -o '['"'"'"][^"'"'"']*.zip' | sed 's/.*<td>\/\///')
# Nov 2013
latestDriverFiles=$(wget -O - $amdLinuxPageUrl | grep -o '['"'"'"][^"'"'"']*.zip' | sed 's/\\u002f//g' | sed 's/\"\\\\/http:\/\//g' | sed 's/\\/\//g')
# Check if any driver zip files are found
if [ "$latestDriverFiles" = "" ]
then
zenity --error --no-wrap --text "<b>No AMD Catalyst™ Proprietary Display Driver found.</b>\n\nThis application will now close." --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] No AMD Catalyst Proprietary Display Drivers found" >> $logFile
exit
fi
# Parse the drivers found
latestDriver=$(echo $latestDriverFiles | cut -d" " -f1)
latestBetaDriver=$(echo $latestDriverFiles | cut -d" " -f2)
# Clean up filenames for display
driverName=`basename "$latestDriver" .zip`
driverCName=$(echo $driverName | sed -e 's/-/ /g' )
driverBetaName=`basename "$latestBetaDriver" .zip`
driverBetaCName=$(echo $driverBetaName | sed -e 's/-/ /g' )
# Log Results Found
echo "$logTime [UACI] Latest AMD Driver found : $driverName" >> $logFile
echo "$logTime [UACI] Latest AMD Beta Driver found : $driverBetaName" >> $logFile
# Select driver
echo "# Driver select"
# Check if Beta exists / second driver link on page
if [ "$latestBetaDriver" = "$latestDriver" ] || [ "$latestBetaDriver" = "" ]
then
# Present user selection one item radio list
amdDriverSelect=$(zenity --list --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "Select the AMD Catalyst driver to install" --radiolist --column "Pick" --column "Option" TRUE "$driverCName" --width=600 --height=200 --ok-label="Next")
else
# Present user selection two item radio list
amdDriverSelect=$(zenity --list --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "Select the AMD Catalyst driver to install" --radiolist --column "Pick" --column "Option" TRUE "$driverCName" FALSE "$driverBetaCName" --width=600 --height=200 --ok-label="Next")
fi
# Check if any driver was selected
if [ "$amdDriverSelect" = "" ]
then
zenity --warning --no-wrap --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<b>No AMD Catalyst™ Proprietary Display Driver selected to install.</b>\n\nThe application will now close." --width=500
echo "$logTime [UACI] No AMD Catalyst™ Proprietary Display Driver selected to install." >> $logFile
exit
fi
# Check if Cancel was pressed
if [ "$?" -eq "1" ]
then
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] Driver installation cancelled." >> $logFile
exit
fi
# Parse Driver Selection
if [ "$amdDriverSelect" = "$driverCName" ]
then
fileToDownload=$latestDriver
amdCatalystDriver=$driverName
fi
if [ "$amdDriverSelect" = "$driverBetaCName" ]
then
fileToDownload=$latestBetaDriver
amdCatalystDriver=$driverBetaName
fi
echo "$logTime [UACI] Driver selected by user : $amdCatalystDriver" >> $logFile
# Set run file vars
amdCatalystFile=$(basename "$fileToDownload")
amdCatalystRunFile=`basename "$amdCatalystFile" .zip`.run
# Download driver file
echo "25"; sleep 1
echo "# Select Build Folder"
buildFolderSelect=$(zenity --file-selection --directory --title "The Fan Club - Ubuntu AMD Catalyst™ Install - Select Download Folder" --text "Select the driver download folder" --filename="$userHome/*" --width=600)
echo $userHome
echo $buildFolderSelect
# Check if Cancel was pressed
if [ "$buildFolderSelect" = "" ]
then
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] Driver installation cancelled." >> $logFile
exit
fi
echo "# Downloading AMD Catalyst™ Driver"
if [ ! "$amdCatalystFile" ]
then
zenity --error --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>No AMD Catalyst™ Display Driver found</b></big>\n\nThe application will now close."
echo "$logTime [UACI] [Error] No AMD Catalyst™ Display Driver found." >> $logFile
exit
else
# Create build folder
#buildFolder="$userHome/Downloads/$amdCatalystDriver"
buildFolder="$buildFolderSelect/$amdCatalystDriver"
if [ ! -d "$buildFolder" ]
then
mkdir "$buildFolder"
fi
cd "$buildFolder"
# Finally download the driver
echo "$logTime [UACI] Downloading : $fileToDownload" >> $logFile
wget -c --timeout=30 --keep-session-cookies --user-agent="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0" $fileToDownload 2>&1 | sed -u 's/.* \([0-9]\+%\)\ \+\([0-9.]\+.\) \(.*\)/\1\n# \1\ Downloaded at \2\/s - Time remaining about \3/' | zenity --progress --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --text="Downloading $amdCatalystFile" --ok-label="Next" --width=500
fi
# Check if Cancel was pressed
if [ "$?" -eq "1" ]
then
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
chown $userName -R "$buildFolder"
#rm -R "$buildFolder"
echo "$logTime [UACI] Driver download cancelled." >> $logFile
exit
fi
# Unzip run file to build folder
echo "50"; sleep 1
echo "# AMD Catalyst™ Driver downloaded, checking files"
# Test ZIP first
zipTest=$(unzip -t -d "$buildFolder" "$amdCatalystFile" | grep "No errors detected")
if [ ! "$zipTest" ]
then
zenity --error --no-wrap --text="<big><b>Downloaded driver file contains errors</b></big>\n\nThe application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install"
# No resume so we delete the folder and download
chown $userName -R "$buildFolder"
# Remove possible corrupt zip files
rm -R "$buildFolder"
echo "$logTime [UACI] [Error] Downloaded driver file contains errors." >> $logFile
exit
else
# unzip if no errors
echo "$logTime [UACI] Extracting driver installation ..." >> $logFile
unzip -o -d "$buildFolder" "$amdCatalystFile" 2>&1 | zenity --progress --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text="Extracting driver installation ..." --width=500 --auto-close --pulsate --no-cancel
# Check if .RUN file exist after unzip
runFileCount=$(ls "$buildFolder"/*.run 2> /dev/null | wc -l)
if [ "$debFileCount" -eq "0" ]
then
zenity --error --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>Failed to find extracted AMD Catalyst Driver RUN file</b></big>\n\nThe application will now close."
echo "$logTime [UACI] [Error] Failed to find extracted AMD Catalyst Driver RUN file." >> $logFile
exit
fi
# Set user permissions to current user and make executable
#chmod +x "$buildFolder/$amdCatalystRunFile"
#chown $userName "$buildFolder/$amdCatalystRunFile"
chmod +x "$buildFolder"/*.run
chown $userName "$buildFolder"/*.run
fi
# Build DEB
echo "60"; sleep 1
echo "# Creating Ubuntu installation files"
echo "$logTime [UACI] Creating Ubuntu $ubuntuVerNum installation files ..." >> $logFile
exec /bin/sh $buildFolder/*.run --buildpkg Ubuntu/$ubuntuVer 2>&1 | zenity --progress --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text="Building Ubuntu $ubuntuVerNum DEB installation packages ..." --width=500 --auto-close --pulsate --no-cancel
# Set permissions back to current user
chown -R $userName "$buildFolder"
# Check if DEB packages exist after build
debFileCount=$(ls "$buildFolder"/*.deb 2> /dev/null | wc -l)
if [ "$debFileCount" -eq "0" ]
then
zenity --error --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>Failed to build Ubuntu Deb installation packages</b></big>\n\nThe application will now close."
echo "$logTime [UACI] [Error] Failed to build Ubuntu Deb installation packages." >> $logFile
exit
fi
# Un-install old driver
echo "80"; sleep 1
echo "# AMD Catalyst™ Driver built successfully. Removing old drivers"
echo "$logTime [UACI] AMD Catalyst Driver built successfully." >> $logFile
zenity --question --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "Remove all old AMD Catalyst Drivers now ? (recommended)" --width=500
if [ "$?" -eq "0" ]
then
# Check for dpkg lock - must be sudo to use lsof
dpkgLock=$(lsof /var/lib/dpkg/lock)
if [ "$dpkgLock" ]
then
# file is locked
zenity --question --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>Installation manager is busy elsewhere</b></big>\n\nClick <b>Next</b> to force the installation manager to quit and continue" --width=600 --ok-label="Next" --cancel-label="Cancel"
case $? in
0)
# Next
# Kill process still locking us out of dpkg
sudo fuser -vk /var/lib/dpkg/lock
# Fix half installed packages if needed
sudo dpkg --configure -a
# Now continue installation
echo "# Installation manager closed"
;;
1)
# Cancel
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
exit
;;
-1)
echo "# An unexpected error has occurred."
exit
;;
esac
fi
# if dpkg not busy Remove old drivers
echo "# Removing old Drivers"
apt-get remove -y --purge fglrx fglrx-amdcccle fglrx-amdcccle-updates fglrx-updates fglrx-updates-dev fglrx-dev xorg-driver-fglrx 2>&1 | zenity --progress --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --text="Removing all previous AMD Catalyst™ driver software" --width=500 --auto-close --pulsate --no-cancel
echo "$logTime [UACI] Old Drivers removed" >> $logFile
fi
echo "90"; sleep 1
echo "# Ready to install the new AMD Catalyst™ Driver"
# Install new driver
zenity --question --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "Install the AMD Catalyst Drivers now ?" --width=500
if [ "$?" -eq "0" ]
then
# Present Terms and Conditions Agreement from AMD
# load file from same directory as program
zenity --text-info \
--title="AMD Software End User License Agreement" \
--filename="$amdCopyrightFile" \
--checkbox="I have read and accept the terms." \
--width=700 --height=600
case $? in
0)
echo "# Start installation!"
# next step
;;
1)
# Cancel
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nYou will need to manually install graphics drivers on this computer before you restart.\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
exit
;;
-1)
echo "# An unexpected error has occurred."
exit
;;
esac
# Install drivers
echo "# Preparing to install new AMD Catalyst™ Driver"
# Check for dpkg lock - must be sudo to use lsof
dpkgLock=$(lsof /var/lib/dpkg/lock)
if [ "$dpkgLock" ]
then
# file is locked
zenity --question --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "<big><b>Installation manager is busy elsewhere</b></big>\n\nClick <b>Next</b> to force the installation manager to quit and continue" --width=600 --height=180 --ok-label="Next" --cancel-label="Cancel"
case $? in
0)
# Next
# Kill process still locking us out of dpkg
sudo fuser -vk /var/lib/dpkg/lock
# Fix half installed packages if needed
sudo dpkg --configure -a
# Now continue installation
echo "# Installation manager closed"
;;
1)
# Cancel
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nYou will need to manually install graphics drivers on this computer before you restart.\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
exit
;;
-1)
echo "# An unexpected error has occurred."
exit
;;
esac
fi
# If dpkg not busy install drivers
echo "# Installing new AMD Catalyst™ Driver"
echo "$logTime [UACI] Installing new AMD Catalyst Driver" >> $logFile
dpkg -i *.deb 2>&1 | zenity --progress --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text="Installing $amdDriverSelect" --auto-close --no-cancel --pulsate --width=500
# Check if install was successful
checkFglrx=$(dpkg -s fglrx | grep -i "Status")
checkOk=$(echo "$checkFglrx" | grep -i -o "ok")
if [ ! "$checkOk" ]
then
zenity --warning --text="<big><b>Driver installation failed</b></big>\n\nYou will need to manually install graphics drivers on this computer before you restart.\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] [Error] Driver installation failed" >> $logFile
exit
fi
echo "# New AMD Catalyst™ Driver installed ok"
echo "$logTime [UACI] New AMD Catalyst™ Driver installed ok" >> $logFile
# Remove BETA logo if selected
if [ "$fileToDownload" = "$latestBetaDriver" ]
then
amdDriverFile=/usr/lib/fglrx/xorg/modules/drivers/fglrx_drv.so
for token in $amdDriverFile; do
for x in $(objdump -d $amdDriverFile | awk '/call/&&/EnableLogo/{print "\\x"$2"\\x"$3"\\x"$4"\\x"$5"\\x"$6}'); do
sed -i "s/$x/\x90\x90\x90\x90\x90/g" $amdDriverFile
done
done
fi
# Enable Video Hardware Acceleration
echo "# Video Hardware Acceleration"
zenity --question --title "The Fan Club - Ubuntu AMD Catalyst™ Install" --text "Enable Video Hardware Acceleration ?" --width=500 --height=180 --ok-label="Yes" --cancel-label="No"
if [ "$?" -eq "0" ]
then
# Install Video Hardware Acceleration
echo "$logTime [UACI] Installing Video Hardware Acceleration" >> $logFile
apt-get install -y xvba-va-driver libva-glx1 libva-egl1 vainfo 2>&1 | zenity --progress --title="The Fan Club - The Fan Club - Ubuntu AMD Catalyst™ Install" --text="Installing Video Hardware Acceleration ..." --width=500 --pulsate --no-cancel --auto-close
echo "# Video Hardware Acceleration enabled"
fi
# Done. Ask for Restart
zenity --question --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --text="<big><b>Installation completed successfully</b></big>\n\n\You need to restart your computer for the changes to take effect.\n\n\nRestart Now ?" --width=600
if [ "$?" -eq "0" ]
then
echo "100"
sudo reboot now
exit
fi
fi
# Check if Cancel was pressed
if [ "$?" -eq "1" ]
then
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nYou will need to manually install graphics drivers on this computer before you restart.\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] Driver installation cancelled" >> $logFile
exit
fi
# All Done
echo "$logTime [UACI] All Done" >> $logFile
echo "100"; sleep 1
echo "# Ubuntu AMD Catalyst™ Install completed"
# End of Main Zenity Code #
) | zenity --progress \
--title "The Fan Club - Ubuntu AMD Catalyst™ Install $tfcVersion" \
--text="Initialising Ubuntu AMD Catalyst™ Install" \
--auto-close \
--width=500
# Check if Cancel was pressed
if [ "$?" -eq "1" ]
then
zenity --warning --text="<big><b>Driver installation cancelled</b></big>\n\nThis application will now close." --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --width=500
echo "$logTime [UACI] Main Driver installation cancelled." >> $logFile
exit
fi
# All Done
zenity --info --title="The Fan Club - Ubuntu AMD Catalyst™ Install" --text="<big><b>Thank you for using this application</b></big>\n\nFor more information visit:\n\n<big><tt><a href='http://www.thefanclub.co.za/how-to/ubuntu-amd-catalyst-install'>www.thefanclub.co.za</a></tt></big>" --ok-label="Done"
exit
fkol k4 έγραψε:Άδεια δεν φαίνεται καν να έχει
fkol k4 έγραψε:Ναι, το ίδιο κάνει, με τη διαφορά πως αναγνωρίζει ποια κάρτα έχεις και κατεβάζει τον ανάλογο οδηγό.
Από ότι κοίταξα δεν είδα να λείπει κάτι. Για κάποιον αρχάριο φαίνεται καλή λύση.
sotos21 έγραψε:Δεν είναι αξιόπιστο καθόλου.
sotos21 έγραψε:Λάθος επιλογή, η σωστή επιλογή για την κάρτα που βρήκε, είναι οι 13.1 legacy( εννοείτε όχι στο ubuntu 13.10)