wrap: Use a tmpfs home as a fallback when unsharing the home dir
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)
Merge request reports
Activity
added 1 commit
- db8c1952 - wrap: Use a tmpfs home as a fallback when unsharing the home dir
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'
requested review from @smcv
- Resolved by Ludovico de Nittis
- Resolved by Ludovico de Nittis
- Resolved by Simon McVittie
added 1 commit
- 604e3531 - wrap: Use a tmpfs home as a fallback when unsharing the home dir
mentioned in commit a6fd0a0d