summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland/weston-init/weston-start
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/wayland/weston-init/weston-start')
-rwxr-xr-xmeta/recipes-graphics/wayland/weston-init/weston-start37
1 files changed, 11 insertions, 26 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start
index 0b93dc964a..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"
6 6
7usage() { 7usage() {
8 cat <<EOF 8 cat <<EOF
9 $0 [<openvt arguments>] [-- <weston options>] 9 $0 [<weston options>]
10EOF 10EOF
11} 11}
12 12
@@ -18,9 +18,12 @@ add_weston_argument() {
18 weston_args="$weston_args $1" 18 weston_args="$weston_args $1"
19} 19}
20 20
21# Add openvt extra argument 21## Add module to --modules argument
22add_openvt_argument() { 22add_weston_module() {
23 openvt_args="$openvt_args $1" 23 if [[ "x${weston_modules}" == "x" ]]; then
24 weston_modules="--modules "
25 fi;
26 weston_modules+="${1},"
24} 27}
25 28
26if [ -n "$WAYLAND_DISPLAY" ]; then 29if [ -n "$WAYLAND_DISPLAY" ]; then
@@ -29,33 +32,12 @@ if [ -n "$WAYLAND_DISPLAY" ]; then
29fi 32fi
30 33
31if [ -n "$WESTON_USER" ]; then 34if [ -n "$WESTON_USER" ]; then
32 if [ -z "$WESTON_TTY" ]; then
33 echo "ERROR: If you have WESTON_USER variable set, you also need WESTON_TTY."
34 exit 1
35 fi
36 if [ -z "$WESTON_GROUP" ]; then 35 if [ -z "$WESTON_GROUP" ]; then
37 # no explicit WESTON_GROUP given, therefore use WESTON_USER 36 # no explicit WESTON_GROUP given, therefore use WESTON_USER
38 export WESTON_GROUP="${WESTON_USER}" 37 export WESTON_GROUP="${WESTON_USER}"
39 fi 38 fi
40 weston_args_user="-u $WESTON_USER -t $WESTON_TTY"
41fi
42
43if [ -n "$DISPLAY" ]; then
44 launcher="weston"
45else
46 launcher="weston-launch $weston_args_user --"
47fi 39fi
48 40
49openvt_args="-s"
50while [ -n "$1" ]; do
51 if [ "$1" = "--" ]; then
52 shift
53 break
54 fi
55 openvt_args="$openvt_args $1"
56 shift
57done
58
59weston_args=$* 41weston_args=$*
60 42
61# Load and run modules 43# Load and run modules
@@ -68,6 +50,9 @@ if [ -d "$modules_dir" ]; then
68 50
69 # process module 51 # process module
70 . $m 52 . $m
53 if [[ x"{$weston_modules}" != "x" ]]; then
54 add_weston_argument "${weston_modules}"
55 fi;
71 done 56 done
72fi 57fi
73 58
@@ -83,4 +68,4 @@ if test -z "$XDG_RUNTIME_DIR"; then
83 fi 68 fi
84fi 69fi
85 70
86exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log 71su -c "XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` weston $weston_args --log=/tmp/weston.log" $WESTON_USER