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

pv-wrap: Don't try so hard to use host graphics by default

For historical reasons, we assume that /run/host is a relatively
complete view of the host system, like it would be inside Flatpak.
However, in a systemd-nspawn container, /run/host contains other
things but not usually /usr or /etc.

Previously, the default was exactly equivalent to the old
PRESSURE_VESSEL_HOST_GRAPHICS=1, which in turn is equivalent to either
PRESSURE_VESSEL_GRAPHICS_PROVIDER=/run/host (if we appear to be in a
container) or PRESSURE_VESSEL_GRAPHICS_PROVIDER=/ (if not).

Now, the default is basically PRESSURE_VESSEL_GRAPHICS_PROVIDER=/, to
maximize the chance that if Steam games can run in the older
LD_LIBRARY_PATH-based Steam Runtime, they'll also run in our containers.

Resolves: https://github.com/ValveSoftware/steam-runtime/issues/367


Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
parent 09578b08
No related branches found
No related tags found
1 merge request!248Use a better default for the graphics stack
......@@ -1074,7 +1074,7 @@ static GOptionEntry options[] =
"and will be adjusted for use on the host system if pressure-vessel "
"is run in a container. The empty string means use the graphics "
"stack from container."
"[Default: $PRESSURE_VESSEL_GRAPHICS_PROVIDER or '/run/host' or '/']", "PATH" },
"[Default: $PRESSURE_VESSEL_GRAPHICS_PROVIDER or '/']", "PATH" },
{ "launcher", '\0',
G_OPTION_FLAG_NONE, G_OPTION_ARG_NONE, &opt_launcher,
"Instead of specifying a command with its arguments to execute, all the "
......@@ -1431,12 +1431,24 @@ main (int argc,
if (opt_graphics_provider == NULL)
{
/* Also check the deprecated 'PRESSURE_VESSEL_HOST_GRAPHICS' */
if (!pv_boolean_environment ("PRESSURE_VESSEL_HOST_GRAPHICS", TRUE))
opt_graphics_provider = g_strdup ("");
else if (g_file_test ("/run/host", G_FILE_TEST_IS_DIR))
opt_graphics_provider = g_strdup ("/run/host");
Tristate value = tristate_environment ("PRESSURE_VESSEL_HOST_GRAPHICS");
if (value == TRISTATE_MAYBE)
{
opt_graphics_provider = g_strdup ("/");
}
else
opt_graphics_provider = g_strdup ("/");
{
g_warning ("$PRESSURE_VESSEL_HOST_GRAPHICS is deprecated, "
"please use PRESSURE_VESSEL_GRAPHICS_PROVIDER instead");
if (value == TRISTATE_NO)
opt_graphics_provider = g_strdup ("");
else if (g_file_test ("/run/host", G_FILE_TEST_IS_DIR))
opt_graphics_provider = g_strdup ("/run/host");
else
opt_graphics_provider = g_strdup ("/");
}
}
g_assert (opt_graphics_provider != NULL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment