]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts: Always try to start distccd, improve distccd cleanup, add SDK directory...
authorRichard Purdie <richard@openedhand.com>
Thu, 31 Jan 2008 17:42:44 +0000 (17:42 +0000)
committerRichard Purdie <richard@openedhand.com>
Thu, 31 Jan 2008 17:42:44 +0000 (17:42 +0000)
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3649 311d38ba-8fff-0310-9ca6-ca027cbcb966

scripts/poky-qemu
scripts/poky-qemu-ifdown [new file with mode: 0755]
scripts/poky-qemu-internal
scripts/runqemu

index 6b8224ba6d5b6f10849c6c63646fc45a25c2627d..1c680b11f1a364cbc0da27c9e9311904428a852d 100755 (executable)
@@ -49,4 +49,8 @@ else
 fi
 
 INTERNAL_SCRIPT=`which poky-qemu-internal`
+
+SDKDIR=/usr/local/poky/eabi-glibc/arm/bin/
+PATH=$SDKDIR:$PATH
+
 . $INTERNAL_SCRIPT
diff --git a/scripts/poky-qemu-ifdown b/scripts/poky-qemu-ifdown
new file mode 100755 (executable)
index 0000000..2212353
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# QEMU network interface configuration script
+#
+# Copyright (C) 2006-2007 OpenedHand Ltd.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+
+IFCONFIG=`which ifconfig`
+if [ "x$IFCONFIG" = "x" ]; then
+    # better than nothing...
+    IFCONFIG=/sbin/ifconfig
+fi
+
+$IFCONFIG tap0 down
index d96b67e38a09fc1a455b8e1e58dc096ef10c4cb1..ceb6afdbf3c08595c2200e2258273e1dd5a541d9 100755 (executable)
@@ -30,8 +30,9 @@
 #
 
 QEMUIFUP=`which poky-qemu-ifup`
+QEMUIFDOWN=`which poky-qemu-ifdown`
 KERNEL_NETWORK_CMD="ip=192.168.7.2::192.168.7.1:255.255.255.0"
-QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP"
+QEMU_NETWORK_CMD="-net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=$QEMUIFUP,downscript=$QEMUIFDOWN"
 KERNCMDLINE="mem=$QEMU_MEMORY"
 
 if [ -z "$QEMU_MEMORY" ]; then
@@ -127,6 +128,30 @@ if [ "x$QEMUOPTIONS" = "x" ]; then
     return
 fi
 
+function _quit() {
+    if [ -n "$PIDFILE" ]; then
+        echo kill `cat $PIDFILE`
+        kill `cat $PIDFILE`
+    fi
+    return
+}
+
+DISTCCD=`which distccd`
+PIDFILE=""
+
+trap _quit INT TERM QUIT
+
+if [ -x "$DISTCCD" ]; then
+    echo "Starting distccd..."
+    PIDFILE=`mktemp`
+    $DISTCCD --allow 192.168.7.2 --daemon --pid-file $PIDFILE &
+else
+    echo "Warning: distccd not present, no distcc support loaded."
+fi
+
 echo "Running $QEMU using sudo..."
 echo $QEMU -kernel $ZIMAGE $QEMUOPTIONS $SERIALOPTS --append "$KERNCMDLINE"
-sudo $QEMU -kernel $ZIMAGE $QEMUOPTIONS $SERIALOPTS --append "$KERNCMDLINE"
+sudo $QEMU -kernel $ZIMAGE $QEMUOPTIONS $SERIALOPTS --append "$KERNCMDLINE" || /bin/true
+
+trap - INT TERM QUIT
+return
index 263a1d4ddb3b76cfe06ceba62b669bcf31d004b5..0176e636a80651134a1ee4c612282293d1ceaccb 100755 (executable)
@@ -23,7 +23,10 @@ if [ "x$BUILDDIR" = "x" ]; then
     exit 1
 fi
 
-PATH=$BUILDDIR/tmp/staging/$BUILD_SYS/usr/bin:$BUILDDIR/tmp/cross/bin:$PATH
+INTERNAL_SCRIPT=`which poky-qemu-internal`
+
+SDKDIR=/usr/local/poky/eabi-glibc/arm/bin/
+PATH=$BUILDDIR/tmp/staging/$BUILD_SYS/usr/bin:$BUILDDIR/tmp/cross/bin:$SDKDIR:$PATH
 
 if [ "x$1" = "x" ]; then
     echo
@@ -121,17 +124,5 @@ if [ ! -e $CROSSPATH/cc ]; then
    ln -s $CROSSPATH/gcc $CROSSPATH/cc
 fi
 
-DISTCCD=`which distccd`
-
-if [ -x "$DISTCCD" ]; then
-    $DISTCCD --allow 192.168.7.2 --daemon
-else
-    echo "Warning: distccd not present, no distcc support loaded"
-fi
-
-INTERNAL_SCRIPT=`which poky-qemu-internal`
 . $INTERNAL_SCRIPT
 
-if [ -x "$DISTCCD" ]; then
-    killall distccd
-fi