Skip to content
Snippets Groups Projects
  1. Feb 10, 2020
  2. Feb 03, 2020
  3. Jan 08, 2020
  4. Jan 07, 2020
  5. Jan 06, 2020
  6. Dec 16, 2019
  7. Dec 13, 2019
    • Simon McVittie's avatar
      wrap: Mount pressure-vessel on /run/pressure-vessel if using runtime · 596e50ad
      Simon McVittie authored
      When we're using a non-trivial runtime, we need to make
      pressure-vessel-with-lock available to the container.
      
      Previously, if your pressure-vessel installation was visible via your
      home directory (if shared), via $(realpath ~/.steam/steam), or via the
      current working directory at the time of running pressure-vessel-wrap,
      then it would exist in the container at the same path as outside the
      container, so this would work. However, if you have installed it in
      an alternative Steam library such as /media/big/library, none of these
      mount points would make it visible and bwrap would fail to run it.
      
      Circumvent this by mounting the relocatable pressure-vessel prefix
      on /run/pressure-vessel, which lets us run it via that path.
      
      Bug: https://github.com/ValveSoftware/steam-runtime/issues/204
      
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      596e50ad
  8. Nov 15, 2019
  9. Nov 14, 2019
    • Simon McVittie's avatar
    • Simon McVittie's avatar
      with-lock: Add a utility to do things while holding a lock · b10c45c8
      Simon McVittie authored
      
      We can use this in the SteamLinuxRuntime depot to deploy and
      garbage-collect runtimes stored in tarballs.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      b10c45c8
    • Simon McVittie's avatar
      wrap: Take out a lock on the container's runtime for the duration · 959fd338
      Simon McVittie authored
      
      If we upgrade from runtime 0.20191024.0 to 0.20191108.0 while an app
      or game is still running under runtime 0.20191024.0, then deleting
      the app or game's shared libraries out from under it will probably
      break it.
      
      Flatpak solves this problem with a read/write lock on the file
      `files/.ref` - for runtimes this is `/usr/.ref` in the container.
      Each instance of `flatpak run` takes a read-lock on that file. Any
      number of processes can hold a read-lock at the same time.
      Before a package-manager-style operation like `flatpak uninstall`
      does anything destructive to a runtime, it takes a write-lock, which
      only succeeds if there are currently no read- or write-locks.
      Depending on the operation, the lock is either taken directly or by
      asking bubblewrap to do it.
      
      We'll use the same scheme. Different families of locking APIs interact
      unpredictably, so it's important that we use the same locking API as
      bubblewrap, namely POSIX byte-range (record) advisory locks via
      fcntl F_SETLK. In particular, this means flock(1) and flock(2) are
      not going to help us: they use POSIX file-level advisory locks.
      
      One difference between our locking and flatpak's is that we support
      runtimes that are not "merged /usr". In this case, we could either
      take a lock on files/.ref (/.ref in the container) or on files/usr/.ref
      (/usr/.ref in the container). I've chosen to do the former here, so that
      it's always files/.ref. It doesn't matter, as long as we're consistent.
      
      (For apps the lock file is `/app/.ref` and for extensions it's
      `$mountpoint/.ref`, but pressure-vessel doesn't have an equivalent of
      Flatpak apps or extensions yet.)
      
      This version is only a partial solution. We can't use bwrap --lock-file
      or bwrap --sync-fd without also using --unshare-pid, which breaks
      gameoverlayrenderer.so; so we do the next best thing, by leaking the
      lock fd to the bubblewrap process, which will leak it to the game's
      main process. This won't work if the game forks background processes,
      but it's good enough for a straightforward execve() chain.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      959fd338
    • Simon McVittie's avatar
    • Simon McVittie's avatar
      wrap: Print version number as YAML · d165c4d4
      Simon McVittie authored
      
      This is inspired by `ostree --version` and `docker version`.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      d165c4d4
    • Simon McVittie's avatar
      wrap: Make GOptionEntry flags clearer · 04b440d1
      Simon McVittie authored
      
      Instead of {0, 0}, represent the absence of a short option with '\0'
      and the absence of flags with G_OPTION_FLAG_NONE. To support older GLib,
      provide a compatibility definition for the latter.
      
      Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
      04b440d1
  10. Nov 12, 2019
Loading