summaryrefslogtreecommitdiffstats
path: root/scripts/poky-qemu-internal
diff options
context:
space:
mode:
authorScott Garman <scott.a.garman@intel.com>2010-09-30 20:39:26 -0700
committerRichard Purdie <rpurdie@linux.intel.com>2010-10-07 19:53:46 +0100
commit8532405c1d6b2184ca88922506b725110a1f7627 (patch)
tree98b676ccdd35f66c9f59898e5752df86e531e0ad /scripts/poky-qemu-internal
parent62625d0ca006153169efc3378ad2d30c30e12612 (diff)
downloadopenembedded-core-contrib-8532405c1d6b2184ca88922506b725110a1f7627.tar.gz
poky-gen-tapdevs: script to create a 'bank' of tap interfaces
This script can be used to create and configure a 'bank' of tap interfaces that can be used by the poky-qemu script. It is useful in locked-down enterprise environments where developers do not have sudo access, but need to be able to run QEMU with networking. A sysadmin would then use this script to bring up a number of tap interfaces for the user to make use of. This fixes [BUGID #391] Signed-off-by: Scott Garman <scott.a.garman@intel.com>
Diffstat (limited to 'scripts/poky-qemu-internal')
-rwxr-xr-xscripts/poky-qemu-internal11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/poky-qemu-internal b/scripts/poky-qemu-internal
index c3720d9ce2..0ea38eef60 100755
--- a/scripts/poky-qemu-internal
+++ b/scripts/poky-qemu-internal
@@ -50,6 +50,10 @@ if [ -z "$QEMU_MEMORY" ]; then
fi
+# This flag file is created when poky-gen-tapdevs creates a bank of
+# tap devices, indicating that the user does not have sudo privs.
+NOSUDO_FLAG="/etc/poky-nosudo"
+
QEMUIFUP=`which poky-qemu-ifup`
QEMUIFDOWN=`which poky-qemu-ifdown`
@@ -81,6 +85,13 @@ for tap in $POSSIBLE; do
done
if [ "$TAP" = "" ]; then
+ if [ -e "$NOSUDO_FLAG" ]; then
+ echo "Error: There are no available tap devices to use for networking,"
+ echo "and I see $NOSUDO_FLAG exists, so I am not going to try creating"
+ echo "a new one with sudo."
+ exit 1
+ fi
+
GROUPID=`id -g`
echo 'Setting up tap interface under sudo'
tap=`sudo $QEMUIFUP $GROUPID $POKY_NATIVE_SYSROOT`