All pastes #455869 Raw Edit

Someone

public text v1 · immutable
#455869 ·published 2007-04-24 14:32 UTC
rendered paste body
#!/bin/bash

vdir=`dirname $0`
. $vdir/vasm-functions
check_root

if [ $DISPLAY ]; then
  DIALOG=Xdialog
else
  DIALOG=dialog
fi

kernel=`uname -r`
drivers="`ls /usr/src/vl-pkgs/new-fglrx*$kernel*tlz 1>/dev/null`"
drivers="`ls /usr/src/vl-pkgs/old-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\
    "AUTOCONFIG" "This is the opensource ati driver" \
    "FGLRX-NEW" "This is for newer ati cards above 9700 series" \
    "FGLRX-OLD" "This is for older ati cards below 9600 series" \
    2> $freply
     result=$?
     if [ $result != 0 ];then
       exit 0
     fi
     DRIVER="`cat $freply`"
     case "$DRIVER" in
      "AUTOCONFIG")
         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-NEW")
       /sbin/installpkg /usr/src/vl-pkgs/new-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
     "FGLRX-OLD")
       /sbin/installpkg /usr/src/vl-pkgs/old-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 2
       ;;
      esac
  fi