[sysprof] flatpak: add access to host system



commit c115a9b59fcba797dbe5605b0fc0fbb938a2e0ac
Author: Christian Hergert <chergert redhat com>
Date:   Mon May 6 21:24:08 2019 -0700

    flatpak: add access to host system
    
    THis allows us to get access to the hosts symbol directories,
    which is necessary for resolving symbols there.

 build-aux/flatpak/org.gnome.Sysprof2.json |  2 ++
 lib/symbols/sp-symbol-dirs.c              | 14 ++++++++++++++
 2 files changed, 16 insertions(+)
---
diff --git a/build-aux/flatpak/org.gnome.Sysprof2.json b/build-aux/flatpak/org.gnome.Sysprof2.json
index 473aff7..022542a 100644
--- a/build-aux/flatpak/org.gnome.Sysprof2.json
+++ b/build-aux/flatpak/org.gnome.Sysprof2.json
@@ -17,6 +17,8 @@
         "--talk-name=org.gtk.vfs.*",
         "--system-talk-name=org.freedesktop.PolicyKit1",
         "--system-talk-name=org.gnome.Sysprof2",
+        "--filesystem=home",
+        "--filesystem=host",
         "--filesystem=xdg-run/dconf",
         "--filesystem=~/.config/dconf:ro",
         "--talk-name=ca.desrt.dconf",
diff --git a/lib/symbols/sp-symbol-dirs.c b/lib/symbols/sp-symbol-dirs.c
index 455fee8..ccc0d50 100644
--- a/lib/symbols/sp-symbol-dirs.c
+++ b/lib/symbols/sp-symbol-dirs.c
@@ -31,6 +31,20 @@ sp_get_symbol_dirs_locked (void)
     {
       sp_symbol_dirs = g_ptr_array_new ();
       g_ptr_array_add (sp_symbol_dirs, g_strdup ("/usr/lib/debug"));
+
+      /* Add path to host system if we have it */
+      if (g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS))
+        {
+          static gchar *tries[] = {
+            "/var/run/host/usr/lib/debug",
+          };
+
+          for (guint i = 0; i < G_N_ELEMENTS (tries); i++)
+            {
+              if (g_file_test (tries[i], G_FILE_TEST_EXISTS))
+                g_ptr_array_add (sp_symbol_dirs, g_strdup (tries[i]));
+            }
+        }
     }
 
   return sp_symbol_dirs;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]