updated on Wed Jan 18 08:00:29 UTC 2012
[aur-mirror.git] / catalyst-hook / catalyst-hook.install
blob9b5161718a61be2ee9170473d75e944d9f0f6380
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 "'linux-headers' in first place"
8     echo "----------------------------------------------------------------"
9     echo "Provide headers to your kernel ie:"
10     echo "linux-headers if you are using linux."
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/vmlinuz-linux 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 captain_hook(){
26     # add hook fglrx to mkiniticpio
27     hooks=$(grep ^HOOKS etc/mkinitcpio.conf | grep fglrx)
28     if [ "$hooks" = "" ]; then
29         sed 's/^HOOKS="\([^"]*\)"/HOOKS="\1 fglrx"/' -i etc/mkinitcpio.conf
30     fi
31     #add linux-headers to SyncFirst array of pacman.conf
32     heads=$(grep ^SyncFirst etc/pacman.conf | grep linux-headers)
33     if [ "$heads" = "" ]; then
34         sed '/^SyncFirst/s|$| linux-headers|' -i etc/pacman.conf
35     fi
39 post_install() {
40     # remove older heads
41     sed '/^SyncFirst/s/ *kernel26-headers//' -i etc/pacman.conf
43     captain_hook
44     usr/bin/catalyst_build_module
45     whisperer
48 post_upgrade() {
49     captain_hook
50     usr/bin/catalyst_build_module
51     whisperer
54 pre_remove(){
55     usr/bin/catalyst_build_module remove_all
58 post_remove() {
60     # remove hook fglrx
61     sed '/^HOOKS/s/ *fglrx//' -i etc/mkinitcpio.conf
62     # remove heads
63     sed '/^SyncFirst/s/ *linux-headers//' -i etc/pacman.conf
64     # If the symlink is dead, remove it
66     # remove log
67     rm -f var/log/catalyst-install.log
69     echo "----------------------------------------------------------------"
70     echo "Don't forget to remove fglrx from MODULES array of /etc/rc.conf"
71     echo "----------------------------------------------------------------"