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

Diff of /trunk/x-setup

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

Revision 18 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.4 2004/11/19 16:11:24 wolf31o2 Exp $ 4# $Header: /var/cvsroot/gentoo/src/livecd-tools/x-setup,v 1.16 2006/08/01 19:38:36 wolf31o2 Exp $
5
6# Check for an xorg.conf
7if [ ! -e /etc/X11/xorg.conf ]
8then
9 echo "ERROR: /etc/X11/xorg.conf cannot be found! Exiting"
10 exit 1
11fi
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
5 22
6#first, get paths right if we're getting started b4 login 23#first, get paths right if we're getting started b4 login
7source /etc/profile 24source /etc/profile
8 25
9echo "0" > /proc/sys/kernel/printk 26livecd_get_cmdline || exit 1
10CMDLINE="`cat /proc/cmdline`" 27
11for x in $CMDLINE 28for x in $CMDLINE
12do 29do
13 if [ "$x" = "agpgart" ] 30 if [ "$x" = "agpgart" ]
14 then 31 then
15 modprobe agpgart > /dev/null 2>&1 32 modprobe agpgart > /dev/null 2>&1
16 fi 33 fi
17done 34done
18 35
19GLTYPE=nvidia 36get_video_cards || exit 1
20#now, for the key component :)
21modprobe nvidia > /dev/null 2>&1
22if [ "`lsmod | cut -f1 -d\" \" | grep ^nvidia$`" = "nvidia" ]
23then
24 echo "NVIDIA driver loaded."
25else
26 modprobe fglrx > /dev/null 2>&1
27 if [ "`lsmod | cut -f1 -d\" \" | grep ^fglrx$`" = "fglrx" ]
28 then
29 echo "ATI driver loaded."
30 GLTYPE=ati
31 else
32 #echo "**********************************************************"
33 #echo "NVIDIA or ATI drivers unable to load; aborting."
34 #echo "This demo requires modern NVIDIA or ATI graphics hardware."
35 #echo "**********************************************************"
36 echo ""
37 if [ -e /proc/splash ]
38 then
39 #echo "*******************************"
40 #echo "Entering Vesa browser-only mode"
41 #echo "*******************************"
42 #sleep 3
43 GLTYPE=xorg-x11
44 fi
45 fi
46 37
47fi
48if [ -x /usr/sbin/opengl-update-livecd ] 38if [ -x /usr/sbin/opengl-update-livecd ]
49then 39then
50 /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
51else 47else
52 opengl-update $GLTYPE 48 echo "ERROR: no opengl-update script can be located"
49 exit 1
53fi 50fi
54 51
55if [ ! -e /etc/sysconfig/mouse ]
56then
57 echo "A mouse could not be detected; aborting."
58 echo "Please make sure a mouse is attached to your system."
59 exit 1
60fi
61source /etc/sysconfig/mouse
62
63VERTREFRESH="\`ddcxinfo-knoppix -vsync\`"
64if [ "$VERTREFRESH" = "0-0" ]
65then
66 echo "No DDC information detected; assuming reasonable defaults."
67 VERTREFRESH=50-80
68 HORIZSYNC=30-70
69else
70 HORIZSYNC="\`ddcxinfo-knoppix -hsync\`"
71fi
72
73sed -i -e "s:##MOUSEPROTO##:${XMOUSETYPE}:" \
74 -e "s:##MOUSEDEV##:${DEVICE}:" \
75 -e "s:##VERTREFRESH##:${VERTREFRESH}:" \
76 -e "s:##HORIZSYNC##:${HORIZSYNC}:" \
77 -e "s:DefaultColorDepth 16:DefaultColorDepth 24:" \
78 /etc/X11/XF86Config-4
79
80#exec /usr/X11R6/bin/xinit 52#exec /usr/bin/xinit

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

  ViewVC Help
Powered by ViewVC 1.1.20