Backport all weston-init qol updates
v2 cover Backport all weston-init qol updates
From: Randolph Sapp <[email protected]>
Backport all the weston-init QOL updates. Getting closer to the point where we can actually drop our distro specific weston-init bbappend. May submit a few more QOL patches sooner or later to completely drop it.
Resubmitting this because I forgot to CC Steve and myself on this series.
Ming Liu (1):
weston-init: introduce xwayland PACKAGECONFIG
Randolph Sapp (6):
weston-init: make sure the render group exists
weston-init: add weston user to the render group
weston-init: add the weston user to the wayland group
weston-init: fix the mixed indentation
weston-init: guard against systemd configs
weston-init: add profile to point users to global socket
ssuesens (1):
weston.init: enabled xwayland
meta/recipes-graphics/wayland/weston-init.bb | 53 ++++++++++++------- .../wayland/weston-init/weston-socket.sh | 20 +++++++ 2 files changed, 53 insertions(+), 20 deletions(-) create mode 100755 meta/recipes-graphics/wayland/weston-init/weston-socket.sh
Signature · 1 line
2.41.0
PATCH v2 1/8 weston.init: enabled xwayland
From: ssuesens <[email protected]>
set xwayland support in weston.init file to true
--- meta/recipes-graphics/wayland/weston-init.bb | 4 ++++ 1 file changed, 4 insertions(+)
meta/recipes-graphics/wayland/weston-init.bb +4 -0
@@ -50,6 +50,10 @@ do_install() { sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini fi + if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'yes', 'no', d)}" = "yes" ]; then + sed -i -e "/^\[core\]/a xwayland=true" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then sed -i -e "/^\[core\]/a idle-time=0" ${D}${sysconfdir}/xdg/weston/weston.ini fi
Signature · 1 line
2.41.0
PATCH v2 2/8 weston-init: introduce xwayland PACKAGECONFIG
In reply to [email protected]From: Ming Liu <[email protected]>
Some BSPs dont support xwayland in weston, this is easier for them to control that.
--- meta/recipes-graphics/wayland/weston-init.bb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
meta/recipes-graphics/wayland/weston-init.bb +3 -2
@@ -14,10 +14,11 @@ SRC_URI = "file://init \ S = "${WORKDIR}" -PACKAGECONFIG ??= "" +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xwayland', '', d)}" PACKAGECONFIG:append:qemuriscv64 = " use-pixman" PACKAGECONFIG:append:qemuppc64 = " use-pixman" +PACKAGECONFIG[xwayland] = ",," PACKAGECONFIG[no-idle-timeout] = ",," PACKAGECONFIG[use-pixman] = ",,"
@@ -50,7 +51,7 @@ do_install() { sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini fi - if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'yes', 'no', d)}" = "yes" ]; then + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then sed -i -e "/^\[core\]/a xwayland=true" ${D}${sysconfdir}/xdg/weston/weston.ini fi
Signature · 1 line
2.41.0
PATCH v2 3/8 weston-init: make sure the render group exists
In reply to [email protected]From: Randolph Sapp <[email protected]>
Add the render group explicitly here to make sure it exists for the useradd command.
--- meta/recipes-graphics/wayland/weston-init.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/wayland/weston-init.bb +1 -1
@@ -94,5 +94,5 @@ CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/we SYSTEMD_SERVICE:${PN} = "weston.service weston.socket" USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston" -GROUPADD_PARAM:${PN} = "-r wayland" +GROUPADD_PARAM:${PN} = "-r wayland; -r render"
Signature · 1 line
2.41.0
PATCH v2 4/8 weston-init: add weston user to the render group
In reply to [email protected]From: Randolph Sapp <[email protected]>
The weston user must be in the render group in order to access render device nodes for standard user-space graphics.
--- meta/recipes-graphics/wayland/weston-init.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/wayland/weston-init.bb +1 -1
@@ -93,6 +93,6 @@ FILES:${PN} += "\ CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" SYSTEMD_SERVICE:${PN} = "weston.service weston.socket" -USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston" +USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,render weston" GROUPADD_PARAM:${PN} = "-r wayland; -r render"
Signature · 1 line
2.41.0
PATCH v2 5/8 weston-init: add the weston user to the wayland group
In reply to [email protected]From: Randolph Sapp <[email protected]>
Add the weston user to the wayland group so all users accessing the global weston socket in /run all share a group.
--- meta/recipes-graphics/wayland/weston-init.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/wayland/weston-init.bb +1 -1
@@ -93,6 +93,6 @@ FILES:${PN} += "\ CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" SYSTEMD_SERVICE:${PN} = "weston.service weston.socket" -USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,render weston" +USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,render,wayland weston" GROUPADD_PARAM:${PN} = "-r wayland; -r render"
Signature · 1 line
2.41.0
PATCH v2 6/8 weston-init: fix the mixed indentation
In reply to [email protected]From: Randolph Sapp <[email protected]>
I know my text editor is going to get angry at me if this continues.
--- meta/recipes-graphics/wayland/weston-init.bb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
meta/recipes-graphics/wayland/weston-init.bb +5 -5
@@ -26,19 +26,19 @@ DEFAULTBACKEND ??= "" DEFAULTBACKEND:qemuall ?= "drm" do_install() { - if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then + if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston - fi + fi install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston # Install Weston systemd service and accompanying udev rule install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket - if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin - fi + fi sed -i -e s:/etc:${sysconfdir}:g \ -e s:/usr/bin:${bindir}:g \ -e s:/var:${localstatedir}:g \
@@ -47,7 +47,7 @@ do_install() { install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start - if [ -n "${DEFAULTBACKEND}" ]; then + if [ -n "${DEFAULTBACKEND}" ]; then sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini fi
Signature · 1 line
2.41.0
PATCH v2 7/8 weston-init: guard against systemd configs
In reply to [email protected]From: Randolph Sapp <[email protected]>
Just as sysvinit scripts shouldn't be present in a distro using systemd, systemd scripts shouldn't be present in a system not using systemd.
--- meta/recipes-graphics/wayland/weston-init.bb | 29 ++++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-)
meta/recipes-graphics/wayland/weston-init.bb +17 -12
@@ -26,27 +26,32 @@ DEFAULTBACKEND ??= "" DEFAULTBACKEND:qemuall ?= "drm" do_install() { + # Install weston-start script if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then + install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start + sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start + sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston fi - install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini - install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston # Install Weston systemd service and accompanying udev rule - install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service - install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service + install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket + sed -i -e s:/etc:${sysconfdir}:g \ + -e s:/usr/bin:${bindir}:g \ + -e s:/var:${localstatedir}:g \ + ${D}${systemd_system_unitdir}/weston.service + fi + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin fi - sed -i -e s:/etc:${sysconfdir}:g \ - -e s:/usr/bin:${bindir}:g \ - -e s:/var:${localstatedir}:g \ - ${D}${systemd_system_unitdir}/weston.service - # Install weston-start script - install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start - sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start - sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start + + install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini + install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston + if [ -n "${DEFAULTBACKEND}" ]; then sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini fi
Signature · 1 line
2.41.0
PATCH v2 8/8 weston-init: add profile to point users to global socket
In reply to [email protected]From: Randolph Sapp <[email protected]>
Add profile script to point users capable of interacting with the global socket to it by default.
--- meta/recipes-graphics/wayland/weston-init.bb | 3 +++ .../wayland/weston-init/weston-socket.sh | 20 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 meta/recipes-graphics/wayland/weston-init/weston-socket.sh
meta/recipes-graphics/wayland/weston-init.bb +3 -0
@@ -9,6 +9,7 @@ SRC_URI = "file://init \ file://weston.ini \ file://weston.service \ file://weston.socket \ + file://weston-socket.sh \ file://weston-autologin \ file://weston-start"
@@ -39,6 +40,7 @@ do_install() { if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket + install -D -p -m0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh sed -i -e s:/etc:${sysconfdir}:g \ -e s:/usr/bin:${bindir}:g \ -e s:/var:${localstatedir}:g \
@@ -88,6 +90,7 @@ INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." FILES:${PN} += "\ ${sysconfdir}/xdg/weston/weston.ini \ + ${sysconfdir}/profile.d/weston-socket.sh \ ${systemd_system_unitdir}/weston.service \ ${systemd_system_unitdir}/weston.socket \ ${sysconfdir}/default/weston \
meta/recipes-graphics/wayland/weston-init/weston-socket.sh new file +20 -0
@@ -0,0 +1,20 @@ +#!/bin/sh + +# set weston variables for use with global weston socket +global_socket="/run/wayland-0" +if [ -e "$global_socket" ]; then + weston_group=$(stat -c "%G" "$global_socket") + if [ "$(id -u)" = "0" ]; then + export WAYLAND_DISPLAY="$global_socket" + else + case "$(groups "$USER")" in + *"$weston_group"*) + export WAYLAND_DISPLAY="$global_socket" + ;; + *) + ;; + esac + fi + unset weston_group +fi +unset global_socket
Signature · 1 line
2.41.0
Hi Randolph,
Unfortunately this patch series results in oe-selftest failures on the autobuilder, three examples below:
https://errors.yoctoproject.org/Errors/Details/710122/
https://errors.yoctoproject.org/Errors/Details/710127/
https://errors.yoctoproject.org/Errors/Details/710125/
Note in particular:
AssertionError: 1 != 0 : Log:/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-1203856/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0-r0/target_logs/dmesg_output.log
-----------------------
Central error: [ 2.392519] weston[373]: segfault at 28 ip00007fad628102aa sp 00007ffff5bf2410 error 4 in
libwayland-server.so.0.20.0[7fad6280c000+8000]
***********************
[ 1.742836] with environment: [ 1.742837] HOME=/ [ 1.742838] TERM=linux [ 1.800627] udevd[167]: starting version 3.2.10 [ 1.806665] udevd[168]: starting eudev-3.2.10 [ 1.964586] EXT4-fs (vda): re-mounted. Opts: (null). Quota mode: disabled. [ 2.020081] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 2.223651] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 2.224563] Bluetooth: BNEP filters: protocol multicast [ 2.225490] Bluetooth: BNEP socket layer initialized [ 2.392519] weston[373]: segfault at 28 ip 00007fad628102aa sp 00007ffff5bf2410 error 4 in libwayland-server.so.0.20.0[7fad6280c000+8000] [ 2.394037] Code: 48 8b 47 08 48 8d 77 10 48 8b 78 08 e9 1f c3 ff
ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 41 54 55 48 89 fd 48 83 ec 08 <8b> 57 28 4c 8b 67 08 85 d2 79 3b 48 8d 05 64 b0 00 00 48 39 07 0f
***********************
1 errors found in logs.
Steve
Quoted 32 lines · On Fri, Jun 23, 2023 at 6:24 AM <[email protected]> wrote:
From: Randolph Sapp <[email protected]>
Backport all the weston-init QOL updates. Getting closer to the point where we can actually drop our distro specific weston-init bbappend. May submit a few more QOL patches sooner or later to completely drop it.
Resubmitting this because I forgot to CC Steve and myself on this series.
Ming Liu (1):
weston-init: introduce xwayland PACKAGECONFIGRandolph Sapp (6):
weston-init: make sure the render group exists
weston-init: add weston user to the render group
weston-init: add the weston user to the wayland group
weston-init: fix the mixed indentation
weston-init: guard against systemd configs
weston-init: add profile to point users to global socketssuesens (1):
weston.init: enabled xwaylandmeta/recipes-graphics/wayland/weston-init.bb | 53 ++++++++++++------- .../wayland/weston-init/weston-socket.sh | 20 +++++++ 2 files changed, 53 insertions(+), 20 deletions(-) create mode 100755 meta/recipes-graphics/wayland/weston-init/weston-socket.sh--
2.41.0
Quoted 32 lines · Steve Sakoman
Hi Randolph,
Unfortunately this patch series results in oe-selftest failures on the autobuilder, three examples below:
https://errors.yoctoproject.org/Errors/Details/710122/
https://errors.yoctoproject.org/Errors/Details/710127/
https://errors.yoctoproject.org/Errors/Details/710125/Note in particular:
AssertionError: 1 != 0 : Log:
/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-1203856/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0-r0/target_logs/dmesg_output.log
-----------------------
Central error: [ 2.392519] weston[373]: segfault at 28 ip00007fad628102aasp00007ffff5bf2410error 4 in
libwayland-server.so.0.20.0[7fad6280c000+8000]
***********************[ 1.742836] with environment: [ 1.742837] HOME=/ [ 1.742838] TERM=linux [ 1.800627] udevd[167]: starting version 3.2.10 [ 1.806665] udevd[168]: starting eudev-3.2.10 [ 1.964586] EXT4-fs (vda): re-mounted. Opts: (null). Quota mode: disabled. [ 2.020081] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 2.223651] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 2.224563] Bluetooth: BNEP filters: protocol multicast [ 2.225490] Bluetooth: BNEP socket layer initialized [ 2.392519] weston[373]: segfault at 28 ip 00007fad628102aa sp 00007ffff5bf2410 error 4 in libwayland-server.so.0.20.0[7fad6280c000+8000] [ 2.394037] Code: 48 8b 47 08 48 8d 77 10 48 8b 78 08 e9 1f c3 ff
Quoted 8 lines
ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 41 54 55 48 89 fd 48 83 ec 08 <8b> 57 28 4c 8b 67 08 85 d2 79 3b 48 8d 05 64 b0 00 00 48 39 07 0f
***********************
1 errors found in logs.Steve
Rats. I'm concerned what could have caused a segfault in libwayland-server in this series. This only tweaked Weston launch parameters and the only time I've seen that result in instability is when you ask Weston to load a module that isn't present. Even that only results in a safely handled runtime failure.
I hate to bother you with this, but where is the source code for this test? I'd like to poke around a bit more...
Randolph
Quoted 43 lines · Randolph Sapp
Quoted 32 lines · Steve Sakoman
Hi Randolph,
Unfortunately this patch series results in oe-selftest failures on the autobuilder, three examples below:
https://errors.yoctoproject.org/Errors/Details/710122/
https://errors.yoctoproject.org/Errors/Details/710127/
https://errors.yoctoproject.org/Errors/Details/710125/Note in particular:
AssertionError: 1 != 0 : Log:
/home/pokybuild/yocto-worker/oe-selftest-centos/build/build-st-1203856/tmp/work/qemux86_64-poky-linux/core-image-weston/1.0-r0/target_logs/dmesg_output.log
-----------------------
Central error: [ 2.392519] weston[373]: segfault at 28 ip00007fad628102aasp00007ffff5bf2410error 4 in
libwayland-server.so.0.20.0[7fad6280c000+8000]
***********************[ 1.742836] with environment: [ 1.742837] HOME=/ [ 1.742838] TERM=linux [ 1.800627] udevd[167]: starting version 3.2.10 [ 1.806665] udevd[168]: starting eudev-3.2.10 [ 1.964586] EXT4-fs (vda): re-mounted. Opts: (null). Quota mode: disabled. [ 2.020081] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready [ 2.223651] Bluetooth: BNEP (Ethernet Emulation) ver 1.3 [ 2.224563] Bluetooth: BNEP filters: protocol multicast [ 2.225490] Bluetooth: BNEP socket layer initialized [ 2.392519] weston[373]: segfault at 28 ip 00007fad628102aa sp 00007ffff5bf2410 error 4 in libwayland-server.so.0.20.0[7fad6280c000+8000] [ 2.394037] Code: 48 8b 47 08 48 8d 77 10 48 8b 78 08 e9 1f c3 ffQuoted 8 lines
ff 66 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 41 54 55 48 89 fd 48 83 ec 08 <8b> 57 28 4c 8b 67 08 85 d2 79 3b 48 8d 05 64 b0 00 00 48 39 07 0f
***********************
1 errors found in logs.Steve
Quoted 8 lines
Rats. I'm concerned what could have caused a segfault in libwayland-server in this series. This only tweaked Weston launch parameters and the only time I've seen that result in instability is when you ask Weston to load a module that isn't present. Even that only results in a safely handled runtime failure.
I hate to bother you with this, but where is the source code for this test? I'd like to poke around a bit more...
I've already dropped your patch series from my test queue, but you could duplicate what I tested by adding your patch series to the stable/kirkstone-nut branch on oe-core-contrib:
https://git.openembedded.org/openembedded-core-contrib/log/?h=stable/kirkstone-nut
Good luck!
Steve