Skip to content
Snippets Groups Projects

wrap: Use a tmpfs home as a fallback when unsharing the home dir

Merged Ludovico de Nittis requested to merge wip/unspecified_home into master
1 unresolved thread

If we don't want to share the host home directory we expect to have wither --home, --freedesktop-app-id, --steam-app-id or $SteamAppId.

There are cases where this might not happen. For example if Steam has been launched with the PRESSURE_VESSEL_SHARE_HOME=0 env variable and we try to run "Help->System Information", the variable $SteamAppId will not be set and the container creation will fail.

To avoid this issue we can use a tmpfs for the home directory when we are in batch mode. In this way the tmpfs will not be used if we need to run an actual game, because we want to retain the home directory on exit.

Fixes: #66 (closed)

Edited by Ludovico de Nittis

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • added 1 commit

    • db8c1952 - wrap: Use a tmpfs home as a fallback when unsharing the home dir

    Compare with previous version

    • This is what happens when the real home directory doesn't contain symlinks and we use the unshare home option while launching the Help->System Information:

      '/usr/bin/bwrap'
      '--new-session'
      '--chdir'
      '/home/ryuzaki/.local/share/Steam'
      '--tmpfs'
      '/home/ryuzaki'
      '--dir'
      '/home/ryuzaki/.cache'
      '--dir'
      '/home/ryuzaki/.cache/tmp'
      '--dir'
      '/home/ryuzaki/.config'
      '--dir'
      '/home/ryuzaki/.local'
      '--dir'
      '/home/ryuzaki/.local/share'
      '--symlink'
      '.cache'
      '/home/ryuzaki/cache'
      '--symlink'
      '.config'
      '/home/ryuzaki/config'
      '--symlink'
      '.local/share'
      '/home/ryuzaki/data'
      '--symlink'
      '/home/ryuzaki/.cache/tmp'
      '/var/tmp'
      '--dir'
      '/home'
      '--dir'
      '/home/ryuzaki'
      '--bind'
      '/home/ryuzaki/.local/share/Steam'
      '/home/ryuzaki/.local/share/Steam'

      And this is when we have a symlink /home -> var/home:

      '/usr/bin/bwrap'
      '--new-session'
      '--chdir'
      '/var/home/ub/.local/share/Steam'
      '--tmpfs'
      '/var/home/ub'
      '--dir'
      '/var/home/ub/.cache'
      '--dir'
      '/var/home/ub/.cache/tmp'
      '--dir'
      '/var/home/ub/.config'
      '--dir'
      '/var/home/ub/.local'
      '--dir'
      '/var/home/ub/.local/share'
      '--symlink'
      '.cache'
      '/var/home/ub/cache'
      '--symlink'
      '.config'
      '/var/home/ub/config'
      '--symlink'
      '.local/share'
      '/var/home/ub/data'
      '--symlink'
      '/var/home/ub/.cache/tmp'
      '/var/tmp'
      '--symlink'
      'var/home'
      '/home'
      '--bind'
      '/tmp'
      '/tmp'
      '--dir'
      '/var/home'
      '--dir'
      '/var/home/ub'
      '--bind'
      '/var/home/ub/.local/share/Steam'
      '/var/home/ub/.local/share/Steam'
    • This seems to work as expected, but the whole binding process is full of subtle side-effects

    • Please register or sign in to reply
  • Ludovico de Nittis marked this merge request as ready

    marked this merge request as ready

  • Ludovico de Nittis changed the description

    changed the description

  • Ludovico de Nittis requested review from @smcv

    requested review from @smcv

  • Simon McVittie
  • Simon McVittie
  • added 1 commit

    • 604e3531 - wrap: Use a tmpfs home as a fallback when unsharing the home dir

    Compare with previous version

  • Simon McVittie approved this merge request

    approved this merge request

  • Simon McVittie mentioned in commit a6fd0a0d

    mentioned in commit a6fd0a0d

  • Please register or sign in to reply
    Loading