diff options
author | Saul Wold <Saul.Wold@intel.com> | 2010-09-17 11:33:01 -0700 |
---|---|---|
committer | Saul Wold <Saul.Wold@intel.com> | 2010-09-17 11:30:44 -0700 |
commit | 0be92981b32a595e7f48d6589d0e7d73c00ede98 (patch) | |
tree | 610a009bd5fbbcf80cd501bdbff2cd51953deaa4 /scripts | |
parent | a67d9dcaa9fb724034b874849b27c5c1ee0b0ec1 (diff) | |
download | openembedded-core-0be92981b32a595e7f48d6589d0e7d73c00ede98.tar.gz openembedded-core-0be92981b32a595e7f48d6589d0e7d73c00ede98.tar.bz2 openembedded-core-0be92981b32a595e7f48d6589d0e7d73c00ede98.zip |
poky-qemu-internal: fix locking of tap lockfile
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/poky-qemu-internal | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal index f1aa43945a..c28568049c 100755 --- a/scripts/poky-qemu-internal +++ b/scripts/poky-qemu-internal @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -x # Handle running Poky images under qemu # @@ -62,22 +62,26 @@ TAP="" LOCKFILE="" for tap in $POSSIBLE; do LOCKFILE="$LOCKDIR/$tap" - if lockfile $LOCKFILE; then + if lockfile -2 -r 1 $LOCKFILE; then TAP=$tap break; - fi + fi done if [ "$TAP" = "" ]; then GROUPID=`id -g` echo 'Setting up tap interface under sudo' - TAP=`sudo $QEMUIFUP $GROUPID $POKY_NATIVE_SYSROOT` + tap=`sudo $QEMUIFUP $GROUPID $POKY_NATIVE_SYSROOT` if [ $? -ne 0 ]; then # Re-run standalone to see verbose errors sudo $QEMUIFUP $GROUPID $POKY_NATIVE_SYSROOT return fi - LOCKFILE="" + LOCKFILE="$LOCKDIR/$tap" + if lockfile $LOCKFILE; then + TAP=$tap + break; + fi else echo "Using preconfigured tap device '$TAP'" fi |