Go Back   MEPISlovers Forum > How-To's and Scripts > Scripts
Register FAQTop Statistics Today's Posts Donate Gallery
Gallery
Mepis Art Gallery
My images
Upload an image
View all users images
Post New Thread  Reply
ATI fglrx-driver install script

 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-02-2008, 11:13 PM
yamal yamal is offline
Luctor et Emergo
 
Join Date: Jul 2006
Posts: 846
Thanks: 7
Thanked 252 Times in 187 Posts
Rep Power: 75
Reputation: 1760
yamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant future
Default ATI fglrx-driver install script

CHANGES:

incorporated a patch for the 2.6.27 kernel-<stepped down patch for 8.11/8.12>
dealt with "cannot stat /usr/lib/libGL.so.1.2"
added ati-config command to change xorg.conf, if needed
-------------------------------------------------------------------------
http://ati.amd.com/support/driver.html

With the latest fglrx driver the debs come rolling out themselves:
So you can install them easily with your package-manager, however you still have to make the driver kernel.
Here is how to automate the whole install process:

1. download the driver run file
2. open console in the folder where the driver run file is (F4).
3. run script as root

Code:
#!/bin/bash

if [ `id -u` != "0" ]; then echo "You should run this as root"; exit; fi

username="nobody"
if [ $(pwd | cut -d/ -f2) = "home" ]; then username=$(pwd | cut -d/ -f3)
else
if [ $(who | head -1 | cut -d" " -f1) == $(who | tail -1 | cut -d" " -f1) ]; then username=$(users); fi
fi
if [ $username = "nobody" ]; then
dialog --inputbox "Enter your username:" 10 80 2>/tmp/username
username=$(grep [A-Za-z0-9] /tmp/username)
fi

ls | grep ati-driver-installer-*-x86.x86_64.run
if [ $? = 1 ]; then echo "no run file found in $PWD"; exit; fi
DIRNAZ=$(basename ati-driver-installer-*-x86.x86_64.run | cut -d. -f1)
mkdir /home/$username/$DIRNAZ
cp ati-driver-installer-*-x86.x86_64.run /home/$username/$DIRNAZ

module-assistant prepare
#rm /usr/src/linux
ln -s /usr/src/linux-headers-$(uname -r) /usr/src/linux

dialog --menu "Choose your distro:" 11 40 4 etch Mepis7.0 lenny Mepis8.0 sid Sid 2>/tmp/distro
if [ $? = "1" ]; then echo "aborting"; exit; fi
DISTRO="`cat /tmp/distro`"

cd /home/$username/$DIRNAZ
# uninstall evt stuff installed by the run file sec
sh /usr/share/ati/fglrx-uninstall.sh
# uninstall previous fglrx-driver to prevent overwrite error
echo "removing the old drivers"
apt-get -y remove --purge  fglrx-kernel-* fglrx-driver fglrx-source
# restore diversion mess
apt-get -y --reinstall install libgl1-mesa-glx
# change evt.to lenny or sid
sh ati-driver-installer-*-x86.x86_64.run --buildpkg Debian/$DISTRO
dpkg -i fglrx-driver_*.deb fglrx-kernel-src_*.deb
apt-get -f install

pushd /usr/src
# remove evt crap from previous fglrx kernel
rm -r /usr/src/modules/fglrx fglrx-kernel-*.deb
tar xjf fglrx.tar.bz2 #  --not-unpack 

# 2.6.27.patch
if [ $DISTRO = "lenny" ]; then
echo "--- /usr/src/modules/fglrx/firegl_public.c	2008-12-11 11:41:46.000000000 +0100
+++ modules/fglrx/firegl_public.c	2008-12-11 10:30:44.000000000 +0100
@@ -241,7 +241,7 @@
 const char BUILD_KERNEL_HAS_MODVERSIONS_CLEARED;
 #endif
 
-#ifdef __SMP__
+#ifdef CONFIG_SMP
 const unsigned long KCL_SYSINFO_SmpSupport = 1;
 const char BUILD_KERNEL_HAS_SMP_SET;
 #else
@@ -2499,7 +2499,7 @@
 
 /*****************************************************************************/
 
-#ifdef __SMP__
+#ifdef CONFIG_SMP
 static atomic_t cpus_waiting;
 
 static void deferred_flush(void* contextp)
@@ -2515,7 +2515,7 @@
 	while (atomic_read(&cpus_waiting) > 0)
 		barrier();
 }
