From patchwork Thu Jun 22 17:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id AD082EB64DD for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mx.groups.io with SMTP id smtpd.web11.17331.1687453870631971391 for ; Thu, 22 Jun 2023 10:11:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=MGbKd7eF; spf=pass (domain: gmail.com, ip: 209.85.208.180, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2b46cfde592so84915231fa.0 for ; Thu, 22 Jun 2023 10:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453868; x=1690045868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=s6MbWQS15cHVvl56zQhC+6DHzBfvRuPBDwqTf9vAZIg=; b=MGbKd7eFHEINxu9AmX/4Tz8W7Ip8IKhlFSQSh4/Nuhq0z3cnqavxLvRBST+zCQiF66 v4xvATk+Uii0n1zVMxYP7/Em+uRaIH8zQ9s73CGSI2XHIHdCx62fijgPA0zGX9mA0UeI eDv9WQ+wT/ZAvdudSZ59TKnUlR5MLM4ov8nXjYirQPzbtV93JuzJ/cWU3HYzajJjqG4p t4H6pvPuh2KORmvxNqiYS+LEZKp6KEZGxTJ18KipTqBQK/ECXTA+iFbV5fs0V2nEital xEP8xDCzF0951NX5YlMZGRvcIYg7D9oo2vPeYtKoNJOz/qLErWe6Apjx3c4F0XTngy3k u+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453868; x=1690045868; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s6MbWQS15cHVvl56zQhC+6DHzBfvRuPBDwqTf9vAZIg=; b=bDBJGmu7CHc+80VLn1hrUwTanFL1ziJA87Podp7+ZB0RI5pOLUqw4EgnhxSxy2XcPp 4rywRLr9Q5nUKb46QvIU8RnohcSrodKbLHsRFLv1WT0opD7eZ112EfVjUDY7fNl09ph/ rG4rhsoOWSDGdV4hnuH+ULDU9jVKutjpSlKW8XfppbWd2TPzngMt4uqQwaK8vpiCrGt0 Satr2OLnXiRrtYegVhAgK0oLYMNjBTpl36JvJzUbZOEJwd1QaNt1ljBsjyX9v4ewKDhM aCuN0YZ+rEvCb2euDXvxhBb/Ts17iAlfmyCm0Hcn84JyWKvMaMwsI4K44gOPS/gijd/L 7a0Q== X-Gm-Message-State: AC+VfDwCrDElIPhTEbm99AQpz0AB/MMrnGBVMMSZorMbR/Lmry+V0ChW zB6e3N99ioCSSfvtJeYb0Lp1ozMPofU= X-Google-Smtp-Source: ACHHUZ7Xq5NqOTZ+dAE0JRK7YWT3S33r49SGXY76pORlji9/+4W0T4+eTB7D8La2slMUFze5MkuONg== X-Received: by 2002:a2e:b0ed:0:b0:2b5:882c:5a8d with SMTP id h13-20020a2eb0ed000000b002b5882c5a8dmr4015829ljl.8.1687453868273; Thu, 22 Jun 2023 10:11:08 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:07 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 1/9] runqemu-ifup: remove uid parameter Date: Thu, 22 Jun 2023 19:01:21 +0200 Message-ID: <20230622170946.10082-2-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183278 ip tuntap does not need the uid, it was an unused variable/parameter. Backward compatibility should be fine. Signed-off-by: Adrian Freihofer --- scripts/runqemu-ifup | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index 5dc765dee82..26714518020 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup @@ -21,7 +21,7 @@ # usage() { - echo "sudo $(basename $0) " + echo "sudo $(basename $0) " } if [ $EUID -ne 0 ]; then @@ -29,17 +29,20 @@ if [ $EUID -ne 0 ]; then exit 1 fi -if [ $# -ne 2 ]; then +if [ $# -eq 2 ]; then + echo "Warning: uid parameter is ignored. It is no longer needed." + GROUP="$2" +elif [ $# -eq 1 ]; then + GROUP="$1" +else usage exit 1 fi -USERID="-u $1" -GROUP="-g $2" if taps=$(ip tuntap list 2>/dev/null); then tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed 's/tap//g' | sort -rn | head -n 1) + 1 )) - ip tuntap add tap$tap_no mode tap group $2 && TAP=tap$tap_no + ip tuntap add tap$tap_no mode tap group "$GROUP" && TAP=tap$tap_no fi if [ -z $TAP ]; then From patchwork Thu Jun 22 17:01:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26237 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A42E6C0015E for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ed1-f47.google.com (mail-ed1-f47.google.com [209.85.208.47]) by mx.groups.io with SMTP id smtpd.web11.17332.1687453870843929384 for ; Thu, 22 Jun 2023 10:11:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=JVXS6Qiy; spf=pass (domain: gmail.com, ip: 209.85.208.47, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ed1-f47.google.com with SMTP id 4fb4d7f45d1cf-51bea30ccbcso876773a12.0 for ; Thu, 22 Jun 2023 10:11:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453869; x=1690045869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YJaALFaVd9wts4+5UTP+qAt/kwrsDkyMJy+zCwegHIk=; b=JVXS6QiyIhRUzgLmS7n7UAa00GQyPWNW/gt+M6Wkbm2zUbQ4VG/FabAUMXXyGuXX66 SxNFb4r9DoAL621U95mcs+VHoDUOW2h887NQr6CKRP9hXM4psxIQOAdIpAId1Jdr6tKu d0gRto+cSnA9+Jx4f+UIhu7uhx2gbteduHlnWCpBEtig+3SSprKg/hNAKdY081WQy0KN R/uoKpNWkkhalCLctY/VTWq5k/94r3qmp452LvQbNhOJv0wmxrhtctdVvIcMXzQQSAfh LqHa3kiP0W3JlE3r4/fwZYTykxIYIUdIQBsCGMiqJSRbZHZw8yqAJPNcR5pKwrA98CMH 4iNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453869; x=1690045869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YJaALFaVd9wts4+5UTP+qAt/kwrsDkyMJy+zCwegHIk=; b=gm4/z1PpeEvXLgHxWpCtD+qPUZDqF2DU0pAvFCNucTAwQ1mdK5Q5wDO/LgCpN/70ha XIf76e3BYp/dS6ZvsI1IsIAqouB1UfL7CPDqMf9i3c7Yr3Ub4Tt6EXhG46mw6+6kei7T jSX5IjPURaVD+O1nTNxWhObX961qvgQrc7E2W26j6L+PHYny8O4u6cg2rEU6L9PZc5sF swbBZ0ye7eTUb6+EU2bctq7pKWhQd5IUfZ5CGMyQHlsZ7QqG9qaFx2xj7FoZks3bKFl3 z9eZyXB7vNzIKHe7VQxd6+uAQ3JnlE+aCEDGpduGizkBZGIzRRJVUeouoOyhYworAnR6 EkrA== X-Gm-Message-State: AC+VfDzrVxsPa8AXFNUGOZ3XSnXHR2gp9T+NgyrX4dQMc74eqKOwQQ3s CSXYXwausywqFXSQstTVy77DULAP8Rs= X-Google-Smtp-Source: ACHHUZ4G1gEUy3JEJn0bcoakunIxAuHY3eXPHcKnt/QoOfsr21CDLEZKqnQKADmU/18JVMoSYrBDpw== X-Received: by 2002:a17:907:3f99:b0:973:e349:43c9 with SMTP id hr25-20020a1709073f9900b00973e34943c9mr17199207ejc.77.1687453868934; Thu, 22 Jun 2023 10:11:08 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:08 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 2/9] runqemu-ifup: configurable tap names Date: Thu, 22 Jun 2023 19:01:22 +0200 Message-ID: <20230622170946.10082-3-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183279 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 --- scripts/runqemu-ifup | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index 26714518020..9820dc535c9 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup @@ -40,12 +40,16 @@ else fi +if [ -z "$OE_TAP_NAME" ]; then + OE_TAP_NAME=tap +fi + if taps=$(ip tuntap list 2>/dev/null); then - tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed 's/tap//g' | sort -rn | head -n 1) + 1 )) - ip tuntap add tap$tap_no mode tap group "$GROUP" && TAP=tap$tap_no + tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) + 1 )) + ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP="$OE_TAP_NAME$tap_no" fi -if [ -z $TAP ]; then +if [ -z "$TAP" ]; then echo "Error: Unable to find a tap device to use" exit 1 fi @@ -69,7 +73,7 @@ if [ ! -x "$IPTABLES" ]; then exit 1 fi -n=$[ (`echo $TAP | sed 's/tap//'` * 2) + 1 ] +n=$[ (`echo $TAP | sed "s/$OE_TAP_NAME//"` * 2) + 1 ] $IPTOOL addr add 192.168.7.$n/32 broadcast 192.168.7.255 dev $TAP STATUS=$? if [ $STATUS -ne 0 ]; then @@ -83,7 +87,7 @@ if [ $STATUS -ne 0 ]; then exit 1 fi -dest=$[ (`echo $TAP | sed 's/tap//'` * 2) + 2 ] +dest=$[ (`echo $TAP | sed "s/$OE_TAP_NAME//"` * 2) + 2 ] $IPTOOL route add to 192.168.7.$dest dev $TAP STATUS=$? if [ $STATUS -ne 0 ]; then From patchwork Thu Jun 22 17:01:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26238 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3D31C001DD for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.web10.17417.1687453871466071600 for ; Thu, 22 Jun 2023 10:11:11 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=Ki67jac2; spf=pass (domain: gmail.com, ip: 209.85.218.41, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-9891c73e0fbso159527766b.1 for ; Thu, 22 Jun 2023 10:11:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453869; x=1690045869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zCHcwbTHpEDk8vvLryH4uSgxgPnEpbqiIKbHRhE6TTk=; b=Ki67jac2UD9WvxTwQjAD6H9JDzAfdOkhLMo3VJAm+AlWdCPi0VcLFmrXon7xpWSejD 2aspfYg2VJ+ZvW9aqI4yyi5GaX94+Bn/qHo4uU1m97Fh5im9GPNAZUMeJDjtT/vh0g4e xSBQ+6InyL1vqPnaTr9V8YnkI2dtqqHjGaRjdFd51Vmlij0GXEBoNW5/2D6I4+LIbfi8 NNUjD/C20D4Bwzy4ejyExGxDL9a2FNN2xI1NLVFp7Rd9mJ6vjGMoTrpkhFobNWBISpa2 eKFnXlS9NxGK/thCJpcMG0OKobjO+7U3cl7LWeonTzdu9b7Zd0VO+AYtRwW+lk2QXmk1 38TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453869; x=1690045869; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zCHcwbTHpEDk8vvLryH4uSgxgPnEpbqiIKbHRhE6TTk=; b=H3eZNNXNb2LRvSWS3f9UODUPG2jEZtH2gdw+4Hy6Pyn+cQNmS+9x2ZRAkwdg3TQ7xt M5508zT+PmS6BNbT1FTfwLRsoi/kdMZLltSYz8v1VYY4iZEH9msyEsUu784Rs8e1EauA 8R5uz0lXEaEYqUqHQ6z6WI0yvVFeLzEV9N66p5JghOdEby8nk5+8x+nFhq2pczDLMtIF Z9iMkeGVishNPGu3yur4hKoX0rw2XJ/TQCde7iqsnJcoW3xJDy/6oieZ1sfKZvALYwAz uxBI/y5f9MIIvex/9jgIS/nDvXwNM0haVzJcwC1g4SJZgJXLJTBQQRVljtnT8rtmPUVf S31g== X-Gm-Message-State: AC+VfDzrRS3X5hu9Jf5KKQLhCNAEChBxSpIhMx+RP22VDky0mymTzE6+ H5tJHKuIVB3QEoirLDYNvQk+aMyacYQ= X-Google-Smtp-Source: ACHHUZ6nAwnbEayB2tHjq3kcH1G/BCLsGb2B+Pz4pOhKs8oRP37ymGFKj+YEc8+L5VZJjrsKAKDlOw== X-Received: by 2002:a17:907:a428:b0:98d:470d:9341 with SMTP id sg40-20020a170907a42800b0098d470d9341mr1413786ejc.27.1687453869606; Thu, 22 Jun 2023 10:11:09 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:09 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 3/9] runqemu-ifup: fix tap index Date: Thu, 22 Jun 2023 19:01:23 +0200 Message-ID: <20230622170946.10082-4-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183280 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 --- scripts/runqemu-ifup | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index 9820dc535c9..fe4492e78b7 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup @@ -45,8 +45,13 @@ if [ -z "$OE_TAP_NAME" ]; then fi if taps=$(ip tuntap list 2>/dev/null); then - tap_no=$(( $(echo "$taps" |cut -f 1 -d ":" | sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) + 1 )) - ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP="$OE_TAP_NAME$tap_no" + tap_no_last=$(echo "$taps" |cut -f 1 -d ":" |sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) + if [ -z "$tap_no_last" ]; then + tap_no=0 + else + tap_no=$(("$tap_no_last" + 1)) + fi + ip tuntap add "$OE_TAP_NAME$tap_no" mode tap group "$GROUP" && TAP=$OE_TAP_NAME$tap_no fi if [ -z "$TAP" ]; then From patchwork Thu Jun 22 17:01:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26236 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id B25ACC001B1 for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web11.17334.1687453872299458015 for ; Thu, 22 Jun 2023 10:11:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=WPA7RAw4; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-98cd280cf94so239533466b.1 for ; Thu, 22 Jun 2023 10:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453870; x=1690045870; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UJdi2W7eQjewNQILqxtGVlJpVZ+0LilyZ5SEztoHKLI=; b=WPA7RAw49WrZJM5iKAdOz7h3Oj/fj1t/ZlRhPQulmaNSY8jxZJDNGVXKFwvlQlUkqP HhEI2TcXGSrot5LxKGAGhc41EDVl/MrWVEDTgIeapZWJifBd//akhQT5I61wkfOHUYDy oKR2VzPvB57MSFucGKL7cPyaisWAyG7CvOpUlgu3mTODmQ7q5A6qw2lgrsVWZiq1dJa8 7R5nRCpzCsRAOBsn692LKBlT5txveTYZUZ3DupkYehDClEhlizK4bjuD9JYsluUdwxuJ edhq2QPsLhiqfusdJ6AUPvuWHX5a6XglO+j+696oCJnKSYRNAA8ltRUrSiwFkkUM16+c CjVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453870; x=1690045870; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UJdi2W7eQjewNQILqxtGVlJpVZ+0LilyZ5SEztoHKLI=; b=IeYTUPKoSjOjkhH2m1tobRZjICZlAM4PrPe+1mBZc6FDmzyK+DAvyFUmitozEgVGEE sXPgfLYLHy9hUxP/TJM7eAQKl/cDx3F2JQotyiY1RxfDeOFNtCnSnZmLqxdLdRJuolBV N8rgvQGDuYUiHlQVdpmsDVvxodnAn3a3a/DdiFFnXzpwuAVNwUhramgF1aWgEc95neoW Uc9iRMM6an2M3mG3I6MFoPn8ctc7goeDIXlM14seQnB5WQdFyLgPdBDWGXQE0bz4sJzo Xua4GwsiZRKgUXOOPVhr7EGGa01jumXj1hn6nAgAyANIhmhIIntgEj0wzJCxlfA6Wnr5 yR2g== X-Gm-Message-State: AC+VfDxdAi/4VBdxiPrvWHIcuKy+Xdr7TrYNOCeqm4+LUp7IwWhO+LjG Nv3FbXhYr4bTBlm4avkbV+6n/uMXeDU= X-Google-Smtp-Source: ACHHUZ6HZHjO3yTmJubhFrijXGEMSBEzl36GMgvm9HbNn+qKBLWyaMtB3Y3oHiKu52ihvLTJ6d7XmQ== X-Received: by 2002:a17:907:7faa:b0:988:2037:c688 with SMTP id qk42-20020a1709077faa00b009882037c688mr16444434ejc.65.1687453870383; Thu, 22 Jun 2023 10:11:10 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:09 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 4/9] runqemu-ifup: remove only our taps Date: Thu, 22 Jun 2023 19:01:24 +0200 Message-ID: <20230622170946.10082-5-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183281 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 --- scripts/runqemu-ifup | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runqemu-ifup b/scripts/runqemu-ifup index fe4492e78b7..c65ceaf1c83 100755 --- a/scripts/runqemu-ifup +++ b/scripts/runqemu-ifup @@ -45,7 +45,7 @@ if [ -z "$OE_TAP_NAME" ]; then fi if taps=$(ip tuntap list 2>/dev/null); then - tap_no_last=$(echo "$taps" |cut -f 1 -d ":" |sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) + tap_no_last=$(echo "$taps" |cut -f 1 -d ":" |grep -E "^$OE_TAP_NAME.*" |sed "s/$OE_TAP_NAME//g" | sort -rn | head -n 1) if [ -z "$tap_no_last" ]; then tap_no=0 else From patchwork Thu Jun 22 17:01:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26240 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id BD914C001DC for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) by mx.groups.io with SMTP id smtpd.web11.17335.1687453872905853936 for ; Thu, 22 Jun 2023 10:11:13 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=Px3QPjYM; spf=pass (domain: gmail.com, ip: 209.85.218.46, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-9896216338cso305175866b.3 for ; Thu, 22 Jun 2023 10:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453871; x=1690045871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ONJYvyvdkvFGuLM4UO3pMjJRyQ0ivg5R9/cnJiQleNk=; b=Px3QPjYMhQpAjCvJmuBHF1ZNK/4DhJptRprLlFtUi+4fazYI5J0bOBJW7XCGIUm98Y lY1TpAZ+uGmK/y7WDW4tmvIx44vdu/BWfkJPzsiaHVJF71iXbLTHNkS1UUUeTamt2OlY cdDa9JrDkljR6A5u8zhFZv6S0WSCM70M/pMYrH16LRvCclA5FwwAm/6qNstLbtBQUyx4 pRdOvEFlzWjpEFPjkSMw+hX9WtlZ26t7RDzXD8VJ+GMzgxFaIAHg26+BAMua0gFOqThV vTEm5WbHr5B6yBnI1KsW/rpPZA3KPkNVk5xgaDRUN+NLcUoaaStX+u2evajOO3nP0Rvq KEFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453871; x=1690045871; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ONJYvyvdkvFGuLM4UO3pMjJRyQ0ivg5R9/cnJiQleNk=; b=fNKnlP5tXADtBOQLllv4me1XzGh4bUngWRBmB5SlDZ/wbu2saH6VYaYfI+zhKYdtVq UHp7ycElL51keHMOdR2PqLBsKza2+Wa+hQpMvsQSZOL4yItO+G5vVg72ZNEawtmezfo1 KeXDR8BUeUtZW0wk8UuwZr1Pit7yJFLNG8cpGVyEOzH1BulI5S0YZ8Z8ZCSH1/pz1Ylr 6YfppQcZqLEGwtJmaQhT9zkCZOpixGcQxN8tV59MNYdunfP07zFEmzYfMtlFR42408Wu sk62O9gTZvU3x5vqPZRoVFlOHXhsfLlN422g/BY+/uK9YrzIBop/MQ5ndOPi6GQ5WFHU abkQ== X-Gm-Message-State: AC+VfDyb9MsnIUVEwitqH9jy5OEdDXLmFcoG/ga4YnCoM3OEE/QVkTlS Cj61BkTVgTD2r+6Vk/JtUjhImkXEKRI= X-Google-Smtp-Source: ACHHUZ7D9unUTLiYcemZ/Cgov4oyvmbhOStKUkC07XFXaaZFmJMjBEuX7nWSex5mnReOOZcJ6Natfw== X-Received: by 2002:a17:907:e8b:b0:988:9b29:564f with SMTP id ho11-20020a1709070e8b00b009889b29564fmr13454700ejc.40.1687453871086; Thu, 22 Jun 2023 10:11:11 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:10 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 5/9] runqemu-gen-tapdevs: remove staging dir parameter Date: Thu, 22 Jun 2023 19:01:25 +0200 Message-ID: <20230622170946.10082-6-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183282 The parameter staging_bindir_native is no longer used. Remove it. For now the script is backward compatible. With 4 parameters it logs an error message but still works. Signed-off-by: Adrian Freihofer --- scripts/runqemu-gen-tapdevs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index ec3ecb03b9b..75547c13613 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs @@ -18,19 +18,22 @@ if [ -n "$SUDO_GID" ]; then fi usage() { - echo "Usage: sudo $0 " + echo "Usage: sudo $0 " echo "Where is the numeric user id the tap devices will be owned by" 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 "For example:" echo "$ bitbake qemu-helper-native" - echo "$ sudo $0 $uid $gid 4 tmp/sysroots-components/x86_64/qemu-helper-native/usr/bin" + echo "$ sudo $0 $uid $gid 4" echo "" exit 1 } -if [ $# -ne 4 ]; then +# Allow passing 4 arguments for backward compatibility with warning +if [ $# -eq 4 ]; then + echo "Warning: The parameter is no longer needed. Ignoring." +fi +if [ $# -lt 3 ] || [ $# -gt 4 ]; then echo "Error: Incorrect number of arguments" usage fi @@ -38,7 +41,6 @@ fi TUID=$1 GID=$2 COUNT=$3 -STAGING_BINDIR_NATIVE=$4 # check if COUNT is a number and >= 0 if ! [ $COUNT -ge 0 ]; then From patchwork Thu Jun 22 17:01:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26239 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2506C001DE for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by mx.groups.io with SMTP id smtpd.web11.17336.1687453873831787006 for ; Thu, 22 Jun 2023 10:11:14 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=jWgi2rU7; spf=pass (domain: gmail.com, ip: 209.85.218.41, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-988a2715b8cso160274966b.0 for ; Thu, 22 Jun 2023 10:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453872; x=1690045872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XmCq8Zct8cIGVgBNMUsHLpcD5luVeHFR5qzunnMD0Pk=; b=jWgi2rU7MiieIe55qvxsFPNFiayTGls6ZtFusVlrfTr6bHMXQ9fA/sNqAz/RQb1yV6 eohTQi3QvKvZOF8U4WsCuKjsxv9nAk5Vj/4zluRvWoCwDRfSS7phgun7m4QH5QU1EBfq XPdKvfI2bRf8a5uIUX0RACtVn1yKwyeN4B7aQ2Vr9rFp+4Ef+liaQdiEfZOWPDS76vIm Wawnqt9Jo+1u/+OZp/e8BMLqP+GbCbfYED4hkLGIlqkWsLIpIQYDJHbo9pS/K/TpSa1s giasnzBfokL4h4nciUYQ0FFkL92AWphqN7UR85AMGzr1zv7bMpqqVl46BD2ZWNqjio/t 0wwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453872; x=1690045872; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XmCq8Zct8cIGVgBNMUsHLpcD5luVeHFR5qzunnMD0Pk=; b=b569857v9dk5tDlwsPOWaEiSHXZmpep9z0iePSnkKDJUyCFFhBok1LdvNc/+nWImqA El3/IKKxB15UM12ezkOokAggvXavEcu6zhmhJtHFdvmDpiYQKGn1EG5tjnzaD7RrfuA2 VxOTbbY/6qwGvPJhqWjz2HEUE/0a2Uc6iXz1l3vM0ZJxQim7hrK9z0Qjy96s5dMoWHK6 oiHX+4G36FRTvQZ+Q7susmcz63hxM6BJ/W+eGvFGPYxOLc+d2kGS5ZOb4WSYAuN4HSUc bjKslfOKTg8HYmMTJhGMSzQXNpmntFSnTmxo1yKaa7dTm8dDRkOOQ1src7QTGXactJiX R06w== X-Gm-Message-State: AC+VfDxPOEgIr+c3Jf0nZVe3Kv/XJabJ5s0iCbcKAiCdYBEJaKy6D/K1 BzbhGUu0dE3VcRzVux7eruZpeii1ilI= X-Google-Smtp-Source: ACHHUZ7MgvMuFdcu/uYbvRgj6vy0ADUmoMorqRC2gvEjTSn2jvSN9nBhyG2QEhzjmoLr3TBlCykaPg== X-Received: by 2002:a17:907:2d10:b0:988:7209:f42 with SMTP id gs16-20020a1709072d1000b0098872090f42mr13155723ejc.7.1687453871829; Thu, 22 Jun 2023 10:11:11 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:11 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 6/9] runqemu-gen-tapdevs: remove uid parameter Date: Thu, 22 Jun 2023 19:01:26 +0200 Message-ID: <20230622170946.10082-7-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183283 The uid parameter is no longer needed since ip tuntap is used internally. Remove it. Backward compatibility to 3 or 4 parameters is still supported. Signed-off-by: Adrian Freihofer --- scripts/runqemu-gen-tapdevs | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index 75547c13613..7f67ee5540e 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs @@ -8,39 +8,42 @@ # SPDX-License-Identifier: GPL-2.0-only # -uid=`id -u` gid=`id -g` -if [ -n "$SUDO_UID" ]; then - uid=$SUDO_UID -fi if [ -n "$SUDO_GID" ]; then gid=$SUDO_GID fi usage() { - echo "Usage: sudo $0 " - echo "Where is the numeric user id the tap devices will be owned by" + echo "Usage: sudo $0 " 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 "For example:" echo "$ bitbake qemu-helper-native" - echo "$ sudo $0 $uid $gid 4" + echo "$ sudo $0 $gid 4" echo "" exit 1 } # Allow passing 4 arguments for backward compatibility with warning -if [ $# -eq 4 ]; then - echo "Warning: The parameter is no longer needed. Ignoring." +if [ $# -gt 4 ]; then + echo "Error: Incorrect number of arguments" + usage fi -if [ $# -lt 3 ] || [ $# -gt 4 ]; then +if [ $# -gt 3 ]; then + echo "Warning: Ignoring the parameter. It is no longer needed." +fi +if [ $# -gt 2 ]; then + echo "Warning: Ignoring the parameter. It is no longer needed." + GID=$2 + COUNT=$3 +elif [ $# -eq 2 ]; then + GID=$1 + COUNT=$2 +else echo "Error: Incorrect number of arguments" usage fi -TUID=$1 -GID=$2 -COUNT=$3 # check if COUNT is a number and >= 0 if ! [ $COUNT -ge 0 ]; then @@ -78,10 +81,10 @@ if [ $COUNT -eq 0 ]; then exit 0 fi -echo "Creating $COUNT tap devices for UID: $TUID GID: $GID..." +echo "Creating $COUNT tap devices for GID: $GID..." for ((index=0; index < $COUNT; index++)); do echo "Creating tap$index" - if ! ifup=`$RUNQEMU_IFUP $TUID $GID 2>&1`; then + if ! ifup=`$RUNQEMU_IFUP $GID 2>&1`; then echo "Error bringing up interface: $ifup" exit 1 fi From patchwork Thu Jun 22 17:01:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26242 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3A98C001E0 for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) by mx.groups.io with SMTP id smtpd.web11.17338.1687453874898691744 for ; Thu, 22 Jun 2023 10:11:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=PnBukERA; spf=pass (domain: gmail.com, ip: 209.85.208.180, mailfrom: adrian.freihofer@gmail.com) Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-2b45b6adffbso101798531fa.3 for ; Thu, 22 Jun 2023 10:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453873; x=1690045873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pnBny6s1kUXPkb1ezOM2RAnALkyUOxh1mS9b/6Ww1/U=; b=PnBukERA4kZ+Q60zdM546O1evKIfzik82ZtH3Ao8GQHsKqJtZkqB3y+K15FHaCLmw4 Xhe3ujX8FUyOLAMFXPiqmPR3EdWEGDUs01VPd4Pk0VAV7Gw4h0DYUfi9vf2MCO+X1G79 ABHjjq7O5tOpd94M412sSydf2hyzx0Mw+tV9tvlCJvdkWLIZzDzJzk+P6UJQ2+X+Fe25 mYzVaMk6R8McLPk0HqrcgCS6R7idvUB72i+se4zTD36AMXfoJTTQNeWMV8vdOwfyyhMf XeL2Ph7s8mYFy+dDeDVCIbbcwzwUrUxPN6f+ftEgUMHatdlNjnj/MBJNVAeAtt4J9Dnl qQ9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453873; x=1690045873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pnBny6s1kUXPkb1ezOM2RAnALkyUOxh1mS9b/6Ww1/U=; b=DbZ1xSSK4n3Uv75lO+IhLWbS1TXah6lo444EuINuSG3N44c6Br65YU8sdV8kFYWZEu hNQQJeuFTTial/E3MomTbbd+0H1xRPjlC2H+6EAWjVfgssmvV+VEj2Tpsjl/i2hM8//9 z3xHZX1VsXj3dO88eOKDf+7Wa20xX4gO48Rue4y/ljJqa6etFUkZGK4WGFLUQw10c4Qq vPB/A1O2bs45fN3EvF+gU1YIj+7fbNWm9h5kskU9PsXi4jlTHZ74tQAD6HmpUMEjNyiD xCMi8p2QlbLi0Jfzp8ZVp+g/ej5iLssY+kbN1HuligdKqzWw0VJ9UKN5UW4/OKAFZD4s 8K3Q== X-Gm-Message-State: AC+VfDyoAK/ydm/N9vFaLOFX8ixCvIYLoAZrKmqi9CBQIrASI7TSWAgp Bp+gHW/pgRHTjJw6EB6XZCEVitWmZmQ= X-Google-Smtp-Source: ACHHUZ6F1RpjZeNmcKlTz2MlD4wYCdisWDM2Pj0rU5zLzfN7o3kSJZoYbgDiTCRnXAlZicm0X2uQQA== X-Received: by 2002:a2e:9d19:0:b0:2b5:8153:deb3 with SMTP id t25-20020a2e9d19000000b002b58153deb3mr4713327lji.4.1687453872487; Thu, 22 Jun 2023 10:11:12 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:12 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 7/9] runqemu-gen-tapdevs: configurable tap names Date: Thu, 22 Jun 2023 19:01:27 +0200 Message-ID: <20230622170946.10082-8-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183284 Feature: Hard-coding the interface names to tap* is not always a good idea. Signed-off-by: Adrian Freihofer --- scripts/runqemu-gen-tapdevs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index 7f67ee5540e..cbf80089290 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs @@ -45,6 +45,10 @@ else fi +if [ -z "$OE_TAP_NAME" ]; then + OE_TAP_NAME=tap +fi + # check if COUNT is a number and >= 0 if ! [ $COUNT -ge 0 ]; then echo "Error: Incorrect count: $COUNT" @@ -64,7 +68,7 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then fi if interfaces=`ip tuntap list` 2>/dev/null; then - interfaces=`echo "$interfaces" |cut -f1 -d:` + interfaces=`echo "$interfaces" |cut -f1 -d: ` else echo "Failed to call 'ip tuntap list'" >&2 exit 1 @@ -83,7 +87,7 @@ fi echo "Creating $COUNT tap devices for GID: $GID..." for ((index=0; index < $COUNT; index++)); do - echo "Creating tap$index" + echo "Creating $OE_TAP_NAME$index" if ! ifup=`$RUNQEMU_IFUP $GID 2>&1`; then echo "Error bringing up interface: $ifup" exit 1 @@ -95,7 +99,7 @@ echo "Note: that the tap devices be set as unmanaged in the" echo "Note: NetworkManager.conf file. Add the following lines to" echo "Note: /etc/NetworkManager/NetworkManager.conf" echo "[keyfile]" -echo "unmanaged-devices=interface-name:tap*" +echo "unmanaged-devices=interface-name:$OE_TAP_NAME*" # The runqemu script will check for this file, and if it exists, # will use the existing bank of tap devices without creating From patchwork Thu Jun 22 17:01:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id CFCF2C001DF for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ej1-f50.google.com (mail-ej1-f50.google.com [209.85.218.50]) by mx.groups.io with SMTP id smtpd.web11.17340.1687453875155044877 for ; Thu, 22 Jun 2023 10:11:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=hK80sg74; spf=pass (domain: gmail.com, ip: 209.85.218.50, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f50.google.com with SMTP id a640c23a62f3a-988a5383fd4so160792866b.0 for ; Thu, 22 Jun 2023 10:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453873; x=1690045873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3df61MYi+55dGP4LdMIHzdCVPIeyFhIvYYv4ioRG6YY=; b=hK80sg74Hi9XPI4HOqfUwIHB5gDaXicq0S3zdsKgRwg3kALNZ76XwEs3BrU2QlYggR LOTNMh/R2tAGggreZVpBmaDJUddbVwR3LDEIasblzqxq1rZQywPeQh5gQsPUjrEsUj6f NbLd2XxBpqv8gWTWHh4zpw1qQ/cyJnRP6569jIdeK+K6j5rw7r1V0bekT0Rccsd/W0ru 6MqC9tXWwYHw0NkHJPkun4KZ1cxvm9gZnJcpTiKaGDqrlApDFdeeOqE/hK6FBk+ZKOue 2t+WZT/OhUqgki8QcT7//cl5lbI0vObqQ/Ubt5vJPquPRkasTAis2pyN9esGe62C0MTT 67xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453873; x=1690045873; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3df61MYi+55dGP4LdMIHzdCVPIeyFhIvYYv4ioRG6YY=; b=UvG09f5xmfBKvX+hp+jkaYT3vf6baPhvCDdT8ATkuOhnpE7UyKKYyEELEEbZABybH2 KeRiTcdFwOc9xq4Qj4QftIElU8k2XQkh2reAMvwIWCKPo9ij2wR6Wio+klLne+tlcCFT wq+BXBSHlRBAMFNbD6fSiD63+PcLwXu2UpxSdeqgvOuuuDL3ndBw61cltYJGBVxsBwpy uxXnyl/0LgsQQCor6ewMOJws5jlukQmYGk5fn3WzWAmhXL1039eRrV/pT8lhgcGGB0Yz 0TSNisUaQkVgF4yhHQCyyT68mhsAdmRUqG9HcKEjPmAtczaSkhtL7xanaNxRzcS9wNG5 XOEQ== X-Gm-Message-State: AC+VfDyNvrstGl7KWr8g5UGKd0J2z+FmCcEGD3h0CecJyQb9zl0f9psR A5/1QIL0r2EKTDCvNziDtjl7W0w5AnA= X-Google-Smtp-Source: ACHHUZ4hkP4eDU9ng/hxi3O3KJiJsVItyVdYSaV76M9k6Jhc2kJNGk+yoNJWB7aBu6QHqtlUEHJ3uw== X-Received: by 2002:a17:907:3e27:b0:978:8685:71d5 with SMTP id hp39-20020a1709073e2700b00978868571d5mr19165749ejc.30.1687453873071; Thu, 22 Jun 2023 10:11:13 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:12 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 8/9] runqemu-gen-tapdevs: remove only our taps Date: Thu, 22 Jun 2023 19:01:28 +0200 Message-ID: <20230622170946.10082-9-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183285 Ignore itnerfaces with other names than what the runqemu scripts created. Signed-off-by: Adrian Freihofer --- scripts/runqemu-gen-tapdevs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/runqemu-gen-tapdevs b/scripts/runqemu-gen-tapdevs index cbf80089290..a00c79c4420 100755 --- a/scripts/runqemu-gen-tapdevs +++ b/scripts/runqemu-gen-tapdevs @@ -68,7 +68,7 @@ if [ ! -x "$RUNQEMU_IFUP" ]; then fi if interfaces=`ip tuntap list` 2>/dev/null; then - interfaces=`echo "$interfaces" |cut -f1 -d: ` + interfaces=`echo "$interfaces" |cut -f1 -d: |grep -E "^$OE_TAP_NAME.*"` else echo "Failed to call 'ip tuntap list'" >&2 exit 1 From patchwork Thu Jun 22 17:01:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Freihofer X-Patchwork-Id: 26243 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0F83C00528 for ; Thu, 22 Jun 2023 17:11:18 +0000 (UTC) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) by mx.groups.io with SMTP id smtpd.web10.17421.1687453875525092070 for ; Thu, 22 Jun 2023 10:11:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@gmail.com header.s=20221208 header.b=eTU4LeuK; spf=pass (domain: gmail.com, ip: 209.85.218.52, mailfrom: adrian.freihofer@gmail.com) Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-98746d7f35dso939965966b.2 for ; Thu, 22 Jun 2023 10:11:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687453874; x=1690045874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ki+oKs7SUp039+dlPzmQSzDPO7J2VBoVujIcH9yywOc=; b=eTU4LeuKZPxQS6zYKj2jnERIeklpfZsG0xQUYkf+SgN25sXYMJteXPS1Y+Iht5OKKx fIWWFcXpHRyNb03iYKrb1FN/rCMvAYfy3IXJekM+TFKf9Zs5ldLERNr5gvRNupG/XiTW Ec+K6bCWeE0bPSQ9sUCRLffqOLvC9N9dmMcIEgcWTztK3cwuWi7gwD27EqZ8q9c4xax8 Wehp2CXOSsEi3olS77MdCPnqabetb5G0BBZrDI7lwX5pIiJx3XsDXt9feRMuMlIaN0kX /D+8T2tPVPzqu4SO90WoYFOjU3l1Eb/4zQSK3YKWxO8W+dUmNVUISyvdMKYRB8RE5NV5 mMWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687453874; x=1690045874; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ki+oKs7SUp039+dlPzmQSzDPO7J2VBoVujIcH9yywOc=; b=iNkMx1XkPwoPhXkMDq9EVCzRYpzvkJzogC9PrhZnjXf4LY0thl5MJ951mfcVFMLfnY VIfZ+k1/paJuoqACWTuldL/MZN/1kBUdFfCNaPA6LDkvGLIIDgM2CfvuhzCG074h6Rn4 xHA7fHB26RqwppUtJ27jiypI3DHSIMojH2z8ooeMG2lDcKrjNgAwmYFtMMvNRexAactk 1XbA76VDcZqquDxw6Mfx7FBHmh0jakJwgbm1t2NetXfHBgEm+RAngBBFHP3HbPdB9UwM 1Py/FCrg3UwOWhKnVUpVFOH6ErGMIASHVRVIAm4Wh8NxxZfcmii09ybFb4X6SVcQY8FA RM+A== X-Gm-Message-State: AC+VfDxagd3uO+0H14fs+W+o+hJLtET9bzj+Bo+UMN7jSHimkMVDefd5 4TsOn3qQiT7MzxS1sXf8M+u9VoTSHUk= X-Google-Smtp-Source: ACHHUZ7R/ZnNZ8n/ioZx6vYXbolaI+8uknLO9p6bN8Y1WuTLzdxr17Z3DQ9t63eOcUVxSm/82T+XyQ== X-Received: by 2002:a17:906:14ca:b0:974:62bc:33d5 with SMTP id y10-20020a17090614ca00b0097462bc33d5mr14863454ejc.20.1687453873732; Thu, 22 Jun 2023 10:11:13 -0700 (PDT) Received: from t14s-af.fritz.box ([2a02:169:59a6:0:5488:f785:9061:cf6c]) by smtp.gmail.com with ESMTPSA id m12-20020a1709062acc00b00982b8cd7a44sm4917053eje.139.2023.06.22.10.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 10:11:13 -0700 (PDT) From: Adrian Freihofer X-Google-Original-From: Adrian Freihofer To: openembedded-core@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH 9/9] runqemu: configurable tap names Date: Thu, 22 Jun 2023 19:01:29 +0200 Message-ID: <20230622170946.10082-10-adrian.freihofer@siemens.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230622170946.10082-1-adrian.freihofer@siemens.com> References: <20230622170946.10082-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 22 Jun 2023 17:11:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/183286 Support the new environment variable OE_TAP_NAME. Signed-off-by: Adrian Freihofer --- scripts/runqemu | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/runqemu b/scripts/runqemu index bd1f8366b63..e1aa5a925c8 100755 --- a/scripts/runqemu +++ b/scripts/runqemu @@ -1159,7 +1159,11 @@ to your build configuration. logger.debug('Running %s...' % str(cmd)) ip_link = subprocess.check_output(cmd).decode('utf-8') # Matches line like: 6: tap0: - possibles = re.findall('^[0-9]+: +(tap[0-9]+): <.*', ip_link, re.M) + oe_tap_name = 'tap' + if 'OE_TAP_NAME' in os.environ: + oe_tap_name = os.environ['OE_TAP_NAME'] + tap_re = '^[0-9]+: +(' + oe_tap_name + '[0-9]+): <.*' + possibles = re.findall(tap_re, ip_link, re.M) tap = "" for p in possibles: lockfile = os.path.join(lockdir, p) @@ -1198,7 +1202,7 @@ to your build configuration. logger.error("Failed to setup tap device. Run runqemu-gen-tapdevs to manually create.") sys.exit(1) self.tap = tap - tapnum = int(tap[3:]) + tapnum = int(tap[len(oe_tap_name):]) gateway = tapnum * 2 + 1 client = gateway + 1 if self.fstype == 'nfs':