/[livecd-tools]/trunk/opengl-update-livecd
Gentoo

Contents of /trunk/opengl-update-livecd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 44 - (show annotations) (download)
Tue Mar 1 18:13:51 2005 UTC (9 years, 7 months ago) by wolf31o2
File size: 2442 byte(s)
Fixed net-setup and x-setup and also updated headers on all files.

1 #!/bin/bash
2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License, v2 or later
4 # $Header: /var/cvsroot/gentoo/src/livecd-tools/Attic/opengl-update-livecd,v 1.5 2005/03/01 18:13:51 wolf31o2 Exp $
5
6 source /etc/init.d/functions.sh
7
8 if [ `id -u` -ne 0 ]
9 then
10 eerror "${0}: must be root."
11 exit 1
12 fi
13
14 usage() {
15 cat << FOO
16 usage: opengl-update-livecd <GL implementation>
17
18 note:
19 This utility switch between OpenGL implementations. Currently there
20 are three supported implementations, namely "xorg-x11", "nvidia", and
21 "ati", the implementations for X.Org, and the NVidia and ATI drivers
22 respectively.
23
24 examples:
25 opengl-update-livecd xorg-x11
26 This will setup things to use libGL.so from X.Org
27
28 opengl-update-livecd nvidia
29 This will setup things to use libGL.so from the NVidia drivers.
30
31 opengl-update-livecd ati
32 This will setup things to use libGL.so from the ATI drivers.
33
34 FOO
35 exit 1
36 }
37
38 if [ $# -ne 1 ]
39 then
40 usage
41 fi
42 if [ ! -d /usr/lib/opengl/${1} ]
43 then
44 usage
45 else
46 ebegin "Switching to ${1} OpenGL interface"
47
48 #set up the $LDPATH
49 echo "LDPATH=/usr/lib/opengl/${1}/lib" >/etc/env.d/09opengl
50 /usr/sbin/env-update &>/dev/null
51
52 #setup the /usr/lib/libGL.so symlink
53 rm -f /etc/opengl/libGL.so /etc/opengl/libGL.so.1
54
55 realname="$(readlink /usr/lib/opengl/${1}/lib/libGL.so)"
56 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
57 /etc/opengl/libGL.so
58 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
59 /etc/opengl/libGL.so.1
60
61 #setup the /usr/lib/libMesaGL.so symlink
62 rm -f /etc/opengl/libMesaGL.so
63 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
64 /etc/opengl/libMesaGL.so
65
66 rm -f /etc/opengl/libGLcore.so*
67
68 if [ -e /usr/lib/opengl/${1}/lib/libGLcore.so ]
69 then
70 realname="$(readlink /usr/lib/opengl/${1}/lib/libGLcore.so)"
71 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
72 /etc/opengl/libGLcore.so
73 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
74 /etc/opengl/libGLcore.so.1
75 fi
76
77 #setup the /usr/lib/modules/extensions/libglx.so symlink
78 rm -f /etc/opengl/libglx.*
79
80 if [ -e /usr/lib/opengl/${1}/extensions/libglx.so ]
81 then
82 ln -sf /usr/lib/opengl/${1}/extensions/libglx.so \
83 /etc/opengl/libglx.so
84 fi
85 #setup the /usr/lib/modules/extensions/libglx.a symlink
86 if [ -e /usr/lib/opengl/${1}/extensions/libglx.a ]
87 then
88 ln -sf /usr/lib/opengl/${1}/extensions/libglx.a \
89 /etc/opengl/libglx.a
90 fi
91
92 eend 0
93 fi
94
95
96 # vim:ts=4

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20