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

Merge branch 'wip/t16562' into 'master'

Pass --library-knowledge to capsule-capture-libs

See merge request steam/pressure-vessel!56
parents d5f15cee 67b855f6
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ Architecture: amd64 i386 ...@@ -24,7 +24,7 @@ Architecture: amd64 i386
Multi-Arch: foreign Multi-Arch: foreign
Depends: Depends:
bubblewrap, bubblewrap,
libcapsule-tools-relocatable, libcapsule-tools-relocatable (>= 0.20200707.0~),
python3 (>= 3.5) | python3.5, python3 (>= 3.5) | python3.5,
steam-runtime-tools-bin, steam-runtime-tools-bin,
${misc:Depends}, ${misc:Depends},
...@@ -41,8 +41,8 @@ Package: pressure-vessel-libs-amd64 ...@@ -41,8 +41,8 @@ Package: pressure-vessel-libs-amd64
Architecture: amd64 Architecture: amd64
Multi-Arch: foreign Multi-Arch: foreign
Depends: Depends:
libcapsule-tools-relocatable, libcapsule-tools-relocatable (>= 0.20200707.0~),
libsteam-runtime-tools-0-helpers, libsteam-runtime-tools-0-helpers (>= 0.20200707.0~),
${misc:Depends}, ${misc:Depends},
${shlibs:Depends}, ${shlibs:Depends},
Description: Steam container launcher - cross-architecture dependencies Description: Steam container launcher - cross-architecture dependencies
...@@ -54,8 +54,8 @@ Package: pressure-vessel-libs-i386 ...@@ -54,8 +54,8 @@ Package: pressure-vessel-libs-i386
Architecture: i386 Architecture: i386
Multi-Arch: foreign Multi-Arch: foreign
Depends: Depends:
libcapsule-tools-relocatable, libcapsule-tools-relocatable (>= 0.20200707.0~),
libsteam-runtime-tools-0-helpers, libsteam-runtime-tools-0-helpers (>= 0.20200707.0~),
${misc:Depends}, ${misc:Depends},
${shlibs:Depends}, ${shlibs:Depends},
Description: Steam container launcher - cross-architecture dependencies Description: Steam container launcher - cross-architecture dependencies
......
...@@ -53,6 +53,7 @@ struct _PvRuntime ...@@ -53,6 +53,7 @@ struct _PvRuntime
gchar *tools_dir; gchar *tools_dir;
PvBwrapLock *runtime_lock; PvBwrapLock *runtime_lock;
gchar *libcapsule_knowledge;
gchar *mutable_parent; gchar *mutable_parent;
gchar *mutable_sysroot; gchar *mutable_sysroot;
gchar *tmpdir; gchar *tmpdir;
...@@ -752,6 +753,14 @@ pv_runtime_initable_init (GInitable *initable, ...@@ -752,6 +753,14 @@ pv_runtime_initable_init (GInitable *initable,
self->runtime_usr = g_strdup (self->runtime_files); self->runtime_usr = g_strdup (self->runtime_files);
} }
self->libcapsule_knowledge = g_build_filename (self->runtime_usr,
"lib", "steamrt",
"libcapsule-knowledge.keyfile",
NULL);
if (!g_file_test (self->libcapsule_knowledge, G_FILE_TEST_EXISTS))
g_clear_pointer (&self->libcapsule_knowledge, g_free);
return TRUE; return TRUE;
} }
...@@ -782,6 +791,7 @@ pv_runtime_finalize (GObject *object) ...@@ -782,6 +791,7 @@ pv_runtime_finalize (GObject *object)
pv_runtime_cleanup (self); pv_runtime_cleanup (self);
g_free (self->bubblewrap); g_free (self->bubblewrap);
g_free (self->libcapsule_knowledge);
glnx_close_fd (&self->mutable_parent_fd); glnx_close_fd (&self->mutable_parent_fd);
g_free (self->mutable_parent); g_free (self->mutable_parent);
glnx_close_fd (&self->mutable_sysroot_fd); glnx_close_fd (&self->mutable_sysroot_fd);
...@@ -1020,6 +1030,27 @@ pv_runtime_provide_container_access (PvRuntime *self, ...@@ -1020,6 +1030,27 @@ pv_runtime_provide_container_access (PvRuntime *self,
return TRUE; return TRUE;
} }
static FlatpakBwrap *
pv_runtime_get_capsule_capture_libs (PvRuntime *self,
RuntimeArchitecture *arch)
{
FlatpakBwrap *ret = pv_bwrap_copy (self->container_access_adverb);
flatpak_bwrap_add_args (ret,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--provider", "/",
NULL);
if (self->libcapsule_knowledge)
flatpak_bwrap_add_args (ret,
"--library-knowledge", self->libcapsule_knowledge,
NULL);
return ret;
}
static gboolean static gboolean
try_bind_dri (PvRuntime *self, try_bind_dri (PvRuntime *self,
RuntimeArchitecture *arch, RuntimeArchitecture *arch,
...@@ -1044,13 +1075,9 @@ try_bind_dri (PvRuntime *self, ...@@ -1044,13 +1075,9 @@ try_bind_dri (PvRuntime *self,
if (!pv_runtime_provide_container_access (self, error)) if (!pv_runtime_provide_container_access (self, error))
return FALSE; return FALSE;
temp_bwrap = pv_bwrap_copy (self->container_access_adverb); temp_bwrap = pv_runtime_get_capsule_capture_libs (self, arch);
flatpak_bwrap_add_args (temp_bwrap, flatpak_bwrap_add_args (temp_bwrap,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--dest", arch->libdir_on_host, "--dest", arch->libdir_on_host,
"--provider", "/",
expr, expr,
NULL); NULL);
flatpak_bwrap_finish (temp_bwrap); flatpak_bwrap_finish (temp_bwrap);
...@@ -1101,13 +1128,9 @@ try_bind_dri (PvRuntime *self, ...@@ -1101,13 +1128,9 @@ try_bind_dri (PvRuntime *self,
if (!pv_runtime_provide_container_access (self, error)) if (!pv_runtime_provide_container_access (self, error))
return FALSE; return FALSE;
temp_bwrap = pv_bwrap_copy (self->container_access_adverb); temp_bwrap = pv_runtime_get_capsule_capture_libs (self, arch);
flatpak_bwrap_add_args (temp_bwrap, flatpak_bwrap_add_args (temp_bwrap,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--dest", arch->libdir_on_host, "--dest", arch->libdir_on_host,
"--provider", "/",
expr, expr,
NULL); NULL);
flatpak_bwrap_finish (temp_bwrap); flatpak_bwrap_finish (temp_bwrap);
...@@ -1365,14 +1388,10 @@ bind_icd (PvRuntime *self, ...@@ -1365,14 +1388,10 @@ bind_icd (PvRuntime *self,
if (!pv_runtime_provide_container_access (self, error)) if (!pv_runtime_provide_container_access (self, error))
return FALSE; return FALSE;
temp_bwrap = pv_bwrap_copy (self->container_access_adverb); temp_bwrap = pv_runtime_get_capsule_capture_libs (self, arch);
flatpak_bwrap_add_args (temp_bwrap, flatpak_bwrap_add_args (temp_bwrap,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--dest", "--dest",
on_host == NULL ? arch->libdir_on_host : on_host, on_host == NULL ? arch->libdir_on_host : on_host,
"--provider", "/",
pattern, pattern,
NULL); NULL);
flatpak_bwrap_finish (temp_bwrap); flatpak_bwrap_finish (temp_bwrap);
...@@ -1395,13 +1414,9 @@ bind_icd (PvRuntime *self, ...@@ -1395,13 +1414,9 @@ bind_icd (PvRuntime *self,
} }
} }
temp_bwrap = pv_bwrap_copy (self->container_access_adverb); temp_bwrap = pv_runtime_get_capsule_capture_libs (self, arch);
flatpak_bwrap_add_args (temp_bwrap, flatpak_bwrap_add_args (temp_bwrap,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--dest", arch->libdir_on_host, "--dest", arch->libdir_on_host,
"--provider", "/",
dependency_pattern, dependency_pattern,
NULL); NULL);
flatpak_bwrap_finish (temp_bwrap); flatpak_bwrap_finish (temp_bwrap);
...@@ -2266,13 +2281,9 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, ...@@ -2266,13 +2281,9 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self,
g_debug ("Collecting graphics drivers from host system..."); g_debug ("Collecting graphics drivers from host system...");
temp_bwrap = pv_bwrap_copy (self->container_access_adverb); temp_bwrap = pv_runtime_get_capsule_capture_libs (self, arch);
flatpak_bwrap_add_args (temp_bwrap, flatpak_bwrap_add_args (temp_bwrap,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--dest", arch->libdir_on_host, "--dest", arch->libdir_on_host,
"--provider", "/",
/* Mesa GLX, etc. */ /* Mesa GLX, etc. */
"gl:", "gl:",
/* Vulkan */ /* Vulkan */
...@@ -2432,13 +2443,9 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self, ...@@ -2432,13 +2443,9 @@ pv_runtime_use_host_graphics_stack (PvRuntime *self,
/* Collect miscellaneous libraries that libc might dlopen. /* Collect miscellaneous libraries that libc might dlopen.
* At the moment this is just libidn2. */ * At the moment this is just libidn2. */
g_assert (temp_bwrap == NULL); g_assert (temp_bwrap == NULL);
temp_bwrap = pv_bwrap_copy (self->container_access_adverb); temp_bwrap = pv_runtime_get_capsule_capture_libs (self, arch);
flatpak_bwrap_add_args (temp_bwrap, flatpak_bwrap_add_args (temp_bwrap,
arch->capsule_capture_libs,
"--container", self->container_access,
"--link-target", "/run/host",
"--dest", arch->libdir_on_host, "--dest", arch->libdir_on_host,
"--provider", "/",
"if-exists:libidn2.so.0", "if-exists:libidn2.so.0",
NULL); NULL);
flatpak_bwrap_finish (temp_bwrap); flatpak_bwrap_finish (temp_bwrap);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment