Signed-off-by: Hongmei Gou <[email protected]>
---
v2 change: simplify the check as suggested by Denys

 recipes-core/matrix/matrix-gui/init         | 49 +++++++++++++++++++++++
 recipes-core/matrix/matrix-gui/init.eglfs   | 60 +++++++++++++++++++++++++++++
 recipes-core/matrix/matrix-gui_2.0.bbappend |  4 +-
 3 files changed, 112 insertions(+), 1 deletion(-)
 create mode 100644 recipes-core/matrix/matrix-gui/init
 create mode 100644 recipes-core/matrix/matrix-gui/init.eglfs

diff --git a/recipes-core/matrix/matrix-gui/init 
b/recipes-core/matrix/matrix-gui/init
new file mode 100644
index 0000000..5124c38
--- /dev/null
+++ b/recipes-core/matrix/matrix-gui/init
@@ -0,0 +1,49 @@
+#! /bin/sh
+
+matrixgui="/usr/bin/matrix_browser"
+GUI_OPTS="http://localhost:80/ __MATRIX_FLAGS__"
+PIDFILE="/var/run/matrix-gui-2.0.pid"
+
+# Important System Environment Variables
+for sh in /etc/profile.d/*.sh ; do
+    [ -r "$sh" ] && . "$sh"
+done
+
+test -x "$matrixgui" || exit 0
+
+case "$1" in
+  start)
+    __SWITCH_FOREGROUND_VT__
+
+    #Clear out the the tmp and lock directory
+    cd __MATRIX_WEB_DIR__
+    rm -rf tmp/*
+    rm -rf lock/*
+    cd -
+
+       if [ -e $PIDFILE ]; then
+      PIDDIR=/proc/$(cat $PIDFILE)
+      if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${matrixgui}" ]; 
then
+        echo "$DESC already started; not starting."
+      else
+        echo "Removing stale PID file $PIDFILE."
+        rm -f $PIDFILE
+      fi
+    fi
+
+    echo -n "Starting Matrix GUI application"
+    start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE 
--exec $matrixgui -- $GUI_OPTS
+    echo "."
+    ;;
+
+  stop)
+    echo -n "Stopping Matrix GUI application"
+    start-stop-daemon --stop --quiet --pidfile $PIDFILE
+    echo "."
+    ;;
+  *)
+    echo "Usage: /etc/init.d/matrix-gui-2.0 {start|stop}"
+    exit 1
+esac
+
+exit 0
diff --git a/recipes-core/matrix/matrix-gui/init.eglfs 
b/recipes-core/matrix/matrix-gui/init.eglfs
new file mode 100644
index 0000000..df07c05
--- /dev/null
+++ b/recipes-core/matrix/matrix-gui/init.eglfs
@@ -0,0 +1,60 @@
+#! /bin/sh
+
+matrixgui="/usr/bin/matrix_browser"
+GUI_OPTS="http://localhost:80/ __MATRIX_FLAGS__"
+PIDFILE="/var/run/matrix-gui-2.0.pid"
+
+# Important System Environment Variables
+for sh in /etc/profile.d/*.sh ; do
+    [ -r "$sh" ] && . "$sh"
+done
+
+test -x "$matrixgui" || exit 0
+
+case "$1" in
+  start)
+    chvt 4
+
+    #Clear out the the tmp and lock directory
+    cd __MATRIX_WEB_DIR__
+    rm -rf tmp/*
+    rm -rf lock/*
+    cd -
+
+       if [ -e $PIDFILE ]; then
+      PIDDIR=/proc/$(cat $PIDFILE)
+      if [ -d ${PIDDIR} -a  "$(readlink -f ${PIDDIR}/exe)" = "${matrixgui}" ]; 
then
+        echo "$DESC already started; not starting."
+      else
+        echo "Removing stale PID file $PIDFILE."
+        rm -f $PIDFILE
+      fi
+    fi
+
+    echo 0 > /sys/class/graphics/fbcon/cursor_blink
+    echo -ne "\033[9;0]\033[14;0]" > /dev/tty4
+
+    echo -n "Starting Matrix GUI application"
+    start-stop-daemon --start --quiet --background -m --pidfile $PIDFILE 
--exec $matrixgui -- $GUI_OPTS
+    echo "."
+    ;;
+
+  stop)
+    echo -n "Stopping Matrix GUI application"
+    start-stop-daemon --stop --quiet --pidfile $PIDFILE
+
+    refresh_screen "background-black"
+
+    echo -ne "\033[9;10]\033[14;10]" > /dev/tty4
+    echo 1 > /sys/class/graphics/fbcon/cursor_blink
+
+    chvt 1
+
+    echo "."
+    ;;
+  *)
+    echo "Usage: /etc/init.d/matrix-gui-2.0 {start|stop}"
+    exit 1
+esac
+
+exit 0
diff --git a/recipes-core/matrix/matrix-gui_2.0.bbappend 
b/recipes-core/matrix/matrix-gui_2.0.bbappend
index 57f4e12..1cc5c0a 100644
--- a/recipes-core/matrix/matrix-gui_2.0.bbappend
+++ b/recipes-core/matrix/matrix-gui_2.0.bbappend
@@ -1,3 +1,5 @@
-PR_append = ".tisdk1"
+PR_append = ".tisdk2"
 
 SRCREV = "9a2d12590102fefc5c29fc9e8d346ce6b0198468"
+
+FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-- 
1.9.1

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to