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

Diff of /trunk/x-setup

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

Revision 32 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.5 2005/02/03 12:25:48 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
26GLTYPE=nvidia 36get_video_cards || exit 1
27#now, for the key component :)
28modprobe nvidia > /dev/null 2>&1
29if [ "`lsmod | cut -f1 -d\" \" | grep ^nvidia$`" = "nvidia" ]
30then
31 echo "NVIDIA driver loaded."
32else
33 modprobe fglrx > /dev/null 2>&1
34 if [ "`lsmod | cut -f1 -d\" \" | grep ^fglrx$`" = "fglrx" ]
35 then
36 echo "ATI driver loaded."
37 GLTYPE=ati
38 else
39 #echo "**********************************************************"
40 #echo "NVIDIA or ATI drivers unable to load; aborting."
41 #echo "This demo requires modern NVIDIA or ATI graphics hardware."
42 #echo "**********************************************************"
43 echo ""
44 if [ -e /proc/splash ]
45 then
46 #echo "*******************************"
47 #echo "Entering Vesa browser-only mode"
48 #echo "*******************************"
49 #sleep 3
50 GLTYPE=xorg-x11
51 fi
52 fi
53 37
54fi
55if [ -x /usr/sbin/opengl-update-livecd ] 38if [ -x /usr/sbin/opengl-update-livecd ]
56then 39then
57 /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
58else 47else
59 opengl-update $GLTYPE 48 echo "ERROR: no opengl-update script can be located"
49 exit 1
60fi 50fi
61 51
62if [ ! -e /etc/sysconfig/mouse ]
63then
64 echo "A mouse could not be detected; aborting."
65 echo "Please make sure a mouse is attached to your system."
66 exit 1
67fi
68source /etc/sysconfig/mouse
69
70VERTREFRESH="\`ddcxinfo-knoppix -vsync\`"
71if [ "$VERTREFRESH" = "0-0" ]
72then
73 echo "No DDC information detected; assuming reasonable defaults."
74 VERTREFRESH=50-80
75 HORIZSYNC=30-70
76else
77 HORIZSYNC="\`ddcxinfo-knoppix -hsync\`"
78fi
79
80sed -i -e "s:##MOUSEPROTO##:${XMOUSETYPE}:" \
81 -e "s:##MOUSEDEV##:${DEVICE}:" \
82 -e "s:##VERTREFRESH##:${VERTREFRESH}:" \
83 -e "s:##HORIZSYNC##:${HORIZSYNC}:" \
84 -e "s:DefaultColorDepth 16:DefaultColorDepth 24:" \
85 /etc/X11/xorg.conf
86
87#exec /usr/X11R6/bin/xinit 52#exec /usr/bin/xinit

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

  ViewVC Help
Powered by ViewVC 1.1.20