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

Contents of /trunk/x-setup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (hide annotations) (download)
Tue Mar 1 18:13:51 2005 UTC (9 years, 6 months ago) by wolf31o2
File size: 2199 byte(s)
Fixed net-setup and x-setup and also updated headers on all files.

1 wolf31o2 5 #!/bin/bash
2     # Copyright 1999-2004 Gentoo Technologies, Inc.
3     # Distributed under the terms of the GNU General Public License v2
4 wolf31o2 44 # $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.12 2005/03/01 18:13:51 wolf31o2 Exp $
5 wolf31o2 5
6 wolf31o2 32 # 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 wolf31o2 5 #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 wolf31o2 43 no_gl() {
27     echo "No OpenGL-capable card found."
28     GLTYPE=xorg-x11
29     }
30    
31 wolf31o2 44 ati_gl() {
32     echo "ATI card detected."
33     GLTYPE=ati
34     }
35    
36     nv_gl() {
37     echo "NVIDIA card detected."
38     GLTYPE=nvidia
39     }
40    
41 wolf31o2 33 get_video_cards() {
42     VIDEO_CARDS=`/sbin/lspci | grep VGA`
43     NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
44 wolf31o2 37 if [ ${NUM_CARDS} -eq 1 ]; then
45 wolf31o2 41 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"`
46 wolf31o2 39 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 wolf31o2 41 if [ -n "${NVIDIA_CARD}" ]; then
50     if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then
51 wolf31o2 44 nv_gl
52 wolf31o2 41 else
53 wolf31o2 43 no_gl
54 wolf31o2 41 fi
55 wolf31o2 33 else
56 wolf31o2 43 no_gl
57 wolf31o2 33 fi
58 wolf31o2 37 elif [ -n "${ATI}" ]; then
59 wolf31o2 44 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 wolf31o2 39 else
65 wolf31o2 44 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 wolf31o2 43 no_gl
75 wolf31o2 39 fi
76 wolf31o2 33 else
77 wolf31o2 43 no_gl
78 wolf31o2 33 fi
79 wolf31o2 5 fi
80 wolf31o2 33 }
81 wolf31o2 5
82 wolf31o2 33 get_video_cards
83    
84 wolf31o2 18 if [ -x /usr/sbin/opengl-update-livecd ]
85     then
86     /usr/sbin/opengl-update-livecd $GLTYPE
87 wolf31o2 44 elif [ -x /usr/sbin/opengl-update ]
88     then
89     opengl-update $GLTYPE
90 wolf31o2 18 else
91 wolf31o2 44 echo "ERROR: no opengl-update script can be located"
92     exit 1
93 wolf31o2 18 fi
94 wolf31o2 5
95 wolf31o2 36 #exec /usr/bin/xinit

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20