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

Contents of /trunk/x-setup

Parent Directory Parent Directory | Revision Log Revision Log


Revision 33 - (show annotations) (download)
Thu Feb 3 15:22:36 2005 UTC (9 years, 5 months ago) by wolf31o2
File size: 2176 byte(s)
Hopefully this will work for detecting opengl implementation.

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.6 2005/02/03 15:22:36 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 get_video_cards() {
27 VIDEO_CARDS=`/sbin/lspci | grep VGA`
28 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
29 if [ ${NUM_CARDS} -eq 1 ]
30 then
31 NVIDIA=`echo ${VIDEO_CARDS} | grep NV`
32 ATI=`echo ${VIDEO_CARDS} | grep "\(R2.*\|R3.*\)"`
33 if [ -z "${NVIDIA}" ]
34 then
35 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}' | cut -dV -f2`
36 if [ ${NVIDIA_CARD} -ge 4 ]
37 then
38 echo "NVIDIA card detected."
39 GLTYPE=nvidia
40 else
41 echo "NVIDIA card is too old for OpenGL."
42 GLTYPE=xorg-x11
43 fi
44 elif [ -z "${ATI}" ]
45 then
46 echo "ATI card detected."
47 GLTYPE=ati
48 else
49 echo "ATI card is too old for OpenGL."
50 GLTYPE=xorg-x11
51 fi
52 else
53 echo "No OpenGL-capable card found."
54 GLTYPE=xorg-x11
55 fi
56 fi
57 }
58
59 get_video_cards
60
61 if [ -x /usr/sbin/opengl-update-livecd ]
62 then
63 /usr/sbin/opengl-update-livecd $GLTYPE
64 else
65 opengl-update $GLTYPE
66 fi
67
68 if [ ! -e /etc/sysconfig/mouse ]
69 then
70 echo "A mouse could not be detected; aborting."
71 echo "Please make sure a mouse is attached to your system."
72 exit 1
73 fi
74 source /etc/sysconfig/mouse
75
76 VERTREFRESH="\`ddcxinfo-knoppix -vsync\`"
77 if [ "$VERTREFRESH" = "0-0" ]
78 then
79 echo "No DDC information detected; assuming reasonable defaults."
80 VERTREFRESH=50-80
81 HORIZSYNC=30-70
82 else
83 HORIZSYNC="\`ddcxinfo-knoppix -hsync\`"
84 fi
85
86 sed -i -e "s:##MOUSEPROTO##:${XMOUSETYPE}:" \
87 -e "s:##MOUSEDEV##:${DEVICE}:" \
88 -e "s:##VERTREFRESH##:${VERTREFRESH}:" \
89 -e "s:##HORIZSYNC##:${HORIZSYNC}:" \
90 -e "s:DefaultColorDepth 16:DefaultColorDepth 24:" \
91 /etc/X11/xorg.conf
92
93 #exec /usr/X11R6/bin/xinit

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.20