diff options
Diffstat (limited to 'meta/recipes-graphics/wayland')
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init.bb | 17 | ||||
-rw-r--r-- | meta/recipes-graphics/wayland/weston-init/init | 56 |
2 files changed, 73 insertions, 0 deletions
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb new file mode 100644 index 0000000000..a3fe811f4d --- /dev/null +++ b/meta/recipes-graphics/wayland/weston-init.bb | |||
@@ -0,0 +1,17 @@ | |||
1 | DESCRIPTION = "startup for weston" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58" | ||
4 | |||
5 | SRC_URI = "file://init" | ||
6 | |||
7 | S = "${WORKDIR}" | ||
8 | |||
9 | do_install() { | ||
10 | install -d ${D}/${sysconfdir}/init.d | ||
11 | install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston | ||
12 | } | ||
13 | |||
14 | inherit allarch update-rc.d | ||
15 | |||
16 | INITSCRIPT_NAME = "weston" | ||
17 | INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." | ||
diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init new file mode 100644 index 0000000000..3c73e7c655 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston-init/init | |||
@@ -0,0 +1,56 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: weston | ||
5 | # Required-Start: $local_fs $remote_fs | ||
6 | # Required-Stop: $local_fs $remote_fs | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: 0 1 6 | ||
9 | ### END INIT INFO | ||
10 | |||
11 | killproc() { | ||
12 | pid=`/bin/pidof $1` | ||
13 | [ "$pid" != "" ] && kill $pid | ||
14 | } | ||
15 | |||
16 | read CMDLINE < /proc/cmdline | ||
17 | for x in $CMDLINE; do | ||
18 | case $x in | ||
19 | weston=false) | ||
20 | echo "Weston disabled" | ||
21 | exit 0; | ||
22 | ;; | ||
23 | esac | ||
24 | done | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | . /etc/profile | ||
29 | |||
30 | # This is all a nasty hack | ||
31 | if test -z "$XDG_RUNTIME_DIR"; then | ||
32 | export XDG_RUNTIME_DIR=/var/run/user/root | ||
33 | mkdir --parents $XDG_RUNTIME_DIR | ||
34 | chmod 0700 $XDG_RUNTIME_DIR | ||
35 | fi | ||
36 | |||
37 | weston | ||
38 | ;; | ||
39 | |||
40 | stop) | ||
41 | echo "Stopping XServer" | ||
42 | killproc weston | ||
43 | ;; | ||
44 | |||
45 | restart) | ||
46 | $0 stop | ||
47 | sleep 1 | ||
48 | $0 start | ||
49 | ;; | ||
50 | |||
51 | *) | ||
52 | echo "usage: $0 { start | stop | restart }" | ||
53 | ;; | ||
54 | esac | ||
55 | |||
56 | exit 0 | ||