From d43c41fcaf061eaf8bff7bc03de19cdc80226796 Mon Sep 17 00:00:00 2001 From: Jörg Sommer Date: Fri, 9 Jun 2023 10:51:06 +0200 Subject: runqemu-ifupdown/get-tapdevs: Add support for ip tuntap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- scripts/runqemu-ifdown | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'scripts/runqemu-ifdown') 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 TAP=$1 STAGING_BINDIR_NATIVE=$2 -TUNCTL=$STAGING_BINDIR_NATIVE/tunctl -if [ ! -e "$TUNCTL" ]; then - echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native" - exit 1 -fi +if !ip tuntap del $TAP mode tap 2>/dev/null; then + TUNCTL=$STAGING_BINDIR_NATIVE/tunctl + if [ ! -e "$TUNCTL" ]; then + echo "Error: Unable to find tunctl binary in '$STAGING_BINDIR_NATIVE', please bitbake qemu-helper-native" + exit 1 + fi -$TUNCTL -d $TAP + $TUNCTL -d $TAP +fi IFCONFIG=`which ip 2> /dev/null` if [ "x$IFCONFIG" = "x" ]; then -- cgit v1.2.3-54-g00ecf