Skip to content
Snippets Groups Projects
Commit d1f513a4 authored by Simon McVittie's avatar Simon McVittie
Browse files

pv-wrap-home: Share the remaining FHS top-level directories

There's no particular reason not to share /home, /opt and /srv, and
they are sometimes used to contain mount points for non-removable,
non-system partitions.

Resolves: #18
Helps: steamrt/tasks#149
Helps: https://github.com/ValveSoftware/steam-runtime/issues/334
Helps: https://github.com/ValveSoftware/Proton/issues/5102


Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 07339df2
No related branches found
No related tags found
1 merge request!482pv-wrap-home: Share the remaining FHS top-level directories
Pipeline #30579 passed
......@@ -270,9 +270,16 @@ desired.
If the home directory is shared, then the following locations are also
shared read/write:
* `/home`: Other users' home directories (if accessible by the current user),
sometimes also sed to contain mount points for non-system partitions
or drives (for example `/home/shared/large-disk-drive`)
* `/opt`: FHS directory for third-party software
* `/media`: FHS parent directory for removable media
* `/mnt`: Legacy mount point for removable media
* `/run/media`: Widely-used parent directory for removable media
* `/srv`: FHS directory for site-specific data,
sometimes used to contain mount points for non-system partitions or drives
(for example `/srv/bulk-data-drive`)
* `/var/tmp`: Medium-term temporary directory
(Note that this changed in pressure-vessel 0.202208xx.x.
......@@ -292,13 +299,8 @@ directory, such as `~/.var/app/com.steampowered.App1234/.cache/tmp`
[Usually not shared]: #usually-not-shared
All top-level directories that are not otherwise mentioned are generally
not shared with the container. This includes:
* Users' home directories in `/home`, apart from
[the current user's home directory][the home directory]
* The FHS third-party software directory `/opt`
* The FHS server-data directory `/srv`
* Any custom top-level directory such as `/large-disk-drive`
not shared with the container. This includes any custom top-level
directory such as `/large-disk-drive`.
Users can instruct the container runtime framework to share locations
in this category between the host system and the container by setting
......@@ -319,11 +321,11 @@ This assumes Steam is not running [under Flatpak][].
* `/etc`: managed by [the runtime][], some files come from the host
* `/home`
* The current user's [home directory][] is usually shared
* The rest of `/home` is [usually not shared][]
* The rest of `/home` [follows the home directory][]
* `/lib`, `/libQUAL`: part of [the runtime][]
* `/media`: [follows the home directory][]
* `/mnt`: [follows the home directory][]
* `/opt`: [usually not shared][]
* `/opt`: [follows the home directory][]
* `/proc`: [always shared][]
* `/sbin`: part of [the runtime][]
* `/usr`: part of [the runtime][]
......@@ -335,7 +337,7 @@ This assumes Steam is not running [under Flatpak][].
* `/run`: [never shared][] in general, but many locations inside it are shared
* `/run/media`: [follows the home directory][]
* `/sbin`: part of [the runtime][]
* `/srv`: [usually not shared][]
* `/srv`: [follows the home directory][]
* `/sys`: [always shared][]
* `/tmp`:
* `/tmp/.X11-unix` is [never shared][], but individual sockets appear there
......
......@@ -297,6 +297,18 @@ pv_wrap_use_home (PvHomeMode mode,
FLATPAK_FILESYSTEM_MODE_READ_WRITE,
"/run/media");
/* If we are sharing the home directory with the host, also share
* typical FHS directories that do not have any other mapping. */
flatpak_exports_add_path_expose (exports,
FLATPAK_FILESYSTEM_MODE_READ_WRITE,
"/home");
flatpak_exports_add_path_expose (exports,
FLATPAK_FILESYSTEM_MODE_READ_WRITE,
"/opt");
flatpak_exports_add_path_expose (exports,
FLATPAK_FILESYSTEM_MODE_READ_WRITE,
"/srv");
/* We always export /tmp for now (see below) and it seems odd
* to share /tmp with the host, but not /var/tmp.
* We don't do this when not sharing the home directory, since
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment