fi
INTERNAL_SCRIPT=`which poky-qemu-internal`
+
+SDKDIR=/usr/local/poky/eabi-glibc/arm/bin/
+PATH=$SDKDIR:$PATH
+
. $INTERNAL_SCRIPT
--- /dev/null
+#!/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
#
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
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
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
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