summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu-ifup
AgeCommit message (Collapse)Author
2023-06-28runqemu: Fix automated call to runqemu-ifupAlejandro Hernandez Samaniego
When runqemu tries to call runqemu-ifup to create tap devices, it checks the output of runqemu-ifup to get the newly created tap device. The behavior of runqemu-ifup was recently modified along with its output, it no longer expects the uid parameter to be passed and it prints out a warning if it was, since this warning was now part of the output runqemu tries to parse it and convert it to an int() which proved impossible. Pass the correct arguments to the runqemu-ifup call and echo the warning to stderr instead to make sure its not being parsed and used by runqemu in any case. Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-24runqemu-ifup: remove only our tapsAdrian Freihofer
If there are other tap interfaces than the interfaces created by the runqemu-* scripts, these interfaces are not ignored. This is now fixed by filtering the interfaces for a specific prefix in the interface name. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-24runqemu-ifup: fix tap indexAdrian Freihofer
Recent patches changed the index of the tap interfaces. They start now with tap1 instead of tap0. Also the IP address starts with 192.168.7.3 instead of 192.168.7.1. This gets reverted to the previous behavior. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-24runqemu-ifup: configurable tap namesAdrian Freihofer
Feature: Hard-coding the interface names to tap* is not always a good idea. Introduce an environment variable which allows to change this: OE_TAP_NAME. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-24runqemu-ifup: remove uid parameterAdrian Freihofer
ip tuntap does not need the uid, it was an unused variable/parameter. Backward compatibility should be fine. Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-19scripts/runqemu-ifup: Fix 10 or more tap devicesRichard Purdie
The use of sort means that tap10 and tap1 don't sort correctly. Tweak the shell expression to correctly handle numbers of tap devices of 10 or more. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-19scripts/runqemu-ifup: Fix extra parameter issueRichard Purdie
The third parameter was dropped in a previous commit but changes were not made to the argument checks. Fix this. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-16runqemu-if*: Rename confusing variable nameRichard Purdie
The IFCONFIG variable is really the path to ip and hasn't been ifconfig for a long time. Rename the variable to something less confusing. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-16runqemu/qemu-helper: Drop tunctlRichard Purdie
ip tuntap provides the functionality that we obtained from tunctl. We only needed tunctl when ifconfig was more available than ip. That isn't the case now so we can drop tunctl and all the hoops we need to jump through to build and provide it. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2023-06-13runqemu-ifupdown/get-tapdevs: Add support for ip tuntapJörg Sommer
The *ip* command supports the creation and destruction of TAP devices since 2009 and might be more likely installed on systems then *tunctl*. Therefore it should be tried to setup or teardown the TAP interface with *ip* before falling back to *tunctl*. https://git.kernel.org/pub/scm/network/iproute2/iproute2.git/commit/?id=580fbd88f75cc9eea0d28a48c025b090eb9419a7 Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
2019-05-09meta/lib+scripts: Convert to SPDX license headersRichard Purdie
This adds SPDX license headers in place of the wide assortment of things currently in our script headers. We default to GPL-2.0-only except for the oeqa code where it was clearly submitted and marked as MIT on the most part or some scripts which had the "or later" GPL versioning. The patch also drops other obsolete bits of file headers where they were encoountered such as editor modelines, obsolete maintainer information or the phrase "All rights reserved" which is now obsolete and not required in copyright headers (in this case its actually confusing for licensing as all rights were not reserved). More work is needed for OE-Core but this takes care of the bulk of the scripts and meta/lib directories. The top level LICENSE files are tweaked to match the new structure and the SPDX naming. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-12runqemu: use bindir_native property to run ifup/down scriptsEd Bartosh
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>
2015-10-24runqemu-ifup: Check if the tap interface is set up correctlyMariano Lopez
The process to set up a tap interface is as follows: - tap interface is created - An IP address is assigned to the tap interface - The interface is bring up - A route is added to the target using the tap interface Of all the previous steps, only the first one is check if it was sucessful. The status of the others are ignored and all of them are required to have basic connectivity in the target. This patch adds the checks for the rest of the stpes needed to set up the tap interface. [YOCTO #8550] Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
2013-08-26runqemu-ifup: when tunctl can't be found, say what package builds itRoss Burton
If runqemu is used without actually building any qemu images (i.e. you downloaded the images) it's likely that qemu-helper-native hasn't been built. Instead of just saying what command can't be found, tell the user how to solve their problem. Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-24runqemu: fix networking issuesLaurentiu Palcu
After switching from ifconfig to ip, networking stopped working. This commit contains the following fixes: * set a decent broadcast address for the tap device; * bring up the device; * add the route using ip tool instead of the old route tool; Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2013-05-16runqemu: Replace use of ifconfig with ipKhem Raj
ifconfig and its ilk (net-tools package) is deprecated in favour of iproute2 package and is now removed by many distro's e.g. Archlinux. So we replace ifconfig with ip utility Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
2012-06-08runqemu-ifup: enable arp proxyingScott Garman
This allows core-image-sato to access the WAN. Thanks to Dexuan Cui for proposing this fix. Fixes [YOCTO #2329] Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Elizabeth Flanagan <elizabeth.flanagan@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-05-03runqemu: Fix TAP='TUNSETGROUP: Invalid argument' by falling back to tunctl -uJason Wessel
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>
2012-04-25runqemu-ifup: enable ip masquerading for QEMU NAT addressesScott Garman
Fix the IP masquerading settings so that networked QEMU sessions can reach external networks. This is a partial fix for [YOCTO #2329]. Signed-off-by: Scott Garman <scott.a.garman@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-12-12scripts/runqemu-ifup: Ensure netmask is set correctlyRichard Purdie
Without this the command will add a route for the subnet 192.168.7.0 which means multiple qemu instances can't operate correctly since all but the last one will be masked out. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-02scripts: Show sensible warning messages if expected binaries don't existRichard Purdie
[YOCTO #1438] Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-09-01scripts: Don't show errors from which ifconfig failingRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-21Further cleanup of various poky referencesRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-20Rename the remaining poky-* scripts to oe-* or runqemu-*Richard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-20Rename poky-qemu to runqemuRichard Purdie
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>