Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Jun 2012 09:01:42 -0600
From:      John Hein <jhein@symmetricom.com>
To:        Baptiste Daroussin <bapt@FreeBSD.org>
Cc:        danfe@FreeBSD.org, x11@FreeBSD.org
Subject:   Re: Proposition to make nvidia driver stop overwritting files
Message-ID:  <20431.28886.146662.868144@gromit.timing.com>
In-Reply-To: <20120606131623.GA82148@ithaqua.etoilebsd.net>
References:  <20120606131623.GA82148@ithaqua.etoilebsd.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Baptiste Daroussin wrote at 15:16 +0200 on Jun  6, 2012:
 > I would like to propose a way to make nvidia drivers stop overwritting files
 > namely libGL.so.1 and libglx.so.
 >
 > Why stop overwritting files is important to me? first pkgng do not support it in
 > fact is forbid it for sake of consistency and integrity of the installed
 > package.
 >
 > second if you upgrade libGL after having the nvidia drivers already installed
 > your drivers will stop working as expected Unless you are going to manurally
 > reinstall the drivers.
 >
 > That is for the rationnal now the proposition.
 >
 > I have modified rtld so that libmap.conf is now aware of 2 new directives:
 > include and includedir this is in current and have been MFCed into 9 no MFC to 8
 > planned for now as it depends on previous modifications of rtld which were not
 > MFC to 8 yet.
 >
 > What I would love to see is: nvidia drivers no more installing libGL.so.1 and
 > libglx.so files but instead of that install libGL-nvidia.so.1 and
 > libglx-nvidia.so.1
 >
 > And same for every single library possibly overwritten by nvidia
 >
 > For FreeBSD version not supporting include{,dir} in libmap.conf, add an entry to
 > libmap.conf to map libGL.so.1 to libGL-nvidia.so.1 etc.
 > for FreeBSD version supporting those directives just make sure that includedir
 > ${LOCALBASE}/etc/libmap exists if not add the line.
 >
 > and add a nvidia.conf file into etc/libmap with the mapping in it.
 >
 > I'm aware of the move of the old libGL and libglx  in the @exec @unexec, this
 > isn't sufficient and it still break the consistency of the installed packages
 > database.
 >
 > regards,
 > Bapt

I agree that the nvidia driver port should install a non-conflicting
libGL (and libGL-nvidia seems fine to me).

The problem I have with defining libGL.so in libmap.conf is similar to
my previous issue with the "alternatives" approach.  It is more
difficult to specify one or the other (nvidia or mesa) flavor of libGL
than, for instance, setting LD_LIBRARY_PATH.

That said, libmap.conf is better than the previously considered
alternatives style sym links because you have granularity at the
application level at least (using a constrained mapping for an
executable).  So libmap.conf can specify different versions of libGL
for different applications (e.g., regular X server vs. virtual X
server like Xvnc).

Regular users don't have that control, however, so INSTALL_AS_USER is
broken since non-root users can't modify libmap.conf normally.

Allowing users write access to libmap.conf (or included libmap files)
is an unacceptable security hole, of course.

So, for reasons of flexibility, I prefer solutions that ultimately
deal with LD_LIBRARY_PATH or user-controllable options (possibly
including application-specific config files).

But the libmap approach doesn't preclude using LD_LIBRARY_PATH, of
course.  And it will work for most users.

The only things I can think of to consider if making the libmap switch
are:

 (a) Try not to break INSTALL_AS_USER.
     Probably just skipping any libmap.conf modification is
     okay, either relying on the user to make appropriate sym
     links and use LD_LIBRARY_PATH manually or for bonus
     points adding a pkg-message explaining things.

 (b) Some applications may not work with the nvidia libGL.
     Those may require constrained executable mappings in libmap.conf.

     Unfortunately, I don't know which ones, if any, fall into that
     category and I currently don't have nvidia controllers on my
     freebsd boxen.

     Does anyone know if there are any ports for which mesa's libGL is
     required or preferred over the nvidia flavor?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20431.28886.146662.868144>