summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-internal
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-05-03 17:12:34 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-05-06 08:55:48 (GMT)
commitc048ff9f9dbd6a00eb9d39dad2098e473db94a0d (patch)
tree57444468586e2e6eed5412b58ac7aa7dc7676448 /scripts/runqemu-internal
parent56f243e4ce3082aed3be19a20f5a8d48dc386a9e (diff)
downloadpoky-c048ff9f9dbd6a00eb9d39dad2098e473db94a0d.tar.gz
runqemu: be sh neutral
Now runs with dash and busybox' ash as well as with bash (From OE-Core rev: 2b93ed90736ed08c25561e24343a5ef2b8f7dbef) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-internal')
-rwxr-xr-xscripts/runqemu-internal16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal
index fb0d806..fe2974b 100755
--- a/scripts/runqemu-internal
+++ b/scripts/runqemu-internal
@@ -69,7 +69,7 @@ QEMU_MEMORY="$mem_size"M
69 69
70# Bug 433: qemuarm cannot use > 256 MB RAM 70# Bug 433: qemuarm cannot use > 256 MB RAM
71if [ "$MACHINE" = "qemuarm" ]; then 71if [ "$MACHINE" = "qemuarm" ]; then
72 if [[ -z "$mem_size" || $mem_size -gt 256 ]]; then 72 if [ -z "$mem_size" -o $mem_size -gt 256 ]; then
73 echo "WARNING: qemuarm does not support > 256M of RAM." 73 echo "WARNING: qemuarm does not support > 256M of RAM."
74 echo "Changing QEMU_MEMORY to default of 256M." 74 echo "Changing QEMU_MEMORY to default of 256M."
75 QEMU_MEMORY="256M" 75 QEMU_MEMORY="256M"
@@ -111,7 +111,7 @@ acquire_lock() {
111 111
112 if [ -e "$lockfile.lock" ]; then 112 if [ -e "$lockfile.lock" ]; then
113 # Check that the lockfile is not stale 113 # Check that the lockfile is not stale
114 ps=`ps -ewwo pid | grep $(cat $lockfile.lock)` 114 ps=`ps -eo pid | grep $(cat $lockfile.lock)`
115 if [ -z "$ps" ]; then 115 if [ -z "$ps" ]; then
116 echo "WARNING: Stale lock file detected, deleting $lockfile.lock." 116 echo "WARNING: Stale lock file detected, deleting $lockfile.lock."
117 rm -f $lockfile.lock 117 rm -f $lockfile.lock
@@ -212,8 +212,9 @@ cleanup() {
212 stty sane 212 stty sane
213} 213}
214 214
215n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] 215n0=$(echo $TAP | sed 's/tap//')
216n2=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] 216n1=$(($n0 * 2 + 1))
217n2=$(($n1 + 1))
217 218
218KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0" 219KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0"
219QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no" 220QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no"
@@ -437,7 +438,7 @@ if [ ! -x "$QEMUBIN" ]; then
437 return 438 return
438fi 439fi
439 440
440function _quit() { 441do_quit() {
441 if [ -n "$PIDFILE" ]; then 442 if [ -n "$PIDFILE" ]; then
442 #echo kill `cat $PIDFILE` 443 #echo kill `cat $PIDFILE`
443 kill `cat $PIDFILE` 444 kill `cat $PIDFILE`
@@ -449,7 +450,7 @@ function _quit() {
449DISTCCD=`which distccd 2> /dev/null` 450DISTCCD=`which distccd 2> /dev/null`
450PIDFILE="" 451PIDFILE=""
451 452
452trap _quit INT TERM QUIT 453trap do_quit INT TERM QUIT
453 454
454if [ -x "$DISTCCD" ]; then 455if [ -x "$DISTCCD" ]; then
455 echo "Starting distccd..." 456 echo "Starting distccd..."
@@ -476,7 +477,7 @@ if grep -i ubuntu /etc/lsb-release &> /dev/null
476then 477then
477 # precede nvidia's driver on Ubuntu 10 478 # precede nvidia's driver on Ubuntu 10
478 UBUNTU_MAIN_VERSION=`cat /etc/lsb-release |grep DISTRIB_RELEASE |cut -d= -f 2| cut -d. -f 1` 479 UBUNTU_MAIN_VERSION=`cat /etc/lsb-release |grep DISTRIB_RELEASE |cut -d= -f 2| cut -d. -f 1`
479 if [ $UBUNTU_MAIN_VERSION -eq 10 ]; 480 if [ "$UBUNTU_MAIN_VERSION" = "10" ];
480 then 481 then
481 GL_PATH="" 482 GL_PATH=""
482 if test -e /usr/lib/libGL.so 483 if test -e /usr/lib/libGL.so
@@ -502,4 +503,3 @@ LD_PRELOAD="$GL_LD_PRELOAD" $QEMUBIN -kernel $KERNEL $QEMUOPTIONS $SERIALOPTS -n
502cleanup 503cleanup
503 504
504trap - INT TERM QUIT 505trap - INT TERM QUIT
505return