diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2011-12-14 16:37:24 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-12-15 14:36:21 +0000 |
commit | 44d8f38a5ee11a993986bbcb3e8b132de9c0264a (patch) | |
tree | 580a6249c4c8d83075a8c931372032181831722e /scripts | |
parent | bc13ebece233c8b1e000c4ad29e26f8298f6e055 (diff) | |
download | poky-44d8f38a5ee11a993986bbcb3e8b132de9c0264a.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.)
(From OE-Core rev: a00b94900d437828f25debce1c30ffcc0bbf29e9)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/runqemu b/scripts/runqemu index 4adeacece1..bed6a2948e 100755 --- a/scripts/runqemu +++ b/scripts/runqemu | |||
@@ -194,6 +194,14 @@ while [ $i -le $# ]; do | |||
194 | i=$((i + 1)) | 194 | i=$((i + 1)) |
195 | done | 195 | done |
196 | 196 | ||
197 | if [ ! -c /dev/net/tun ] ; then | ||
198 | echo "TUN control device /dev/net/tun is unavailable; you may need to enable TUN (e.g. sudo modprobe tun)" | ||
199 | exit 1 | ||
200 | elif [ ! -w /dev/net/tun ] ; then | ||
201 | echo "TUN control device /dev/net/tun is not writable, please fix (e.g. sudo chmod 666 /dev/net/tun)" | ||
202 | exit 1 | ||
203 | fi | ||
204 | |||
197 | YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" | 205 | YOCTO_KVM_WIKI="https://wiki.yoctoproject.org/wiki/How_to_enable_KVM_for_Poky_qemu" |
198 | # Detect KVM configuration | 206 | # Detect KVM configuration |
199 | if [[ "x$KVM_ENABLED" == "xyes" ]]; then | 207 | if [[ "x$KVM_ENABLED" == "xyes" ]]; then |