]> git.kernelconcepts.de Git - meta-kc-bsp.git/blobdiff - recipes-bsp/dotsplash/files/dotsplash-init
dotsplash: Improve start script and psplash compatibility
[meta-kc-bsp.git] / recipes-bsp / dotsplash / files / dotsplash-init
index 27a1ba05e10d3c5d2790f1a56209df5f81a5f267..1f7f77f69be24c5d197074b7921e54d22fe89168 100644 (file)
@@ -1,5 +1,10 @@
 #!/bin/sh 
 
+killproc() {            # kill the named process(es)
+        pid=`/bin/pidof $1`
+        [ "$pid" != "" ] && kill $pid
+}
+
 if grep -qE '\s?psplash=false\s?' /proc/cmdline; then
        echo "Boot splashscreen disabled"
        exit 0;
@@ -8,10 +13,25 @@ fi
 . /etc/init.d/functions
 . /etc/default/dotsplash
 
-export TMPDIR=/mnt/.splash
-mount tmpfs -t tmpfs $TMPDIR -o,size=40k
+export TMPDIR=/mnt/.psplash
+
+case "$1" in
+  start)
+       mount tmpfs -t tmpfs $TMPDIR -o,size=40k
+       /usr/bin/dotsplash $PARAMS &
 
-/usr/bin/dotsplash $PARAMS &
+       # Timetrap against hanging with splash hiding console messages.
+       (sleep 60; dotsplash-write "QUIT"; sleep 1 ; killall dotsplash) &
+  ;;
+  
+  stop)
+        killproc dotsplash
+        umount $TMPDIR
+  ;;
 
-# Timetrap against hanging with splash hiding console messages.
-(sleep 120; dotsplash-write "QUIT") &
+  restart)
+        $0 stop
+        $0 start
+  ;;
+  
+esac
\ No newline at end of file