From 3ebf371fc281da37c2814bfd7f9d899156eff660 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 7 Dec 2020 19:29:40 +0000 Subject: run: Allow caller to replace /app and/or /usr The pressure-vessel container tool in Steam will want to use this, to replace /usr with a Steam Runtime container supplied by the Steam CDN, instead of using the same Flatpak runtime that is used to run the Steam client and non-containerized games. If a custom /usr is used, the "official" Flatpak runtime is still the one reflected in the metadata. It is also mounted at /run/parent, with all its extensions, so that pressure-vessel has the option of using its graphics drivers (by populating the custom /usr with symlinks into /run/parent and/or /run/host). When doing this, we need to put an empty directory on /app, because the real /app expects to be run on top of the real runtime. It would also be reasonable to substitute a custom replacement for /app, so I've included support for that too. Partially addresses #3797. Signed-off-by: Simon McVittie --- doc/flatpak-metadata.xml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++ doc/flatpak-run.xml | 47 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+) (limited to 'doc') diff --git a/doc/flatpak-metadata.xml b/doc/flatpak-metadata.xml index abb213d2..f4cd84ce 100644 --- a/doc/flatpak-metadata.xml +++ b/doc/flatpak-metadata.xml @@ -530,11 +530,42 @@ app files, as mounted at /app inside the container. Available since 0.6.10. + + Since 1.12.0, if flatpak run + was run with the option, + this key gives the absolute path of whatever files + were mounted on /app, even if + that differs from the app's normal app files. + + + If flatpak run was run with + (resulting in an + empty directory being mounted on + /app), the value is set to + the empty string. + + + + (string) + + If flatpak run was run with the + option, this key gives + the absolute path of the app's original files, + as mounted at /run/parent/app + inside the container. Available since 1.12.0. + + + If this key is missing, the app files are given + by . + (string) The commit ID of the application that is running. + The filename of a deployment of this commit can + be found in + if present, or otherwise. @@ -543,6 +574,10 @@ A list of app extensions that are mounted into the running instance. The format for each list item is . + If is present, + the extensions are mounted below + /run/parent/app; otherwise, + they are mounted below /app. @@ -573,11 +608,36 @@ runtime files, as mounted at /usr inside the container. Available since 0.6.10. + + Since 1.12.0, if flatpak run + was run with the option, + this key gives the absolute path of whatever files + were mounted on /usr, even if + that differs from the app's normal runtime files. + + + + (string) + + If flatpak run was run with the + option, this key gives + the absolute path of the app's original runtime, + as mounted at /run/parent/usr + inside the container. Available since 1.12.0. + + + If this key is missing, the runtime files are given + by . + (string) The commit ID of the runtime that is used. + The filename of a deployment of this commit can be + found in + if present, or + otherwise. @@ -586,6 +646,10 @@ A list of runtime extensions that are mounted into the running instance. The format for each list item is . + If is present, + the extensions are mounted below + /run/parent/usr; otherwise, + they are mounted below /usr. diff --git a/doc/flatpak-run.xml b/doc/flatpak-run.xml index 28e7f599..a9c2c947 100644 --- a/doc/flatpak-run.xml +++ b/doc/flatpak-run.xml @@ -636,7 +636,54 @@ key=v1;v2; permissions for the application. + + + + + Instead of mounting the app's content on + /app in the sandbox, mount + PATH on /app, + and the app's content on + /run/parent/app. + If the app has extensions, they will also be redirected + into /run/parent/app, and will not + be included in the LD_LIBRARY_PATH inside + the sandbox. + + + + + + As a special case, + (with an empty PATH) + results in an empty directory being mounted on + /app. + + + + + + + Instead of mounting the runtime's files on + /usr in the sandbox, mount + PATH on + /usr, + and the runtime's normal files on + /run/parent/usr. + If the runtime has extensions, they will also be redirected + into /run/parent/usr, and will not + be included in the LD_LIBRARY_PATH inside + the sandbox. + + + This option will usually only be useful if it is + combined with and + . + + + + -- cgit v1.2.1