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

Diff of /trunk/x-setup

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

Revision 36 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.7 2005/02/03 20:59:03 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 ]
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
59get_video_cards 36get_video_cards || exit 1
60 37
61if [ -x /usr/sbin/opengl-update-livecd ] 38if [ -x /usr/sbin/opengl-update-livecd ]
62then 39then
63 /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
64else 47else
65 opengl-update $GLTYPE 48 echo "ERROR: no opengl-update script can be located"
49 exit 1
66fi 50fi
67 51
68#exec /usr/bin/xinit 52#exec /usr/bin/xinit

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

  ViewVC Help
Powered by ViewVC 1.1.20