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

Merge branch 'wip/denittis/issue97' into 'main'

pv-wrap: Fix /run/host binding when under an emulator

See merge request !516
parents 514bc1df f39a6e8e
No related branches found
No related tags found
1 merge request!516pv-wrap: Fix /run/host binding when under an emulator
......@@ -1577,11 +1577,31 @@ main (int argc,
pv_bwrap_add_api_filesystems (bwrap_filesystem_arguments, sysfs_mode);
/* The FlatpakExports will populate /run/host for us */
flatpak_exports_add_host_etc_expose (exports,
FLATPAK_FILESYSTEM_MODE_READ_ONLY);
flatpak_exports_add_host_os_expose (exports,
FLATPAK_FILESYSTEM_MODE_READ_ONLY);
flatpak_bwrap_add_args (bwrap_filesystem_arguments,
"--ro-bind", "/etc", "/run/host/etc", NULL);
if (!pv_bwrap_bind_usr (bwrap, "/", root_fd, "/run/host", error))
goto out;
if (interpreter_root != NULL)
{
/* If we are in an emulator, we also need to populate /run/host
* in the interpreter mount point */
glnx_autofd int interpreter_fd = -1;
g_autofree gchar *inter_run_host = g_build_filename (PV_RUNTIME_PATH_INTERPRETER_ROOT,
"/run/host", NULL);
g_autofree gchar *etc_src = g_build_filename (interpreter_root,
"etc", NULL);
g_autofree gchar *etc_dest = g_build_filename (inter_run_host, "etc", NULL);
if (!glnx_opendirat (-1, interpreter_root, TRUE, &interpreter_fd, error))
goto out;
flatpak_bwrap_add_args (bwrap_filesystem_arguments,
"--ro-bind", etc_src, etc_dest, NULL);
if (!pv_bwrap_bind_usr (bwrap, interpreter_root, interpreter_fd, inter_run_host, error))
goto out;
}
/* steam-runtime-system-info uses this to detect pressure-vessel, so we
* need to create it even if it will be empty */
......
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