Skip to content
Snippets Groups Projects
  1. Jun 14, 2022
  2. Jun 13, 2022
  3. Jun 09, 2022
  4. Jun 08, 2022
  5. Jun 07, 2022
  6. Jun 06, 2022
    • Simon McVittie's avatar
      pv-runtime: Be more compatible with interpreters like FEX-Emu · b6e5d13e
      Simon McVittie authored
      
      A common approach to transparent CPU-architecture emulation is to have
      an overlay with binaries for the emulated architecture, and transparently
      use those (as though they were an overlayfs over the real filesystem)
      when an emulated process accesses their paths.
      
      For example, FEX-Emu emulates x86 on aarch64 systems. When an aarch64
      process opens an architecture-dependent file like /usr/lib64/libc.so.6
      or /etc/ld.so.cache, it gets the real file; when an emulated x86 process
      opens an architecture-dependent file, if that file exists in the
      FEX-Emu "rootfs", FEX-Emu will transparently redirect the file access
      to the copy in the "rootfs".
      
      When we enter the Steam Runtime container, we need two environments
      inside the container: an aarch64 environment that can run the FEX-Emu
      interpreter itself, and an x86 environment that can run
      pressure-vessel-adverb, Steam Runtime executables, and the actual game.
      
      To arrange for this to happen, we can use a subset of the real aarch64
      operating system as the root of the container, and set up a new FEX-Emu
      rootfs in /run/pressure-vessel/interpreter-root. This means that
      aarch64 executables in the Steam Runtime container see the real host OS,
      but x86 executables see the Steam Runtime.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      b6e5d13e
    • Simon McVittie's avatar
      pv-wrap: Adjust paths set up by Flatpak code for FEX-Emu rootfs · 42d397f6
      Simon McVittie authored
      
      The code we've borrowed from Flatpak to deal with things like X11 and
      D-Bus can find files and directories in either the real root filesystem,
      or the FEX-Emu rootfs. If we naively pass the paths it has discovered to
      bwrap, we'll find that they don't necessarily exist: for example, the
      minimal aarch64 system I'm using for initial testing of this code
      doesn't have /var/cache/fontconfig, but the rootfs does. This makes
      bwrap fail when it tries to bind-mount /oldroot/var/cache/fontconfig
      onto /newroot/var/cache/fontconfig.
      
      To avoid this failure mode, look up the paths in the rootfs, and if
      necessary rewrite them. For example, we can bind-mount
      /oldroot/$FEX_ROOTFS/var/cache/fontconfig onto
      /newroot/var/cache/fontconfig, and that will work fine.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      42d397f6
    • Simon McVittie's avatar
      pv-wrap: Use the FEX-Emu rootfs as the default graphics stack provider · 3de3e03c
      Simon McVittie authored
      
      We don't yet do anything with FEX-Emu thunks (substitute shared
      libraries that override certain real libraries), so we need to provide
      a complete x86 graphics stack, and the FEX-Emu rootfs is a good place
      to find one of those.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      3de3e03c
Loading