diff options
author | Jason Wessel <jason.wessel@windriver.com> | 2012-05-02 06:30:46 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-03 15:38:07 +0100 |
commit | 3af2bc59776fb738bd795160512a2f3f49ce6d32 (patch) | |
tree | b5907e3e3bb8a575e03a2322745198711992080b /scripts/runqemu-internal | |
parent | 7d3fd68480d54a8ef0d91a772df3506cd45ef2c2 (diff) | |
download | openembedded-core-3af2bc59776fb738bd795160512a2f3f49ce6d32.tar.gz openembedded-core-3af2bc59776fb738bd795160512a2f3f49ce6d32.tar.bz2 openembedded-core-3af2bc59776fb738bd795160512a2f3f49ce6d32.tar.xz openembedded-core-3af2bc59776fb738bd795160512a2f3f49ce6d32.zip |
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.
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-internal')
-rwxr-xr-x | scripts/runqemu-internal | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/runqemu-internal b/scripts/runqemu-internal index 1831a098c..fb0d80660 100755 --- a/scripts/runqemu-internal +++ b/scripts/runqemu-internal @@ -173,13 +173,14 @@ if [ "$TAP" = "" ]; then fi GROUPID=`id -g` + USERID=`id -u` echo "Setting up tap interface under sudo" # Redirect stderr since we could see a LD_PRELOAD warning here if pseudo is loaded # but inactive. This looks scary but is harmless - tap=`sudo $QEMUIFUP $GROUPID $OECORE_NATIVE_SYSROOT 2> /dev/null` + tap=`sudo $QEMUIFUP $USERID $GROUPID $OECORE_NATIVE_SYSROOT 2> /dev/null` if [ $? -ne 0 ]; then # Re-run standalone to see verbose errors - sudo $QEMUIFUP $GROUPID $OECORE_NATIVE_SYSROOT + sudo $QEMUIFUP $USERID $GROUPID $OECORE_NATIVE_SYSROOT return fi LOCKFILE="$LOCKDIR/$tap" |