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

Diff of /trunk/x-setup

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

Revision 46 Revision 51
1#!/bin/bash 1#!/bin/bash
2# Copyright 1999-2004 Gentoo Technologies, Inc. 2# Copyright 1999-1999-2005 Gentoo Foundation
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.13 2005/04/12 21:25:21 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.14 2005/05/16 19:26:39 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"
10 exit 1 10 exit 1
11fi 11fi
12 12
13if [ -f /sbin/livecd-functions.sh ]
14then
15 source /sbin/livecd-functions.sh
16else
17 echo "ERROR: /sbin/livecd-functions.sh could not be loaded!"
18 exit 1
19fi
20
21livecd_check_root || exit 1
22
13#first, get paths right if we're getting started b4 login 23#first, get paths right if we're getting started b4 login
14source /etc/profile 24source /etc/profile
15 25
16echo "0" > /proc/sys/kernel/printk 26livecd_get_cmdline || exit 1
17CMDLINE="`cat /proc/cmdline`" 27
18for x in $CMDLINE 28for x in $CMDLINE
19do 29do
20 if [ "$x" = "agpgart" ] 30 if [ "$x" = "agpgart" ]
21 then 31 then
22 modprobe agpgart > /dev/null 2>&1 32 modprobe agpgart > /dev/null 2>&1
23 fi 33 fi
24done 34done
25 35
26no_gl() {
27 echo "No OpenGL-capable card found."
28 GLTYPE=xorg-x11
29}
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
41get_video_cards() {
42 VIDEO_CARDS=`/sbin/lspci | grep VGA`
43 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
44 if [ ${NUM_CARDS} -eq 1 ]; then
45 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"`
46 ATI=`echo ${VIDEO_CARDS} | grep "ATI Technologies"`
47 if [ -n "${NVIDIA}" ]; then
48 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}'`
49 if [ -n "${NVIDIA_CARD}" ]; then
50 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then
51 nv_gl
52 else
53 no_gl
54 fi
55 else
56 no_gl
57 fi
58 elif [ -n "${ATI}" ]; then
59 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)[0-9]+/ {print $1}'`
60 if [ `echo ${ATI_CARD} | grep S` ]; then
61 ATI_CARD_S=`echo ${ATI_CARD} | cut -dS -f2`
62 elif [ `echo ${ATI_CARD} | grep V` ]; then
63 ATI_CARD_V=`echo ${ATI_CARD} | cut -dV -f2`
64 else
65 ATI_CARD=`echo ${ATI_CARD} | cut -dR -f2`
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
73 else
74 no_gl
75 fi
76 else
77 no_gl
78 fi
79 fi
80}
81
82get_video_cards 36get_video_cards || exit 1
83 37
84if [ -x /usr/sbin/opengl-update-livecd ] 38if [ -x /usr/sbin/opengl-update-livecd ]
85then 39then
86 /usr/sbin/opengl-update-livecd $GLTYPE 40 /usr/sbin/opengl-update-livecd $GLTYPE
87elif [ -x /usr/sbin/opengl-update ] 41elif [ -x /usr/sbin/opengl-update ]

Legend:
Removed from v.46  
changed lines
  Added in v.51

  ViewVC Help
Powered by ViewVC 1.1.20