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

Contents of /trunk/x-setup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 37 - (hide annotations) (download)
Fri Feb 4 13:46:11 2005 UTC (9 years, 5 months ago) by wolf31o2
File size: 1438 byte(s)
Initial x-setup init script added.

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 37 # $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.8 2005/02/04 13:46:11 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 33 get_video_cards() {
27     VIDEO_CARDS=`/sbin/lspci | grep VGA`
28     NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
29 wolf31o2 37 if [ ${NUM_CARDS} -eq 1 ]; then
30 wolf31o2 33 NVIDIA=`echo ${VIDEO_CARDS} | grep NV`
31     ATI=`echo ${VIDEO_CARDS} | grep "\(R2.*\|R3.*\)"`
32 wolf31o2 37 if [ -n "${NVIDIA}" ]; then
33 wolf31o2 33 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}' | cut -dV -f2`
34 wolf31o2 37 if [ ${NVIDIA_CARD} -ge 4 ]; then
35 wolf31o2 33 echo "NVIDIA card detected."
36     GLTYPE=nvidia
37     else
38 wolf31o2 37 echo "No OpenGL-capable card found."
39 wolf31o2 33 GLTYPE=xorg-x11
40     fi
41 wolf31o2 37 elif [ -n "${ATI}" ]; then
42 wolf31o2 33 echo "ATI card detected."
43     GLTYPE=ati
44     else
45     echo "No OpenGL-capable card found."
46     GLTYPE=xorg-x11
47     fi
48 wolf31o2 5 fi
49 wolf31o2 33 }
50 wolf31o2 5
51 wolf31o2 33 get_video_cards
52    
53 wolf31o2 18 if [ -x /usr/sbin/opengl-update-livecd ]
54     then
55     /usr/sbin/opengl-update-livecd $GLTYPE
56     else
57     opengl-update $GLTYPE
58     fi
59 wolf31o2 5
60 wolf31o2 36 #exec /usr/bin/xinit

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20