diff options
Diffstat (limited to 'meta/recipes-graphics/wayland/weston-init/weston-start')
-rwxr-xr-x | meta/recipes-graphics/wayland/weston-init/weston-start | 41 |
1 files changed, 15 insertions, 26 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start index ccc7093425..01670cd4f5 100755 --- a/meta/recipes-graphics/wayland/weston-init/weston-start +++ b/meta/recipes-graphics/wayland/weston-init/weston-start @@ -6,7 +6,7 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin" usage() { cat <<EOF - $0 [<openvt arguments>] [-- <weston options>] + $0 [<weston options>] EOF } @@ -18,9 +18,12 @@ add_weston_argument() { weston_args="$weston_args $1" } -# Add openvt extra argument -add_openvt_argument() { - openvt_args="$openvt_args $1" +## Add module to --modules argument +add_weston_module() { + if [[ "x${weston_modules}" == "x" ]]; then + weston_modules="--modules " + fi; + weston_modules+="${1}," } if [ -n "$WAYLAND_DISPLAY" ]; then @@ -29,29 +32,12 @@ if [ -n "$WAYLAND_DISPLAY" ]; then fi if [ -n "$WESTON_USER" ]; then - if [ -z "$WESTON_TTY" ]; then - echo "ERROR: If you have WESTON_USER variable set, you also need WESTON_TTY." - exit 1 + if [ -z "$WESTON_GROUP" ]; then + # no explicit WESTON_GROUP given, therefore use WESTON_USER + export WESTON_GROUP="${WESTON_USER}" fi - weston_args_user="-u $WESTON_USER -t $WESTON_TTY" fi -if [ -n "$DISPLAY" ]; then - launcher="weston" -else - launcher="weston-launch $weston_args_user --" -fi - -openvt_args="-s" -while [ -n "$1" ]; do - if [ "$1" = "--" ]; then - shift - break - fi - openvt_args="$openvt_args $1" - shift -done - weston_args=$* # Load and run modules @@ -64,6 +50,9 @@ if [ -d "$modules_dir" ]; then # process module . $m + if [[ x"{$weston_modules}" != "x" ]]; then + add_weston_argument "${weston_modules}" + fi; done fi @@ -75,8 +64,8 @@ if test -z "$XDG_RUNTIME_DIR"; then fi if [ -n "$WESTON_USER" ] then - chown $WESTON_USER:$WESTON_USER $XDG_RUNTIME_DIR + chown $WESTON_USER:$WESTON_GROUP $XDG_RUNTIME_DIR fi fi -exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log +su -c "XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` weston $weston_args --log=/tmp/weston.log" $WESTON_USER |