diff options
Diffstat (limited to 'meta/recipes-graphics/wayland/weston-init/weston-start')
-rwxr-xr-x | meta/recipes-graphics/wayland/weston-init/weston-start | 37 |
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 | ||
7 | usage() { | 7 | usage() { |
8 | cat <<EOF | 8 | cat <<EOF |
9 | $0 [<openvt arguments>] [-- <weston options>] | 9 | $0 [<weston options>] |
10 | EOF | 10 | EOF |
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 |
22 | add_openvt_argument() { | 22 | add_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 | ||
26 | if [ -n "$WAYLAND_DISPLAY" ]; then | 29 | if [ -n "$WAYLAND_DISPLAY" ]; then |
@@ -29,33 +32,12 @@ if [ -n "$WAYLAND_DISPLAY" ]; then | |||
29 | fi | 32 | fi |
30 | 33 | ||
31 | if [ -n "$WESTON_USER" ]; then | 34 | if [ -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" | ||
41 | fi | ||
42 | |||
43 | if [ -n "$DISPLAY" ]; then | ||
44 | launcher="weston" | ||
45 | else | ||
46 | launcher="weston-launch $weston_args_user --" | ||
47 | fi | 39 | fi |
48 | 40 | ||
49 | openvt_args="-s" | ||
50 | while [ -n "$1" ]; do | ||
51 | if [ "$1" = "--" ]; then | ||
52 | shift | ||
53 | break | ||
54 | fi | ||
55 | openvt_args="$openvt_args $1" | ||
56 | shift | ||
57 | done | ||
58 | |||
59 | weston_args=$* | 41 | weston_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 |
72 | fi | 57 | fi |
73 | 58 | ||
@@ -83,4 +68,4 @@ if test -z "$XDG_RUNTIME_DIR"; then | |||
83 | fi | 68 | fi |
84 | fi | 69 | fi |
85 | 70 | ||
86 | exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log | 71 | su -c "XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` weston $weston_args --log=/tmp/weston.log" $WESTON_USER |