All of lore.kernel.org
 help / color / mirror / Atom feed
* [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
@ 2015-12-17 22:04 Tom Hochstein
  2015-12-17 22:04 ` [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured Tom Hochstein
                   ` (3 more replies)
  0 siblings, 4 replies; 17+ messages in thread
From: Tom Hochstein @ 2015-12-17 22:04 UTC (permalink / raw)
  To: openembedded-core

Weston is started in different ways depending on the image
configuration and the runtime scenario. Refer to the weston man
page for more information.

Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>
---
 meta/recipes-graphics/wayland/weston-init.bb           | 15 ++++++++++++++-
 meta/recipes-graphics/wayland/weston-init/init         |  2 +-
 meta/recipes-graphics/wayland/weston-init/weston-start | 18 ++++++++++++++++++
 .../wayland/weston-init/weston.service                 |  4 ++--
 4 files changed, 35 insertions(+), 4 deletions(-)
 create mode 100644 meta/recipes-graphics/wayland/weston-init/weston-start

diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index 653541e..0bd3ad8 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -3,7 +3,8 @@ LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
 
 SRC_URI = "file://init \
-           file://weston.service"
+           file://weston.service \
+           file://weston-start"
 
 S = "${WORKDIR}"
 
@@ -13,6 +14,18 @@ do_install() {
 
 	install -d ${D}${systemd_system_unitdir}
 	install -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}
+
+	install -d ${D}/${bindir}
+	install -m755 ${WORKDIR}/weston-start ${D}/${bindir}
+	if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)}" = "xwayland" ]; then
+		weston_launch_setup="mkdir -p /tmp/.X11-unix"
+		weston_launch_args="--modules=xwayland.so"
+	else
+		weston_launch_setup=""
+		weston_launch_args=""
+	fi
+	sed -i "s#WESTON_LAUNCH_SETUP#${weston_launch_setup}#" ${D}/${bindir}/weston-start
+	sed -i "s#WESTON_LAUNCH_ARGS#${weston_launch_args}#" ${D}/${bindir}/weston-start
 }
 
 inherit allarch update-rc.d distro_features_check systemd
diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init
index 2e938f4..8567dfc 100644
--- a/meta/recipes-graphics/wayland/weston-init/init
+++ b/meta/recipes-graphics/wayland/weston-init/init
@@ -38,7 +38,7 @@ case "$1" in
                 chmod 0700 $XDG_RUNTIME_DIR
         fi
 
-        openvt -s weston -- $OPTARGS
+        weston-start
   ;;
 
   stop)
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start
new file mode 100644
index 0000000..1360dd7
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston-start
@@ -0,0 +1,18 @@
+#! /bin/sh
+
+# There are multiple ways to start weston.
+if [ "$WAYLAND_DISPLAY" ]; then
+    echo -e "\aError: Weston is already running."
+    echo "This script does not support launching Weston nested."
+    exit 1
+else
+    if [ "$DISPLAY" ]; then
+        echo "Launching Weston"
+        openvt -s -- sh -c "weston -- $OPTARGS > /var/log/weston.log 2>&1"
+    else
+        echo "Launching Weston"
+        export XDG_CONFIG_HOME=/etc
+        WESTON_LAUNCH_SETUP
+        openvt $OPENVT_ARGS -- sh -c "weston-launch -- WESTON_LAUNCH_ARGS $OPTARGS > /var/log/weston.log 2>&1"
+    fi
+fi
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.service b/meta/recipes-graphics/wayland/weston-init/weston.service
index 4f1f7ff..856f91f 100644
--- a/meta/recipes-graphics/wayland/weston-init/weston.service
+++ b/meta/recipes-graphics/wayland/weston-init/weston.service
@@ -5,10 +5,10 @@ RequiresMountsFor=/run
 [Service]
 User=root
 EnvironmentFile=-/etc/default/weston
