diff options
author | Richard Purdie <richard@openedhand.com> | 2008-01-31 17:42:44 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2008-01-31 17:42:44 +0000 |
commit | d0dae3b6166027eea33dd03e5fa3a02e35140728 (patch) | |
tree | 4b53aca3a2f4b2a5451954ed2f89bc0fbd890020 /scripts/poky-qemu-internal | |
parent | 4592a9b58ce6df99a7b8e0ad022ceef374211db3 (diff) | |
download | openembedded-core-d0dae3b6166027eea33dd03e5fa3a02e35140728.tar.gz openembedded-core-d0dae3b6166027eea33dd03e5fa3a02e35140728.tar.bz2 openembedded-core-d0dae3b6166027eea33dd03e5fa3a02e35140728.tar.xz openembedded-core-d0dae3b6166027eea33dd03e5fa3a02e35140728.zip |
scripts: Always try to start distccd, improve distccd cleanup, add SDK directory to the search path so any cross compiler installed in /usr/local/poky is found and used, add ifdown script to avoid warning messages
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@3649 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-x | scripts/poky-qemu-internal | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal index d96b67e38..ceb6afdbf 100755 --- a/scripts/poky-qemu-internal +++ b/scripts/poky-qemu-internal @@ -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 |