| 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.3 2004/11/18 23:34:13 wolf31o2 Exp $
|
| 5 |
|
| 6 |
#first, get paths right if we're getting started b4 login
|
| 7 |
source /etc/profile
|
| 8 |
|
| 9 |
echo "0" > /proc/sys/kernel/printk
|
| 10 |
CMDLINE="`cat /proc/cmdline`"
|
| 11 |
for x in $CMDLINE
|
| 12 |
do
|
| 13 |
if [ "$x" = "agpgart" ]
|
| 14 |
then
|
| 15 |
modprobe agpgart > /dev/null 2>&1
|
| 16 |
fi
|
| 17 |
done
|
| 18 |
|
| 19 |
GLTYPE=nvidia
|
| 20 |
#now, for the key component :)
|
| 21 |
modprobe nvidia > /dev/null 2>&1
|
| 22 |
if [ "`lsmod | cut -f1 -d\" \" | grep ^nvidia$`" = "nvidia" ]
|
| 23 |
then
|
| 24 |
echo "NVIDIA driver loaded."
|
| 25 |
else
|
| 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 |
|
| 47 |
fi
|
| 48 |
opengl-update $GLTYPE
|
| 49 |
|
| 50 |
if [ ! -e /etc/sysconfig/mouse ]
|
| 51 |
then
|
| 52 |
echo "A mouse could not be detected; aborting."
|
| 53 |
echo "Please make sure a mouse is attached to your system."
|
| 54 |
exit 1
|
| 55 |
fi
|
| 56 |
source /etc/sysconfig/mouse
|
| 57 |
|
| 58 |
VERTREFRESH="\`ddcxinfo-knoppix -vsync\`"
|
| 59 |
if [ "$VERTREFRESH" = "0-0" ]
|
| 60 |
then
|
| 61 |
echo "No DDC information detected; assuming reasonable defaults."
|
| 62 |
VERTREFRESH=50-80
|
| 63 |
HORIZSYNC=30-70
|
| 64 |
else
|
| 65 |
HORIZSYNC="\`ddcxinfo-knoppix -hsync\`"
|
| 66 |
fi
|
| 67 |
|
| 68 |
sed -i -e "s:##MOUSEPROTO##:${XMOUSETYPE}:" \
|
| 69 |
-e "s:##MOUSEDEV##:${DEVICE}:" \
|
| 70 |
-e "s:##VERTREFRESH##:${VERTREFRESH}:" \
|
| 71 |
-e "s:##HORIZSYNC##:${HORIZSYNC}:" \
|
| 72 |
-e "s:DefaultColorDepth 16:DefaultColorDepth 24:" \
|
| 73 |
/etc/X11/XF86Config-4
|
| 74 |
|
| 75 |
#exec /usr/X11R6/bin/xinit
|