summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland/weston-init/init
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2013-03-27 17:50:42 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-06-07 16:48:23 +0100
commit6a27d8bcf708e69fdcab305f917723d57941f3a5 (patch)
treec169747c7a23921f0186b28418cdbc41010fc728 /meta/recipes-graphics/wayland/weston-init/init
parentef2a7bcc625cb3644e592a46efc3b22ee351c874 (diff)
downloadpoky-6a27d8bcf708e69fdcab305f917723d57941f3a5.tar.gz
weston-init: basic init script to start Weston on KMS/DRM
weston-init is a very basic init script to start Weston as root on KMS/DRM. To re-iterate, this runs Weston as root. This will be fixed to use weston-launch shortly. (From OE-Core rev: eba825e4698f6923c32c347eb306abe9d7f3519d) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics/wayland/weston-init/init')
-rw-r--r--meta/recipes-graphics/wayland/weston-init/init56
1 files changed, 56 insertions, 0 deletions
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
11killproc() {
12 pid=`/bin/pidof $1`
13 [ "$pid" != "" ] && kill $pid
14}
15
16read CMDLINE < /proc/cmdline
17for x in $CMDLINE; do
18 case $x in
19 weston=false)
20 echo "Weston disabled"
21 exit 0;
22 ;;
23 esac
24done
25
26case "$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 ;;
54esac
55
56exit 0