All pastes #463760 Raw Edit

Someone

public text v1 · immutable
#463760 ·published 2007-04-29 03:09 UTC
rendered paste body
#!/bin/bash

vdir=`dirname $0`
. $vdir/vasm-functions
check_root
        
if [ $DISPLAY ]; then
  DIALOG=Xdialog
else
  DIALOG=dialog
fi

if ( lspci | grep -i vga | grep -iq "geforce " ) then
       if ( ls /var/log/packages | grep -i nvidia ) then
         removepkg nvidia* >/dev/null
       fi
fi

kernel=`uname -r`
drivers="`ls /usr/src/vl-pkgs/fglrx*$kernel*tlz 2>/dev/null`"
     j="0"
     for i in $drivers; do
         driv[$j]="$i"
         j=`expr $j + 1`
     done

 $DIALOG --title  "ATI Driver Selection" --menu \
   "     The system has detected an ATI chipset for video display. The system defaults to the standard (ati) driver which is generic and non-proprietary. This driver works with most radeon cards but has limited 3D capability. There are other drivers available from ATI that are proprietary and supply full funtionality. Which ATI Driver would you like to install?\n
    Choose the Driver you would like to use!" 20 71 4\
    "FGLRX" "This is the Proprietary fglrx driver" \
    "radeon" "This is the opensource radeon driver" \
    
    2> $freply
     result=$?
     if [ $result != 0 ];then
       exit 0
     fi
     DRIVER="`cat $freply`"
     #echo $DRIVER
     case "$DRIVER" in
      "radeon") 
         sed s'/\"ati\"/\"radeon\"/'g /etc/X11/xorg.conf > /etc/X11/xorg.conf.new && \
         mv /etc/X11/xorg.conf.new /etc/X11/xorg.conf
         exit 0
       ;;
      "FGLRX")
       /sbin/installpkg /usr/src/vl-pkgs/fglrx*$kernel*tlz
       result=$?
       if [ $result = 0 ];then
         sed s'/\"ati\"/\"fglrx\"/'g /etc/X11/xorg.conf > /etc/X11/xorg.conf.new && \
         mv /etc/X11/xorg.conf.new /etc/X11/xorg.conf
         depmod -aq
         exit 0
       fi
       exit 1
       ;;
      esac
  fi