summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glib-2.0
diff options
context:
space:
mode:
authorMarius Avram <marius.avram@intel.com>2014-09-08 12:58:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-10 11:33:25 +0100
commitc46a54853a47b6373e71a9f25b537b6ab907db3e (patch)
treecfe069ad9beff975109c43d9bfadd5ae5b3928cc /meta/recipes-core/glib-2.0
parent77369679efb68ef89141fff914ccac93c836853e (diff)
downloadpoky-c46a54853a47b6373e71a9f25b537b6ab907db3e.tar.gz
glib-2.0: fix mount detection
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] (From OE-Core rev: da9bbcd2233057a0529005b9b2cc34aff65bc6e2) Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glib-2.0')
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0/allow-run-media-sdX-drive-mount-if-username-root.patch39
-rw-r--r--meta/recipes-core/glib-2.0/glib-2.0_2.40.0.bb1
2 files changed, 40 insertions, 0 deletions
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 0000000000..3d0c008bbe
--- /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,39 @@
1From c53e94a520b573aa0dcf12903e9563fe8badc34c Mon Sep 17 00:00:00 2001
2From: Marius Avram <marius.avram@intel.com>
3Date: Wed, 27 Aug 2014 12:10:41 +0300
4Subject: [PATCH] Allow /run/media/sdX drive mount if username root
5
6In case that the username logged in the system is root
7the drives are directly mounted in /run/media/sdX and
8not /run/media/<username>/sdX as the function
9g_unix_mount_guess_should_display() expects.
10
11Without this change USB stick mounts are not accesible from
12graphical applications such as the File Manager (pcmanfm).
13
14Upstream-Status: Inappropriate
15
16Signed-off-by: Marius Avram <marius.avram@intel.com>
17---
18 gio/gunixmounts.c | 5 +++++
19 1 file changed, 5 insertions(+)
20
21diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
22index 4999354..f6c1472 100644
23--- a/gio/gunixmounts.c
24+++ b/gio/gunixmounts.c
25@@ -2136,6 +2136,11 @@ g_unix_mount_guess_should_display (GUnixMountEntry *mount_entry)
26 mount_path[sizeof ("/run/media/") - 1 + user_name_len] == '/')
27 is_in_runtime_dir = TRUE;
28
29+ /* Allow no username in path in /run/media if current user is root */
30+ if (strcmp(user_name, "root") == 0 &&
31+ strncmp (mount_path, "/run/media/", sizeof("run/media")) == 0)
32+ is_in_runtime_dir = TRUE;
33+
34 if (is_in_runtime_dir || g_str_has_prefix (mount_path, "/media/"))
35 {
36 char *path;
37--
381.7.9.5
39
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 ff1fb87a38..4b1bcf85c5 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
@@ -13,6 +13,7 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
13 file://ptest-paths.patch \ 13 file://ptest-paths.patch \
14 file://uclibc.patch \ 14 file://uclibc.patch \
15 file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch \ 15 file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch \
16 file://allow-run-media-sdX-drive-mount-if-username-root.patch \
16 " 17 "
17 18
18SRC_URI_append_class-native = " file://glib-gettextize-dir.patch" 19SRC_URI_append_class-native = " file://glib-gettextize-dir.patch"