Re: [OE-core] [PATCH 3/3] runqemu-gen-tapdevs: Improve help text with an example

2017-04-27 Thread Martin Jansa
FWIW: I've tried to use runqemu for first time (using my own scripts until
now).

And this example doesn't work for me, the tunctl binary is here:

OE @ /OE/openembedded-core # find
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/sysroot-providers
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/sysroot-providers/qemu-helper-native
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/usr
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/usr/bin
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/usr/bin/tunctl

But the script still complains that it cannot find tunctl:

OE @ /OE/openembedded-core # ./scripts/runqemu-gen-tapdevs 1026 1026 4
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/
Note: Destroying pre-existing tap interface tap0...
TUNSETIFF: Device or resource busy
Creating 4 tap devices for UID: 1026 GID: 1026...
Creating tap0
Error running tunctl: Error: Unable to find tunctl binary in
'/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/',
please bitbake qemu-helper-native

The message is actually from runqemu-ifup, which is called from
runqemu-gen-tapdevs as:
++ ./scripts/runqemu-ifup 1026 1026
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/

But runqemu-ifup expects 3rd parameter to be STAGING_BINDIR_NATIVE directly
not just SYSROOT dir
STAGING_BINDIR_NATIVE=$3
because tunctl is then used as:
TUNCTL=$STAGING_BINDIR_NATIVE/tunctl

It looks like it got broken by:
commit cc5513bf7a6114e14bb307acb88a44e9cf0aed8a
Author: Ed Bartosh 
Date:   Wed Apr 12 23:40:59 2017 +0300

runqemu: use bindir_native property to run ifup/down scripts

Used self.bindir_native to point out to the native sysroot
when running runqemu-ifup and runqemu-ifdown scripts.

[YOCTO #11266]
[YOCTO #11193]

Signed-off-by: Ed Bartosh 
Signed-off-by: Richard Purdie 

Seemingly obvious fix would be to call runqemu-gen-tapdevs with path to
STAGING_BINDIR_NATIVE in 4th parameter as well, but that won't work,
because runqemu-gen-tapdevs checks for TUNCTL=$SYSROOT/usr/bin/tunctl

OE @ /OE/openembedded-core # ./scripts/runqemu-gen-tapdevs 1026 1026 4
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/usr/bin/
Error:
/OE/build/oe-core/tmp-glibc/sysroots-components/x86_64/qemu-helper-native/usr/bin//usr/bin/tunctl
is not an executable

I'm sending a fix for this, but as I said it's first time I've tried to use
this, so maybe this all was supposed to work somehow differently - or it
isn't tested at all as it is now.

Regards,

On Fri, Mar 10, 2017 at 1:58 PM, Richard Purdie <
richard.pur...@linuxfoundation.org> wrote:

> Figuring how the correct commandline isn't trivial, improve the help
> text with RSS in mind.
>
> Signed-off-by: Richard Purdie 
> ---
>  scripts/runqemu-gen-tapdevs | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
> index bfb60f4..9e5e5b9 100755
> --- a/scripts/runqemu-gen-tapdevs
> +++ b/scripts/runqemu-gen-tapdevs
> @@ -28,6 +28,8 @@ usage() {
> echo "Where  is the numeric group id the tap devices will be
> owned by"
> echo " is the number of tap devices to create (0 to remove
> all)"
> echo " is the path to the build system's
> native sysroot"
> +   echo "e.g. $ bitbake qemu-helper-native -c addto_recipe_sysroot"
> +   echo "$ sudo $0 1000 1000 4 tmp/work/x86_64-linux/qemu-
> helper-native/*/recipe-sysroot-native/"
> exit 1
>  }
>
> --
> 2.7.4
>
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 3/3] runqemu-gen-tapdevs: Improve help text with an example

2017-03-10 Thread Richard Purdie
Figuring how the correct commandline isn't trivial, improve the help
text with RSS in mind.

Signed-off-by: Richard Purdie 
---
 scripts/runqemu-gen-tapdevs | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs
index bfb60f4..9e5e5b9 100755
--- a/scripts/runqemu-gen-tapdevs
+++ b/scripts/runqemu-gen-tapdevs
@@ -28,6 +28,8 @@ usage() {
echo "Where  is the numeric group id the tap devices will be owned 
by"
echo " is the number of tap devices to create (0 to remove all)"
echo " is the path to the build system's native 
sysroot"
+   echo "e.g. $ bitbake qemu-helper-native -c addto_recipe_sysroot"
+   echo "$ sudo $0 1000 1000 4 
tmp/work/x86_64-linux/qemu-helper-native/*/recipe-sysroot-native/"
exit 1
 }
 
-- 
2.7.4

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core