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

Diff of /trunk/x-setup

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

Revision 43 Revision 44
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.11 2005/03/01 01:26:08 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.12 2005/03/01 18:13:51 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"
26no_gl() { 26no_gl() {
27 echo "No OpenGL-capable card found." 27 echo "No OpenGL-capable card found."
28 GLTYPE=xorg-x11 28 GLTYPE=xorg-x11
29} 29}
30 30
31ati_gl() {
32 echo "ATI card detected."
33 GLTYPE=ati
34}
35
36nv_gl() {
37 echo "NVIDIA card detected."
38 GLTYPE=nvidia
39}
40
31get_video_cards() { 41get_video_cards() {
32 VIDEO_CARDS=`/sbin/lspci | grep VGA` 42 VIDEO_CARDS=`/sbin/lspci | grep VGA`
33 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l` 43 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
34 if [ ${NUM_CARDS} -eq 1 ]; then 44 if [ ${NUM_CARDS} -eq 1 ]; then
35 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"` 45 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"`
36 ATI=`echo ${VIDEO_CARDS} | grep "ATI Technologies"` 46 ATI=`echo ${VIDEO_CARDS} | grep "ATI Technologies"`
37 if [ -n "${NVIDIA}" ]; then 47 if [ -n "${NVIDIA}" ]; then
38 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}'` 48 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}'`
39 if [ -n "${NVIDIA_CARD}" ]; then 49 if [ -n "${NVIDIA_CARD}" ]; then
40 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then 50 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then
41 echo "NVIDIA card detected." 51 nv_gl
42 GLTYPE=nvidia
43 else 52 else
44 no_gl 53 no_gl
45 fi 54 fi
46 else 55 else
47 no_gl 56 no_gl
48 fi 57 fi
49 elif [ -n "${ATI}" ]; then 58 elif [ -n "${ATI}" ]; then
50 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)\d{3}/ {print $1}'` 59 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)[0-9]+/ {print $1}'`
51 if [ -n "${ATI_CARD}" ]; then 60 if [ `echo ${ATI_CARD} | grep S` ]; then
52 if [ `echo ${ATI_CARD} | cut -dS -f2` -ge 350 ] || \ 61 ATI_CARD_S=`echo ${ATI_CARD} | cut -dS -f2`
53 [ `echo ${ATI_CARD} | cut -dV -f2` -ge 250 ] || \ 62 elif [ `echo ${ATI_CARD} | grep V` ]; then
54 [ `echo ${ATI_CARD} | cut -dR -f2` -ge 200 ]; then 63 ATI_CARD_V=`echo ${ATI_CARD} | cut -dV -f2`
55 echo "ATI card detected."
56 GLTYPE=ati
57 else 64 else
58 no_gl 65 ATI_CARD=`echo ${ATI_CARD} | cut -dR -f2`
59 fi 66 fi
67 if [ -n "${ATI_CARD_S}" ] && [ ${ATI_CARD_S} -ge 350 ]; then
68 ati_gl
69 elif [ -n "${ATI_CARD_V}" ] && [ ${ATI_CARD_V} -ge 250 ]; then
70 ati_gl
71 elif [ -n "${ATI_CARD}" ] && [ ${ATI_CARD} -ge 200 ]; then
72 ati_gl
60 else 73 else
61 no_gl 74 no_gl
62 fi 75 fi
63 else 76 else
64 no_gl 77 no_gl
69get_video_cards 82get_video_cards
70 83
71if [ -x /usr/sbin/opengl-update-livecd ] 84if [ -x /usr/sbin/opengl-update-livecd ]
72then 85then
73 /usr/sbin/opengl-update-livecd $GLTYPE 86 /usr/sbin/opengl-update-livecd $GLTYPE
87elif [ -x /usr/sbin/opengl-update ]
88then
89 opengl-update $GLTYPE
74else 90else
75 opengl-update $GLTYPE 91 echo "ERROR: no opengl-update script can be located"
92 exit 1
76fi 93fi
77 94
78#exec /usr/bin/xinit 95#exec /usr/bin/xinit

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

  ViewVC Help
Powered by ViewVC 1.1.20