Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Otavio Salvador <otavio@ossystems.com.br>
Cc: openembedded-core@lists.openembedded.org,
	Tom Hochstein <tom.hochstein@nxp.com>
Subject: Re: [OE-core] [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit
Date: Mon, 7 Aug 2023 10:56:25 +0200	[thread overview]
Message-ID: <2023080708562589664a88@mail.local> (raw)
In-Reply-To: <20230804200438.1651568-3-otavio@ossystems.com.br>

Hello,

I believe this change causes this QA failure:

https://autobuilder.yoctoproject.org/typhoon/#/builders/40/builds/7576/steps/12/logs/stdio

On 04/08/2023 17:04:11-0300, Otavio Salvador wrote:
> The systemd uses /run/wayland-0 as global socket and it is important to
> align the behavior so it avoids diverging when using sysvinit. Another
> change is installing the ${sysconfdir}/profile.d/weston-socket.sh script
> also aligning the behaviors.
> 
> The commit modifies the behavior of the weston-init script when running
> in sysvinit. It mimics the behavior of systemd by exporting the
> WAYLAND_DISPLAY variable and using it as the socket for the weston
> command.
> 
> The changes include:
> 
> - The installation of the weston-socket.sh script in the /etc/profile.d
> directory, which sets the WAYLAND_DISPLAY variable to /run/wayland-0 if
> it is not already set.
> 
> - Modifying the weston-start script to check if the WAYLAND_DISPLAY
> variable is set. If not, it sets it to /run/wayland-0.
> 
> These changes ensure that the weston command uses the same socket
> defined in the WAYLAND_DISPLAY variable, allowing compatibility with
> systems using sysvinit and systemd.
> 
> Fixes: 2818cbc730 ("weston-init: add profile to point users to global socket")
> Tested-by: Tom Hochstein <tom.hochstein@nxp.com>
> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
> ---
> 
>  meta/recipes-graphics/wayland/weston-init.bb           | 4 +++-
>  meta/recipes-graphics/wayland/weston-init/weston-start | 6 +++++-
>  2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
> index 024e400665..6c8dc36467 100644
> --- a/meta/recipes-graphics/wayland/weston-init.bb
> +++ b/meta/recipes-graphics/wayland/weston-init.bb
> @@ -40,13 +40,15 @@ 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 \
>  			${D}${systemd_system_unitdir}/weston.service
>  	fi
>  
> +	# Export the WAYLAND_DISPLAY in case it is using the global socket
> +	install -D -p -m0644 ${WORKDIR}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh
> +
>  	if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
>  		install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
>  	fi
> diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start
> index 01670cd4f5..7b898bb436 100755
> --- a/meta/recipes-graphics/wayland/weston-init/weston-start
> +++ b/meta/recipes-graphics/wayland/weston-init/weston-start
> @@ -68,4 +68,8 @@ if test -z "$XDG_RUNTIME_DIR"; then
>  	fi
>  fi
>  
> -su -c "XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` weston $weston_args --log=/tmp/weston.log" $WESTON_USER
> +if [ -z "$WAYLAND_DISPLAY" ]; then
> +	WAYLAND_DISPLAY=/run/wayland-0
> +fi
> +
> +su -c "XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` weston $weston_args --socket=$WAYLAND_DISPLAY --log=/tmp/weston.log" $WESTON_USER
> -- 
> 2.41.0
> 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#185541): https://lists.openembedded.org/g/openembedded-core/message/185541
> Mute This Topic: https://lists.openembedded.org/mt/100553774/3617179
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [alexandre.belloni@bootlin.com]
> -=-=-=-=-=-=-=-=-=-=-=-
> 


-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  parent reply	other threads:[~2023-08-07  8:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04 20:04 [PATCH 1/3] weston-init: remove misleading comment about udev rule Otavio Salvador
2023-08-04 20:04 ` [PATCH 2/3] weston-init: fix init code indentation Otavio Salvador
2023-08-04 20:04 ` [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit Otavio Salvador
2023-08-04 23:54   ` [OE-core] " Khem Raj
2023-08-05 12:48     ` Otavio Salvador
2023-08-07  8:56   ` Alexandre Belloni [this message]
2023-08-07 11:35     ` Otavio Salvador

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2023080708562589664a88@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=otavio@ossystems.com.br \
    --cc=tom.hochstein@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox