Skip to content
Snippets Groups Projects
  1. Jul 09, 2020
  2. Jul 08, 2020
  3. Jul 02, 2020
  4. Jun 24, 2020
  5. Jun 23, 2020
  6. Jun 17, 2020
    • Simon McVittie's avatar
      Merge branch 'wip/t18688' into 'master' · f20c59be
      Simon McVittie authored
      Create a mutable copy of the runtime
      
      See merge request steam/pressure-vessel!26
      f20c59be
    • Simon McVittie's avatar
    • Simon McVittie's avatar
      runtime: Move pressure-vessel overrides into /usr · e1439c1a
      Simon McVittie authored
      
      Flatpak is not going to give us control over the root directory when
      using sub-sandboxing - the most we're likely to get is control over
      which directory is chosen to be /usr. Prepare for this by using
      /usr/lib/pressure-vessel/overrides instead of /overrides for the things
      we overwrite.
      
      To be nice to developers and steam-runtime-tools, put a symlink
      overrides -> usr/lib/pressure-vessel/overrides at the root, as a hint
      for where to look.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      e1439c1a
    • Simon McVittie's avatar
      bf4de6c4
    • Simon McVittie's avatar
      runtime: Use pv_runtime_take_from_host() for ld.so · bf8396b5
      Simon McVittie authored
      
      In a mutable sysroot, overwrite ld.so with a symlink into /run/host.
      We overwrite both the interoperable path (to avoid long chains of
      symlinks in the common case) and the canonicalized path (to make sure
      nothing can end up finding the container's ld.so, which is incompatible
      with the libc we have dropped in).
      
      If building a long bwrap command-line, we have to mount over the
      canonicalized path, and just live with the fact that there will be
      a long chain of symlinks leading to it.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      bf8396b5
    • Simon McVittie's avatar
    • Simon McVittie's avatar
      runtime: Remove overridden libraries from mutable sysroot · 5b403eb2
      Simon McVittie authored
      We currently arrange for the overridden libraries to be used by setting
      the LD_LIBRARY_PATH, but this fails in two cases:
      
      - If we want to use the scout LD_LIBRARY_PATH Steam Runtime inside a
        newer container (approximating how Steam games currently run in
        practice), it will reset the LD_LIBRARY_PATH instead of prepending
        to it.
      
      - Games also sometimes overwrite the LD_LIBRARY_PATH instead of
        prepending to it.
      
      We can avoid all that by arranging for our directories in /overrides
      to be in the default search path for ld.so, by editing ld.so.conf and
      running ldconfig, like Flatpak does (T14481). However, if we do that,
      we cannot reliably force a resolution order: ldconfig considers the
      OS ABI tag, which exists on some libraries and in particular on the
      versions of glibc and Mesa in scout, to be more important than directory
      search order.
      
      See also: https://bugs.freedesktop.org/show_bug.cgi?id=26663
      
      
      
      If we don't remove the unwanted version of glibc, we also run the risk
      of encountering mismatched copies of glibc and ld.so, leading to an
      immediate crash. This is particularly likely to happen if we use bwrap
      to enter the partially-set-up container.
      
      Because we have a temporary mutable copy of the sysroot, we can solve
      this easily by deleting the overridden libraries. That way, there can
      be no confusion: the only remaining implementation of each SONAME is
      the one we wanted :-)
      
      Note that after removing the overridden libraries, we will be unable
      to execute code in the sysroot without mounting /overrides/lib and
      setting up the LD_LIBRARY_PATH to point into it: for example, in the
      common case where we have taken libc from the host, the mutable
      sysroot no longer contains libc.so.6. This is why it's so important
      that a previous commit avoided the call to readlink(1) inside the
      container for the mutable case.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      5b403eb2
    • Simon McVittie's avatar
      runtime: Try to resolve path to ld.so without running bwrap · 6d6bb03b
      Simon McVittie authored
      
      If we have a mutable copy of the sysroot (which we know is a complete
      sysroot, not just /usr), then we don't need to use bwrap to rearrange
      it into something where we can canonicalize a path.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      6d6bb03b
Loading