Patchwork [meta-fsl-arm,17/25] weston-init: Update weston-init for i.MX wayland

login
register
mail settings
Submitter Otavio Salvador
Date Oct. 28, 2013, 6:10 p.m.
Message ID <1382983863-5208-18-git-send-email-otavio@ossystems.com.br>
Download mbox | patch
Permalink /patch/60641/
State Deferred
Delegated to: Otavio Salvador
Headers show

Comments

Otavio Salvador - Oct. 28, 2013, 6:10 p.m.
From: Lauren Post <lauren.post@freescale.com>

Change-Id: Ia893b3c588e8f368464b420d0cc7defe157761c0
Signed-off-by: Lauren Post <lauren.post@freescale.com>
---
 recipes-graphics/wayland/weston-init.bbappend |  4 ++
 recipes-graphics/wayland/weston-init/init     | 56 +++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)
 create mode 100644 recipes-graphics/wayland/weston-init.bbappend
 create mode 100644 recipes-graphics/wayland/weston-init/init

Patch

diff --git a/recipes-graphics/wayland/weston-init.bbappend b/recipes-graphics/wayland/weston-init.bbappend
new file mode 100644
index 0000000..fdc6473
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init.bbappend
@@ -0,0 +1,4 @@ 
+# Replace Weston init script
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+
+PACKAGE_ARCH_mx6 = "${MACHINE_ARCH}"
\ No newline at end of file
diff --git a/recipes-graphics/wayland/weston-init/init b/recipes-graphics/wayland/weston-init/init
new file mode 100644
index 0000000..ce75061
--- /dev/null
+++ b/recipes-graphics/wayland/weston-init/init
@@ -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=/var/run/user/root
+                mkdir --parents $XDG_RUNTIME_DIR
+                chmod 0700 $XDG_RUNTIME_DIR
+        fi
+
+        weston &
+  ;;
+
+  stop)
+        echo "Stopping Weston"
+        killproc weston
+  ;;
+
+  restart)
+	$0 stop
+        sleep 1
+        $0 start
+  ;;
+
+  *)
+        echo "usage: $0 { start | stop | restart }"
+  ;;
+esac
+
+exit 0