Skip to content

pv-runtime: Create /usr/share/defaults/etc/ld.so.conf, for Solus

Simon McVittie requested to merge wip/smcv/more-ldso-conf into master

This is one of several possible solutions to https://github.com/ValveSoftware/steam-runtime/issues/510. As well as resolving the immediate issue in Solus (I hope!), it puts in the groundwork for solving equivalent issues in any other distros that have a similar approach to ldconfig.


  • pv-runtime: Start generalizing creation of ld.so.cache symlinks

    This is mostly just refactoring, but it introduces the concept that creating the symlink might fail. This can't actually happen in practice, because the only failure mode that is implemented right now is bwrap being NULL, which cannot really happen in these call sites.

    These alternate filenames won't be critical on most OS configurations, so if creating the symlink fails, we just warn and try to continue.

    The slightly odd error exit path will get more use in subsequent commits.

  • pv-runtime: Only try to create symlinks in tmpfs locations

    Writing into other locations will either fail at runtime or modify persistent state, so don't even try.

  • pv-runtime: Create symlinks in /usr by modifying mutable sysroot

    By the time we're running bubblewrap, it's too late to modify /usr: we're going to mount it read-only, so writes will fail. However, in the configuration with a mutable sysroot (which is what we actually do in production), we can modify the mutable sysroot before that point instead.

    This code isn't used yet, but will be used in a subsequent commit.

  • pv-runtime: Create /usr/share/defaults/etc/ld.so.conf, for Solus

    Solus' ldconfig is hard-coded to read this path as its default, rather than the /etc/ld.so.conf used in all other known distributions, in an effort to be able to run with an empty /etc. When Steam's LD_LIBRARY_PATH runtime runs inside a pressure-vessel container, it relies on ldconfig picking up the configuration that was set up by pressure-vessel, so we need this path to be a symlink to the location we have set up.

    Because this path is below /usr, it'll only work for the mutable-sysroot code path, but in practice that's the one that Steam uses in production anyway, so this limitation seems reasonable.

    Resolves: https://github.com/ValveSoftware/steam-runtime/issues/510

/cc @denittis

Edited by Simon McVittie

Merge request reports

Loading