From 93653d90f5519a4d3c2945efb9f04537d28244c8 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 30 Mar 2020 17:13:54 -0400 Subject: meta-agl-profile-graphical: update wayland for dunfell Remove backported patch now present in wayland 1.18.0 in dunfell, and update another patch to quiet patch fuzz QA warning. Bug-AGL: SPEC-3302 Signed-off-by: Scott Murray Change-Id: I4ac5adfac6167cc96a755f07922c1c0721d0cb05 --- .../0001-Change-socket-mode-add-rw-for-group.patch | 14 ++++----- ...ver-Fix-fake-Address-already-in-use-error.patch | 35 ---------------------- .../recipes-graphics/wayland/wayland_%.bbappend | 1 - 3 files changed, 7 insertions(+), 43 deletions(-) delete mode 100644 meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch (limited to 'meta-agl-profile-graphical/recipes-graphics') diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch index b04127b57..d0dcb45af 100644 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0001-Change-socket-mode-add-rw-for-group.patch @@ -4,16 +4,19 @@ Date: Tue, 18 Apr 2017 13:53:26 +0200 Subject: [PATCH] Change socket mode:add rw for group Signed-off-by: Ronan Le Martret +[Updated for 1.18.0 to remove fuzz] +Signed-off-by: Scott Murray + --- src/wayland-server.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/wayland-server.c b/src/wayland-server.c -index 64d1bec..313c5a0 100644 +index 3f48dfe..fbccb45 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c -@@ -1189,7 +1189,10 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s) - wl_log("bind() failed with error: %m\n"); +@@ -1528,7 +1528,10 @@ _wl_display_add_socket(struct wl_display *display, struct wl_socket *s) + wl_log("bind() failed with error: %s\n", strerror(errno)); return -1; } - @@ -22,8 +25,5 @@ index 64d1bec..313c5a0 100644 + return -1; + } if (listen(s->fd, 128) < 0) { - wl_log("listen() failed with error: %m\n"); + wl_log("listen() failed with error: %s\n", strerror(errno)); return -1; --- -2.6.6 - diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch deleted file mode 100644 index ea9dbd65d..000000000 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland/0002-server-Fix-fake-Address-already-in-use-error.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 152c9ed968124c253f0be25b76c2a083a21af37e Mon Sep 17 00:00:00 2001 -From: Liu Wenlong -Date: Mon, 26 Aug 2019 17:08:22 +0800 -Subject: [PATCH] server: Fix fake "Address already in use" error - -In the current workflow, socket file will be deleted if it already exists. -However, if the socket file is a symbolic link and the file that it refers -to doesn't exist, we will got "Address already in use" because bind() -thinks the socket file exists and won't create it. - -Now, use lstat() to determine whether the socket file exists. - -Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/35] - -Signed-off-by: Liu Wenlong ---- - src/wayland-server.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/wayland-server.c b/src/wayland-server.c -index 83b984f..3bc6ed7 100644 ---- a/src/wayland-server.c -+++ b/src/wayland-server.c -@@ -1393,7 +1393,7 @@ wl_socket_lock(struct wl_socket *socket) - goto err_fd; - } - -- if (stat(socket->addr.sun_path, &socket_stat) < 0 ) { -+ if (lstat(socket->addr.sun_path, &socket_stat) < 0 ) { - if (errno != ENOENT) { - wl_log("did not manage to stat file %s\n", - socket->addr.sun_path); --- -2.7.4 - diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend index 5677ed52d..9d1822697 100644 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland_%.bbappend @@ -2,5 +2,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI_append = "\ file://0001-Change-socket-mode-add-rw-for-group.patch \ - file://0002-server-Fix-fake-Address-already-in-use-error.patch \ " -- cgit 1.2.3-korg From 75903b3b663a1f94d581fff80cd1439a8c5d4fcc Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 30 Mar 2020 17:16:10 -0400 Subject: meta-agl-profile-graphical: update wayland-ivi-extension for dunfell Update wayland-ivi-extension patch for weston 8.0.0 in dunfell. Bug-AGL: SPEC-3302 Signed-off-by: Scott Murray Change-Id: I2d82203e33d87c49ea8ceadc225fcf3930aae20e --- .../wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'meta-agl-profile-graphical/recipes-graphics') diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch index d86e1f22e..0fe2abb35 100644 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch @@ -73,7 +73,7 @@ index 0000000..7354a7e +pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED) +pkg_check_modules(WESTON weston>=5.0.0 REQUIRED) +pkg_check_modules(PIXMAN pixman-1 REQUIRED) -+pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-7 REQUIRED) ++pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-8 REQUIRED) + +find_package(Threads REQUIRED) + -- cgit 1.2.3-korg From 76fdd8c9f0532c56d65e1124801bb1054c692078 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Mon, 30 Mar 2020 17:47:06 -0400 Subject: meta-agl-profile-graphical: update weston for dunfell Rename weston bbappend, remove backported patch, and update a patch for weston 8.0.0 in dunfell. Bug-AGL: SPEC-3302 Signed-off-by: Scott Murray Change-Id: I518bd403133c193e5f68ee89e69dfccc56d5c78d --- ...g-parser-Export-get_full_path-and-destroy.patch | 36 ---------------------- .../wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch | 26 ++++++++-------- .../recipes-graphics/wayland/weston_7.0.0.bbappend | 15 --------- .../recipes-graphics/wayland/weston_8.0.0.bbappend | 14 +++++++++ 4 files changed, 28 insertions(+), 63 deletions(-) delete mode 100644 meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch delete mode 100644 meta-agl-profile-graphical/recipes-graphics/wayland/weston_7.0.0.bbappend create mode 100644 meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend (limited to 'meta-agl-profile-graphical/recipes-graphics') diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch deleted file mode 100644 index 9dbd7a749..000000000 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0001-config-parser-Export-get_full_path-and-destroy.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 40ff644ac4da90c5cf5239c6ee6051d9bb2b099a Mon Sep 17 00:00:00 2001 -From: Daniel Stone -Date: Mon, 25 Nov 2019 10:30:11 +0000 -Subject: [PATCH] config-parser: Export get_full_path and destroy - -Make sure we export the get_full_path() accessor (declared in the -header, used by Weston itself) and the parser's destroy function. - -Signed-off-by: Daniel Stone ---- - shared/config-parser.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/shared/config-parser.c b/shared/config-parser.c -index 35f09f006..94eb24cc1 100644 ---- a/shared/config-parser.c -+++ b/shared/config-parser.c -@@ -470,6 +470,7 @@ weston_config_parse(const char *name) - return config; - } - -+WL_EXPORT - const char * - weston_config_get_full_path(struct weston_config *config) - { -@@ -500,6 +501,7 @@ weston_config_next_section(struct weston_config *config, - return 1; - } - -+WL_EXPORT - void - weston_config_destroy(struct weston_config *config) - { --- -2.21.0 - diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch index 2f3b0108a..0e5d7cdf9 100644 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/use-XDG_RUNTIMESHARE_DIR.patch @@ -29,19 +29,21 @@ remain maintained locally out of mainstream in the wait of further investigations. Signed-off-by: José Bollo +[Updated for Weston 8.0.0] +Signed-off-by: Scott Murray diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c -index e19fb61b..826e48b8 100644 +index 5e1ce47..9962588 100644 --- a/shared/os-compatibility.c +++ b/shared/os-compatibility.c -@@ -157,7 +157,9 @@ os_create_anonymous_file(off_t size) - int fd; - int ret; - -- path = getenv("XDG_RUNTIME_DIR"); -+ path = getenv("XDG_RUNTIMESHARE_DIR"); -+ if (!path) -+ path = getenv("XDG_RUNTIME_DIR"); - if (!path) { - errno = ENOENT; - return -1; +@@ -184,7 +184,9 @@ os_create_anonymous_file(off_t size) + } else + #endif + { +- path = getenv("XDG_RUNTIME_DIR"); ++ path = getenv("XDG_RUNTIMESHARE_DIR"); ++ if (!path) ++ path = getenv("XDG_RUNTIME_DIR"); + if (!path) { + errno = ENOENT; + return -1; diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston_7.0.0.bbappend b/meta-agl-profile-graphical/recipes-graphics/wayland/weston_7.0.0.bbappend deleted file mode 100644 index 67ce0ba5e..000000000 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/weston_7.0.0.bbappend +++ /dev/null @@ -1,15 +0,0 @@ -FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" - -# NOTE: -# file://0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch -# has been removed until someone more familiar with weston internals -# and waltham can take a look and update it. -SRC_URI_append = "\ - file://0001-Allow-regular-users-to-launch-Weston_7.0.0.patch \ - file://use-XDG_RUNTIMESHARE_DIR.patch \ - file://0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch \ - file://0001-config-parser-Export-get_full_path-and-destroy.patch \ - file://0001-libweston-Expose-weston_output_damage-in-libweston.patch \ - " - -EXTRA_OEMESON_append = " -Denable-user-start=true" diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend b/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend new file mode 100644 index 000000000..737992c62 --- /dev/null +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend @@ -0,0 +1,14 @@ +FILESEXTRAPATHS_append := ":${THISDIR}/${PN}" + +# NOTE: +# file://0003-compositor-drm-introduce-drm_get_dmafd_from_view.patch +# has been removed until someone more familiar with weston internals +# and waltham can take a look and update it. +SRC_URI_append = "\ + file://0001-Allow-regular-users-to-launch-Weston_7.0.0.patch \ + file://use-XDG_RUNTIMESHARE_DIR.patch \ + file://0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch \ + file://0001-libweston-Expose-weston_output_damage-in-libweston.patch \ + " + +EXTRA_OEMESON_append = " -Denable-user-start=true" -- cgit 1.2.3-korg From e2c93c5b5ba29f3e4b901f870d2e11e5e485da35 Mon Sep 17 00:00:00 2001 From: Scott Murray Date: Thu, 2 Apr 2020 11:49:45 -0400 Subject: meta-agl-profile-graphical: disable memfd usage in weston The YP dunfell release's Weston 8.0.0 is the first version to switch to hard-coded usage of memfd's for its shared memory access if the memfd_create system call is available in libc. At the moment, this is problematic since accesses to the non-filesystem file descriptors get blocked by SMACK. For now, while a longer-term solution is worked out in SPEC-3305, patch Weston to allow disabling memfs usage at build time, and do so by using the option in our bbappend. Bug-AGL: SPEC-3302, SPEC-3305 Signed-off-by: Scott Murray Change-Id: Ie217c63cd4f43e3de1e802cb026c1ee2905bc5b7 --- .../0004-unconditionally-include-mman.h.patch | 33 +++++++++++++++ .../weston/0005-add-memfd-create-option.patch | 48 ++++++++++++++++++++++ .../recipes-graphics/wayland/weston_8.0.0.bbappend | 4 +- 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-unconditionally-include-mman.h.patch create mode 100644 meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-add-memfd-create-option.patch (limited to 'meta-agl-profile-graphical/recipes-graphics') diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-unconditionally-include-mman.h.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-unconditionally-include-mman.h.patch new file mode 100644 index 000000000..278087156 --- /dev/null +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0004-unconditionally-include-mman.h.patch @@ -0,0 +1,33 @@ +commit 7b36f171d09354a2d3a48db0ae2d34d66aa4f1ae +Author: James Hilliard +Date: Sat Feb 1 20:02:29 2020 -0700 + + unconditionally include sys/mman.h in os-compatibility.c + + Fixes: + ../shared/os-compatibility.c:273:25: error: ‘PROT_READ’ undeclared (first use in this function); did you mean ‘LOCK_READ’? + map = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, file->fd, 0); + ^~~~~~~~~ + LOCK_READ + + Signed-off-by: James Hilliard + +Upstream-Status: Backport + +Signed-off-by: Scott Murray + +diff --git a/shared/os-compatibility.c b/shared/os-compatibility.c +index 5e1ce479..041c929f 100644 +--- a/shared/os-compatibility.c ++++ b/shared/os-compatibility.c +@@ -34,10 +34,7 @@ + #include + #include + #include +- +-#ifdef HAVE_MEMFD_CREATE + #include +-#endif + + #include "os-compatibility.h" + diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-add-memfd-create-option.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-add-memfd-create-option.patch new file mode 100644 index 000000000..f4ea60130 --- /dev/null +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston/0005-add-memfd-create-option.patch @@ -0,0 +1,48 @@ +Add memfd-create option + +Add a meson build option, memfd-create, that controls whether the +memfd_create system call support will be enabled. The default value +is true so that it will be enabled, but it allows users like AGL +that currently has issues with security labels and memfd to disable +it. + +Upstream-Status: Pending + +Signed-off-by: Scott Murray + +diff --git a/meson.build b/meson.build +index 82107e1..9d042ca 100644 +--- a/meson.build ++++ b/meson.build +@@ -78,8 +78,12 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major') + endif + + optional_libc_funcs = [ +- 'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate', 'memfd_create' ++ 'mkostemp', 'strchrnul', 'initgroups', 'posix_fallocate' + ] ++if get_option('memfd-create') ++ optional_libc_funcs += [ 'memfd_create' ] ++endif ++ + foreach func : optional_libc_funcs + if cc.has_function(func) + config_h.set('HAVE_' + func.to_upper(), 1) +diff --git a/meson_options.txt b/meson_options.txt +index 80a2ad7..4a93472 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -99,6 +99,13 @@ option( + description: 'systemd service plugin: state notify, watchdog, socket activation' + ) + ++option( ++ 'memfd-create', ++ type: 'boolean', ++ value: true, ++ description: 'Use memfd_create system call' ++) ++ + option( + 'remoting', + type: 'boolean', diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend b/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend index 737992c62..03626abe8 100644 --- a/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend +++ b/meta-agl-profile-graphical/recipes-graphics/wayland/weston_8.0.0.bbappend @@ -9,6 +9,8 @@ SRC_URI_append = "\ file://use-XDG_RUNTIMESHARE_DIR.patch \ file://0002-ivi-shell-Fix-crash-due-no-transmitter-screen.patch \ file://0001-libweston-Expose-weston_output_damage-in-libweston.patch \ + file://0004-unconditionally-include-mman.h.patch \ + file://0005-add-memfd-create-option.patch \ " -EXTRA_OEMESON_append = " -Denable-user-start=true" +EXTRA_OEMESON_append = " -Denable-user-start=true -Dmemfd-create=false" -- cgit 1.2.3-korg