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

Diff of /trunk/x-setup

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

Revision 41 Revision 43
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.10 2005/02/17 13:45:22 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.11 2005/03/01 01:26:08 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
26no_gl() {
27 echo "No OpenGL-capable card found."
28 GLTYPE=xorg-x11
29}
30
26get_video_cards() { 31get_video_cards() {
27 VIDEO_CARDS=`/sbin/lspci | grep VGA` 32 VIDEO_CARDS=`/sbin/lspci | grep VGA`
28 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l` 33 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
29 if [ ${NUM_CARDS} -eq 1 ]; then 34 if [ ${NUM_CARDS} -eq 1 ]; then
30 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"` 35 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"`
34 if [ -n "${NVIDIA_CARD}" ]; then 39 if [ -n "${NVIDIA_CARD}" ]; then
35 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then 40 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then
36 echo "NVIDIA card detected." 41 echo "NVIDIA card detected."
37 GLTYPE=nvidia 42 GLTYPE=nvidia
38 else 43 else
39 echo "No OpenGL-capable card found." 44 no_gl
40 GLTYPE=xorg-x11
41 fi 45 fi
42 else 46 else
43 echo "No OpenGL-capable card found." 47 no_gl
44 GLTYPE=xorg-x11
45 fi 48 fi
46 elif [ -n "${ATI}" ]; then 49 elif [ -n "${ATI}" ]; then
47 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)\d{3}/ {print $1}'` 50 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)\d{3}/ {print $1}'`
48 if [ -n "${ATI_CARD}" ]; then 51 if [ -n "${ATI_CARD}" ]; then
49 if [ `echo ${ATI_CARD} | cut -dS -f2` -ge 350 ] || \ 52 if [ `echo ${ATI_CARD} | cut -dS -f2` -ge 350 ] || \
50 [ `echo ${ATI_CARD} | cut -dV -f2` -ge 250 ] || \ 53 [ `echo ${ATI_CARD} | cut -dV -f2` -ge 250 ] || \
51 [ `echo ${ATI_CARD} | cut -dR -f2` -ge 200 ]; then 54 [ `echo ${ATI_CARD} | cut -dR -f2` -ge 200 ]; then
52 echo "ATI card detected." 55 echo "ATI card detected."
53 GLTYPE=ati 56 GLTYPE=ati
54 else 57 else
55 echo "No OpenGL-capable card found." 58 no_gl
56 GLTYPE=xorg-x11
57 fi 59 fi
58 else 60 else
59 echo "No OpenGL-capable card found." 61 no_gl
60 GLTYPE=xorg-x11
61 fi 62 fi
62 else 63 else
63 echo "No OpenGL-capable card found." 64 no_gl
64 GLTYPE=xorg-x11
65 fi 65 fi
66 fi 66 fi
67} 67}
68 68
69get_video_cards 69get_video_cards

Legend:
Removed from v.41  
changed lines
  Added in v.43

  ViewVC Help
Powered by ViewVC 1.1.20