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

Diff of /trunk/x-setup

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

Revision 41 Revision 117
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.10 2005/02/17 13:45:22 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.16 2006/08/01 19:38:36 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
26get_video_cards() {
27 VIDEO_CARDS=`/sbin/lspci | grep VGA`
28 NUM_CARDS=`echo ${VIDEO_CARDS} | wc -l`
29 if [ ${NUM_CARDS} -eq 1 ]; then
30 NVIDIA=`echo ${VIDEO_CARDS} | grep "nVidia Corporation"`
31 ATI=`echo ${VIDEO_CARDS} | grep "ATI Technologies"`
32 if [ -n "${NVIDIA}" ]; then
33 NVIDIA_CARD=`echo ${NVIDIA} | awk 'BEGIN {RS=" "} /NV[0-9]+/ {print $1}'`
34 if [ -n "${NVIDIA_CARD}" ]; then
35 if [ `echo ${NVIDIA_CARD} | cut -dV -f2` -ge 4 ]; then
36 echo "NVIDIA card detected."
37 GLTYPE=nvidia
38 else
39 echo "No OpenGL-capable card found."
40 GLTYPE=xorg-x11
41 fi
42 else
43 echo "No OpenGL-capable card found."
44 GLTYPE=xorg-x11
45 fi
46 elif [ -n "${ATI}" ]; then
47 ATI_CARD=`echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)\d{3}/ {print $1}'`
48 if [ -n "${ATI_CARD}" ]; then
49 if [ `echo ${ATI_CARD} | cut -dS -f2` -ge 350 ] || \
50 [ `echo ${ATI_CARD} | cut -dV -f2` -ge 250 ] || \
51 [ `echo ${ATI_CARD} | cut -dR -f2` -ge 200 ]; then
52 echo "ATI card detected."
53 GLTYPE=ati
54 else
55 echo "No OpenGL-capable card found."
56 GLTYPE=xorg-x11
57 fi
58 else
59 echo "No OpenGL-capable card found."
60 GLTYPE=xorg-x11
61 fi
62 else
63 echo "No OpenGL-capable card found."
64 GLTYPE=xorg-x11
65 fi
66 fi
67}
68
69get_video_cards 36get_video_cards || exit 1
70 37
71if [ -x /usr/sbin/opengl-update-livecd ] 38if [ -x /usr/sbin/opengl-update-livecd ]
72then 39then
73 /usr/sbin/opengl-update-livecd $GLTYPE 40 /usr/sbin/opengl-update-livecd $GLTYPE
41elif [ -x /usr/bin/eselect -a -e /usr/share/eselect/modules/opengl.eselect ]
42then
43 /usr/bin/eselect opengl set $GLTYPE --dst-prefix=/etc/opengl
44elif [ -x /usr/sbin/opengl-update ]
45then
46 /usr/sbin/opengl-update --dst-prefix=/etc/opengl $GLTYPE
74else 47else
75 opengl-update $GLTYPE 48 echo "ERROR: no opengl-update script can be located"
49 exit 1
76fi 50fi
77 51
78#exec /usr/bin/xinit 52#exec /usr/bin/xinit

Legend:
Removed from v.41  
changed lines
  Added in v.117

  ViewVC Help
Powered by ViewVC 1.1.20