diff options
author | Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> | 2012-05-03 19:12:34 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-06 09:55:48 +0100 |
commit | c048ff9f9dbd6a00eb9d39dad2098e473db94a0d (patch) | |
tree | 57444468586e2e6eed5412b58ac7aa7dc7676448 /scripts/runqemu-internal | |
parent | 56f243e4ce3082aed3be19a20f5a8d48dc386a9e (diff) | |
download | poky-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-x | scripts/runqemu-internal | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index fb0d80660f..fe2974ba48 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 |
71 | if [ "$MACHINE" = "qemuarm" ]; then | 71 | if [ "$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 | ||
215 | n1=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] | 215 | n0=$(echo $TAP | sed 's/tap//') |
216 | n2=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] | 216 | n1=$(($n0 * 2 + 1)) |
217 | n2=$(($n1 + 1)) | ||
217 | 218 | ||
218 | KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0" | 219 | KERNEL_NETWORK_CMD="ip=192.168.7.$n2::192.168.7.$n1:255.255.255.0" |
219 | QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no" | 220 | QEMU_TAP_CMD="-net tap,vlan=0,ifname=$TAP,script=no,downscript=no" |
@@ -437,7 +438,7 @@ if [ ! -x "$QEMUBIN" ]; then | |||
437 | return | 438 | return |
438 | fi | 439 | fi |
439 | 440 | ||
440 | function _quit() { | 441 | do_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() { | |||
449 | DISTCCD=`which distccd 2> /dev/null` | 450 | DISTCCD=`which distccd 2> /dev/null` |
450 | PIDFILE="" | 451 | PIDFILE="" |
451 | 452 | ||
452 | trap _quit INT TERM QUIT | 453 | trap do_quit INT TERM QUIT |
453 | 454 | ||
454 | if [ -x "$DISTCCD" ]; then | 455 | if [ -x "$DISTCCD" ]; then |
455 | echo "Starting distccd..." | 456 | echo "Starting distccd..." |
@@ -476,7 +477,7 @@ if grep -i ubuntu /etc/lsb-release &> /dev/null | |||
476 | then | 477 | then |
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 | |||
502 | cleanup | 503 | cleanup |
503 | 504 | ||
504 | trap - INT TERM QUIT | 505 | trap - INT TERM QUIT |
505 | return | ||