poky-qemu-internal: fix locking of tap lockfile
Signed-off-by: Saul Wold <Saul.Wold@intel.com>
This commit is contained in:
parent
a67d9dcaa9
commit
0be92981b3
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue