/[livecd-tools]/trunk/x-setup
Gentoo

Diff of /trunk/x-setup

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 32 Revision 33
1#!/bin/bash 1#!/bin/bash
2# Copyright 1999-2004 Gentoo Technologies, Inc. 2# Copyright 1999-2004 Gentoo Technologies, Inc.
3# Distributed under the terms of the GNU General Public License v2 3# Distributed under the terms of the GNU General Public License v2
4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.5 2005/02/03 12:25:48 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.6 2005/02/03 15:22:36 wolf31o2 Exp $
5 5
6# Check for an xorg.conf 6# Check for an xorg.conf
7if [ ! -e /etc/X11/xorg.conf ] 7if [ ! -e /etc/X11/xorg.conf ]
8then 8then
9 echo "ERROR: /etc/X11/xorg.conf cannot be found! Exiting" 9 echo "ERROR: /etc/X11/xorg.conf cannot be found! Exiting"
21 then 21 then
22 modprobe agpgart > /dev/null 2>&1 22 modprobe agpgart > /dev/null 2>&1
23 fi 23 fi
24done 24done
25 25
26GLTYPE=nvidia 26get_video_cards() {
27#now, for the key component :) 27 VIDEO_CARDS=`/sbin/lspci | grep VGA`
28modprobe nvidia > /dev/null 2>&1 28 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
29if [ "`lsmod | cut -f1 -d\" \" | grep ^nvidia$`" = "nvidia" ] 29 if [ ${NUM_CARDS} -eq 1 ]
30then
31 echo "NVIDIA driver loaded."
32else
33 modprobe fglrx > /dev/null 2>&1
34 if [ "`lsmod | cut -f1 -d\" \" | grep ^fglrx$`" = "fglrx" ]
35 then 30 then
36 echo "ATI driver loaded." 31 NVIDIA=`echo ${VIDEO_CARDS} | grep NV`
32 ATI=`echo ${VIDEO_CARDS} | grep "\(R2.*\|R3.*\)"`
33 if [ -z "${NVIDIA}" ]
34 then
35 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}' | cut -dV -f2`
36 if [ ${NVIDIA_CARD} -ge 4 ]
37 then
38 echo "NVIDIA card detected."
39 GLTYPE=nvidia
40 else
41 echo "NVIDIA card is too old for OpenGL."
42 GLTYPE=xorg-x11
43 fi
44 elif [ -z "${ATI}" ]
45 then
46 echo "ATI card detected."
37 GLTYPE=ati 47 GLTYPE=ati
38 else 48 else
39 #echo "**********************************************************" 49 echo "ATI card is too old for OpenGL."
40 #echo "NVIDIA or ATI drivers unable to load; aborting." 50 GLTYPE=xorg-x11
41 #echo "This demo requires modern NVIDIA or ATI graphics hardware." 51 fi
42 #echo "**********************************************************" 52 else
43 echo "" 53 echo "No OpenGL-capable card found."
44 if [ -e /proc/splash ]
45 then
46 #echo "*******************************"
47 #echo "Entering Vesa browser-only mode"
48 #echo "*******************************"
49 #sleep 3
50 GLTYPE=xorg-x11 54 GLTYPE=xorg-x11
51 fi 55 fi
52 fi 56 fi
57}
53 58
54fi 59get_video_cards
60
55if [ -x /usr/sbin/opengl-update-livecd ] 61if [ -x /usr/sbin/opengl-update-livecd ]
56then 62then
57 /usr/sbin/opengl-update-livecd $GLTYPE 63 /usr/sbin/opengl-update-livecd $GLTYPE
58else 64else
59 opengl-update $GLTYPE 65 opengl-update $GLTYPE

Legend:
Removed from v.32  
changed lines
  Added in v.33

  ViewVC Help
Powered by ViewVC 1.1.20