summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch')
-rw-r--r--meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch47
1 files changed, 25 insertions, 22 deletions
diff --git a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
index 81cc025371..e50845b17a 100644
--- a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
+++ b/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -1,4 +1,4 @@
1From 7d2fea61a95e9498b5a19c8cffcb2ab5631d5685 Mon Sep 17 00:00:00 2001 1From 682b7d79a7b81ec8e38760381104b24ad549e8c0 Mon Sep 17 00:00:00 2001
2From: Tom Hochstein <tom.hochstein@nxp.com> 2From: Tom Hochstein <tom.hochstein@nxp.com>
3Date: Wed, 22 Feb 2017 15:53:30 +0200 3Date: Wed, 22 Feb 2017 15:53:30 +0200
4Subject: [PATCH] weston-launch: Provide a default version that doesn't require 4Subject: [PATCH] weston-launch: Provide a default version that doesn't require
@@ -18,16 +18,16 @@ Signed-off-by: Denys Dmytriyenko <denys@ti.com>
18Signed-off-by: Ming Liu <ming.liu@toradex.com> 18Signed-off-by: Ming Liu <ming.liu@toradex.com>
19--- 19---
20 libweston/meson.build | 16 ++++++++++++---- 20 libweston/meson.build | 16 ++++++++++++----
21 libweston/weston-launch.c | 20 ++++++++++++++++++++ 21 libweston/weston-launch.c | 21 +++++++++++++++++++++
22 meson_options.txt | 7 +++++++ 22 meson_options.txt | 7 +++++++
23 3 files changed, 39 insertions(+), 4 deletions(-) 23 3 files changed, 40 insertions(+), 4 deletions(-)
24 24
25diff --git a/libweston/meson.build b/libweston/meson.build 25diff --git a/libweston/meson.build b/libweston/meson.build
26index 33ab970..32f495a 100644 26index d8d3fc0..326683f 100644
27--- a/libweston/meson.build 27--- a/libweston/meson.build
28+++ b/libweston/meson.build 28+++ b/libweston/meson.build
29@@ -472,16 +472,24 @@ if get_option('renderer-gl') 29@@ -199,16 +199,24 @@ dep_vertex_clipping = declare_dependency(
30 endif 30 )
31 31
32 if get_option('weston-launch') 32 if get_option('weston-launch')
33- dep_pam = cc.find_library('pam') 33- dep_pam = cc.find_library('pam')
@@ -56,7 +56,7 @@ index 33ab970..32f495a 100644
56 install: true 56 install: true
57 ) 57 )
58diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c 58diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
59index 9064439..c6abe92 100644 59index 4962bd6..fc531c5 100644
60--- a/libweston/weston-launch.c 60--- a/libweston/weston-launch.c
61+++ b/libweston/weston-launch.c 61+++ b/libweston/weston-launch.c
62@@ -51,7 +51,9 @@ 62@@ -51,7 +51,9 @@
@@ -69,7 +69,7 @@ index 9064439..c6abe92 100644
69 69
70 #ifdef HAVE_SYSTEMD_LOGIN 70 #ifdef HAVE_SYSTEMD_LOGIN
71 #include <systemd/sd-login.h> 71 #include <systemd/sd-login.h>
72@@ -101,8 +103,10 @@ drmSetMaster(int drm_fd) 72@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd)
73 #endif 73 #endif
74 74
75 struct weston_launch { 75 struct weston_launch {
@@ -80,7 +80,7 @@ index 9064439..c6abe92 100644
80 int tty; 80 int tty;
81 int ttynr; 81 int ttynr;
82 int sock[2]; 82 int sock[2];
83@@ -191,6 +195,7 @@ weston_launch_allowed(struct weston_launch *wl) 83@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl)
84 return false; 84 return false;
85 } 85 }
86 86
@@ -88,7 +88,7 @@ index 9064439..c6abe92 100644
88 static int 88 static int
89 pam_conversation_fn(int msg_count, 89 pam_conversation_fn(int msg_count,
90 const struct pam_message **messages, 90 const struct pam_message **messages,
91@@ -231,6 +236,7 @@ setup_pam(struct weston_launch *wl) 91@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl)
92 92
93 return 0; 93 return 0;
94 } 94 }
@@ -96,7 +96,7 @@ index 9064439..c6abe92 100644
96 96
97 static int 97 static int
98 setup_launcher_socket(struct weston_launch *wl) 98 setup_launcher_socket(struct weston_launch *wl)
99@@ -424,6 +430,7 @@ quit(struct weston_launch *wl, int status) 99@@ -431,6 +437,7 @@ quit(struct weston_launch *wl, int status)
100 close(wl->signalfd); 100 close(wl->signalfd);
101 close(wl->sock[0]); 101 close(wl->sock[0]);
102 102
@@ -104,7 +104,7 @@ index 9064439..c6abe92 100644
104 if (wl->new_user) { 104 if (wl->new_user) {
105 err = pam_close_session(wl->ph, 0); 105 err = pam_close_session(wl->ph, 0);
106 if (err) 106 if (err)
107@@ -431,6 +438,7 @@ quit(struct weston_launch *wl, int status) 107@@ -438,6 +445,7 @@ quit(struct weston_launch *wl, int status)
108 err, pam_strerror(wl->ph, err)); 108 err, pam_strerror(wl->ph, err));
109 pam_end(wl->ph, err); 109 pam_end(wl->ph, err);
110 } 110 }
@@ -112,7 +112,7 @@ index 9064439..c6abe92 100644
112 112
113 if (ioctl(wl->tty, KDSKBMUTE, 0) && 113 if (ioctl(wl->tty, KDSKBMUTE, 0) &&
114 ioctl(wl->tty, KDSKBMODE, wl->kb_mode)) 114 ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
115@@ -610,6 +618,7 @@ setup_session(struct weston_launch *wl, char **child_argv) 115@@ -660,6 +668,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
116 setenv("HOME", wl->pw->pw_dir, 1); 116 setenv("HOME", wl->pw->pw_dir, 1);
117 setenv("SHELL", wl->pw->pw_shell, 1); 117 setenv("SHELL", wl->pw->pw_shell, 1);
118 118
@@ -120,7 +120,7 @@ index 9064439..c6abe92 100644
120 env = pam_getenvlist(wl->ph); 120 env = pam_getenvlist(wl->ph);
121 if (env) { 121 if (env) {
122 for (i = 0; env[i]; ++i) { 122 for (i = 0; env[i]; ++i) {
123@@ -618,6 +627,7 @@ setup_session(struct weston_launch *wl, char **child_argv) 123@@ -668,6 +677,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
124 } 124 }
125 free(env); 125 free(env);
126 } 126 }
@@ -128,7 +128,7 @@ index 9064439..c6abe92 100644
128 128
129 /* 129 /*
130 * We open a new session, so it makes sense 130 * We open a new session, so it makes sense
131@@ -685,8 +695,10 @@ static void 131@@ -739,8 +749,10 @@ static void
132 help(const char *name) 132 help(const char *name)
133 { 133 {
134 fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); 134 fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
@@ -139,7 +139,7 @@ index 9064439..c6abe92 100644
139 fprintf(stderr, " -t, --tty Start session on alternative tty,\n" 139 fprintf(stderr, " -t, --tty Start session on alternative tty,\n"
140 " e.g. -t /dev/tty4, requires -u option.\n"); 140 " e.g. -t /dev/tty4, requires -u option.\n");
141 fprintf(stderr, " -v, --verbose Be verbose\n"); 141 fprintf(stderr, " -v, --verbose Be verbose\n");
142@@ -700,7 +712,9 @@ main(int argc, char *argv[]) 142@@ -754,7 +766,9 @@ main(int argc, char *argv[])
143 int i, c; 143 int i, c;
144 char *tty = NULL; 144 char *tty = NULL;
145 struct option opts[] = { 145 struct option opts[] = {
@@ -149,21 +149,24 @@ index 9064439..c6abe92 100644
149 { "tty", required_argument, NULL, 't' }, 149 { "tty", required_argument, NULL, 't' },
150 { "verbose", no_argument, NULL, 'v' }, 150 { "verbose", no_argument, NULL, 'v' },
151 { "help", no_argument, NULL, 'h' }, 151 { "help", no_argument, NULL, 'h' },
152@@ -712,9 +726,13 @@ main(int argc, char *argv[]) 152@@ -766,11 +780,16 @@ main(int argc, char *argv[])
153 while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { 153 while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) {
154 switch (c) { 154 switch (c) {
155 case 'u': 155 case 'u':
156+#ifdef HAVE_PAM 156+#ifdef HAVE_PAM
157 wl.new_user = optarg; 157 wl.new_user = optarg;
158 if (getuid() != 0) 158 if (getuid() != 0) {
159 error(1, 0, "Permission denied. -u allowed for root only"); 159 fprintf(stderr, "weston: Permission denied. -u allowed for root only\n");
160 exit(EXIT_FAILURE);
161 }
160+#else 162+#else
161+ error(1, 0, "-u is unsupported in this weston-launch build"); 163+ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n");
164+ exit(EXIT_FAILURE);
162+#endif 165+#endif
163 break; 166 break;
164 case 't': 167 case 't':
165 tty = optarg; 168 tty = optarg;
166@@ -755,8 +773,10 @@ main(int argc, char *argv[]) 169@@ -822,8 +841,10 @@ main(int argc, char *argv[])
167 if (setup_tty(&wl, tty) < 0) 170 if (setup_tty(&wl, tty) < 0)
168 exit(EXIT_FAILURE); 171 exit(EXIT_FAILURE);
169 172
@@ -175,7 +178,7 @@ index 9064439..c6abe92 100644
175 if (setup_launcher_socket(&wl) < 0) 178 if (setup_launcher_socket(&wl) < 0)
176 exit(EXIT_FAILURE); 179 exit(EXIT_FAILURE);
177diff --git a/meson_options.txt b/meson_options.txt 180diff --git a/meson_options.txt b/meson_options.txt
178index 0e1d183..9a5c3d5 100644 181index d5bf1d5..254eb2b 100644
179--- a/meson_options.txt 182--- a/meson_options.txt
180+++ b/meson_options.txt 183+++ b/meson_options.txt
181@@ -73,6 +73,13 @@ option( 184@@ -73,6 +73,13 @@ option(