meta-tizen: Add busybox Term to weston
authorRonan Le Martret <ronan@fridu.net>
Wed, 23 Apr 2014 12:49:16 +0000 (14:49 +0200)
committerPatrick Ohly <patrick.ohly@intel.com>
Fri, 9 Jan 2015 17:19:38 +0000 (09:19 -0800)
Change-Id: Ie8b339aefb7fd17f26382195195c7213059d91f6
(From meta-tizen rev: 1e5b86d78a346dc0bdf4b75a87f846e41f34845d)

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
meta-tizen/recipes-graphics/wayland/weston-init.bb [new file with mode: 0644]
meta-tizen/recipes-graphics/wayland/weston-init/init [new file with mode: 0644]

diff --git a/meta-tizen/recipes-graphics/wayland/weston-init.bb b/meta-tizen/recipes-graphics/wayland/weston-init.bb
new file mode 100644 (file)
index 0000000..38b78bc
--- /dev/null
@@ -0,0 +1,19 @@
+SUMMARY = "Startup script for the Weston Wayland compositor"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+
+SRC_URI = "file://init"
+
+S = "${WORKDIR}"
+
+do_install() {
+       install -d ${D}/${sysconfdir}/init.d
+       install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+}
+
+inherit allarch update-rc.d
+
+RDEPENDS_${PN} = "weston kbd"
+
+INITSCRIPT_NAME = "weston"
+INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
diff --git a/meta-tizen/recipes-graphics/wayland/weston-init/init b/meta-tizen/recipes-graphics/wayland/weston-init/init
new file mode 100644 (file)
index 0000000..35bb48e
--- /dev/null
@@ -0,0 +1,56 @@
+#!/bin/sh
+#
+### BEGIN INIT INFO
+# Provides: weston
+# Required-Start: $local_fs $remote_fs
+# Required-Stop: $local_fs $remote_fs
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+### END INIT INFO
+
+killproc() {
+        pid=`/bin/pidof $1`
+        [ "$pid" != "" ] && kill $pid
+}
+
+read CMDLINE < /proc/cmdline
+for x in $CMDLINE; do
+        case $x in
+        weston=false)
+               echo "Weston disabled"
+               exit 0;
+                ;;
+        esac
+done
+
+case "$1" in
+  start)
+        . /etc/profile
+
+        # This is all a nasty hack
+        if test -z "$XDG_RUNTIME_DIR"; then
+                export XDG_RUNTIME_DIR=/run/user/root
+                mkdir --parents $XDG_RUNTIME_DIR
+                chmod 0700 $XDG_RUNTIME_DIR
+        fi
+        export SHELL=/bin/sh
+        openvt -s weston
+  ;;
+
+  stop)
+        echo "Stopping Weston"
+        killproc weston
+  ;;
+
+  restart)
+       $0 stop
+        sleep 1
+        $0 start
+  ;;
+
+  *)
+        echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0