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

Contents of /trunk/x-setup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 43 - (show annotations) (download)
Tue Mar 1 01:26:08 2005 UTC (9 years, 6 months ago) by wolf31o2
File size: 1832 byte(s)
Making use of a no_gl function, rather than repeating code.

1 #!/bin/bash
2 # Copyright 1999-2004 Gentoo Technologies, Inc.
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 $
5
6 # Check for an xorg.conf
7 if [ ! -e /etc/X11/xorg.conf ]
8 then
9 echo "ERROR: /etc/X11/xorg.conf cannot be found! Exiting"
10 exit 1
11 fi
12
13 #first, get paths right if we're getting started b4 login
14 source /etc/profile
15
16 echo "0" > /proc/sys/kernel/printk
17 CMDLINE="`cat /proc/cmdline`"
18 for x in $CMDLINE
19 do
20 if [ "$x" = "agpgart" ]
21 then
22 modprobe agpgart > /dev/null 2>&1
23 fi
24 done
25
26 no_gl() {
27 echo "No OpenGL-capable card found."
28 GLTYPE=xorg-x11
29 }
30
31 get_video_cards() {
32 VIDEO_CARDS=`/sbin/lspci | grep VGA`
33 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
34 if [ ${NUM_CARDS} -eq 1 ]; then
35 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"`
36 ATI=`echo ${VIDEO_CARDS} | grep "ATI Technologies"`
37 if [ -n "${NVIDIA}" ]; then
38 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}'`
39 if [ -n "${NVIDIA_CARD}" ]; then
40 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then
41 echo "NVIDIA card detected."
42 GLTYPE=nvidia
43 else
44 no_gl
45 fi
46 else
47 no_gl
48 fi
49 elif [ -n "${ATI}" ]; then
50 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)\d{3}/ {print $1}'`
51 if [ -n "${ATI_CARD}" ]; then
52 if [ `echo ${ATI_CARD} | cut -dS -f2` -ge 350 ] || \
53 [ `echo ${ATI_CARD} | cut -dV -f2` -ge 250 ] || \
54 [ `echo ${ATI_CARD} | cut -dR -f2` -ge 200 ]; then
55 echo "ATI card detected."
56 GLTYPE=ati
57 else
58 no_gl
59 fi
60 else
61 no_gl
62 fi
63 else
64 no_gl
65 fi
66 fi
67 }
68
69 get_video_cards
70
71 if [ -x /usr/sbin/opengl-update-livecd ]
72 then
73 /usr/sbin/opengl-update-livecd $GLTYPE
74 else
75 opengl-update $GLTYPE
76 fi
77
78 #exec /usr/bin/xinit

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20