summaryrefslogtreecommitdiff
path: root/meta/packages/oh/qemu-config
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2008-01-23 17:00:31 +0000
committerRichard Purdie <richard@openedhand.com>2008-01-23 17:00:31 +0000
commit21441368996e0724d7488307254e3029d8b07b8a (patch)
treeea62d15e1ae746f7ff2097ab77f8fa034e66af35 /meta/packages/oh/qemu-config
parenta9a84bfd3747ee00700ce5393c345dbaa76aca19 (diff)
downloadopenembedded-core-21441368996e0724d7488307254e3029d8b07b8a.tar.gz
openembedded-core-21441368996e0724d7488307254e3029d8b07b8a.tar.bz2
openembedded-core-21441368996e0724d7488307254e3029d8b07b8a.zip
qemu-config: Autostart oprofile-server in qemu images
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3575 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/oh/qemu-config')
-rwxr-xr-xmeta/packages/oh/qemu-config/qemu-autostart34
1 files changed, 34 insertions, 0 deletions
diff --git a/meta/packages/oh/qemu-config/qemu-autostart b/meta/packages/oh/qemu-config/qemu-autostart
new file mode 100755
index 0000000000..5c11269389
--- /dev/null
+++ b/meta/packages/oh/qemu-config/qemu-autostart
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+killproc() { # kill the named process(es)
+ pid=`/bin/ps -e x |
+ /bin/grep $1 |
+ /bin/grep -v grep |
+ /bin/sed -e 's/^ *//' -e 's/ .*//'`
+ [ "$pid" != "" ] && kill $pid
+}
+
+case "$1" in
+ start)
+ echo "Starting automatic qemu services"
+ . /etc/profile
+ /usr/bin/oprofile-server &
+ ;;
+
+ stop)
+ echo "Stopping qemu services"
+ killproc oprofile-server
+ ;;
+
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+
+ *)
+ echo "usage: $0 { start | stop | restart }"
+ ;;
+esac
+
+exit 0