Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 55212 - opengl-update, staticly shared /usr partition, and diskless nodes with different gl setups don't get along.
Summary: opengl-update, staticly shared /usr partition, and diskless nodes with differ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Unspecified (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-06-25 22:19 UTC by Edward A. Hasley III
Modified: 2005-02-08 02:09 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Context diffs of my changes to /usr/sbin/opengl-update (new_opengl-update.diff,5.79 KB, patch)
2004-06-25 22:26 UTC, Edward A. Hasley III
Details | Diff
Unified diffs of my proposed changes. (opengl-update.diff,2.80 KB, patch)
2004-06-26 10:45 UTC, Edward A. Hasley III
Details | Diff
This time I used `diff -u`. Sorry! (opengl-update.diff,4.88 KB, patch)
2004-06-26 15:14 UTC, Edward A. Hasley III
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Edward A. Hasley III 2004-06-25 22:19:17 UTC
Greetings, I have two machines running Gentoo.  One is the "master" for a diskless node, and it uses ati for opengl.  The diskless node uses nvidia for opengl.  When I use opengl-update, this overwrites symlinks under /usr/lib.  Since I share /usr between the two machines, this causes problems in that only one computer has the proper libraries linked at any given time.

To solve this problem, I synced my portage tree, installed the latest available version of x11-base/opengl-update, and then proceeded to edit it by hand.  I made a directory called 'opengl' in lib/ under /usr/local, which i mount separately on each machine, and had opengl-update make all of its symlinks there as opposed to under /usr/lib directly.  I then removed the old symlinks to gl libs from /usr/lib and re-ran my script.  Everything is fixed now.

My explanation is terrible, and for that I apologize, but I have a diff file against /usr/sbin/opengl-update from x11-base/opengl-update-1.7.1 that more clearly explains things... I added no new comments, however.

Please let me know if there is a more elegant solution than this.

Reproducible: Always
Steps to Reproduce:
1.Create a diskless node with a different video card and accompanying opengl configuration than the host system.
2.Export /usr via nfs as a static, read-only filesystem.
3.Attempt to use X or anything that utilizes opengl.
4.Attempt to use opengl-update to use the correct opengl library.

Actual Results:  
One of the two systems was always b0rked; I could not run X simultaneously, or
at least I couldn't log out and restart X because it couldn't load the GL libraries.

Expected Results:  
It should have been more friendly to the prospect of sharing /usr among multiple
machines. (haha, that's a lot to ask really. =P)

None should be needed in this situation, but for consistency's sake:

Portage 2.0.50-r8 (default-x86-2004.0, gcc-3.3.3, glibc-2.3.3_pre20040207-r0,
2.6.5-gentoo-r1)
=================================================================
System uname: 2.6.5-gentoo-r1 i686 AMD Athlon(tm) XP 2200+
Gentoo Base System version 1.4.3.13p1
distcc 2.14 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) [disabled]
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59-r3
Automake: sys-devel/automake-1.8.2
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3.2/share/config /usr/kde/3/share/config /usr/lib/mozilla/defaults/pref
/usr/share/config /usr/share/texmf/dvipdfm/config/
/usr/share/texmf/dvips/config/ /usr/share/texmf/tex/generic/config/
/usr/share/texmf/tex/platex/config/ /usr/share/texmf/xdvi/ /var/qmail/alias
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer -pipe -z combreloc"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache sandbox"
GENTOO_MIRRORS="http://128.213.5.34/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://localhost/gentoo-portage"
USE="3dnow X aalib acpi alsa apache2 apm arts avi berkdb bonobo cdr crypt cups
dga directfb doc dvd encode esd foomaticdb gd gdbm ggi ggz gif gnome gpm gtk
gtk2 gtkhtml imap imlib innodb ipv6 java jikes jpeg kde lcms ldap libg++ libwww
mad maildir mikmod mmx motif mozilla mpeg mysql nas ncurses nls nocardbus
oggvorbis opengl oss pam pdflib perl pic plotutils png python qt quicktime
readline ruby samba sasl scanner sdl slang slp snmp spell sse ssl svga tcltk
tcpd tetex tiff truetype wmf x86 xml xml2 xmms xv zlib"

See attachment for my solution!
Comment 1 Edward A. Hasley III 2004-06-25 22:26:43 UTC
Created attachment 34179 [details, diff]
Context diffs of my changes to /usr/sbin/opengl-update

These are the context diffs of the changes that I made to
/usr/sbin/opengl-update that solved the problem I described.  I've never
submitted a patch before, so I don't know if I did it the right way, but I hope
this helps.
Comment 2 Donnie Berkholz (RETIRED) gentoo-dev 2004-06-26 01:06:41 UTC
Could you please provide a unified diff instead?
Comment 3 Edward A. Hasley III 2004-06-26 10:45:04 UTC
Created attachment 34209 [details, diff]
Unified diffs of my proposed changes.

Unified diffs per request of <spyderous@gentoo.org>.  Also, added two comment
lines.
Comment 4 Donnie Berkholz (RETIRED) gentoo-dev 2004-06-26 14:45:59 UTC
Odd, when I run `diff -u` the output is quite different. =) I see what you're getting at here regarding /usr/local, though. Let's try again, with a real unified diff, then we can really get into some discussion.
Comment 5 Edward A. Hasley III 2004-06-26 15:14:14 UTC
Created attachment 34239 [details, diff]
This time I used `diff -u`.   Sorry!

I left out the -u the second time around... really sorry about that.  Here we
go again. =)
Comment 6 Andrew Bevitt 2004-07-31 07:37:46 UTC
How about we provide a option to specify _where_ the base directory for where the links should be created. The script that is currently in portage as 1.8.1 would have this as /usr as all things are then
 include/GL/*
 lib/*

opengl-update --prefix /usr/local nvidia

Would place them as
/usr/local/include/GL/*
/usr/local/lib/*

By default this can be /usr naturally.

Comments?
Comment 7 Calin Culianu 2004-09-19 07:53:08 UTC
You should do what Mandrake for switching gcc versions by having an intermediate level of symlinks pointing to in a directory in /etc.  Those symlinks could then point to the real files, but since the intermediate layer of symlinks is in /etc, it is node-specific.

For swapping around GCC versions, Mandrake had a directory called /etc/alternatives which was just full of symlinks to real programs.

For opengl libs, this stuff might break fewer systems if it was in /etc.  Files like /usr/lib/libGL.so could symlink to /etc/alternatives/opengl/libGL.so which is itself a node-specific symlink to (for example) /usr/lib/opengl/xfree/lib/libGL.so, etc.

Whaddayatink?
Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2004-10-28 11:07:10 UTC
I like Andrew's suggestion in comment #6.

Comment #7 is quite valid, too, especially when considering integrating the LiveCD opengl-update -- on LiveCD's, only /etc is writable. This should be further discussed on bug #51726.
Comment 9 Jeremy Huddleston (RETIRED) gentoo-dev 2005-01-24 17:18:18 UTC
It shouldn't be neccessary to write to /usr.  opengl-update sets the proper LDPATH to look in the /usr/lib/opengl/<profile>/lib subdirectory, so it should "just work"  Please try opengl-update-2.1_pre1 and report if there're still issues.
Comment 10 Jeremy Huddleston (RETIRED) gentoo-dev 2005-02-07 00:08:06 UTC
I like comment #6's solution actually, and the livecd-tools can use that with /etc/opengl or whereever Chris wants it located.
Comment 11 Jeremy Huddleston (RETIRED) gentoo-dev 2005-02-08 02:09:44 UTC
2.1_pre7 has --prefix and --dst-prefix.