-#endif /* __SMP__ */
+#endif /* CONFIG_SMP */
 
 /** \brief Run a function on all other CPUs.
  * \param func The function to run.
@@ -2531,7 +2531,7 @@
 
 int ATI_API_CALL KCL_MEM_FlushCpuCaches(void)
 {
-#ifdef __SMP__
+#ifdef CONFIG_SMP
     /* write back invalidate all other CPUs (exported by kernel) */
 	if (KCL_SmpCallFunction(deferred_flush, NULL, 1, 0) != 0)
 		panic(\"timed out waiting for the other CPUs!\n\");
@@ -2547,7 +2547,7 @@
 
 	while (atomic_read(&cpus_waiting) > 0)
 		barrier();
-#else /* !__SMP__ */
+#else /* !CONFIG_SMP */
 #if defined(__i386__) || defined(__x86_64__)
 	asm volatile (\"wbinvd\":::\"memory\");
 #elif defined(__alpha__) || defined(__sparc__)
@@ -2555,7 +2555,7 @@
 #else
 #error \"Please define flush_cache for your architecture.\"
 #endif
-#endif /* !__SMP__ */
+#endif /* !CONFIG_SMP */
 
     //for kernel 2.6.25, tlb_flush has been included when calling set_pages_*.
     #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
" > /usr/src/modules/fglrx/ati-drivers-2.6.27.patch
patch -p0 < /usr/src/modules/fglrx/ati-drivers-2.6.27.patch
fi
# End patch

export CC=$(cat /proc/version | awk '{print "gcc-"$9-0}')
m-a --text-mode --not-unpack build fglrx
dpkg -i fglrx-kernel-*.deb
mv fglrx-kernel-*.deb /home/$username/$DIRNAZ
echo "kernel deb moved to"
popd
# clean up to prevent future failures
rm -r /usr/src/modules/fglrx
rm ati-driver-installer-*-x86.x86_64.run
cd ..
chown -R $username:users /home/$username/$DIRNAZ
cat /etc/X11/xorg.conf | grep '^\s*[^#]*fglrx'  || aticonfig --initial --input=/etc/X11/xorg.conf
apt-get -y remove fglrx-kernel-src
Download:
http://www.xs4all.nl/~beukrode/yamal...lrx-install.sh
Make executable by: right click>properties>permissions>check executable

At the end everything should be installed, driver and driver-kernel, and deb files should be found in a folder named after the installer, for example ati-driver-installer-8-10-x86.
Also xorg.conf should be set to use the fglrx driver.

Last edited by yamal : 12-11-2008 at 06:18 AM.
Reply With Quote
The Following 7 Users Say Thank You to yamal For This Useful Post:
  #2  
Old 02-02-2008, 11:28 PM
Saist Saist is offline
Max Level Fahr Tank
 
Join Date: Jul 2006
Posts: 3,802
Thanks: 236
Thanked 1,330 Times in 862 Posts
Rep Power: 159
Reputation: 7134
Saist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond reputeSaist has a reputation beyond repute
Default

okay. stupid question time.

What needs to be added to a default installation of Mepis 7 in order for the script to work?

Right off hand I'm thinking kernel headers and g++ to start... anything else?
__________________
Slow, lazy, but still around: Call me if ya need help
http://zerias.blogspot.com
http://www.mepisguides.com
Biting the Bullet: Help
Want to buy Mepis Based Computer? Ask me!
Reply With Quote
  #3  
Old 02-02-2008, 11:39 PM
yamal yamal is offline
Luctor et Emergo
 
Join Date: Jul 2006
Posts: 846
Thanks: 7
Thanked 252 Times in 187 Posts
Rep Power: 75
Reputation: 1760
yamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant futureyamal has a brilliant future
Default

It installs the kernels headers and maybe one or two extra packages(build-essential) from itself.
You dont need to install stuff first, module-assistant is standard installed.

I'm pretty sure it is.
I you want to use it off-line(which was not my intention) then you must have the kernel headers already installed and prob also comment out some lines.

Last edited by yamal : 02-03-2008 at 12:04 AM.
Reply With Quote
  #4  
Old 02-03-2008, 05:00 PM
namida12 namida12 is offline
AMD Athlon 11 X4 630
 
Join Date: Apr 2007
Location: Las Vegas, NV
Gender: Male
Posts: 1,770
Thanks: 452
Thanked 359 Times in 278 Posts
Rep Power: 78
Reputation: 2061
namida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud of
Default

Quote:
Originally Posted by yamal View Post
With the latest fglrx driver the debs come rolling out themselves:
http://ati.amd.com/support/driver.html

So you can install them easily with your package-manager, however you still have to make the driver kernel.
Here is how to automate the whole install process:

1. download the driver run file
2. open console in the folder where the driver run file is
3. run script as root

Code:
#!/bin/sh


if [ `whoami` != "root" ]; then
echo "You should run this as root"
exit
fi
mkdir ati_debs_72
cp ati-driver-installer-*-x86.x86_64.run ./ati_debs_72 || exit
cd ./ati_debs_72
# uninstall previous fglrx-driver to prevent overwrite error
echo "removing the old drivers"
apt-get remove --purge  fglrx-kernel-* fglrx-driver
# change evt.to lenny or sid
sh ati-driver-installer-*-x86.x86_64.run --buildpkg Debian/etch
dpkg -i fglrx-driver_*.deb
# install eventual missing dependencies
apt-get -f install
# making and installing the ati kernel
dpkg -i fglrx-kernel-src_*.deb
apt-get -f install
apt-get install linux-headers-`uname -r`
cd /usr/src
# remove evt crap from previous fglrx kernel
rm -r /usr/src/modules/fglrx
mv fglrx-kernel-*.deb $OLDPWD
module-assistant prepare
module-assistant a-i fglrx
# clean up to prevent future failures
rm -r /usr/src/modules/fglrx
mv fglrx-kernel-*.deb $OLDPWD
echo "kernel deb(s) moved to"
cd -
rm ati-driver-installer-*-x86.x86_64.run
At the end everything should be installed, driver and driver-kernel.
I did let apt still ask, and did not force a yes, just to be sure.

This does not edit xorg.conf to choose the fglrx-driver, so you should have done a previous install with the Mepis X-windows assistant.
Here is my posting, it seems to abort, and I can do a "Y" or "n"

Blue11@mepis1:~$ su
Password:
root@mepis1:/home/Blue11# #!/bin/sh
root@mepis1:/home/Blue11#
root@mepis1:/home/Blue11#
root@mepis1:/home/Blue11# if [ `whoami` != "root" ]; then
> echo "You should run this as root"
> exit
> fi
root@mepis1:/home/Blue11# mkdir ati_debs_72
mkdir: cannot create directory `ati_debs_72': File exists
root@mepis1:/home/Blue11# cp ati-driver-installer-*-x86.x86_64.run ./ati_debs_72 || exit
root@mepis1:/home/Blue11# cd ./ati_debs_72
root@mepis1:/home/Blue11/ati_debs_72# # uninstall previous fglrx-driver to prevent overwrite error
root@mepis1:/home/Blue11/ati_debs_72# echo "removing the old drivers"
removing the old drivers
root@mepis1:/home/Blue11/ati_debs_72# apt-get remove --purge fglrx-kernel-* fglrx-driver
Reading package lists... Done
Building dependency tree... Done
Note, selecting fglrx-kernel-2.6.22-1-mepis64-smp for regex 'fglrx-kernel-*'
Note, selecting fglrx-kernel-src for regex 'fglrx-kernel-*'
Note, selecting fglrx-kernel for regex 'fglrx-kernel-*'
Note, selecting fglrx-kernel-2.6.22-1-mepis64-smp instead of fglrx-kernel
The following packages will be REMOVED:
fglrx-driver* fglrx-kernel-2.6.22-1-mepis64-smp* fglrx-kernel-src*
0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 29.1MB disk space will be freed.
Do you want to continue [Y/n]? Y
Abort.
root@mepis1:/home/Blue11/ati_debs_72#

If I do a "n" I get the same response - abort

JR
Reply With Quote
  #5  
Old 02-03-2008, 05:08 PM
Flashback Flashback is offline
The Ironic Catfish
 
Join Date: Nov 2006
Gender: Male
Posts: 485
Thanks: 192
Thanked 106 Times in 68 Posts
Rep Power: 56
Reputation: 618
Flashback is a name known to allFlashback is a name known to allFlashback is a name known to allFlashback is a name known to allFlashback is a name known to allFlashback is a name known to all
Default

Namida, save the script he posted as install.sh, become root, type "chmod +x install.sh", then ./install.sh.
__________________

Reply With Quote
The Following User Says Thank You to Flashback For This Useful Post:
  #6  
Old 02-03-2008, 05:42 PM
namida12 namida12 is offline
AMD Athlon 11 X4 630
 
Join Date: Apr 2007
Location: Las Vegas, NV
Gender: Male
Posts: 1,770
Thanks: 452
Thanked 359 Times in 278 Posts
Rep Power: 78
Reputation: 2061
namida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud of
Default

Quote:
Originally Posted by Flashback View Post
Namida, save the script he posted as install.sh, become root, type "chmod +x install.sh", then ./install.sh.
I copied the script, saved it in kwrite...

Please excuse my lack of knowledge,
1. open text file in kwrite then save as, install.sh to home folder with Kwrite?
2. open home folder > open terminal> type su> type password> type chmod +x install.sh> type /install.sh

And watch it work?

JR

Last edited by namida12 : 02-03-2008 at 05:43 PM. Reason: spelling
Reply With Quote
  #7  
Old 02-03-2008, 05:50 PM
richb's Avatar
richb richb is offline
Super Moderator
 
Join Date: Jul 2006
Location: Rochester NY
Gender: Male
Posts: 7,281
Thanks: 907
Thanked 1,929 Times in 1,411 Posts
Rep Power: 230
Reputation: 10805
richb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond reputerichb has a reputation beyond repute
Default

My card`is a 9100 not supported by fglrx, but I grabbed the correct driver for it off the ATI site. I assume this script will work for it as well?
__________________

Guide - How to Ask for Help
Link to Wiki
Rich
Danum Canteras-3C 32 bit: Dell 8100: 1.0 Ghz Desktop
Mepis 8.5 Final 64 bit: Acer Laptop 7520: AMD Turion 64 X2, nVidia 8400m G
Mepis 8.4.99 Beta RC2:
Fujitsu Laptop, Pentium M
Reply With Quote
  #8  
Old 02-03-2008, 06:25 PM
Flashback Flashback is offline
The Ironic Catfish
 
Join Date: Nov 2006
Gender: Male
Posts: 485
Thanks: 192
Thanked 106 Times in 68 Posts
Rep Power: 56
Reputation: 618
Flashback is a name known to allFlashback is a name known to allFlashback is a name known to allFlashback is a name known to allFlashback is a name known to allFlashback is a name known to all
Default

Quote:
Originally Posted by namida12 View Post
I copied the script, saved it in kwrite...

Please excuse my lack of knowledge,
1. open text file in kwrite then save as, install.sh to home folder with Kwrite?
2. open home folder > open terminal> type su> type password> type chmod +x install.sh> type /install.sh

And watch it work?

JR
./install.sh, but other than that it'll all work.
Reply With Quote
  #9  
Old 02-03-2008, 09:45 PM
gwrench gwrench is offline
MEPIS Rules!
 
Join Date: Nov 2007
Location: Colorado, USA
Gender: Male
Posts: 60
Thanks: 35
Thanked 16 Times in 15 Posts
Rep Power: 33
Reputation: 90
gwrench is on a distinguished road
Default

I'm close to getting this to work but I get an md5 sum error. Am I saving the file improperly?
Reply With Quote
  #10  
Old 02-04-2008, 01:10 AM
namida12 namida12 is offline
AMD Athlon 11 X4 630
 
Join Date: Apr 2007
Location: Las Vegas, NV
Gender: Male
Posts: 1,770
Thanks: 452
Thanked 359 Times in 278 Posts
Rep Power: 78
Reputation: 2061
namida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud ofnamida12 has much to be proud of
Default

Quote:
Originally Posted by Flashback View Post
./install.sh, but other than that it'll all work.
OK... seems nothing is easy for me...

lots of things took place until:

Done with /usr/src/fglrx-kernel-2.6.22-1-mepis64-smp_8.452.1-1+2.6.22-14mepis1_a md64.deb .
dpkg -Ei /usr/src/fglrx-kernel-2.6.22-1-mepis64-smp_8.452.1-1+2.6.22-14mepis1_am d64.deb
dpkg: status database area is locked by another process

I: Direct installation failed, trying to post-install the dependencies

apt-get -f install
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavail able)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another proc ess using it?
kernel deb(s) moved to
/home/Blue11/ati_debs_72
root@mepis1:/home/Blue11#

Guess - I now need some real assistance?

JR
Reply With Quote
Post New Thread  Reply

  MEPISlovers Forum > How-To's and Scripts > Scripts


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 10:52 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2007-2010 MEPISlovers.org