diff options
| author | Jörg Sommer <joerg.sommer@navimatix.de> | 2023-06-09 10:51:06 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-06-13 22:10:32 +0100 |
| commit | d43c41fcaf061eaf8bff7bc03de19cdc80226796 (patch) | |
| tree | 9ec2ccdcd0232adb6b4b055571f43dbc773822b3 /scripts/runqemu-ifdown | |
| parent | 177886950ea29fcc0496ebcfd7478d694dd72704 (diff) | |
| download | poky-d43c41fcaf061eaf8bff7bc03de19cdc80226796.tar.gz | |
runqemu-ifupdown/get-tapdevs: Add support for ip tuntap
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
(From OE-Core rev: 424ede206baae1c228583aab1df6c18513ac104f)
Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu-ifdown')
| -rwxr-xr-x | scripts/runqemu-ifdown | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/runqemu-ifdown b/scripts/runqemu-ifdown index e0eb5344c6..f72166b32b 100755 --- a/scripts/runqemu-ifdown +++ b/scripts/runqemu-ifdown | |||
| @@ -33,13 +33,15 @@ fi | |||
| 33 | TAP=$1 | 33 | TAP=$1 |
| 34 | STAGING_BINDIR_NATIVE=$2 | 34 | STAGING_BINDIR_NATIVE=$2 |
| 35 | 35 | ||
| 36 | TUNCTL=$STAGING_BINDIR_NATIVE/tunctl | 36 | if !ip tuntap del $TAP mode tap 2>/dev/null; then |
| 37 | if [ ! -e "$TUNCTL" ]; then | 37 | TUNCTL=$STAGING_BINDIR_NATIVE/tunctl |
| 38 | echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native" | 38 | if [ ! -e "$TUNCTL" ]; then |
| 39 | exit 1 | 39 | echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native" |
| 40 | fi | 40 | exit 1 |
| 41 | fi | ||
| 41 | 42 | ||
| 42 | $TUNCTL -d $TAP | 43 | $TUNCTL -d $TAP |
| 44 | fi | ||
| 43 | 45 | ||
| 44 | IFCONFIG=`which ip 2> /dev/null` | 46 | IFCONFIG=`which ip 2> /dev/null` |
| 45 | if [ "x$IFCONFIG" = "x" ]; then | 47 | if [ "x$IFCONFIG" = "x" ]; then |
