diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 2a8fb711..69abded3 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -3637,24 +3637,31 @@ apply_extra_data (FlatpakDir *self, if (runtime_ref_parts == NULL) return FALSE; - runtime_deploy = flatpak_find_deploy_for_ref (runtime_ref, cancellable, error); - if (runtime_deploy == NULL) - return FALSE; + if (!g_key_file_get_boolean (metakey, "Extra Data", "NoRuntime", NULL)) + { + runtime_deploy = flatpak_find_deploy_for_ref (runtime_ref, cancellable, error); + if (runtime_deploy == NULL) + return FALSE; + runtime_files = flatpak_deploy_get_files (runtime_deploy); + } app_files = g_file_get_child (checkoutdir, "files"); app_export_file = g_file_get_child (checkoutdir, "export"); extra_files = g_file_get_child (app_files, "extra"); extra_export_file = g_file_get_child (extra_files, "export"); - runtime_files = flatpak_deploy_get_files (runtime_deploy); argv_array = g_ptr_array_new_with_free_func (g_free); fd_array = g_array_new (FALSE, TRUE, sizeof (int)); g_array_set_clear_func (fd_array, clear_fd); g_ptr_array_add (argv_array, g_strdup (flatpak_get_bwrap ())); - add_args (argv_array, - "--ro-bind", flatpak_file_get_path_cached (runtime_files), "/usr", + if (runtime_files) + add_args (argv_array, + "--ro-bind", flatpak_file_get_path_cached (runtime_files), "/usr", "--lock-file", "/usr/.ref", + NULL); + + add_args (argv_array, "--ro-bind", flatpak_file_get_path_cached (app_files), "/app", "--bind", flatpak_file_get_path_cached (extra_files), "/app/extra", "--chdir", "/app/extra", diff --git a/common/flatpak-run.c b/common/flatpak-run.c index fdd9153c..12eb669b 100644 --- a/common/flatpak-run.c +++ b/common/flatpak-run.c @@ -3960,8 +3960,10 @@ flatpak_run_setup_base_argv (GPtrArray *argv_array, else if (g_file_test ("/var/lib/dbus/machine-id", G_FILE_TEST_EXISTS)) add_args (argv_array, "--ro-bind", "/var/lib/dbus/machine-id", "/etc/machine-id", NULL); - etc = g_file_get_child (runtime_files, "etc"); - if ((flags & FLATPAK_RUN_FLAG_WRITABLE_ETC) == 0 && + if (runtime_files) + etc = g_file_get_child (runtime_files, "etc"); + if (etc != NULL && + (flags & FLATPAK_RUN_FLAG_WRITABLE_ETC) == 0 && g_file_query_exists (etc, NULL)) { g_auto(GLnxDirFdIterator) dfd_iter = { 0, }; @@ -4023,7 +4025,7 @@ flatpak_run_setup_base_argv (GPtrArray *argv_array, NULL); } - for (i = 0; i < G_N_ELEMENTS (usr_links); i++) + for (i = 0; runtime_files != NULL && i < G_N_ELEMENTS (usr_links); i++) { const char *subdir = usr_links[i]; g_autoptr(GFile) runtime_subdir = g_file_get_child (runtime_files, subdir);