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

runtime: Move more responsibility for runtime setup to here

parent 66f3ecce
No related branches found
No related tags found
No related merge requests found
...@@ -104,6 +104,8 @@ static const char * const libquals[] = ...@@ -104,6 +104,8 @@ static const char * const libquals[] =
static gboolean pv_runtime_use_host_graphics_stack (PvRuntime *self, static gboolean pv_runtime_use_host_graphics_stack (PvRuntime *self,
FlatpakBwrap *bwrap, FlatpakBwrap *bwrap,
GError **error); GError **error);
static void pv_runtime_set_search_paths (PvRuntime *self,
FlatpakBwrap *bwrap);
static void static void
pv_runtime_init (PvRuntime *self) pv_runtime_init (PvRuntime *self)
...@@ -1760,6 +1762,10 @@ pv_runtime_bind (PvRuntime *self, ...@@ -1760,6 +1762,10 @@ pv_runtime_bind (PvRuntime *self,
g_return_val_if_fail (!pv_bwrap_was_finished (bwrap), FALSE); g_return_val_if_fail (!pv_bwrap_was_finished (bwrap), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE); g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
/* Start with just the root tmpfs (which appears automatically)
* and the standard API filesystems */
pv_bwrap_add_api_filesystems (bwrap);
if (!bind_runtime (self, bwrap, error)) if (!bind_runtime (self, bwrap, error))
return FALSE; return FALSE;
...@@ -1772,6 +1778,8 @@ pv_runtime_bind (PvRuntime *self, ...@@ -1772,6 +1778,8 @@ pv_runtime_bind (PvRuntime *self,
"/run/pressure-vessel", "/run/pressure-vessel",
NULL); NULL);
pv_runtime_set_search_paths (self, bwrap);
return TRUE; return TRUE;
} }
......
...@@ -47,8 +47,6 @@ PvRuntime *pv_runtime_new (const char *source_files, ...@@ -47,8 +47,6 @@ PvRuntime *pv_runtime_new (const char *source_files,
void pv_runtime_append_lock_adverb (PvRuntime *self, void pv_runtime_append_lock_adverb (PvRuntime *self,
FlatpakBwrap *bwrap); FlatpakBwrap *bwrap);
void pv_runtime_set_search_paths (PvRuntime *self,
FlatpakBwrap *bwrap);
gboolean pv_runtime_bind (PvRuntime *self, gboolean pv_runtime_bind (PvRuntime *self,
FlatpakBwrap *bwrap, FlatpakBwrap *bwrap,
GError **error); GError **error);
......
...@@ -1026,15 +1026,9 @@ main (int argc, ...@@ -1026,15 +1026,9 @@ main (int argc,
tools_dir, tools_dir,
error); error);
/* Start with just the root tmpfs (which appears automatically)
* and the standard API filesystems */
pv_bwrap_add_api_filesystems (bwrap);
if (runtime == NULL) if (runtime == NULL)
goto out; goto out;
pv_runtime_set_search_paths (runtime, bwrap);
if (!pv_runtime_bind (runtime, bwrap, error)) if (!pv_runtime_bind (runtime, bwrap, error))
goto out; goto out;
} }
......
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