generic-poky/scripts
Martin Jansa 9784ad79a4 runqemu-gen-tapdevs: fix runqemu-ifup script call
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 <ed.bartosh@linux.intel.com>
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 <ed.bartosh@linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>

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've tested that with this change it can call 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
Note: Destroying pre-existing tap interface tap0...
TUNSETIFF: Device or resource busy
Creating 4 tap devices for UID: 1026 GID: 1026...
Creating tap0
Creating tap1
Creating tap2
Creating tap3
Note: For systems running NetworkManager, it's recommended
Note: that the tap devices be set as unmanaged in the
Note: NetworkManager.conf file. Add the following lines to
Note: /etc/NetworkManager/NetworkManager.conf
[keyfile]
unmanaged-devices=interface-name:tap*

but runqemu itself still doesn't work for me:
OE qemux86@ ~/build/oe-core $ runqemu
runqemu - INFO - Running MACHINE=qemux86 bitbake -e...
runqemu - INFO - Running ls -t /OE/build/oe-core/tmp-glibc/deploy/images/qemux86/*.qemuboot.conf...
runqemu - INFO - CONFFILE: /OE/build/oe-core/tmp-glibc/deploy/images/qemux86/core-image-sato-qemux86-20170427174052.qemuboot.conf
runqemu - INFO - Overriding conf file setting of STAGING_DIR_NATIVE to /OE/build/oe-core/tmp-glibc/work/i586-oe-linux/defaultpkgname/1.0-r0/recipe-sysroot-native from Bitbake environment
runqemu - INFO - Continuing with the following parameters:

KERNEL: [tmp-glibc/deploy/images/qemux86/bzImage--4.10.9+git0+ad2e885015_fe0fb8da3d-r0.2-qemux86-20170427085800.bin]
MACHINE: [qemux86]
FSTYPE: [ext4]
ROOTFS: [tmp-glibc/deploy/images/qemux86/core-image-sato-qemux86-20170427174052.rootfs.ext4]
CONFFILE: [/OE/build/oe-core/tmp-glibc/deploy/images/qemux86/core-image-sato-qemux86-20170427174052.qemuboot.conf]

runqemu - INFO - Running /bin/ip link...
runqemu - INFO - Acquiring lockfile /tmp/qemu-tap-locks/tap0.lock...
runqemu - INFO - Using preconfigured tap device tap0
runqemu - INFO - If this is not intended, touch /tmp/qemu-tap-locks/tap0.skip to make runqemu skip tap0.
runqemu - INFO - Network configuration: 192.168.7.2::192.168.7.1:255.255.255.0
runqemu - INFO - Running ldd tmp-glibc/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin//qemu-system-i386...
runqemu - INFO - Running tmp-glibc/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin//qemu-system-i386 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=tmp-glibc/deploy/images/qemux86/core-image-sato-qemux86-20170427174052.rootfs.ext4,if=virtio,format=raw -vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci   -cpu qemu32 -m 256 -serial mon:vc -serial null -kernel tmp-glibc/deploy/images/qemux86/bzImage--4.10.9+git0+ad2e885015_fe0fb8da3d-r0.2-qemux86-20170427085800.bin -append 'root=/dev/vda rw highres=off  mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1 '
qemu-system-i386: -netdev tap,id=net0,ifname=tap0,script=no,downscript=no: could not configure /dev/net/tun (tap0): Device or resource busy
runqemu - INFO - Releasing lockfile for tap device 'tap0'
Traceback (most recent call last):
  File "/OE/build/oe-core/openembedded-core/scripts/runqemu", line 1235, in <module>
    ret = main()
  File "/OE/build/oe-core/openembedded-core/scripts/runqemu", line 1228, in main
    config.start_qemu()
  File "/OE/build/oe-core/openembedded-core/scripts/runqemu", line 1139, in start_qemu
    raise Exception('Failed to run %s' % cmd)
Exception: Failed to run tmp-glibc/work/x86_64-linux/qemu-helper-native/1.0-r1/recipe-sysroot-native/usr/bin//qemu-system-i386 -device virtio-net-pci,netdev=net0,mac=52:54:00:12:34:02 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -drive file=tmp-glibc/deploy/images/qemux86/core-image-sato-qemux86-20170427174052.rootfs.ext4,if=virtio,format=raw -vga vmware -show-cursor -usb -usbdevice tablet -device virtio-rng-pci   -cpu qemu32 -m 256 -serial mon:vc -serial null -kernel tmp-glibc/deploy/images/qemux86/bzImage--4.10.9+git0+ad2e885015_fe0fb8da3d-r0.2-qemux86-20170427085800.bin -append 'root=/dev/vda rw highres=off  mem=256M ip=192.168.7.2::192.168.7.1:255.255.255.0 vga=0 uvesafb.mode_option=640x480-32 oprofile.timer=1 uvesafb.task_timeout=-1 '

(From OE-Core rev: a31b1434c5f1edbd4e8faca813b4f084297c061d)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-29 11:17:22 +01:00
..
contrib oe-build-perf-report-email.py: use pwd for getting user name 2017-04-13 10:54:10 +01:00
lib devtool: extract: drop erroneous bb.event.TaskStarted 2017-04-14 09:47:08 +01:00
native-intercept native.bbclass: Add a simple chown intercept command 2011-06-23 21:08:01 +01:00
postinst-intercepts update_gio_module_cache: Do not chown a non-existing file 2017-04-05 23:22:12 +01:00
pybootchartgui pybootchartgui: support reading reduced /proc logs 2016-12-07 10:38:00 +00:00
tiny scripts: python3 fixes and new tool ksum 2017-01-16 18:05:14 +00:00
README Further cleanup of various poky references 2011-04-21 12:56:16 +01:00
bitbake-prserv-tool bitbake-prserv-tool: check file name 2015-11-25 07:50:30 +00:00
bitbake-whatchanged scripts: python3: change python to python3 in shebang 2016-06-03 13:13:29 +01:00
buildhistory-collect-srcrevs buildhistory-collect-srcrevs: Fix multiple SRCREV definitions 2016-10-28 16:15:17 +01:00
buildhistory-diff buildhistory-diff: add option to compare actual signature differences 2017-04-11 18:10:17 +01:00
buildstats-diff scripts/buildstats-diff: fix epoch numbers in --ver-diff 2017-02-23 12:49:48 -08:00
combo-layer combo-layer: handle file_exclude matching dirs 2016-10-28 16:15:21 +01:00
combo-layer-hook-default.sh combo-layer-hook-default.sh: handle patches without Signed-off-by 2015-03-20 11:21:25 +00:00
combo-layer.conf.example combo-layer: partial import for '--history init' 2015-03-20 11:21:24 +00:00
cp-noerror scripts: python3: change python to python3 in shebang 2016-06-03 13:13:29 +01:00
create-pull-request create-pull-request: fix for OE cgit URL change 2017-01-23 12:05:22 +00:00
crosstap crosstap: Changes to support Recipe specific sysroot 2017-03-08 11:52:56 +00:00
devtool devtool: check locale and refuse to start if it isn't UTF-8 2017-01-23 12:05:22 +00:00
gen-lockedsig-cache gen-lockedsig-cache: catch os.link error 2017-03-22 11:35:21 +00:00
gen-site-config siteconfig: generate configuration data caches for autoconf 2010-09-03 10:50:02 +01:00
lnr scripts/lnr: update for python3 2016-06-01 12:47:10 +01:00
multilib_header_wrapper.h multilib_header: Update wrapper to handle arm 32/64 bit 2017-03-31 10:10:29 +01:00
oe-build-perf-report scripts/oe-build-perf-report: improve guessing of args 2017-04-10 23:00:44 +01:00
oe-build-perf-test oe-build-perf-test: pack all buildstat in one file 2017-03-27 08:15:06 +01:00
oe-buildenv-internal oe-buildenv-internal: show usage output 2016-12-13 22:55:21 +00:00
oe-check-sstate devtool/recipetool/meta: Adapt to bitbake API changes for multi-configuration builds 2016-08-18 10:07:23 +01:00
oe-find-native-sysroot oe-find-native-sysroot: add appopriate suggestion 2017-04-13 10:54:11 +01:00
oe-git-archive scripts/oe-git-archive: implement --notes 2017-03-27 08:15:06 +01:00
oe-git-proxy oe-git-proxy: create usage output 2016-12-13 22:55:21 +00:00
oe-gnome-terminal-phonehome terminal: Fix gnome-terminal to work with recent versions 2016-07-08 10:50:18 +01:00
oe-pkgdata-util scripts: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
oe-publish-sdk oe-publish-sdk: add pyshtables.py to .gitignore 2017-01-31 14:43:00 +00:00
oe-run-native oe-run-native: print more error messages 2017-04-14 23:25:54 +01:00
oe-selftest oe-selftest: Error if known problem variables are set 2017-04-13 10:54:10 +01:00
oe-setup-builddir oe-setup-builddir: create usage output 2016-12-13 22:55:20 +00:00
oe-setup-rpmrepo scripts/oe-setup-rpmrepo: replace createrepo with createrepo_c 2017-03-14 14:42:17 +00:00
oe-test testexport.bbclass: Migrate testexport to use new framework 2017-01-23 12:05:21 +00:00
oe-trim-schemas oe-trim-schemas: create usage output 2016-12-13 22:55:20 +00:00
oepydevshell-internal.py oepydevshell-internal.py: standardize usage output 2016-12-13 22:55:21 +00:00
opkg-query-helper.py scripts: python3: change python to python3 in shebang 2016-06-03 13:13:29 +01:00
pythondeps scripts: python3: change python to python3 in shebang 2016-06-03 13:13:29 +01:00
recipetool scripts: remove True option to getVar calls 2016-12-16 10:23:23 +00:00
relocate_sdk.py relocate_sdk.py: skip debug files from relocation 2017-03-08 11:52:57 +00:00
rootfs_rpm-extract-postinst.awk meta/classes/rootfs_rpm.bbclass: re implement base on rpm5 2010-07-24 00:46:57 +01:00
rpm2cpio.sh scripts/rpm2cpio.sh: replace 5.x version with 4.x version 2017-03-14 14:42:17 +00:00
runqemu runqemu: fix incorrect calls to get variable values 2017-04-19 10:38:36 +01:00
runqemu-addptable2image scripts/oe-setup-builddir: Fix up OE-Core/Poky mismatch for now (and fix permissions) 2011-04-21 19:19:33 +01:00
runqemu-export-rootfs oe-find-native-sysroot: work with RSS 2017-04-13 10:54:10 +01:00
runqemu-extract-sdk oe-find-native-sysroot: work with RSS 2017-04-13 10:54:10 +01:00
runqemu-gen-tapdevs runqemu-gen-tapdevs: fix runqemu-ifup script call 2017-04-29 11:17:22 +01:00
runqemu-ifdown runqemu: use bindir_native property to run ifup/down scripts 2017-04-13 10:54:10 +01:00
runqemu-ifup runqemu: use bindir_native property to run ifup/down scripts 2017-04-13 10:54:10 +01:00
runqemu.README scripts/runqemu.README: Clean this up to accurately reflect what the runqemu command now does 2011-04-21 12:56:13 +01:00
send-error-report send-error-report: encode data to bytes 2016-06-03 13:13:30 +01:00
send-pull-request scripts/send-pull-request: Avoid multiple chain headers 2016-12-07 10:37:59 +00:00
sstate-cache-management.sh scripts/sstate-cache-management.sh: Change wording 2016-02-15 16:28:43 +00:00
sstate-diff-machines.sh sstate-diff-machines.sh: Return non-zero return code when there was some failure detected 2014-06-29 09:04:22 +01:00
sstate-sysroot-cruft.sh sstate-sysroot-cruft: Add /etc/ld.so.conf to whitelist 2016-10-28 16:15:19 +01:00
sysroot-relativelinks.py sysroot-relativelinks: also consider links to dirs on the host 2017-03-29 16:37:27 +01:00
task-time task-time: Add simple buildstats analysis script 2016-11-06 23:35:36 +00:00
test-dependencies.sh test-dependencies.sh: Strip also '\.bb: .*' before adding failed recipe to list of failed 2016-10-28 16:15:19 +01:00
test-reexec test-reexec: Add script to address issues when task re-execution 2012-05-18 15:25:11 +01:00
test-remote-image scripts: python3: change python to python3 in shebang 2016-06-03 13:13:29 +01:00
verify-bashisms verify-bashisms: support warnings with more than one line of source code 2017-01-31 15:28:41 +00:00
wic scripts/wic: fix typo 2017-03-27 08:15:07 +01:00
yocto-bsp yocto-bsp: Refactor script to use argparse instead of optparse 2016-07-07 13:38:13 +01:00
yocto-compat-layer-wrapper scripts: Add yocto-compat-layer-wrapper 2017-04-05 23:22:12 +01:00
yocto-compat-layer.py yocto-compat-layer: test signature differences when setting MACHINE 2017-04-13 10:54:10 +01:00
yocto-kernel scripts: Fixed typo in parameter that was causing exception 2016-07-07 13:38:13 +01:00
yocto-layer scripts: Fixed typo in parameter that was causing exception 2016-07-07 13:38:13 +01:00

README

This directory contains Various useful scripts for working with OE builds