forked from imageguy/fglrx-for-Fedora
-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_install
52 lines (41 loc) · 965 Bytes
/
do_install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#! /bin/sh
# extracts, patches and installs the fglrx. Will select the right patch for
# the kernel version
# must be run as root
if [[ `id -u` -ne "0" ]]
then
echo 'must be run as root (do not use sudo)'
exit 1
fi
k_ver=`uname -r`
echo kernel version: $k_ver
if [[ $k_ver < "4.6.4" ]]
then
patchfile=fglrx_kernel_4.4.diff
elif [[ $k_ver < "4.7.0" ]]
then
patchfile=fglrx_kernel_4.6.diff
elif [[ $k_ver < "4.9.0" ]]
then
patchfile=fglrx_kernel_4.7.diff
else
patchfile=fglrx_kernel_4.9.diff
fi
if [ -f $patchfile ]
then
echo using patch $patchfile
else
echo missing patch file: $patchfile
exit 2
fi
echo cleaning any old fglrx-install directories
\rm -rf fglrx-install.*
# extract
./amd-driver-installer-15.302-x86.x86_64.run --extract
install_dir=fglrx-install.*
echo using install directory $install_dir
# so the non-root can work with it
chmod -R 777 $install_dir
cd $install_dir
patch -p1 < ../$patchfile
./ati-installer.sh 15.302 --install