All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB not mounted.
@ 2014-08-26 14:24 Marius Avram
  2014-08-26 14:24 ` [PATCH] Fix USB not mounted in file manager Marius Avram
  0 siblings, 1 reply; 4+ messages in thread
From: Marius Avram @ 2014-08-26 14:24 UTC (permalink / raw)
  To: yocto

I also created a bug on the gnome bugtracker, in case it is a general problem
and not simply yocto related:

https://bugzilla.gnome.org/show_bug.cgi?id=735447

Marius Avram (1):
  Fix USB not mounted in file manager

 ...un-media-sdX-drive-mount-if-username-root.patch |   44 ++++++++++++++++++++
 meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb      |    2 +-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch

-- 
1.7.9.5



^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCH] Fix USB not mounted in file manager
@ 2014-08-27  8:09 Marius Avram
  0 siblings, 0 replies; 4+ messages in thread
From: Marius Avram @ 2014-08-27  8:09 UTC (permalink / raw)
  To: openembedded-core

Currently a USB stick gets mounted on /run/media/sdX, where X is the
letter corresponding to a certain drive. In older builds of core-image-sato
it got mounted in /media/sdX. This change made the drives to not be
displayed in graphical applications which use glib-2.0 such as the
File Manager (pcmanfm). The reason is that the gio component of glib-2.0
which handles mounts contains a function which determines if a mount
is worthy to be displayed in the UI or not. The function is called
g_unix_mount_guess_should_display().

It expects a drive to be mounted in /run/media/<username>/sdX, but
in the current build the username part is missing in case a root user
is authenticated in the system.

The easiest solution is to allow the display of drives mounted in the
path used by the current configuration and that is /run/media/sdX.

[YOCTO #6492]

Signed-off-by: Marius Avram <marius.avram@intel.com>
---
 ...un-media-sdX-drive-mount-if-username-root.patch |   43 ++++++++++++++++++++
 meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb      |    2 +-
 2 files changed, 44 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch

diff --git a/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch b/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch
new file mode 100644
index 0000000..13e35e7
--- /dev/null
+++ b/meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch
@@ -0,0 +1,43 @@
+From: Marius Avram <marius.avram@intel.com>
+Date: Tue, 26 Aug 2014 16:31:51 +0300
+Subject: [PATCH] Allow /run/media/sdX drive mount if username root
+
+In case that the username logged in the system is root
+the drives are directly mounted in /run/media/sdX and
+not /run/media/<username>/sdX as the function
+g_unix_mount_guess_should_display() expects.
+
+Without this change USB stick mounts are not accesible from
+graphical applications such as the File Manager (pcmanfm).
+
+Upstream-Status: Inappropriate
+
+Signed-off-by: Marius Avram <marius.avram@intel.com>
+---
+ gio/gunixmounts.c |    6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
+index 4999354..5053f5e 100644
+--- a/gio/gunixmounts.c
++++ b/gio/gunixmounts.c
+@@ -2131,11 +2131,17 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
+       /* Check /run/media/$USER/ */
+       user_name = g_get_user_name ();
+       user_name_len = strlen (user_name);
+       if (strncmp (mount_path, "/run/media/", sizeof ("/run/media/") - 1) == 0 &&
+           strncmp (mount_path + sizeof ("/run/media/") - 1, user_name, user_name_len) == 0 &&
+           mount_path[sizeof ("/run/media/") - 1 + user_name_len] == '/')
+         is_in_runtime_dir = TRUE;
+
++      /* Allow no username in path in /run/media if current user is root */
++      if (strcmp(user_name, "root") == 0 &&
++          strncmp (mount_path, "/run/media/", sizeof("run/media")) == 0)
++        is_in_runtime_dir = TRUE;
++
+       if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/"))
+         {
+           char *path;
+--
+1.7.9.5
+
diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb
index ff1fb87..211bc32 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb
@@ -12,7 +12,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
            file://run-ptest \
            file://ptest-paths.patch \
            file://uclibc.patch \
-           file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch \
+           file://allow-run-media-sdX-drive-mount-if-username-root.patch \
           "
 
 SRC_URI_append_class-native = " file://glib-gettextize-dir.patch"
-- 
1.7.9.5



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-27  8:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-26 14:24 [PATCH] USB not mounted Marius Avram
2014-08-26 14:24 ` [PATCH] Fix USB not mounted in file manager Marius Avram
2014-08-26 14:35   ` Burton, Ross
  -- strict thread matches above, loose matches on Subject: below --
2014-08-27  8:09 Marius Avram

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.