runqemu: Fix TAP='TUNSETGROUP: Invalid argument' by falling back to tunctl -u
authorJason Wessel <jason.wessel@windriver.com>
Wed, 2 May 2012 11:30:46 +0000 (06:30 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 3 May 2012 14:48:09 +0000 (15:48 +0100)
commit43574a0f77042d8f4d7697b80ec3b0788c8b378e
treed6f74fcb954aff3dc27c2627b6a6a9c190d4184f
parent1d2101d12252c54c2f63e76595ec6c800b1de680
runqemu: Fix TAP='TUNSETGROUP: Invalid argument' by falling back to tunctl -u

By default the runqemu script tries to set the group permissions on any
tap device it creates.  The TUNSETGROUP ioctl is not implemented on some
popular host enterprise linux distributions.

Internally the script will exit as follows:

++ /opt/qemux86/bitbake_build/tmp/sysroots/x86_64-linux/usr/bin/tunctl -b -g 100
+ TAP='TUNSETGROUP: Invalid argument'
+ STATUS=1
+ '[' 1 -ne 0 ']'
+ echo 'tunctl failed:'
tunctl failed:
+ echo TUNSETGROUP: Invalid argument

This patch implements a fallback to using the userid as the owner of
the tap device which is supported by all 2.6 kernels, the default remains
to try and use the groupid first.

(From OE-Core rev: 3af2bc59776fb738bd795160512a2f3f49ce6d32)

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/runqemu-ifup
scripts/runqemu-internal