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!
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.
Could you please provide a unified diff instead?
Created attachment 34209 [details, diff] Unified diffs of my proposed changes. Unified diffs per request of <spyderous@gentoo.org>. Also, added two comment lines.
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.
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. =)
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?
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?
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.
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.
I like comment #6's solution actually, and the livecd-tools can use that with /etc/opengl or whereever Chris wants it located.
2.1_pre7 has --prefix and --dst-prefix.