updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / catalyst-firepro / catalyst-firepro.install
blob73d00c47a32e7809473308b388a88d23c30b87d4
2 whisperer(){
3     echo "----------------------------------------------------------------"
4     echo "Automatic re-compilation is enabled now."
5     echo "----------------------------------------------------------------"
6     echo "Answer 'Yes' whenever pacman ask you about updating"
7     echo "'kernel26-headers' in first place"
8     echo "----------------------------------------------------------------"
9     echo "Provide headers to your kernel ie:"
10     echo "kernel26-headers if you are using kernel26."
11     echo "Most of custom kernels provides own headers."
12     echo "----------------------------------------------------------------"
13     echo "Add nomodeset to your kernel line in /boot/grub/menu.lst , ie.:"
14     echo "kernel /boot/vmlinuz26 root=/dev/sda1 ro nomodeset"
15     echo "---------------------------------------- ^^^^^^^^^ -------------"
16     echo "If experiencing problems with building module or using more than"
17     echo "one kernel use catalyst_build_module command as root, more info:"
18     echo "# catalyst_build_module help"
19     echo "- ^^^^^^^^^^^^^^^^^^^^^ ----------------------------------------"
20     echo "For more info and more troubleshooting visit:"
21     echo "http://wiki.archlinux.org/index.php/ATI_Catalyst"
22     echo "----------------------------------------------------------------"
25 check_libdri_so(){
26     if [ ! -e usr/lib/xorg/modules/extensions/libdri.so ]; then
27         ln -sf usr/lib/xorg/modules/extensions/libdri.xorg usr/lib/xorg/modules/extensions/libdri.so
28     fi
31 captain_hook(){
32     # add hook fglrx to mkiniticpio
33     hooks=$(grep ^HOOKS etc/mkinitcpio.conf | grep fglrx)
34     if [ "$hooks" = "" ]; then
35         sed 's/^HOOKS="\([^"]*\)"/HOOKS="\1 fglrx"/' -i etc/mkinitcpio.conf
36     fi
37     #add kernel26-headers to SyncFirst array of pacman.conf
38     heads=$(grep ^SyncFirst etc/pacman.conf | grep kernel26-headers)
39     if [ "$heads" = "" ]; then
40         sed '/^SyncFirst/s|$| kernel26-headers|' -i etc/pacman.conf
41     fi
44 post_install() {
45     captain_hook
46     whisperer
47     check_libdri_so
48     usr/bin/catalyst_build_module
51 post_upgrade() {
52     captain_hook
53     whisperer
54     check_libdri_so
55     usr/bin/catalyst_build_module
58 pre_remove(){
59     usr/bin/catalyst_build_module remove_all
62 post_remove() {
63     # remove hook fglrx
64     sed '/^HOOKS/s/ *fglrx//' -i etc/mkinitcpio.conf
65     # remove heads
66     sed '/^SyncFirst/s/ *kernel26-headers//' -i etc/pacman.conf
67     # If the symlink is dead, remove it
69     # remove log
70     rm -f var/log/catalyst-install.log
72     echo "----------------------------------------------------------------"
73     echo "Don't forget to remove fglrx from MODULES array of /etc/rc.conf"
74     echo "----------------------------------------------------------------"