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

Diff of /trunk/opengl-update-livecd

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

Revision 22 Revision 23
1#!/bin/bash 1#!/bin/bash
2# Copyright 1999-2004 Gentoo Technologies, Inc. 2# Copyright 1999-2004 Gentoo Technologies, Inc.
3# Distributed under the terms of the GNU General Public License, v2 or later 3# Distributed under the terms of the GNU General Public License, v2 or later
4# Author: Martin Schlemmer <azarah@gentoo.org> 4# Author: Martin Schlemmer <azarah@gentoo.org>
5# $Header: /var/cvsroot/gentoo/src/livecd-tools/Attic/opengl-update-livecd,v 1.2 2005/01/11 12:06:36 wolf31o2 Exp $ 5# $Header: /var/cvsroot/gentoo/src/livecd-tools/Attic/opengl-update-livecd,v 1.3 2005/01/14 16:13:05 wolf31o2 Exp $
6 6
7source /etc/init.d/functions.sh 7source /etc/init.d/functions.sh
8 8
9if [ \`id -u\` -ne 0 ] 9if [ `id -u` -ne 0 ]
10then 10then
11 eerror "\${0}: must be root." 11 eerror "${0}: must be root."
12 exit 1 12 exit 1
13fi 13fi
14 14
15usage() { 15usage() {
16cat << FOO 16cat << FOO
34 34
35FOO 35FOO
36 exit 1 36 exit 1
37} 37}
38 38
39if [ \$# -ne 1 ] 39if [ $# -ne 1 ]
40then 40then
41 usage 41 usage
42fi 42fi
43if [ ! -d /usr/lib/opengl/\${1} ] 43if [ ! -d /usr/lib/opengl/${1} ]
44then 44then
45 usage 45 usage
46else 46else
47 ebegin "Switching to \${1} OpenGL interface" 47 ebegin "Switching to ${1} OpenGL interface"
48 48
49 #set up the \$LDPATH 49 #set up the $LDPATH
50 echo "LDPATH=/usr/lib/opengl/\${1}/lib" >/etc/env.d/09opengl 50 echo "LDPATH=/usr/lib/opengl/${1}/lib" >/etc/env.d/09opengl
51 /usr/sbin/env-update &>/dev/null 51 /usr/sbin/env-update &>/dev/null
52 52
53 #setup the /usr/lib/libGL.so symlink 53 #setup the /usr/lib/libGL.so symlink
54 rm -f /etc/opengl/libGL.so /etc/opengl/libGL.so.1 54 rm -f /etc/opengl/libGL.so /etc/opengl/libGL.so.1
55 55
56 realname="\$(readlink /usr/lib/opengl/\${1}/lib/libGL.so)" 56 realname="$(readlink /usr/lib/opengl/${1}/lib/libGL.so)"
57 ln -sf /usr/lib/opengl/\${1}/lib/\${realname} \ 57 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
58 /etc/opengl/libGL.so 58 /etc/opengl/libGL.so
59 ln -sf /usr/lib/opengl/\${1}/lib/\${realname} \ 59 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
60 /etc/opengl/libGL.so.1 60 /etc/opengl/libGL.so.1
61 61
62 #setup the /usr/X11R6/lib/libMesaGL.so symlink 62 #setup the /usr/X11R6/lib/libMesaGL.so symlink
63 rm -f /etc/opengl/libMesaGL.so 63 rm -f /etc/opengl/libMesaGL.so
64 ln -sf /usr/lib/opengl/\${1}/lib/\${realname} \ 64 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
65 /etc/opengl/libMesaGL.so 65 /etc/opengl/libMesaGL.so
66 66
67 rm -f /etc/opengl/libGLcore.so* 67 rm -f /etc/opengl/libGLcore.so*
68 68
69 if [ -e /usr/lib/opengl/\${1}/lib/libGLcore.so ] 69 if [ -e /usr/lib/opengl/${1}/lib/libGLcore.so ]
70 then 70 then
71 realname="\$(readlink /usr/lib/opengl/\${1}/lib/libGLcore.so)" 71 realname="$(readlink /usr/lib/opengl/${1}/lib/libGLcore.so)"
72 ln -sf /usr/lib/opengl/\${1}/lib/\${realname} \ 72 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
73 /etc/opengl/libGLcore.so 73 /etc/opengl/libGLcore.so
74 ln -sf /usr/lib/opengl/\${1}/lib/\${realname} \ 74 ln -sf /usr/lib/opengl/${1}/lib/${realname} \
75 /etc/opengl/libGLcore.so.1 75 /etc/opengl/libGLcore.so.1
76 fi 76 fi
77 77
78 #setup the /usr/X11R6/lib/modules/extensions/libglx.so symlink 78 #setup the /usr/X11R6/lib/modules/extensions/libglx.so symlink
79 rm -f /etc/opengl/libglx.* 79 rm -f /etc/opengl/libglx.*
80 80
81 if [ -e /usr/lib/opengl/\${1}/extensions/libglx.so ] 81 if [ -e /usr/lib/opengl/${1}/extensions/libglx.so ]
82 then 82 then
83 ln -sf /usr/lib/opengl/\${1}/extensions/libglx.so \ 83 ln -sf /usr/lib/opengl/${1}/extensions/libglx.so \
84 /etc/opengl/libglx.so 84 /etc/opengl/libglx.so
85 fi 85 fi
86 #setup the /usr/X11R6/lib/modules/extensions/libglx.a symlink 86 #setup the /usr/X11R6/lib/modules/extensions/libglx.a symlink
87 if [ -e /usr/lib/opengl/\${1}/extensions/libglx.a ] 87 if [ -e /usr/lib/opengl/${1}/extensions/libglx.a ]
88 then 88 then
89 ln -sf /usr/lib/opengl/\${1}/extensions/libglx.a \ 89 ln -sf /usr/lib/opengl/${1}/extensions/libglx.a \
90 /etc/opengl/libglx.a 90 /etc/opengl/libglx.a
91 fi 91 fi
92 92
93 eend 0 93 eend 0
94fi 94fi

Legend:
Removed from v.22  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.20