diff options
| author | Ross Burton <ross.burton@intel.com> | 2013-06-19 15:51:03 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-06-25 17:44:54 +0100 |
| commit | 9e28afb8245ed2acb06457f19bdd4ab4c7b7670f (patch) | |
| tree | 1ad93baba3ef3fdaca10ceacd536076952503f7d | |
| parent | fb6f0d4d8100d7419f8a2ac5a5eba5a3edce0825 (diff) | |
| download | poky-9e28afb8245ed2acb06457f19bdd4ab4c7b7670f.tar.gz | |
weston: add patches to make weston-launch work
(From OE-Core rev: 7b4f2c7c305ef4c0848311712f17cab76232c4bf)
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-graphics/wayland/weston/groups.patch | 47 | ||||
| -rw-r--r-- | meta/recipes-graphics/wayland/weston/weston-launch-shell.patch | 74 | ||||
| -rw-r--r-- | meta/recipes-graphics/wayland/weston_1.1.0.bb | 2 |
3 files changed, 123 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston/groups.patch b/meta/recipes-graphics/wayland/weston/groups.patch new file mode 100644 index 0000000000..9dc043ac3b --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/groups.patch | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | Upstream-Status: Submitted (https://bugs.freedesktop.org/show_bug.cgi?id=65933) | ||
| 2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
| 3 | |||
| 4 | From 42821739a228a85ce3432be1796858e5cc31688b Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Quentin Glidic <sardemff7+git@sardemff7.net> | ||
| 6 | Date: Wed, 19 Jun 2013 15:27:11 +0200 | ||
| 7 | Subject: [PATCH weston] weston-launch: Set all groups for user | ||
| 8 | |||
| 9 | Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> | ||
| 10 | --- | ||
| 11 | configure.ac | 2 +- | ||
| 12 | src/weston-launch.c | 4 ++++ | ||
| 13 | 2 files changed, 5 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/configure.ac b/configure.ac | ||
| 16 | index b625221..db3feb0 100644 | ||
| 17 | --- a/configure.ac | ||
| 18 | +++ b/configure.ac | ||
| 19 | @@ -52,7 +52,7 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[], | ||
| 20 | [[#include <time.h>]]) | ||
| 21 | AC_CHECK_HEADERS([execinfo.h]) | ||
| 22 | |||
| 23 | -AC_CHECK_FUNCS([mkostemp strchrnul]) | ||
| 24 | +AC_CHECK_FUNCS([mkostemp strchrnul initgroups]) | ||
| 25 | |||
| 26 | COMPOSITOR_MODULES="wayland-server >= 1.1.90 xkbcommon pixman-1" | ||
| 27 | |||
| 28 | diff --git a/src/weston-launch.c b/src/weston-launch.c | ||
| 29 | index 76dcede..7d7b556 100644 | ||
| 30 | --- a/src/weston-launch.c | ||
| 31 | +++ b/src/weston-launch.c | ||
| 32 | @@ -631,9 +631,13 @@ main(int argc, char *argv[]) | ||
| 33 | } | ||
| 34 | |||
| 35 | if (setgid(wl.pw->pw_gid) < 0 || | ||
| 36 | +#ifdef HAVE_INITGROUPS | ||
| 37 | + initgroups(wl.pw->pw_name, wl.pw->pw_gid) < 0 || | ||
| 38 | +#endif | ||
| 39 | setuid(wl.pw->pw_uid) < 0) | ||
| 40 | error(1, errno, "dropping privilidges failed"); | ||
| 41 | |||
| 42 | + | ||
| 43 | if (sleep_fork) { | ||
| 44 | if (wl.verbose) | ||
| 45 | printf("weston-launch: waiting %d seconds\n", sleep_fork); | ||
| 46 | -- | ||
| 47 | 1.8.3 | ||
diff --git a/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch b/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch new file mode 100644 index 0000000000..ffe0608ee2 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/weston-launch-shell.patch | |||
| @@ -0,0 +1,74 @@ | |||
| 1 | Upstream-Status: Backport | ||
| 2 | Signed-off-by: Ross Burton <ross.burton@intel.com> | ||
| 3 | |||
| 4 | From ff3230952a68077669e0ea0ac3ceb234273556fc Mon Sep 17 00:00:00 2001 | ||
| 5 | From: Quentin Glidic <sardemff7+git@sardemff7.net> | ||
| 6 | Date: Fri, 17 May 2013 16:20:37 +0200 | ||
| 7 | Subject: [PATCH] weston-launch: Run weston in the user login shell | ||
| 8 | |||
| 9 | This patch brings back the user environment from the shell. | ||
| 10 | In the future, weston-launch could create the Wayland socket earlier, in | ||
| 11 | which case the user's shell could be used to run Wayland-specific tools | ||
| 12 | in the new Weston session. | ||
| 13 | |||
| 14 | Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net> | ||
| 15 | --- | ||
| 16 | src/weston-launch.c | 19 ++++++++++++++++--- | ||
| 17 | 1 file changed, 16 insertions(+), 3 deletions(-) | ||
| 18 | |||
| 19 | diff --git a/src/weston-launch.c b/src/weston-launch.c | ||
| 20 | index 64d4a8a..89c3c5a 100644 | ||
| 21 | --- a/src/weston-launch.c | ||
| 22 | +++ b/src/weston-launch.c | ||
| 23 | @@ -60,6 +60,8 @@ | ||
| 24 | |||
| 25 | #include "weston-launch.h" | ||
| 26 | |||
| 27 | +#define MAX_ARGV_SIZE 256 | ||
| 28 | + | ||
| 29 | struct weston_launch { | ||
| 30 | struct pam_conv pc; | ||
| 31 | pam_handle_t *ph; | ||
| 32 | @@ -523,8 +525,9 @@ main(int argc, char *argv[]) | ||
| 33 | struct weston_launch wl; | ||
| 34 | char **env; | ||
| 35 | int i, c; | ||
| 36 | - char **child_argv; | ||
| 37 | + char *child_argv[MAX_ARGV_SIZE]; | ||
| 38 | char *tty = NULL, *new_user = NULL; | ||
| 39 | + char *term; | ||
| 40 | int sleep_fork = 0; | ||
| 41 | struct option opts[] = { | ||
| 42 | { "user", required_argument, NULL, 'u' }, | ||
| 43 | @@ -562,8 +565,8 @@ main(int argc, char *argv[]) | ||
| 44 | } | ||
| 45 | } | ||
| 46 | |||
| 47 | - child_argv = &argv[optind-1]; | ||
| 48 | - child_argv[0] = BINDIR "/weston"; | ||
| 49 | + if ((argc - optind) > (MAX_ARGV_SIZE - 5)) | ||
| 50 | + error(1, E2BIG, "Too many arguments to pass to weston"); | ||
| 51 | |||
| 52 | if (new_user) | ||
| 53 | wl.pw = getpwnam(new_user); | ||
| 54 | @@ -572,7 +575,17 @@ main(int argc, char *argv[]) | ||
| 55 | if (wl.pw == NULL) | ||
| 56 | error(1, errno, "failed to get username"); | ||
| 57 | |||
| 58 | + child_argv[0] = wl.pw->pw_shell; | ||
| 59 | + child_argv[1] = "-l"; | ||
| 60 | + child_argv[2] = "-c"; | ||
| 61 | + child_argv[3] = BINDIR "/weston \"$@\""; | ||
| 62 | + child_argv[4] = "weston"; | ||
| 63 | + for (i = 0; i < (argc - optind); ++i) | ||
| 64 | + child_argv[5+i] = argv[optind+i]; | ||
| 65 | + | ||
| 66 | + term = getenv("TERM"); | ||
| 67 | clearenv(); | ||
| 68 | + setenv("TERM", term, 1); | ||
| 69 | setenv("USER", wl.pw->pw_name, 1); | ||
| 70 | setenv("LOGNAME", wl.pw->pw_name, 1); | ||
| 71 | setenv("HOME", wl.pw->pw_dir, 1); | ||
| 72 | -- | ||
| 73 | 1.7.10.4 | ||
| 74 | |||
diff --git a/meta/recipes-graphics/wayland/weston_1.1.0.bb b/meta/recipes-graphics/wayland/weston_1.1.0.bb index 026f13666b..ee33be6b64 100644 --- a/meta/recipes-graphics/wayland/weston_1.1.0.bb +++ b/meta/recipes-graphics/wayland/weston_1.1.0.bb | |||
| @@ -7,6 +7,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=275efac2559a224527bd4fd593d38466 \ | |||
| 7 | 7 | ||
| 8 | SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ | 8 | SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ |
| 9 | file://install-examples.patch \ | 9 | file://install-examples.patch \ |
| 10 | file://weston-launch-shell.patch \ | ||
| 11 | file://groups.patch \ | ||
| 10 | file://weston.png \ | 12 | file://weston.png \ |
| 11 | file://weston.desktop" | 13 | file://weston.desktop" |
| 12 | SRC_URI[md5sum] = "dd9f3043fc5228c6bc4e99873fae2254" | 14 | SRC_URI[md5sum] = "dd9f3043fc5228c6bc4e99873fae2254" |
