Thanks Alex and Otavio.

I'm hopeful that I've found the guidance we need from the Weston man page:

http://manpages.ubuntu.com/manpages/saucy/man1/weston.1.html

In particular, the Examples section looks like this:

EXAMPLES
       Launch Weston with the DRM backend on a VT
              weston-launch

       Launch Weston with the DRM backend and XWayland support
              weston-launch -- --modules=xwayland.so

       Launch Weston (wayland-1) nested in another Weston instance (wayland-0)
              WAYLAND_DISPLAY=wayland-0 weston -Swayland-1

       From an X terminal, launch Weston with the x11 backend
              weston

XWayland support is specified in weston.ini, so the first two examples collapse 
to one case for the init script. The third example, nested Weston, is something 
the init script has never supported, so I propose continuing to not support it. 
The fourth condition I propose to support by checking for $DISPLAY. So you end 
up with something like this:
        
        # 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 with the x11 backend"
            openvt -s weston -- --log=/var/log/weston.log $OPTARGS
        else
            echo "Launching Weston with the DRM backend"
            export XDG_CONFIG_HOME=/etc
            openvt -v -- weston-launch -- --log=/var/log/weston.log $OPTARGS
        fi

I still need to test this (and apply the design in systemd), but I wanted your 
feedback on the approach.

Tom

-----Original Message-----
From: Alexander Kanavin [mailto:[email protected]] 
Sent: Monday, December 07, 2015 8:19 AM
To: Hochstein Tom-R60874 <[email protected]>
Cc: Otavio Salvador <[email protected]>; Sundararaj 
Prabhu-B36876 <[email protected]>; 
[email protected]
Subject: Re: [OE-core] [PATCH v2] weston-init: Use weston-launch for XWayland

On 12/07/2015 04:13 PM, Otavio Salvador wrote:
>> We're wondering how best to fix this.
>>
>> The Weston website seems to give the answer for a run-time solution, which 
>> is basically 'if $DISPLAY is set use weston, otherwise use weston-launch'.
>>
>> http://wayland.freedesktop.org/building.html
>>
>> Is that the right approach? Another possibility is to make it a build-time 
>> solution where the bsp layer sets a variable controlling the selection.
>
> Runtime is always better, when possible.

I guess you need to dig deeper into what weston-launch actually does, and which 
are the scenarios when it should be used; the documentation isn't particularly 
helpful here, so maybe you need to ask the upstream developers.

Also, whatever fix you come up with, it should also be provided for the 
situation when a native systemd unit file is used instead of the init script (a 
patch for that has been posted here, and should show up in master shortly).

Alex

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Reply via email to