aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2011-12-14 16:37:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-12-15 14:17:18 +0000
commita00b94900d437828f25debce1c30ffcc0bbf29e9 (patch)
treefd0026e606604f8852d524b36ea1794f813db968 /scripts/runqemu
parent8c21c71f005b601f58925e9912f2cf44127e291d (diff)
downloadopenembedded-core-contrib-a00b94900d437828f25debce1c30ffcc0bbf29e9.tar.gz
scripts/runqemu: show an error if /dev/net/tun is unusable
If /dev/net/tun is either not present or is not writable by the user, then show an appropriate error message. (QEMU needs access to this device in order to enable networking; it may be missing if it is not enabled or loaded into the kernel, and some distributions such as CentOS 5.x set restrictive permissions upon it.) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index 4adeacece1c..bed6a2948e8 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -194,6 +194,14 @@ while [ $i -le $# ]; do
i=$((i + 1))
done
+if [ ! -c /dev/net/tun ] ; then
+ echo "TUN control device /dev/net/tun is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)"
+ exit 1
+elif [ ! -w /dev/net/tun ] ; then
+ echo "TUN control device /dev/net/tun is not writable, please fix (e.g. sudo chmod 666 /dev/net/tun)"
+ exit 1
+fi
+
YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu"
# Detect KVM configuration
if [[ "x$KVM_ENABLED" == "xyes" ]]; then