From c471ec56b4a81f4db0aee91e8fc83fe68fb48e43 Mon Sep 17 00:00:00 2001 From: Paul Eggleton Date: Wed, 14 Dec 2011 16:37:24 +0000 Subject: 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.) (From OE-Core rev: a00b94900d437828f25debce1c30ffcc0bbf29e9) (From OE-Core rev: b66fa6238a8f9c0972a60932941997517826ff03) Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- scripts/runqemu | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/runqemu b/scripts/runqemu index 31e9822693..1e8121b321 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 -- cgit v1.2.3-54-g00ecf