[Proton#4288] Gets broken by host graphics libraries in /opt
In https://github.com/ValveSoftware/Proton/issues/4288 the user had a copy of libdrm.so.2
in /opt
, part of a third-party OpenCL driver (amdgpu-pro) which somehow added it to the global search path for shared libraries (presumably by either dropping a file into /etc/ld.so.conf.d/
or editing /etc/ld.so.conf
).
When pressure-vessel captures the host graphics stack, the user's GLX driver depends on libdrm.so.2
, so we "capture" libdrm.so.2
and put a symlink to it in /overrides
.
However, there's a problem:
- The symlink is to
/run/host/opt
- There is no
/run/host/opt
- There is no
/opt
either
We could mount /opt
on /run/host/opt
, but that would break the Flatpak use-case. What we probably need to do is:
- Replace
capsule-capture-libs --link-dest=/run/host
with something likecapsule-capture-libs --remap-link-dest=/usr=/run/host/usr --remap-link-dest='/lib*=/run/host/lib*'
- For each library that is found to be outside the
/usr
-like directories, do the equivalent of--filesystem=/opt/path/to/driver/libdrm.so.2:ro
That would also allow us to deal with graphics libraries in $HOME
(I think).
Edited by Simon McVittie