* [PATCH 1/3] weston-init: remove misleading comment about udev rule
@ 2023-08-04 20:04 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
0 siblings, 2 replies; 7+ messages in thread
From: Otavio Salvador @ 2023-08-04 20:04 UTC (permalink / raw)
To: openembedded-core; +Cc: Otavio Salvador, Tom Hochstein
The udev rule has been removed but the comment has kept, by
mistake. Remove it.
Fixes: dd83fb40f7 ("weston-init: Stop running weston as root")
Tested-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/recipes-graphics/wayland/weston-init.bb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 1884b5d440..024e400665 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -36,7 +36,7 @@ do_install() {
sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston
fi
- # Install Weston systemd service and accompanying udev rule
+ # Install Weston systemd service
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
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 2/3] weston-init: fix init code indentation
2023-08-04 20:04 [PATCH 1/3] weston-init: remove misleading comment about udev rule Otavio Salvador
@ 2023-08-04 20:04 ` Otavio Salvador
2023-08-04 20:04 ` [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit Otavio Salvador
1 sibling, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2023-08-04 20:04 UTC (permalink / raw)
To: openembedded-core; +Cc: Otavio Salvador, Tom Hochstein
Tested-by: Tom Hochstein <tom.hochstein@nxp.com>
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
---
meta/recipes-graphics/wayland/weston-init/init | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init
index d3b0d1873e..a5c54e001e 100644
--- a/meta/recipes-graphics/wayland/weston-init/init
+++ b/meta/recipes-graphics/wayland/weston-init/init
@@ -30,7 +30,7 @@ done
case "$1" in
start)
. /etc/profile
- export HOME=ROOTHOME
+ export HOME=ROOTHOME
WESTON_USER=weston weston-start $OPTARGS &
;;
--
2.41.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit
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 ` Otavio Salvador
2023-08-04 23:54 ` [OE-core] " Khem Raj
2023-08-07 8:56 ` Alexandre Belloni
1 sibling, 2 replies; 7+ messages in thread
From: Otavio Salvador @ 2023-08-04 20:04 UTC (permalink / raw)
To: openembedded-core; +Cc: Otavio Salvador, Tom Hochstein
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
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [OE-core] [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit
2023-08-04 20:04 ` [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit Otavio Salvador
@ 2023-08-04 23:54 ` Khem Raj
2023-08-05 12:48 ` Otavio Salvador
2023-08-07 8:56 ` Alexandre Belloni
1 sibling, 1 reply; 7+ messages in thread
From: Khem Raj @ 2023-08-04 23:54 UTC (permalink / raw)
To: Otavio Salvador; +Cc: openembedded-core, Tom Hochstein
On Fri, Aug 4, 2023 at 1:05 PM Otavio Salvador <otavio@ossystems.com.br> 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
This can be set automatically by something like
WAYLAND_DISPLAY=`basename /run/user/1000/wayland-[0-9]`
That way it can cover more e.g. my variscite/imx8 SOM I have wayland-1
> +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/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [OE-core] [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit
2023-08-04 23:54 ` [OE-core] " Khem Raj
@ 2023-08-05 12:48 ` Otavio Salvador
0 siblings, 0 replies; 7+ messages in thread
From: Otavio Salvador @ 2023-08-05 12:48 UTC (permalink / raw)
To: Khem Raj; +Cc: Otavio Salvador, openembedded-core, Tom Hochstein
Em sex., 4 de ago. de 2023 às 20:54, Khem Raj <raj.khem@gmail.com> escreveu:
> On Fri, Aug 4, 2023 at 1:05 PM Otavio Salvador <otavio@ossystems.com.br> wrote:
> > -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
>
> This can be set automatically by something like
> WAYLAND_DISPLAY=`basename /run/user/1000/wayland-[0-9]`
>
> That way it can cover more e.g. my variscite/imx8 SOM I have wayland-1
This uses the same as systemd, so it has the same behavior. However,
it supports users to override it using /etc/default/weston. So it sets
this only if unset.
--
Otavio Salvador O.S. Systems
http://www.ossystems.com.br http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854 Mobile: +1 (347) 903-9750
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 3/3] weston-init: mimic systemd behavior when running in sysvinit
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-07 8:56 ` Alexandre Belloni
2023-08-07 11:35 ` Otavio Salvador
1 sibling, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2023-08-07 8:56 UTC (permalink / raw)
To: Otavio Salvador; +Cc: openembedded-core, Tom Hochstein
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
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-08-07 11:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2023-08-07 11:35 ` Otavio Salvador
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.