From 8532405c1d6b2184ca88922506b725110a1f7627 Mon Sep 17 00:00:00 2001 From: Scott Garman Date: Thu, 30 Sep 2010 20:39:26 -0700 Subject: 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 --- scripts/poky-qemu-internal | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/poky-qemu-internal') 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` -- cgit v1.2.3-54-g00ecf