-Environment="XDG_RUNTIME_DIR=/run/user/root"
+Environment="XDG_RUNTIME_DIR=/run/user/root" "OPENVT_ARGS=-w"
 ExecStartPre=/bin/mkdir -p /run/user/root
 ExecStartPre=/bin/chmod 0700 /run/user/root
-ExecStart=/usr/bin/openvt -v -e /usr/bin/weston -- $OPTARGS
+ExecStart=/usr/bin/weston-start
 
 [Install]
 WantedBy=multi-user.target
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured.
  2015-12-17 22:04 [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Tom Hochstein
@ 2015-12-17 22:04 ` Tom Hochstein
  2015-12-18 16:52   ` Otavio Salvador
  2015-12-17 22:04 ` [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case Tom Hochstein
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 17+ messages in thread
From: Tom Hochstein @ 2015-12-17 22:04 UTC (permalink / raw)
  To: openembedded-core

The weston-launch app is required for Wayland.

Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>
---
 meta/recipes-graphics/wayland/weston_1.8.0.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-graphics/wayland/weston_1.8.0.bb b/meta/recipes-graphics/wayland/weston_1.8.0.bb
index aff9a12..807e799 100644
--- a/meta/recipes-graphics/wayland/weston_1.8.0.bb
+++ b/meta/recipes-graphics/wayland/weston_1.8.0.bb
@@ -20,7 +20,8 @@ SRC_URI[sha256sum] = "8963e69f328e815cec42c58046c4af721476c7541bb7d9edc71740fada
 
 inherit autotools pkgconfig useradd distro_features_check
 # depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
+REQUIRED_DISTRO_FEATURES = "opengl \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'pam', '', d)}"
 
 DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
 DEPENDS += "wayland libinput virtual/egl pango"
@@ -39,9 +40,8 @@ EXTRA_OECONF_append_qemux86 = "\
 EXTRA_OECONF_append_qemux86-64 = "\
 		WESTON_NATIVE_BACKEND=fbdev-backend.so \
 		"
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl launch', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
-                   ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'launch', '', d)} \
                    ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
                   "
 #
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case.
  2015-12-17 22:04 [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Tom Hochstein
  2015-12-17 22:04 ` [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured Tom Hochstein
@ 2015-12-17 22:04 ` Tom Hochstein
  2015-12-18 16:53   ` Otavio Salvador
  2016-01-07 21:34   ` Burton, Ross
  2015-12-17 22:04 ` [<OE-core][PATCH v2 4/4] packagegroup-core-x11-sato: " Tom Hochstein
  2015-12-18 16:50 ` [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Otavio Salvador
  3 siblings, 2 replies; 17+ messages in thread
From: Tom Hochstein @ 2015-12-17 22:04 UTC (permalink / raw)
  To: openembedded-core

Matchbox is redundant when Weston is run.

Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>
---
 meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb b/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
index 17301a0..6c567ea 100644
--- a/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
+++ b/meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb
@@ -12,8 +12,7 @@ RDEPENDS_${PN} = "\
     packagegroup-core-x11-utils \
     dbus \
     pointercal \
-    matchbox-terminal \
-    matchbox-wm \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', 'matchbox-terminal matchbox-wm', d)} \
     mini-x-session \
     liberation-fonts \
     "
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [<OE-core][PATCH v2 4/4] packagegroup-core-x11-sato: Remove matchbox for XWayland case.
  2015-12-17 22:04 [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Tom Hochstein
  2015-12-17 22:04 ` [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured Tom Hochstein
  2015-12-17 22:04 ` [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case Tom Hochstein
@ 2015-12-17 22:04 ` Tom Hochstein
  2015-12-18 16:50 ` [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Otavio Salvador
  3 siblings, 0 replies; 17+ messages in thread
From: Tom Hochstein @ 2015-12-17 22:04 UTC (permalink / raw)
  To: openembedded-core

Matchbox is redundant when Weston is run.

Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>
---
 meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb b/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
index 6679db8..4fe21d1 100644
--- a/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
+++ b/meta/recipes-sato/packagegroups/packagegroup-core-x11-sato.bb
@@ -25,12 +25,7 @@ NETWORK_MANAGER_libc-uclibc = ""
 
 SUMMARY_${PN}-base = "Sato desktop - base packages"
 RDEPENDS_${PN}-base = "\
-    matchbox-desktop \
-    matchbox-session-sato \
-    matchbox-keyboard \
-    matchbox-keyboard-applet \
-    matchbox-keyboard-im \
-    matchbox-config-gtk \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', 'matchbox-desktop matchbox-session-sato matchbox-keyboard matchbox-keyboard-applet matchbox-keyboard-im matchbox-config-gtk', d)} \
     xcursor-transparent-theme \
     sato-icon-theme \
     settings-daemon \
@@ -54,7 +49,7 @@ RDEPENDS_${PN}-apps = "\
     leafpad \
     gst-player-bin \
     x11vnc \
-    matchbox-terminal \
+    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', 'matchbox-terminal', d)} \
     sato-screenshot \
     ${FILEMANAGER} \
     ${WEB} \
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
  2015-12-17 22:04 [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Tom Hochstein
                   ` (2 preceding siblings ...)
  2015-12-17 22:04 ` [<OE-core][PATCH v2 4/4] packagegroup-core-x11-sato: " Tom Hochstein
@ 2015-12-18 16:50 ` Otavio Salvador
  2015-12-18 22:36   ` Tom Hochstein
  3 siblings, 1 reply; 17+ messages in thread
From: Otavio Salvador @ 2015-12-18 16:50 UTC (permalink / raw)
  To: Tom Hochstein; +Cc: Patches and discussions about the oe-core layer

Hello Tom,

On Thu, Dec 17, 2015 at 8:04 PM, Tom Hochstein
<tom.hochstein@freescale.com> wrote:
> Weston is started in different ways depending on the image
> configuration and the runtime scenario. Refer to the weston man
> page for more information.
>
> Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>

I think we are quite close to something which works for all supported
use-cases. More below...

...
> @@ -13,6 +14,18 @@ do_install() {
>
>         install -d ${D}${systemd_system_unitdir}
>         install -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}
> +
> +       install -d ${D}/${bindir}
> +       install -m755 ${WORKDIR}/weston-start ${D}/${bindir}
> +       if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)}" = "xwayland" ]; then
> +               weston_launch_setup="mkdir -p /tmp/.X11-unix"
> +               weston_launch_args="--modules=xwayland.so"
> +       else
> +               weston_launch_setup=""
> +               weston_launch_args=""
> +       fi
> +       sed -i "s#WESTON_LAUNCH_SETUP#${weston_launch_setup}#" ${D}/${bindir}/weston-start
> +       sed -i "s#WESTON_LAUNCH_ARGS#${weston_launch_args}#" ${D}/${bindir}/weston-start

We can do it at runtime and avoid using this hardcoded options?

One possibility is to check if XWayland is available. If it is, it can
enable those options.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured.
  2015-12-17 22:04 ` [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured Tom Hochstein
@ 2015-12-18 16:52   ` Otavio Salvador
  2015-12-18 21:58     ` Tom Hochstein
  0 siblings, 1 reply; 17+ messages in thread
From: Otavio Salvador @ 2015-12-18 16:52 UTC (permalink / raw)
  To: Tom Hochstein; +Cc: Patches and discussions about the oe-core layer

On Thu, Dec 17, 2015 at 8:04 PM, Tom Hochstein
<tom.hochstein@freescale.com> wrote:
> The weston-launch app is required for Wayland.
>
> Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>

The commit log needs a good rework; this is explaining the source code
and not why it has been change. Please rework it.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case.
  2015-12-17 22:04 ` [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case Tom Hochstein
@ 2015-12-18 16:53   ` Otavio Salvador
       [not found]     ` <AMSPR04MB309D9FAC0C65002218BAE1CE2F50@AMSPR04MB309.eurprd04.prod.outlook.com>
  2016-01-07 21:34   ` Burton, Ross
  1 sibling, 1 reply; 17+ messages in thread
From: Otavio Salvador @ 2015-12-18 16:53 UTC (permalink / raw)
  To: Tom Hochstein, Burton, Ross
  Cc: Patches and discussions about the oe-core layer

On Thu, Dec 17, 2015 at 8:04 PM, Tom Hochstein
<tom.hochstein@freescale.com> wrote:
> Matchbox is redundant when Weston is run.
>
> Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>

I think there will be people that will wish to use X11 only, even if
XWayland is available.

Redundancy is not a justification to remove it, if it can be used in
some use-cases. Does it cause problem? Ross?

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured.
  2015-12-18 16:52   ` Otavio Salvador
@ 2015-12-18 21:58     ` Tom Hochstein
  2015-12-19  9:46       ` Otavio Salvador
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Hochstein @ 2015-12-18 21:58 UTC (permalink / raw)
  To: Otavio Salvador; +Cc: Patches and discussions about the oe-core layer

Thanks, Otavio. Shall I simply quote the weston man page:

When weston is started as the first windowing system (i.e. not under X
nor under another Wayland server), it should be done with the command
weston-launch to set up proper privileged access to devices.

Tom

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br] 
Sent: Friday, December 18, 2015 10:52 AM
To: Hochstein Tom-R60874 <Tom.Hochstein@freescale.com>
Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured.

On Thu, Dec 17, 2015 at 8:04 PM, Tom Hochstein <tom.hochstein@freescale.com> wrote:
> The weston-launch app is required for Wayland.
>
> Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>

The commit log needs a good rework; this is explaining the source code and not why it has been change. Please rework it.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
  2015-12-18 16:50 ` [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Otavio Salvador
@ 2015-12-18 22:36   ` Tom Hochstein
  2015-12-19  9:57     ` Otavio Salvador
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Hochstein @ 2015-12-18 22:36 UTC (permalink / raw)
  To: Otavio Salvador, Sundararaj Prabhu
  Cc: Patches and discussions about the oe-core layer

Hi Otavio,

Does the existence of /usr/lib/weston/xwayland.so give us what we want?

        if [ -f /usr/lib/weston/xwayland.so ]; then
            mkdir -p /tmp/.X11-unix
            OPTARGS="--modules=xwayland.so $OPTARGS"
        fi
        openvt $OPENVT_ARGS -- sh -c "weston-launch -- $OPTARGS > /var/log/weston.log 2>&1"

Tom

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br] 
Sent: Friday, December 18, 2015 10:50 AM
To: Hochstein Tom-R60874 <Tom.Hochstein@freescale.com>
Cc: Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.

Hello Tom,

On Thu, Dec 17, 2015 at 8:04 PM, Tom Hochstein <tom.hochstein@freescale.com> wrote:
> Weston is started in different ways depending on the image 
> configuration and the runtime scenario. Refer to the weston man page 
> for more information.
>
> Signed-off-by: Tom Hochstein <tom.hochstein@freescale.com>

I think we are quite close to something which works for all supported use-cases. More below...

...
> @@ -13,6 +14,18 @@ do_install() {
>
>         install -d ${D}${systemd_system_unitdir}
>         install -m0644 ${WORKDIR}/weston.service 
> ${D}${systemd_system_unitdir}
> +
> +       install -d ${D}/${bindir}
> +       install -m755 ${WORKDIR}/weston-start ${D}/${bindir}
> +       if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)}" = "xwayland" ]; then
> +               weston_launch_setup="mkdir -p /tmp/.X11-unix"
> +               weston_launch_args="--modules=xwayland.so"
> +       else
> +               weston_launch_setup=""
> +               weston_launch_args=""
> +       fi
> +       sed -i "s#WESTON_LAUNCH_SETUP#${weston_launch_setup}#" ${D}/${bindir}/weston-start
> +       sed -i "s#WESTON_LAUNCH_ARGS#${weston_launch_args}#" 
> + ${D}/${bindir}/weston-start

We can do it at runtime and avoid using this hardcoded options?

One possibility is to check if XWayland is available. If it is, it can enable those options.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured.
  2015-12-18 21:58     ` Tom Hochstein
@ 2015-12-19  9:46       ` Otavio Salvador
  0 siblings, 0 replies; 17+ messages in thread
From: Otavio Salvador @ 2015-12-19  9:46 UTC (permalink / raw)
  To: Tom Hochstein; +Cc: Patches and discussions about the oe-core layer

On Fri, Dec 18, 2015 at 7:58 PM, Tom Hochstein
<Tom.Hochstein@freescale.com> wrote:
> Thanks, Otavio. Shall I simply quote the weston man page:
>
> When weston is started as the first windowing system (i.e. not under X
> nor under another Wayland server), it should be done with the command
> weston-launch to set up proper privileged access to devices.

Yes; you also need to check pam support is really required for it.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
  2015-12-18 22:36   ` Tom Hochstein
@ 2015-12-19  9:57     ` Otavio Salvador
  2015-12-19 18:08       ` Tom Hochstein
  0 siblings, 1 reply; 17+ messages in thread
From: Otavio Salvador @ 2015-12-19  9:57 UTC (permalink / raw)
  To: Tom Hochstein
  Cc: Sundararaj Prabhu, Patches and discussions about the oe-core layer

On Fri, Dec 18, 2015 at 8:36 PM, Tom Hochstein
<Tom.Hochstein@freescale.com> wrote:
> Hi Otavio,
>
> Does the existence of /usr/lib/weston/xwayland.so give us what we want?
>
>         if [ -f /usr/lib/weston/xwayland.so ]; then
>             mkdir -p /tmp/.X11-unix
>             OPTARGS="--modules=xwayland.so $OPTARGS"
>         fi
>         openvt $OPENVT_ARGS -- sh -c "weston-launch -- $OPTARGS > /var/log/weston.log 2>&1"

No.

I think I came up with a plan:

 - make weston-launch to be a wrapper
 - make it source ${datadir}/weston/weston-launch.d/<scripts>
 -  XWayland package, you install a ${datadir}/weston/weston-launch.d/XWayland

XWayland file:

mkdir -p /tmp/.X11-unix
OPTARGS="--modules=xwayland.so $OPTARGS"

Done. It became a generic one ;-)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
  2015-12-19  9:57     ` Otavio Salvador
@ 2015-12-19 18:08       ` Tom Hochstein
  2015-12-21 11:24         ` Otavio Salvador
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Hochstein @ 2015-12-19 18:08 UTC (permalink / raw)
  To: Otavio Salvador
  Cc: Sundararaj Prabhu, Patches and discussions about the oe-core layer

Hi Otavio,

Can you be more explicit about what you mean by weston-launch wrapper? Do you want to hide the current weston-launch binary and replace it by a new weston-launch wrapper? What happens to my proposed weston-start, which is itself a wrapper? Does its functionality move into weston-launch?
       
Can you help me understand the rationale for the extra XWayland script? The existing weston recipe installs xwayland.so when the XWayland package is specified. In your proposal, the weston recipe would also install the extra script when the XWayland package is specified. Since the same XWayland package mechanism is used in both cases, the benefit of the extra script isn't clear to me.
	
Tom

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br] 
Sent: Saturday, December 19, 2015 3:58 AM
To: Hochstein Tom-R60874 <Tom.Hochstein@freescale.com>
Cc: Sundararaj Prabhu-B36876 <Prabhu.Sundararaj@freescale.com>; Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.

On Fri, Dec 18, 2015 at 8:36 PM, Tom Hochstein <Tom.Hochstein@freescale.com> wrote:
> Hi Otavio,
>
> Does the existence of /usr/lib/weston/xwayland.so give us what we want?
>
>         if [ -f /usr/lib/weston/xwayland.so ]; then
>             mkdir -p /tmp/.X11-unix
>             OPTARGS="--modules=xwayland.so $OPTARGS"
>         fi
>         openvt $OPENVT_ARGS -- sh -c "weston-launch -- $OPTARGS > /var/log/weston.log 2>&1"

No.

I think I came up with a plan:

 - make weston-launch to be a wrapper
 - make it source ${datadir}/weston/weston-launch.d/<scripts>
 -  XWayland package, you install a ${datadir}/weston/weston-launch.d/XWayland

XWayland file:

mkdir -p /tmp/.X11-unix
OPTARGS="--modules=xwayland.so $OPTARGS"

Done. It became a generic one ;-)

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
  2015-12-19 18:08       ` Tom Hochstein
@ 2015-12-21 11:24         ` Otavio Salvador
  2016-01-08 20:24           ` Tom Hochstein
  0 siblings, 1 reply; 17+ messages in thread
From: Otavio Salvador @ 2015-12-21 11:24 UTC (permalink / raw)
  To: Tom Hochstein
  Cc: Sundararaj Prabhu, Patches and discussions about the oe-core layer

Hello Tom,

On Sat, Dec 19, 2015 at 4:08 PM, Tom Hochstein
<Tom.Hochstein@freescale.com> wrote:
> Can you be more explicit about what you mean by weston-launch wrapper? Do you want to hide the current weston-launch binary and replace it by a new weston-launch wrapper? What happens to my proposed weston-start, which is itself a wrapper? Does its functionality move into weston-launch?

Yes; my proposal is to use weston-launch to hide the real binary and
call it internally. This allows for everyone using weston-launch (even
on terminal or serial console) to benefit from it otherwise people
will be aware of the custom script.

> Can you help me understand the rationale for the extra XWayland script? The existing weston recipe installs xwayland.so when the XWayland package is specified. In your proposal, the weston recipe would also install the extra script when the XWayland package is specified. Since the same XWayland package mechanism is used in both cases, the benefit of the extra script isn't clear to me.

Because it would allow for same distro to generate one XWayland based
image[1] and another pure Wayland image[2].

1. xserver-xorg-xwayland (a) -> weston-module-xwayland (b)

   So (a) includes the inner script which says to weston-launch
wrapper to load the xwayland.so module. (b) is split out from normal
weston package so it avoids unneeded runtime dependencies.

2. weston

  weston includes just the normal weston bits so allowing pure Weston
images without manual changes.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case.
       [not found]       ` <VI1PR0401MB1821ACB2780D69703AB13B28E6F50@VI1PR0401MB1821.eurprd04.prod.outlook.com>
@ 2016-01-07 20:44         ` Otavio Salvador
  0 siblings, 0 replies; 17+ messages in thread
From: Otavio Salvador @ 2016-01-07 20:44 UTC (permalink / raw)
  To: Prabhu Sundararaj, Burton, Ross; +Cc: Tom Hochstein, openembedded-core

Hello Prabhu,

(adding Ross on CC)

On Thu, Jan 7, 2016 at 6:29 PM, Prabhu Sundararaj
<prabhu.sundararaj@nxp.com> wrote:
> Xwayland with Weston and MatchBox cannot go together. Both are window managers. In the xwayland(core-image-weston), matchbox will run on top weston.
> XWayland need Wayland supported Window Manager (Weston in this case) to run X applications.
>
> When Matchbox added to xwayland(in this case weston image), then it will be two window managers. Which does not makes sense
>
> Also while building core-image-weston, someone should not expect matchbox. It is meant for Weston.
>
> I understand your usecase, but that can be achieved using mutter(clutter). Mutter is a full window manager supports both X11 and wayland. Users will not see any difference whether xwayland or x11 image.

Great; so the mutter or another option is how we ought to work on
OE-Core. We cannot apply hacks here just to move on but instead we
ought to fix this in OE-Core and move all ecosystem to the right
direction.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case.
  2015-12-17 22:04 ` [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case Tom Hochstein
  2015-12-18 16:53   ` Otavio Salvador
@ 2016-01-07 21:34   ` Burton, Ross
  2016-01-08  0:02     ` Otavio Salvador
  1 sibling, 1 reply; 17+ messages in thread
From: Burton, Ross @ 2016-01-07 21:34 UTC (permalink / raw)
  To: Tom Hochstein; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

On 17 December 2015 at 22:04, Tom Hochstein <tom.hochstein@freescale.com>
wrote:

> +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '',
> 'matchbox-terminal matchbox-wm', d)} \
>

No, this is broken.

Poky (and others) build with wayland and x11 DISTRO_FEATURES, the presence
of wayland DISTRO_FEATURE doesn't mean that XWayland is being used.  If
you're using XWayland then you'll either have to create your own package
groups, use appends to remove matchbox, or just live with matchbox being
installed.

Ross

[-- Attachment #2: Type: text/html, Size: 1081 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case.
  2016-01-07 21:34   ` Burton, Ross
@ 2016-01-08  0:02     ` Otavio Salvador
  0 siblings, 0 replies; 17+ messages in thread
From: Otavio Salvador @ 2016-01-08  0:02 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

On Thu, Jan 7, 2016 at 7:34 PM, Burton, Ross <ross.burton@intel.com> wrote:
>
> On 17 December 2015 at 22:04, Tom Hochstein <tom.hochstein@freescale.com>
> wrote:
>>
>> +    ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '',
>> 'matchbox-terminal matchbox-wm', d)} \
>
>
> No, this is broken.
>
> Poky (and others) build with wayland and x11 DISTRO_FEATURES, the presence
> of wayland DISTRO_FEATURE doesn't mean that XWayland is being used.  If
> you're using XWayland then you'll either have to create your own package
> groups, use appends to remove matchbox, or just live with matchbox being
> installed.

We may need an xwayland image or DISTRO_FEATURE so we avoid those
hacks on BSP and distro layers.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.
  2015-12-21 11:24         ` Otavio Salvador
@ 2016-01-08 20:24           ` Tom Hochstein
  0 siblings, 0 replies; 17+ messages in thread
From: Tom Hochstein @ 2016-01-08 20:24 UTC (permalink / raw)
  To: Otavio Salvador, Prabhu Sundararaj
  Cc: Patches and discussions about the oe-core layer

Hi Otavio,

I'm still not clear on your proposal. Here is my last proposed weston-start script (called from sysvinit and systemd):

#! /bin/sh
# There are multiple ways to start weston.
if [ "$WAYLAND_DISPLAY" ]; then
    echo -e "\aError: Weston is already running."
    echo "This script does not support launching Weston nested."
    exit 1
else
    if [ "$DISPLAY" ]; then
        echo "Launching Weston"
        openvt -s -- sh -c "weston -- $OPTARGS > /var/log/weston.log 2>&1"
    else
        echo "Launching Weston"
        export XDG_CONFIG_HOME=/etc
        if [ -f /usr/lib/weston/xwayland.so ]; then
            mkdir -p /tmp/.X11-unix
            OPTARGS="--modules=xwayland.so $OPTARGS"
        fi
        openvt $OPENVT_ARGS -- sh -c "weston-launch -- $OPTARGS > /var/log/weston.log 2>&1"
    fi
fi

Do you want to move this whole script to weston-launch? I think that doesn't make sense because it would unexpectedly change the fundamental behavior of weston-launch for the user.

Or do you want to keep weston-start and just move the weston-launch portion of the script (the last else-statement) to the new weston-launch script, something like this:

#! /bin/sh
export XDG_CONFIG_HOME=/etc
if [ -f /usr/lib/weston/xwayland.so ]; then
    mkdir -p /tmp/.X11-unix
    MODULES="--modules=xwayland.so"
    OPTARGS="$MODULES $OPTARGS"
fi
if [ $USE_OPENVT ]; then
    openvt $OPENVT_ARGS -- sh -c "/usr/bin/weston-wrapped/weston-launch -- $OPTARGS > /var/log/weston.log 2>&1"
else
    /usr/bin/weston-wrapped/weston-launch "$@"
Fi

Regarding your idea for the separate xwayland script file, there is a usage problem if the user wants to change his deployed image from Wayland to XWayland. Since the script file is not there, it is hard to know the appropriate settings for this reconfiguration.

Instead, I propose to add a new variable in the script called 'USE_XWAYLAND', to be initialized by Yocto based on user preference, and easily changed after deployment:

#! /bin/sh
USE_XWAYLAND="1"
if [ $USE_XWAYLAND = "1" ]; then
    mkdir -p /tmp/.X11-unix
    MODULES="--modules=xwayland.so"
    OPTARGS="$MODULES $OPTARGS"
Fi

Do you think I should pursue your proposed idea of a new image or DISTRO_FEATURE to control the initial state of USE_XWAYLAND?

Tom

-----Original Message-----
From: Otavio Salvador [mailto:otavio.salvador@ossystems.com.br] 
Sent: Monday, December 21, 2015 5:24 AM
To: Thomas Hochstein <Tom.Hochstein@freescale.com>
Cc: Prabhu Sundararaj <Prabhu.Sundararaj@freescale.com>; Patches and discussions about the oe-core layer <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly.

Hello Tom,

On Sat, Dec 19, 2015 at 4:08 PM, Tom Hochstein <Tom.Hochstein@freescale.com> wrote:
> Can you be more explicit about what you mean by weston-launch wrapper? Do you want to hide the current weston-launch binary and replace it by a new weston-launch wrapper? What happens to my proposed weston-start, which is itself a wrapper? Does its functionality move into weston-launch?

Yes; my proposal is to use weston-launch to hide the real binary and call it internally. This allows for everyone using weston-launch (even on terminal or serial console) to benefit from it otherwise people will be aware of the custom script.

> Can you help me understand the rationale for the extra XWayland script? The existing weston recipe installs xwayland.so when the XWayland package is specified. In your proposal, the weston recipe would also install the extra script when the XWayland package is specified. Since the same XWayland package mechanism is used in both cases, the benefit of the extra script isn't clear to me.

Because it would allow for same distro to generate one XWayland based image[1] and another pure Wayland image[2].

1. xserver-xorg-xwayland (a) -> weston-module-xwayland (b)

   So (a) includes the inner script which says to weston-launch wrapper to load the xwayland.so module. (b) is split out from normal weston package so it avoids unneeded runtime dependencies.

2. weston

  weston includes just the normal weston bits so allowing pure Weston images without manual changes.

-- 
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2016-01-08 20:24 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17 22:04 [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Tom Hochstein
2015-12-17 22:04 ` [<OE-core][PATCH v2 2/4] weston: Include weston-launch if Wayland is configured Tom Hochstein
2015-12-18 16:52   ` Otavio Salvador
2015-12-18 21:58     ` Tom Hochstein
2015-12-19  9:46       ` Otavio Salvador
2015-12-17 22:04 ` [<OE-core][PATCH v2 3/4] packagegroup-core-x11-base: Remove matchbox for XWayland case Tom Hochstein
2015-12-18 16:53   ` Otavio Salvador
     [not found]     ` <AMSPR04MB309D9FAC0C65002218BAE1CE2F50@AMSPR04MB309.eurprd04.prod.outlook.com>
     [not found]       ` <VI1PR0401MB1821ACB2780D69703AB13B28E6F50@VI1PR0401MB1821.eurprd04.prod.outlook.com>
2016-01-07 20:44         ` Otavio Salvador
2016-01-07 21:34   ` Burton, Ross
2016-01-08  0:02     ` Otavio Salvador
2015-12-17 22:04 ` [<OE-core][PATCH v2 4/4] packagegroup-core-x11-sato: " Tom Hochstein
2015-12-18 16:50 ` [<OE-core][PATCH v2 1/4] weston-init: Handle Weston startup correctly Otavio Salvador
2015-12-18 22:36   ` Tom Hochstein
2015-12-19  9:57     ` Otavio Salvador
2015-12-19 18:08       ` Tom Hochstein
2015-12-21 11:24         ` Otavio Salvador
2016-01-08 20:24           ` Tom Hochstein

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.